diff --git a/a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/6d258242-903c-489b-ae9b-a8204d589125_content_list.json b/a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/6d258242-903c-489b-ae9b-a8204d589125_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..7e841e429633572210958351c58fbae168236882 --- /dev/null +++ b/a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/6d258242-903c-489b-ae9b-a8204d589125_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7be8a43abb59d82e70855809d0cf67db8b1cf3ea41027631b7472d04c98b6022 +size 72819 diff --git a/a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/6d258242-903c-489b-ae9b-a8204d589125_model.json b/a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/6d258242-903c-489b-ae9b-a8204d589125_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a7deab6371bb472e8ce605782a8d4d278c692018 --- /dev/null +++ b/a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/6d258242-903c-489b-ae9b-a8204d589125_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:178727ccb52483ed89da2a9e02c42ed7d820de0c3b2af14b9f581e8dc10d7a13 +size 89512 diff --git a/a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/6d258242-903c-489b-ae9b-a8204d589125_origin.pdf b/a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/6d258242-903c-489b-ae9b-a8204d589125_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8229832d67e877a87ef9e5556e56f17760642e99 --- /dev/null +++ b/a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/6d258242-903c-489b-ae9b-a8204d589125_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f2ea67bbfcf2c836d141d7ee4982c577de57c0d4ee03d20053b4e2013f11195 +size 7193441 diff --git a/a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/full.md b/a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/full.md new file mode 100644 index 0000000000000000000000000000000000000000..9101c5e200ed6e93379dfd374c48d5802949f55e --- /dev/null +++ b/a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/full.md @@ -0,0 +1,291 @@ +# $\mathbf{A}^{2}$ -NET: Learning Attribute-Aware Hash Codes for Large-Scale Fine-Grained Image Retrieval + +Xiu-Shen Wei $^{1,2}$ , Yang Shen $^{1}$ , Xuhao Sun $^{1}$ , Han-Jia Ye $^{2}$ , Jian Yang $^{1*}$ + +$^{1}$ Nanjing University of Science and Technology + +$^{2}$ State Key Lab. for Novel Software Technology, Nanjing University + +# Abstract + +Our work focuses on tackling large-scale fine-grained image retrieval as ranking the images depicting the concept of interests (i.e., the same sub-category labels) highest based on the fine-grained details in the query. It is desirable to alleviate the challenges of both fine-grained nature of small inter-class variations with large intra-class variations and explosive growth of fine-grained data for such a practical task. In this paper, we propose an Attribute-Aware hashing Network $(\mathsf{A}^2$ -NET) for generating attribute-aware hash codes to not only make the retrieval process efficient, but also establish explicit correspondences between hash codes and visual attributes. Specifically, based on the captured visual representations by attention, we develop an encoder-decoder structure network of a reconstruction task to unsupervisedly distill high-level attribute-specific vectors from the appearance-specific visual representations without attribute annotations. $\mathsf{A}^2$ -NET is also equipped with a feature decorrelation constraint upon these attribute vectors to enhance their representation abilities. Finally, the required hash codes are generated by the attribute vectors driven by preserving original similarities. Qualitative experiments on five benchmark fine-grained datasets show our superiority over competing methods. More importantly, quantitative results demonstrate the obtained hash codes can strongly correspond to certain kinds of crucial properties of fine-grained objects. + +# 1 Introduction + +Fine-grained image retrieval in computer vision aims to retrieve images belonging to multiple subordinate categories of a super-category (aka a meta-category), e.g., different species of animals/plants [36], different models of cars [20], different kinds of retail products [39], etc. Its key challenge therefore lies with understanding fine-grained visual differences that sufficiently discriminate between objects that are highly similar in overall appearance, but differ in fine-grained features. Also, fine-grained retrieval still demands ranking all the instances so that images depicting the concept of interest (e.g., the same sub-category label) are ranked highest based on the fine-grained details in the query. + +In particular, with the explosive growth of fine-grained data in real applications [1, 14, 26, 36, 39], fine-grained hashing, as a promising solution for dealing with large-scale fine-grained retrieval tasks, has proven to be able to greatly reduce the storage cost and increase the query speed [8, 18] benefiting from the learned compact binary hash code representations. However, although previous works, + +![](images/b4e060f90e263be1d74b470394cb690d0dc7c61ea3e73d72b90b9081cbe3a723.jpg) +Figure 1: Key idea of our $\mathbf{A}^2$ -NET, as well as the main process of fine-grained hashing based on our attribute-aware hash codes. In concretely, regarding a query image $\mathcal{I}_q$ of Red bellied Woodpecker, after returning all the correct results, a fine-grained image belonging to Red headed Woodpecker closest to the query image in terms of Hamming distance is also retrieved. + +e.g., [8, 18], achieved good retrieval performance, the bits of their hash codes correspond to no semantics, i.e., fine-grained attributes. While, such attributes, e.g., head color, tail color, male, female, living habits, are great means of describing fine-grained objects, in a way both humans and computers understand. In this paper, to establish an explicit correspondence between hash codes and visual attributes for not only further improving large-scale fine-grained retrieval accuracy, but more importantly integrating interpretation into deep learning based hash methods, we propose a unified Attribute-Aware hashing Network, termed as $\mathrm{A}^2$ -NET (cf. Figure 1), for achieving these goals. + +In our $\mathrm{A}^2$ -NET, considering huge labor cost of supervised attribute annotations, we restrict ourselves in an unsupervised setting to automatically capture discriminative visual attributes from still images and then correspond the final learned hash code representations to these attributes. Therefore, a hash bit of learned hash codes could be both discriminative and intuitive. Additionally, thanks to the unsupervised setting, the attributes derived from $\mathrm{A}^2$ -NET will be not restricted to pre-defined attributes like supervised-based attribute learning methods [15, 21, 42, 45]. Moreover, it can distill the most useful properties of fine-grained objects as attribute-aware hash codes in such an end-to-end trainable manner for accuracy retrieval among multiple similar subordinate categories. + +More specifically, as the overall framework shown in Figure 2, our $\mathrm{A}^2$ -NET consists of a fine-grained representation learning module and an attribute-aware hash codes generating module. It first leverages attention mechanisms to model fine-grained tailored patterns in terms of both global-level deep features $T_{i}$ and local-level cues $T_{i}^{c}$ from input image $\mathcal{I}_i$ . Then, the appearance-specific features of these visual patterns $T$ are aggregated and translated into semantic-specific representations $x_{i}$ . After that, we formulate the aforementioned unsupervised attribute learning as a reconstruction task of projecting $x_{i}$ to an attribute vector $v_{i}$ by performing an encoder-decoder structure network. Therefore, it can be expected that in the high-level attribute space, $v_{i}$ could correspond to certain kinds of nameable properties of fine-grained objects. Moreover, a feature decorrelation constraint is further introduced upon $v_{i}$ to both enhance the discriminative ability and remove the redundant correlation among these dimensions of attribute-specific features. Finally, our attribute-aware hash codes $u_{i}$ are generated from $v_{i}$ by conducting the hash code learning procedure. + +To evaluate our model, we conduct extensive experiments using five benchmark fine-grained retrieval datasets for both accuracy and interpretability. Quantitative results of retrieval accuracy on these datasets show that the proposed A $^2$ -NET model obviously and consistently outperforms existing state-of-the-art methods. Qualitative visualization of the obtained attribute-aware hash codes demonstrates that these hash bits have strong correspondences to visual attributes of fine-grained objects (cf. Figure 4), even without employing attribute supervisions or part-level annotations. In addition, the ablation studies of these crucial components in A $^2$ -NET also validate their own effectiveness. + +# 2 Related Work + +# 2.1 Fine-Grained Image Retrieval + +Fine-grained image retrieval as an integral part of fine-grained image analysis [41] has gained more and more traction in recent years [8, 25, 29, 40, 43, 47, 48]. What makes it challenging is that + +![](images/6179f80dbefc26deef990461b0ecc6f884bdf160cc27f57437d49a9dab858b3c.jpg) +Figure 2: Overall framework of the proposed A $^2$ -NET model, which consists of two crucial modules, i.e., fine-grained representation learning and attribute-aware hash codes generating. The whole network can be end-to-end trainable, and is generally driven by the unsupervised attribute-guided reconstruction loss, the feature decorrelation loss and the hash code learning loss, cf. Section 3.3. + +objects of fine-grained images have only subtle differences, and often largely vary in pose, scale, and orientation or can exhibit cross-modal differences (e.g., sketch-based retrieval [25]). + +Depending on the type of query image, the most studied areas of fine-grained image retrieval can be separated into two groups: fine-grained content-based image retrieval (FG-CBIR) and fine-grained sketch-based image retrieval (FG-SBIR). More specifically, in FG-CBIR, unsupervised learning based [40] and supervised learning based methods [44, 47, 48] were developed from different perspectives for handling fine-grained retrieval tasks, e.g., localizing fine-grained parts [40], enhancing intra-class separability with inter-class compactness [48], and reducing the confidence of the fine-grained predictions [44], etc. While, FG-SBIR needs to not only capture fine-grained characteristics present in the sketches, but also possess the ability to traverse the sketch and image domain gap. In the literature of FG-SBIR, the earlier works, e.g., [23, 43, 46], were mostly based on Siamese-triplet networks [3] to tackle the aforementioned challenges. Recently, some works tried to incorporate the advances of recent progress in self-supervised learning [6] and attention mechanisms [7] for further improving the retrieval accuracy of FG-SBIR, e.g., [29, 32]. + +However, although these fine-grained retrieval methods achieved good results, they still have the limitations in the face of large-scale data, i.e., the searching time for exact nearest neighbor is typically expensive or even impossible for the given queries. To alleviate this issue, fine-grained hashing, which aims to generate compact binary codes to represent fine-grained images, as a promising direction has attracted the attention in the fine-grained community very recently [8, 19]. More specifically, ExchNet [8] was the first to define the fine-grained hashing task and develop a fine-grained tailored method to firstly locate discriminative object parts and further learn binary hash codes for representing fine-grained images. In the same period, DSaH [19] was proposed to automatically mine salient regions and learn semantic-preserving hash codes simultaneously. Unfortunately, the learned hash bits of these methods lack any semantics which are more meaningful to fine-grained objects, and thus lack the model interpretability. Compared with them, our proposed A $^2$ -NET can not only outperform the previous fine-grained hashing methods, but more importantly, the learned hash codes of A $^2$ -NET are attribute-aware, i.e., the hash bits of A $^2$ -NET have strong correspondence to semantic visual properties that are useful for fine-grained image retrieval. + +# 2.2 Learning to Hash + +Hashing [38] is a widely-studied solution to approximate nearest neighbor search, which transforms the data item to a short code consisting of a sequence of bits (i.e., hash codes). The research efforts of hashing can be categorized into two groups, including data-independent hashing (aka locality sensitive hashing [9, 27, 34]) and data-dependent hashing (aka learning to hash [4, 12, 17, 33]). + +Specifically, locality sensitive hashing methods attempted to adjust hash learning from different perspectives, e.g., the theory or machine learning views, to name a few: proposing random hash functions satisfying local sensitive property [9], developing better search schemes [27], providing faster computation of hash functions [34], etc. While, compared with locality sensitive hashing methods, since data-dependent hashing methods learn hash functions from a specific dataset to achieve similarity preserving, they can generally obtain superior retrieval accuracy. Especially for capitalizing on advances in deep learning, many well-performing methods were proposed to integrate feature learning and hash code learning into an end-to-end framework based on deep networks, e.g., [4, 12, 17]. In particular, very recently researchers in the vision community have begun to pay attention to the more challenging and practical hashing task, i.e., fine-grained hashing [8, 19]. To the best of our knowledge, this is the first work to equip these learned hash codes with strong correspondence to visual attributes for dealing with large-scale fine-grained image retrieval. + +# 2.3 Visual Attributes + +Attributes are typically mid-level semantic properties of objects [10], such as colors (e.g., "red", "blue"), texture (e.g., "striped", "spotted"), or even life habits of animals (e.g., "living on the tree", "living in the water"). Visual attributes have exhibited their impact for strengthening various vision tasks, including facial verification [21], fine-grained categorization [45], zero-shot transfer [42], scene understanding [30], and so on. Most of the previous attribute learning methods are supervised by costly human-generated annotations and also are dependent on pre-defined attribute labels, e.g., [15, 21, 42, 45]. In consequence, for large-scale problems, these supervised methods might be not feasible due to the restriction caused by the cumbersomely obtained attribute annotations. Moreover, even for some tasks, their visual attributes are quite hard to define. In this paper, to alleviate the aforementioned issues, we propose an $\mathrm{A}^2$ -NET model to formulate an unsupervised learning structure to project the learned visual features into an attribute space where it finally generates attribute-aware binary hash codes. Compared with previous attribute learning methods, our $\mathrm{A}^2$ -NET is independent with pre-defined attribute labels, and could automatically learn discriminative attribute-aware hash codes in a unified end-to-end trainable fashion. Furthermore, our method can not only correspond hash bits to visual attributes tailored for fine-grained objects, which shows significant improvements of retrieval accuracy, but also offer an intuitive way of deep hashing interpretation. + +# 3 Methodology + +In this section, we introduce the overall framework and notations of the proposed A $^2$ -NET model, as well as elaborating the key modules of A $^2$ -NET and its corresponding optimization algorithm. + +# 3.1 Overall Framework and Notations + +As illustrated in Figure 2, our $\mathbf{A}^2$ -NET model consists of two crucial modules, i.e., a fine-grained representation learning module and an attribute-aware hash codes generating module. Given an input image $\mathcal{I}_i$ , based on its corresponding deep activation tensor $\pmb{T}_i \in \mathbb{R}^{C \times H \times W}$ extracted by a backbone CNN, a set of attention guidance $\mathcal{A} = \{\pmb{A}^c\}$ is learned for capturing fine-grained tailored local patterns $\pmb{T}_i^c$ from $\pmb{T}_i$ . To distill semantical cues and further generate the final attribute-aware binary hash codes, we propose to transform these appearance-specific features $\pmb{T}$ towards semantic-specific representations $\hat{\pmb{T}}$ by performing a transform network $\phi(\cdot)$ . After aggregating $\hat{\pmb{T}}$ , the obtained attentive local-level features $\pmb{x}_i^c$ are associated with the global-level feature $\pmb{x}_i^{\mathrm{global}}$ to form as a holistic feature representation $\pmb{x}_i$ . In order to generate attribute-aware binary hash codes, we conduct a reconstructing paradigm to project $\pmb{x}_i$ as $\pmb{v}_i$ in an attribute space where its data point corresponds to an attribute vector w.r.t. a certain kind of nameable properties of fine-grained objects (e.g., "red head" or "spotted body"). Furthermore, with the aid of feature decorrelation, $\pmb{v}_i$ is expected to be more discriminative by removing redundant correlation information. Finally, hash code learning is performed upon $\pmb{v}_i$ to obtain the final attribute-aware binary codes $\pmb{u}_i$ . + +# 3.2 Fine-Grained Representation Learning + +Attention plays an important role in human perception [7, 16], and humans exploit a sequence of partial glimpses and selectively focus on salient parts of an object or a scene in order to better capture + +visual structure [22]. Inspired by this, we incorporate the attention mechanism into representation learning to capture fine-grained local patterns for distinguishing subtle differences between these subordinate categories. + +In concretely, we extract the deep feature of its input image $\mathcal{I}_i$ via a backbone CNN model $\Phi_{\mathrm{CNN}}(\cdot)$ by + +$$ +\boldsymbol {T} _ {i} = \Phi_ {\mathrm {C N N}} (\mathcal {I} _ {i}) \in \mathbb {R} ^ {C \times H \times W}. \tag {1} +$$ + +Then, based on $T_{i}$ , $C$ attention guidance $A^{c} \in \mathbb{R}^{H \times W}$ is generated as a set of attention maps, i.e., $\mathcal{A}$ . The attention guidance $A^{c}$ is designed to evaluate which deep descriptors [40] in these $H \times W$ cells should be attended or even overlooked by conducting + +$$ +\boldsymbol {T} _ {i} ^ {c} = \boldsymbol {A} ^ {c} \odot \boldsymbol {T} _ {i}, \tag {2} +$$ + +where $\odot$ is the element-wise Hadamard product. To obtain the final attribute-aware binary codes, it is desirable to transform these appearance-specific (i.e., low-level) features $\pmb{T}$ to semantic-specific (i.e., mid-level) representations which are closer to the attribute space. Thus, a transforming network $\phi (\cdot)$ , which is equipped with a stack of convolution layers, is performed on $\pmb{T}$ as follows: + +$$ +\hat {\boldsymbol {T}} _ {i} ^ {c} = \phi \left(\boldsymbol {T} _ {i} ^ {c}; \theta_ {\text {l o c a l}}\right), \tag {3} +$$ + +$$ +\hat {\boldsymbol {T}} _ {i} = \phi (\boldsymbol {T} _ {i}; \theta_ {\text {g l o b a l}}), \tag {4} +$$ + +where $\theta$ presents the parameters of the corresponding transforming networks w.r.t. $T_{i}^{c}$ and $T_{i}$ , respectively. Then, we aggregate $\hat{T}_i^c$ and $\hat{T}_i$ by conducting global average-pooling and correspondingly obtain the attentive local-level features $\pmb{x}_i^c$ , as well as the global-level feature $\pmb{x}_i^{\mathrm{global}}$ . The holistic feature representation w.r.t. the input image $\mathcal{L}_i$ is achieved by concatenating both $\pmb{x}_i^c$ and $\pmb{x}_i^{\mathrm{global}}$ , i.e., $\pmb{x}_i = \left[\pmb{x}_i^c;\pmb{x}_i^{\mathrm{global}}\right] = F(\mathcal{L}_i;\Theta)\in \mathbb{R}^d$ . Note that, we hereby abstract the aforementioned fine-grained feature learning process as a function $F(\mathcal{L}_i;\Theta)$ associated with its parameters $\Theta$ . + +# 3.3 Attribute-Aware Hash Codes Generating + +How to generate attribute-aware hash codes is the key of our A $^2$ -NET model. We elaborate it in the following three aspects, i.e., unsupervised attribute-guided learning, attribute-specific feature decorrelation, and hash code learning. + +# 3.3.1 Unsupervised Attribute-Guided Learning + +In real-applications, especially for the large-scale and fine-grained tasks, attribute annotations are always infeasible, which limits the learning process to be conducted in an unsupervised setting. While, in the literature, the main goal of unsupervised learning is to capture regularities in data for the purpose of extracting useful representations or for restoring corrupted data [31]. Many unsupervised methods explicitly produce internal latent units or codes, from which the data is to be reconstructed. + +Inspired by this, we develop an unsupervised attribute-guided reconstruction component to project the holistic representation $\pmb{x}_i$ of $\mathcal{I}_i$ into a latent space, i.e., the attribute space $\mathcal{V}$ . In $\mathcal{V}$ , its high-level vectors are designed to have certain desirable properties, e.g., corresponding to semantic properties of fine-grained objects (aka "fine-grained attributes"). + +More specifically, in our $\mathbf{A}^2$ -NET, the unsupervised attribute-guided learning is realized by a reconstruction paradigm with an encoder-decoder structure, as shown in Figure 2. In concretely, given a batch of $n$ training data $\mathcal{I}_i$ , their holistic representations $\pmb{X} = \{\pmb{x}_1; \pmb{x}_2; \dots; \pmb{x}_n\} \in \mathbb{R}^{d \times n}$ can be obtained as aforementioned. By formulation, the encoder projects $\pmb{X}$ into the attribute space $\mathcal{V}$ with a projection matrix $\pmb{W} \in \mathbb{R}^{k \times d}$ to get an internal latent representation $\pmb{V} \in \mathbb{R}^{k \times n}$ w.r.t. $\pmb{X}$ . In particularly, we set that the dimension of latent representation $k$ equals the number of hash bits in the final binary hash code $\pmb{u}_i$ . Furthermore, each column of $\pmb{V}$ , i.e., $\pmb{v}_i \in \mathbb{R}^k$ , can derive $\pmb{u}_i$ by + +$$ +\boldsymbol {u} _ {i} = \operatorname {s g n} \left(\tanh \left(\boldsymbol {v} _ {i}\right)\right). \tag {5} +$$ + +Meanwhile, regarding $\pmb{v}_i$ , we also consider to reconstruct its input $\pmb{x}_i$ by a decoder as a counterpart of the encoder. Therefore, on one hand, such a reconstruction paradigm can reduce and further distill high-level semantic cues in the attribute space $\mathcal{V}$ . While, on the other hand, it can drive the training + +of $\mathrm{A}^2$ -NET by preserving the similarity between queried hash codes and database points in terms of hash code learning (cf. Section 3.3.3). + +In concretely, the learning objective of unsupervised attribute-guided reconstruction is written as follows: + +$$ +\min _ {\boldsymbol {W}} \| \boldsymbol {X} - \boldsymbol {W} ^ {\top} \boldsymbol {W} \boldsymbol {X} \| _ {F} ^ {2} \quad \text {s . t .} \boldsymbol {W} \boldsymbol {X} = \boldsymbol {V} ^ {\prime} = \tanh (\boldsymbol {V}), \tag {6} +$$ + +where the decoder (i.e., a counterpart of the encoder) is realized by $\boldsymbol{W}^{\top}$ to simplify the network. However, directly minimizing Eq. (6) with a hard constraint is difficult to optimize. Therefore, we relax the constraint into a soft constraint, and then the learning objective can be rewritten as + +$$ +\min _ {\boldsymbol {W}} \| \boldsymbol {X} - \boldsymbol {W} ^ {\top} \boldsymbol {V} ^ {\prime} \| _ {F} ^ {2} + \lambda \| \boldsymbol {W} \boldsymbol {X} - \boldsymbol {V} ^ {\prime} \| _ {F} ^ {2}. \tag {7} +$$ + +# 3.3.2 Attribute-Specific Feature Decorrelation + +By conducting the aforementioned unsupervised attribute-guided learning, we can obtain the internal latent vectors $\mathbf{V}'$ as the attribute-specific features. In order to both enhance the discriminative ability and remove the redundant correlation among these attribute-specific features, we introduce a feature decorrelation constraint upon $\mathbf{V}'$ , which is formulated by + +$$ +\min _ {\boldsymbol {V} ^ {\prime}} \left\| \boldsymbol {V} ^ {\prime} \boldsymbol {V} ^ {\prime \top} - n \boldsymbol {I} \right\| _ {F} ^ {2}, \tag {8} +$$ + +where $I$ is the identity matrix and $n$ is the batch size. Such a feature decorrelation constraint is preferable to construct independent features and reduce redundant information. Therefore, based on both unsupervised attribute-guided reconstruction and attribute-specific feature decorrelation, the final learned hash codes are expected to be both attribute-aware and hash-bit independent. + +# 3.3.3 Hash Code Learning + +In the following, we conduct the hash code learning based on the obtained attribute-specific features. Assume that we have $n$ query data points which are denoted as $\{q_i\}_{i=1}^n$ , as well as $m$ database points which are denoted as $\{v_j\}_{j=1}^m$ . Note that, both $q_i$ and $v_i$ are belonging to the attribute space $\mathcal{V}$ . By following Eq. (5), the corresponding binary hash codes can be obtained via + +$$ +\boldsymbol {u} _ {i} = \operatorname {s g n} \left(\tanh \left(\boldsymbol {q} _ {i}\right)\right), \tag {9} +$$ + +$$ +\boldsymbol {z} _ {j} = \operatorname {s g n} \left(\tanh \left(\boldsymbol {v} _ {j}\right)\right), \tag {10} +$$ + +where $\pmb{u}_i, \pmb{z}_j \in \{-1, +1\}^k$ . The goal of our hash code learning is to learn binary hash codes for both query points and database points from $\{\pmb{q}_i\}_{i=1}^n$ , $\{\pmb{v}_j\}_{j=1}^m$ , and the pairwise supervised information, i.e., $\pmb{S} \in \{-1, +1\}^{n \times m}$ . To preserve the pairwise similarity, we adopt the $\ell_2$ loss between the supervised information (aka similarity) and the inner product of query-database point binary code pairs. It can be formulated as follows: + +$$ +\min _ {\boldsymbol {U}, \boldsymbol {Z}} \sum_ {i = 1} ^ {n} \sum_ {j = 1} ^ {m} \left(\boldsymbol {u} _ {i} ^ {\top} \boldsymbol {z} _ {j} - k S _ {i j}\right) ^ {2} +$$ + +$$ +\text {s . t .} \quad \boldsymbol {U} \in \{- 1, + 1 \} ^ {n \times k}, \boldsymbol {Z} \in \{- 1, + 1 \} ^ {m \times k}. \tag {11} +$$ + +Overall, we get the final objective of the proposed A $^2$ -NET model by considering Eq. (7), Eq. (8) and Eq. (11) together as follows: + +$$ +\min _ {\boldsymbol {W}, \boldsymbol {\Theta}} \mathcal {L} (\mathcal {I}) = \| \boldsymbol {X} - \boldsymbol {W} ^ {\top} \boldsymbol {V} ^ {\prime} \| _ {F} ^ {2} + \lambda \| \boldsymbol {W} \boldsymbol {X} - \boldsymbol {V} ^ {\prime} \| _ {F} ^ {2} + \alpha \| \boldsymbol {V} ^ {\prime} \boldsymbol {V} ^ {\prime \top} - n \boldsymbol {I} \| _ {F} ^ {2} + \beta \sum_ {i = 1} ^ {n} \sum_ {j = 1} ^ {m} \left(\boldsymbol {u} _ {i} ^ {\top} \boldsymbol {z} _ {j} - k S _ {i j}\right) ^ {2}, \tag {12} +$$ + +where $\lambda, \alpha$ and $\beta$ are hyper-parameters as the trade-off. + +In practice, during training, it might be only available a set of database points $\{v_{j}\}_{j = 1}^{m}$ without query points. Thus, we randomly sample $n$ data points from database to construct a query set, and denote the indices of all the database points as $\Gamma$ with the indices of the query set as $\Omega$ . Additionally, because we cannot back-propagate the gradient to $\Theta$ due to the $\mathrm{sgn}(\cdot)$ function, we omit the $\mathrm{sgn}(\cdot)$ function and only apply $\tanh (\cdot)$ for relaxation in Eq. (10) of the whole optimization process. Therefore, the + +optimization formulation of $\mathbf{A}^2$ -NET can be rewritten with only database points $\{\pmb{v}_j\}_{j=1}^m$ for training as: + +$$ +\begin{array}{l} \min _ {\boldsymbol {W}, \boldsymbol {\Theta}} \mathcal {L} (\mathcal {I}) = \| \boldsymbol {X} - \boldsymbol {W} ^ {\top} \boldsymbol {V} ^ {\prime} \| _ {F} ^ {2} + \lambda \| \boldsymbol {W} \boldsymbol {X} - \boldsymbol {V} ^ {\prime} \| _ {F} ^ {2} + \alpha \| \boldsymbol {V} ^ {\prime} \boldsymbol {V} ^ {\prime \top} - n \boldsymbol {I} \| _ {F} ^ {2} \\ + \beta \sum_ {i \in \Omega} \sum_ {j \in \Gamma} \left(\tanh \left(\boldsymbol {W} \cdot F (\mathcal {I} _ {i}; \Theta)\right) ^ {\top} \boldsymbol {z} _ {j} - k S _ {i j}\right) ^ {2}. \tag {13} \\ \end{array} +$$ + +For optimization, our $\mathrm{A}^2$ -NET does not require complicated two-stage learning algorithms, e.g., the alternative optimization strategy. In experiments, we employ the back-propagation algorithm and follow [17] to train the whole $\mathrm{A}^2$ -NET model in a unified end-to-end manner. + +# 3.4 Out-of-Sample Extension + +After training $\mathrm{A}^2$ -NET, the learned model can be applied for generating binary codes for query points including unseen query points in the training phase. Specifically, we can use the following equation to generate the binary code for $\mathcal{I}_q$ : + +$$ +\boldsymbol {u} _ {q} = \operatorname {s g n} \left(\tanh \left(\boldsymbol {W} \cdot F \left(\mathcal {I} _ {q}; \Theta\right)\right)\right). \tag {14} +$$ + +# 4 Experiments + +# 4.1 Datasets + +By following ExchNet [8], our experiments are conducted on five fine-grained benchmark datasets, i.e., CUB200-2011 [37], Aircraft [28], Food101 [2], NABirds [35] and VegFru [14]. Specifically, CUB200-2011 is one of the most popular used fine-grained datasets. It contains 11,788 bird images from 200 bird species and is officially split into 5,994 images for training and 5,794 images for test. Aircraft contains 10,000 images spanning 100 aircraft models with 3,334 for training, 3,333 for validation and 3,333 for test. For large-scale datasets, Food101 contains 101 kinds of foods with 101,000 images, where for each class, 250 test images are checked manually for correctness while 750 training images still contain a certain amount of noises. NABirds is a high quality dataset which has 48,562 images of North American birds with 555 sub-categories, where 23,929 for training with 24,633 for test. VegFru is another large-scale fine-grained dataset covering 200 kinds of vegetables and 92 kinds of fruits with 29,200 for training, 14,600 for validation and 116,931 for test. + +# 4.2 Baselines and Implementation Details + +Baselines In experiments, we compare our proposed model to the following competitive baselines, i.e., ITQ [11], SDH [33], DPSH [24], HashNet [5], and ADSH [17]. Among them, DPSH, HashNet and ADSH are deep learning based methods, while ITQ and SDH are not. Furthermore, we also compare the results of our $\mathrm{A}^2$ -NET with state-of-the-arts of fine-grained hashing methods, including ExchNet [8]. Additionally, another fine-grained hashing method, i.e., DSaH [19], also achieved good retrieval accuracy. However, due to its empirical settings quite distant from other existing fine-grained hashing methods, for fair comparisons, we strictly control empirical settings as the same as those of [19] and compare the results of our $\mathrm{A}^2$ -NET with its results in the supplementary materials. + +Implementation Details For fair comparisons, we follow the efficient training setting in ExchNet [8]. In concretely, for CUB200-2011, Aircraft and Food101, we sample 2,000 images per epoch, while 4,000 samples are randomly selected for NABirds and VegFru. For the training details, regarding the backbone model, we can choose any network structure as the base network for the fine-grained representation learning module. While, by following [8], ResNet-50 [13] is employed in experiments. The total number of training epochs is 20, and the number of batch size is set as 16. While, different from ExchNet, our model only requires a smaller iteration time until convergence. Specifically, for these datasets containing less than 20,000 training images, the iteration time $T_{\mathrm{max}}$ is 60, and the learning rate is divided by 10 at the $50^{\mathrm{th}}$ iteration. For other datasets, $T_{\mathrm{max}}$ is set as 70, and the learning rate is divided by 10 at the $60^{\mathrm{th}}$ iteration. The hyper-parameters, i.e., $\lambda$ , $\alpha$ and $\beta$ in Eq. (13), are set as 1, $\frac{1}{n \times k}$ and $\frac{12}{k}$ , respectively. The number of attention guidance equals the number of hash bits. The optimizer is standard mini-batch stochastic gradient descent with the weight decay as $10^{-4}$ . All experiments are conducted with a GeForce RTX 2080 Ti GPU. + +Table 1: Comparisons of retrieval accuracy (\% mAP) on five fine-grained benchmark datasets. + +
Datasets# bitsITQSDHDPSHHashNetADSHExchNetOurs
CUB200-2011126.8010.528.6812.0320.0325.1433.83
249.4216.9512.5117.7750.3358.9861.01
3211.1920.4312.7419.9361.6867.7471.61
4812.4522.2315.5822.1365.4371.0577.33
Aircraft124.384.898.7414.9115.5433.2740.00
245.286.3610.8717.7523.0945.8363.66
325.826.9013.5419.4230.3751.8372.51
486.057.6513.9420.3250.6559.0581.37
Food101126.4610.2111.8224.4235.6445.6346.44
248.2011.4413.0534.4840.9355.4866.87
329.7013.3616.4135.9042.8956.3974.27
4810.0715.5520.0639.6548.8164.1982.13
NABirds122.533.102.172.342.535.228.20
244.226.724.083.298.2315.6919.15
325.388.863.614.5214.7121.9424.41
486.1010.383.204.9725.3434.8135.64
VegFru123.055.926.333.708.2423.5525.52
245.5111.559.056.2424.9035.9344.73
327.4814.5510.287.8336.5348.2752.75
488.7416.459.1110.2955.1569.3069.77
+ +![](images/8bb2e8cc3b13e017f5a99fc443e931f587a83be7724caa595f68847ce842e061.jpg) +Figure 3: Examples of top-10 retrieved images on CUB200-2011 of 48-bit hash codes by our $\mathrm{A}^2$ -NET. + +# 4.3 Main Results + +Table 1 presents the mean average precision (mAP) results of fine-grained retrieval on these five aforementioned fine-grained benchmark datasets. For each dataset, we report the results of four lengths of hash bits, i.e., 12, 24, 32, and 48, for evaluations. As shown in that table, our proposed A $^2$ -NET model significantly and consistently outperforms the other baseline methods on these datasets. In particular, compared with the state-of-the-art method ExchNet [8], our A $^2$ -NET achieves $17.83\%$ and $17.88\%$ improvements over ExchNet of 24-bit and 32-bit experiments on Aircraft and Food-101, respectively. Moreover, A $^2$ -NET also obtains superior results with an absolute value of about $80\%$ mAP on CUB200-2011, Aircraft and Food101 with 48-bit hash codes. These observations validate the effectiveness of the proposed A $^2$ -NET model, as well as its promising practicality in real-applications of fine-grained retrieval. Additionally, in Figure 3, we illustrate several retrieval results on CUB200-2011, which shows that A $^2$ -NET can retrieve well among multiple subordinate categories when the same species of birds with diverse variations appear in different kinds of background. Also, there also exist several failure cases, where quite tiny differences (e.g., caused by different views) between the query image and the returned images are demanded by carefully observations. + +# 4.4 Ablation Studies + +In this section, we demonstrate the effectiveness of these crucial components of the proposed A $^2$ -NET model, i.e., the attention-based fine-grained representation learning component 3.2, the unsupervised + +Table 2: Retrieval accuracy (% mAP) with incremental components of the proposed A ${}^{2}$ -NET model. + +
ConfigurationsCUB200-2011Food101
12 bits24 bits32 bits48 bits12 bits24 bits32 bits48 bits
Vanilla backbone20.0350.3361.6865.4335.6440.9342.8948.81
+ Attention (Sec. 3.2)27.4258.1768.2476.1041.3365.0770.0678.51
+ Reconstruction (Sec. 3.3.1)33.3160.6571.2877.1045.0267.4973.5781.63
+ Feature decorrelation (Sec. 3.3.2)33.8361.0171.6177.3346.4466.8774.2782.13
+ +![](images/f5be703109a64fe81b81d0377a928c993d33a08fc931056b329a88777d48e335.jpg) +(a) CUB200-2011 + +![](images/8cfe542e5341fa5eee50f8e36b760acb17c6127e90b84b1b7ff87eb4585143cd.jpg) +(b) Aircraft + +![](images/0626c357675d00f0d13ce318dfa64353b986ff9a144d5c93b4b23f4de07d12a3.jpg) +(c) Food101 +Figure 4: Quality demonstrations of the learned attribute-aware hash codes by the proposed A²-NET model. Each column in each sub-figure can strongly correspond to a certain kind of properties of the fine-grained objects, e.g., "yellow birds in the forest", "double-winged aircrafts", "noodle-like food", "Bromeliaceae fruits", etc. (Best viewed in color and zoomed in.) + +![](images/5a6c657bb8706fd6245fc339c09abcf741045bba5831de8064066aa7b9694959.jpg) +(d) NABirds + +![](images/073d76733db66e01d9426a2e6162fe31fbf79273e5fdc25d92f0ad6b7828b333.jpg) +(e) VegFru + +attribute-guided reconstruction component (cf. Section 3.3.1) and the attribute-specific feature decorrelation component (cf. Section 3.3.2). In the ablation studies, we apply these components incrementally on a vanilla backbone (i.e., ResNet-50) as the baseline. As evaluated in Table 2, by stacking these two components one by one, the retrieval results are steadily improved, which justifies the effectiveness of our proposed components in $\mathrm{A}^2$ -NET. + +# 4.5 Qualitative Analyses of Attribute-Aware Hash Codes + +We hereby discuss the quality of the learned attribute-aware hash codes $\pmb{u}_i$ of $\mathrm{A}^2$ -NET. After obtaining $\pmb{u}_i$ , we visualize fine-grained images retrieved by a random single hash bit of $\pmb{u}_i$ to demonstrate the strong correspondence between visual attributes and the obtained hash bits. All the five datasets in experiments are used as examples to illustrate the quality. As observed in Figure 4, images of each column have some similar fine-grained object properties, i.e., visual attributes. Indeed, the learned hash codes are apparently attribute-aware, which could provide an explanation of the $\mathrm{A}^2$ -NET's success in fine-grained retrieval. Meanwhile, it also offers human-understandable interpretation for such a deep learning based fine-grained hashing method. + +# 5 Conclusion + +In this paper, we proposed an Attribute-Aware hashing Network, i.e., $\mathrm{A}^2$ -NET, for dealing with the large-scale fine-grained image retrieval task. Particularly, $\mathrm{A}^2$ -NET was designed as expected to be efficient, effective and more importantly interpretable. In concretely, by developing an unsupervised attribute-guided reconstruction method based on the obtained appearance-specific visual representation with attention, it can distill attribute-specific vectors in a high-level attribute space. After further performing feature decorrelation upon attribute-specific vectors, their discriminative ability is strengthened for representing a fine-grained object. Then, hash codes can be generated from these attribute-specific vectors and thus became attribute-aware. Both qualitative and quantitative experiments demonstrate the effectiveness of our $\mathrm{A}^2$ -NET. Additionally, visual attributes have been shown to be useful in describing both known and unknown entities, which motivates us to study identifying unobserved sub-categories, i.e., zero-shot fine-grained recognition, based on our attribute-aware hash codes as the future work. + +# References + +[1] Thomas Berg, Jiongxin Liu, Seung Woo Lee, Michelle L. Alexander, David W. Jacobs, and Peter N. Belhumeur. Birdsnap: Large-scale fine-grained visual categorization of birds. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., pages 2019-2026, 2014. +[2] Lukas Bossard, Matthieu Guillaumin, and Luc Van Gool. Food-101 – mining discriminative components with random forests. In Proc. Eur. Conf. Comp. Vis., pages 446–461, 2014. +[3] Jane Bromley, Isabelle Guyon, Yann LeCun, Eduard Säckinger, and Roopak Shah. Signature verification using a "siamese" time delay neural network. In Proc. Advances in Neural Inf. Process. Syst., pages 737-744, 1993. +[4] Fatih Cakir, Kun He, Sarah Adel Bargal, and Stan Sclaroff. Hashing with mutual information. IEEE Trans. Pattern Anal. Mach. Intell., 41(10):2424-2437, 2019. +[5] Zhangjie Cao, Mingsheng Long, Jianmin Wang, and Philip S. Yu. HashNet: Deep learning to hash by continuation. In Proc. IEEE Int. Conf. Comp. Vis., pages 5608-5617, 2017. +[6] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. In Proc. Int. Conf. Mach. Learn., pages 1597-1607, 2020. +[7] Maurizio Corbetta and Gordon L. Shulman. Control of goal-directed and stimulus-driven attention in the brain. Nature Reviews Neuroscience, 3:201-215, 2002. +[8] Quan Cui, Qing-Yuan Jiang, Xiu-Shen Wei, Wu-Jun Li, and Osamu Yoshie. ExchNet: A unified hashing network for large-scale fine-grained image retrieval. In Proc. Eur. Conf. Comp. Vis., pages 189-205, 2020. +[9] Anirban Dasgupta, Ravi Kumar, and Tamas Sarlos. Fast locality-sensitive hashing. In Proc. ACM SIGKDD Int. Conf. Knowledge discovery & data mining, pages 1073-1081, 2011. +[10] Vittorio Ferrari and Andrew Zisserman. Learning visual attributes. In Proc. Advances in Neural Inf. Process. Syst., pages 433-440, 2007. +[11] Yunchao Gong, Svetlana Lazebnik, Albert Gordo, and Florent Perronnin. Iterative quantization: A procrustean approach to learning binary codes for large-scale image retrieval. IEEE Trans. Pattern Anal. Mach. Intell., 35(12):2916-2929, 2012. +[12] Kun He, Fatih Cakir, Sarah Adel Bargal, and Stan Sclaroff. Hashing as tie-aware learning to rank. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., pages 4023-4032, 2018. +[13] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., pages 770-778, 2016. +[14] Saihui Hou, Yushan Feng, and Zilei Wang. VegFru: A domain-specific dataset for fine-grained visual categorization. In Proc. IEEE Int. Conf. Comp. Vis., pages 541-549, 2017. +[15] Junshi Huang, Rogerio Feris, Qiang Chen, and Shuicheng Yan. Cross-domain image retrieval with a dual attribute-aware ranking network. In Proc. IEEE Int. Conf. Comp. Vis., pages 1062-1070, 2015. +[16] Laurent Itti, Christof Koch, and Ernst Niebur. A model of saliency-based visual attention for rapid scene analysis. IEEE Trans. Pattern Anal. Mach. Intell., 20(11):1254-1259, 1998. +[17] Qing-Yuan Jiang and Wu-Jun Li. Asymmetric deep supervised hashing. In Proc. Conf. AAAI, pages 3342-3349, 2018. +[18] Sheng Jin, Hongxun Yao, Xiaoshuai Sun, Shangchen Zhou, Lei Zhang, and Xiansheng Hua. Deep saliency hashing for fine-grained retrieval. IEEE Trans. Image Process., 29:5336-5351, 2020. +[19] Sheng Jin, Hongxun Yao, Xiaoshuai Sun, Shangchen Zhou, Lei Zhang, and Xiansheng Hua. Deep saliency hashing for fine-grained retrieval. IEEE Trans. Image Process., 29:5336-5351, 2020. +[20] Jonathan Krause, Michael Stark, Jia Deng, and Li Fei-Fei. 3D object representations for fine-grained categorization. In ICCV Workshop on 3D Representation and Recognition, 2013. +[21] Neeraj Kumar, Alexander Berg, Peter N. Belhumeur, and Shree Nayar. Describable visual attributes for face verification and image search. IEEE Trans. Pattern Anal. Mach. Intell., 33(10):1962-1977, 2011. +[22] Hugo Larochelle and Geoffrey Hinton. Learning to combine foveal glimpses with a third-order boltzmann machine. In Proc. Advances in Neural Inf. Process. Syst., pages 1243–1251, 2010. +[23] Ke Li, Kaiyue Pang, Yi-Zhe Song, Timothy M. Hospedales, Tao Xiang, and Honggang Zhang. Synergistic instance-level subspace alignment for fine-grained sketch-based image retrieval. IEEE Trans. Image Process., 26(12):5908-5921, 2017. +[24] Wu-Jun Li, Sheng Wang, and Wang-Cheng Kang. Feature learning based deep supervised hashing with pairwise labels. In Proc. Int. Joint Conf. Artificial Intell., pages 1711-1717, 2015. +[25] Yi Li, Timothy M. Hospedales, Yi-Zhe Song, and Shaogang Gong. Fine-grained sketch-based image retrieval by matching deformable part models. In Proc. British Machine Vis. Conf., pages + +1-12, 2014. +[26] Ziwei Liu, Ping Luo, Shi Qiu, Xiaogang Wang, and Xiaou Tang. DeepFashion: Powering robust clothes recognition and retrieval with rich annotations. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., pages 1096-1104, 2016. +[27] Qin Lv, William Josephson, Zhe Wang, Moses Charikar, and Kai Li. Multi-probe LSH: Efficient indexing for high-dimensional similarity search. In Proc. Int. Conf. Very Large Data Bases, pages 950-961, 2007. +[28] Subhransu Maji, Esa Rahtu, Juho Kannala, Matthew Blaschko, and Andrea Vedaldi. Fine-grained visual classification of aircraft. arXiv preprint arXiv:1306.5151, 2013. +[29] Kaiyue Pang, Yongxin Yang, Timothy M. Hospedales, Tao Xiang, and Yi-Zhe Song. Solving mixed-modal jigsaw puzzle for fine-grained sketch-based image retrieval. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., pages 10347-10355, 2020. +[30] Genevieve Patterson, Chen Xu, Hang Su, and James Hays. The SUN attribute database: Beyond categories for deeper scene understanding. Int. J. Comput. Vision, 108(1-2):59-81, 2014. +[31] Marc'Aurelio Ranzato, Y-Lan Boureau, Sumit Chopra, and Yann LeCun. A unified energy-based framework for unsupervised learning. In ICAIS, pages 371-379, 2007. +[32] Aneeshan Sain, Ayan Kumar Bhunia, Yongxin Yang, Tao Xiang, and Yi-Zhe Song. Cross-modal hierarchical modelling for fine-grained sketch based image retrieval. In Proc. British Machine Vis. Conf., pages 1-14, 2020. +[33] Fumin Shen, Chunhua Shen, Wei Liu, and Heng Tao Shen. Supervised discrete hashing. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., pages 37-45, 2015. +[34] Anshumali Shrivastava and Ping Li. Densifying one permutation hashing via rotation for fast near neighbor search. In Proc. Int. Conf. Mach. Learn., pages 557-565, 2014. +[35] Grant Van Horn, Steve Branson, Ryan Farrell, Scott Haber, Jessie Barry, Panos Ipeirotis, Pietro Perona, and Serge Belongie. Building a bird recognition app and large scale dataset with citizen scientists: The fine print in fine-grained dataset collection. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., pages 595-604, 2015. +[36] Grant Van Horn, Oisin Mac Aodha, Yang Song, Yin Cui, Chen Sun, Alex Shepard, Hartwig Adam, Pietro Perona, and Serge Belongie. The iNaturalist species classification and detection dataset. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., pages 8769-8778, 2017. +[37] Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The Caltech-UCSD birds-200-2011 dataset. Tech. Report CNS-TR-2011-001, 2011. +[38] Jingdong Wang, Heng Tao Shen, and Ting Zhang. A survey on learning to hash. IEEE Trans. Pattern Anal. Mach. Intell., 40(4):769-790, 2018. +[39] Xiu-Shen Wei, Quan Cui, Lei Yang, Peng Wang, and Lingqiao Liu. RPC: A large-scale retail product checkout dataset. arXiv preprint arXiv:1901.07249, 2019. +[40] Xiu-Shen Wei, Jian-Hao Luo, Jianxin Wu, and Zhi-Hua Zhou. Selective convolutional descriptor aggregation for fine-grained image retrieval. IEEE Trans. Image Process., 26(6):2868-2881, 2017. +[41] Xiu-Shen Wei, Jianxin Wu, and Quan Cui. Deep learning for fine-grained image analysis: A survey. arXiv preprint arXiv:1907.03069, 2019. +[42] Yongqin Xian, Christoph H. Lampert, Bernt Schiele, and Zeynep Akata. Zero-shot learning-a comprehensive evaluation of the good, the bad and the ugly. IEEE Trans. Pattern Anal. Mach. Intell., 41(9):2251-2265, 2019. +[43] Qian Yu, Feng Liu, Yi-Zhe Song, Tao Xiang, Timothy M. Hospedales, and Chen-Change Loy. Sketch me that shoel. In Proc. IEEE Conf. Comp. Vis. Patt. Recogn., pages 799–807, 2016. +[44] Xianxian Zeng, Yun Zhang, Xiaodong Wang, Kairui Chen, Dong Li, and Weijun Yang. Fine-grained image retrieval via piecewise cross entropy loss. Image and Vision Computing, 93:2868-2881, 2020. +[45] Hua Zhang, Xiaochun Cao, and Rui Wang. Audio visual attribute discovery for fine-grained object recognition. In Proc. Conf. AAAI, pages 7542-7549, 2018. +[46] Jingyi Zhang, Fumin Shen, Li Liu, Fan Zhu, Mengyang Yu, Ling Shao, Heng Tao Shen, and Luc Van Gool. Generative domain-migration hashing for sketch-to-image retrieval. In Proc. Eur. Conf. Comp. Vis., pages 297-314, 2018. +[47] Xiawu Zheng, Rongrong Ji, Xiaoshuai Sun, Yongjian Wu, Feiyue Huang, and Yanhua Yang. Centralized ranking loss with weakly supervised localization for fine-grained object retrieval. In Proc. Int. Joint Conf. Artificial Intell., pages 1226-1233, 2018. +[48] Xiawu Zheng, Rongrong Ji, Xiaoshuai Sun, Baochang Zhang, Yongjian Wu, and Feiyue Huang. Towards optimal fine grained retrieval via decorrelated centralized loss with normalize-scale layer. In Proc. Conf. AAAI, pages 9291-9298, 2019. \ No newline at end of file diff --git a/a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/images.zip b/a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..cd0ac2d7a3e5abaf14d04e8cbd9424ee269f3965 --- /dev/null +++ b/a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2acf8d867d5fd700dde006ceb1336b46cef0a0fe19242e0f2a517d169aec8312 +size 529042 diff --git a/a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/layout.json b/a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..e11d8bb4de4792de9b4314f002f8bd4f39260176 --- /dev/null +++ b/a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1024d32f7965487e2ab8fc6f62a98cda5a0b6db6217acdc86400c395007a3b6 +size 418018 diff --git a/abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/85b474c0-b943-4f6a-80a4-4003071c79ef_content_list.json b/abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/85b474c0-b943-4f6a-80a4-4003071c79ef_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..0fb59ab0b071c362396a61194964ff2dc854ffed --- /dev/null +++ b/abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/85b474c0-b943-4f6a-80a4-4003071c79ef_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7f0536dac092605c5262961725d618ad633f108022cf3dde86390c72d1a91fb +size 78147 diff --git a/abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/85b474c0-b943-4f6a-80a4-4003071c79ef_model.json b/abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/85b474c0-b943-4f6a-80a4-4003071c79ef_model.json new file mode 100644 index 0000000000000000000000000000000000000000..291b4b1a8c3556ec5e8abb0c6088f9b5acfd58cc --- /dev/null +++ b/abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/85b474c0-b943-4f6a-80a4-4003071c79ef_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b249a53f732423043f6997acd608c723e85f67625b16e41a1dd45fb6c6b44274 +size 97367 diff --git a/abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/85b474c0-b943-4f6a-80a4-4003071c79ef_origin.pdf b/abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/85b474c0-b943-4f6a-80a4-4003071c79ef_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d85161f489faf12d8d44db566b0fa7978269d3dd --- /dev/null +++ b/abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/85b474c0-b943-4f6a-80a4-4003071c79ef_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c52e9be10462a7fe6321c99a1c91d79c99e79d8dcb4a4f5e913a0e4cf48d26d9 +size 1918711 diff --git a/abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/full.md b/abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a2de58d6addb5acb27de4761497caa8113fd6022 --- /dev/null +++ b/abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/full.md @@ -0,0 +1,272 @@ +# ABC: Auxiliary Balanced Classifier for Class-Imbalanced Semi-Supervised Learning + +Hyuck Lee Seungjae Shin Heeyoung Kim + +Department of Industrial and Systems Engineering, KAIST + +{dlgur0921, tmdwo0910, heeyoungkim}@kaist.ac.kr + +# Abstract + +Existing semi-supervised learning (SSL) algorithms typically assume class-balanced datasets, although the class distributions of many real-world datasets are imbalanced. In general, classifiers trained on a class-imbalanced dataset are biased toward the majority classes. This issue becomes more problematic for SSL algorithms because they utilize the biased prediction of unlabeled data for training. However, traditional class-imbalanced learning techniques, which are designed for labeled data, cannot be readily combined with SSL algorithms. We propose a scalable class-imbalanced SSL algorithm that can effectively use unlabeled data, while mitigating class imbalance by introducing an auxiliary balanced classifier (ABC) of a single layer, which is attached to a representation layer of an existing SSL algorithm. The ABC is trained with a class-balanced loss of a minibatch, while using high-quality representations learned from all data points in the minibatch using the backbone SSL algorithm to avoid overfitting and information loss. Moreover, we use consistency regularization, a recent SSL technique for utilizing unlabeled data in a modified way, to train the ABC to be balanced among the classes by selecting unlabeled data with the same probability for each class. The proposed algorithm achieves state-of-the-art performance in various class-imbalanced SSL experiments using four benchmark datasets. + +# 1 Introduction + +Recently, numerous deep neural network (DNN)-based semi-supervised learning (SSL) algorithms have been proposed to improve the performance of DNNs by utilizing unlabeled data when only a small amount of labeled data is available. These algorithms have shown effective performance in various tasks. However, most existing SSL algorithms assume class-balanced datasets, whereas the class distributions of many real-world datasets are imbalanced. It is well known that classifiers trained on class-imbalanced data tend to be biased toward the majority classes. This issue can be more problematic for SSL algorithms that use predicted labels of unlabeled data for their training, because the labels predicted by the algorithm trained on class-imbalanced data become even more severely imbalanced [18]. For example, Figure 1 (b) presents biased predictions of ReMixMatch [3], a recent SSL algorithm, trained on CIFAR-10-LT, which is a class-imbalanced dataset with the amount of Class 0 being 100 times more than that of Class 9, as depicted in Figure 1 (a). Although there are various class-imbalanced learning techniques, they are usually designed for labeled data, and thus cannot be simply combined with SSL algorithms under class-imbalanced SSL (CISSL) scenarios. Recently, a few CISSL algorithms have been proposed, but the CISSL problem is still underexplored. + +We propose a new CISSL algorithm that can effectively use unlabeled data, while mitigating class imbalance by using an existing DNN-based SSL algorithm [3, 29] as the backbone and introducing an auxiliary balanced classifier (ABC) of a single layer. The ABC is attached to a representation + +![](images/70ca829a4dcbfc7184cd16800e1a3bdd1b80000c6839e10b95422431d43b9ab6.jpg) +(a) Class-imbalanced training set + +![](images/f363f63b16cf92f006502b133dbfaab2a73cea941f2cfa12d6eb947a05ab35e0.jpg) +(b) ReMixMatch +Figure 1: Predictions on a class-balanced test set using ReMixMatch (b) and the proposed algorithm (c) trained on a class-imbalanced training set (a). + +![](images/a7b98c16c522995d204c563f80c3ad817896fb3db90f9478e353b5814a0e6b27.jpg) +(c) Proposed algorithm + +layer immediately preceding the classification layer of the backbone, based on the argument that a classification algorithm (i.e., backbone) can learn high-quality representations even if its classifier is biased toward the majority classes [17]. The ABC is trained to be balanced across all classes by using a mask that rebalances the class distribution, similar to re-sampling in previous SSL studies [2, 7, 13, 16]. Specifically, the mask stochastically regenerates a class-balanced subset of a minibatch on which the ABC is trained. The ABC is trained simultaneously with the backbone, so that the ABC can use high-quality representations learned from all data points in the minibatch using the backbone. In this way, the ABC can overcome the limitations of the previous resampling techniques, overfitting on minority-class data or loss of information on majority-class data [6, 27]. + +Moreover, to place decision boundaries in low-density regions by utilizing unlabeled data, we use consistency regularization, a recent SSL technique, which enforces the classification outputs of two augmented or perturbed versions of the same unlabeled example to remain unchanged. In particular, we encourage the ABC to be balanced across classes when using consistency regularization by selecting unlabeled examples with the same probability for each class using a mask. Figure 1 (c) illustrates that compared to the results of ReMixMatch in Figure 1 (b), the class distribution of the predicted labels becomes more balanced using the proposed algorithm trained on the same dataset. Our experimental results under various scenarios demonstrate that the proposed algorithm achieves state-of-the-art performance. Through qualitative analysis and an ablation study, we further investigate the contribution of each component of the proposed algorithm. The code for the proposed algorithm is available at https://github.com/LeeHyuck/ABC. + +# 2 Related Work + +Semi-supervised learning (SSL) Recently, several SSL techniques that utilize unlabeled data have been proposed. Entropy minimization [12] encourages the classifier outputs to have low entropy for unlabeled data, as in pseudo-labels [22]. Mixup regularization [4, 32] makes the decision boundaries farther away from the data clusters by encouraging the prediction for an interpolation of two inputs to be the same as the interpolation of the prediction for each input. Consistency regularization [26, 24, 30] encourages a classifier to produce similar predictions for perturbed versions of the same unlabeled input. To create perturbed unlabeled inputs, various data augmentation techniques have been used. For example, FixMatch [29] and ReMixMatch [3] used strong augmentation methods such as Cutout [10] and RandomAugment [8]. FixMatch and ReMixMatch are used as the backbone of the proposed algorithm; they are described in Section 3.2. + +Class-imbalanced learning (CIL) As a popular approach for CIL, re-sampling techniques [16, 7, 2, 13] balance the number of training samples for each class in the training set. As another popular approach, re-weighting techniques [23, 14, 33] re-weight the loss for each class by a factor inversely proportional to the number of data points belonging to that class. Although these approaches are simple, they have some drawbacks. For example, oversampling from minority classes can cause overfitting, whereas undersampling from majority classes can cause information loss [6]. In the case of re-weighting, gradients can be calculated to be abnormally large when the class imbalance is severe, resulting in unstable training [6, 1]. Many attempts have been made to alleviate these problems, such as effective re-weighting [9] and meta-learning-based re-weighting [28, 15]. New forms of losses have also been proposed [6, 27]. In [36, 19], knowledge is transferred from the data of + +majority classes to the data of minority classes. These CIL algorithms were designed for labeled data and require label information; thus, they are not applicable to unlabeled data. In [17], it was found that biased classification is mainly due to the classification layer and that a classification algorithm can learn meaningful representations even from a class-imbalanced training set. Based on this finding, we design the ABC to use high-quality representations learned from class-imbalanced data utilizing FixMatch [29] and ReMixMatch [3]. + +Class-imbalanced semi-supervised learning (CISSL) There have been few studies on CISSL. In [35], it was found that more accurate decision boundaries can be obtained in class-imbalanced settings through self-supervised learning and semi-supervised learning. DARP [18] refines biased pseudolabels by solving a convex optimization problem. CReST [34], a recent self-training technique, mitigates class imbalance by using pseudo-labeled unlabeled data points classified as minority classes with a higher probability than those classified as majority classes. + +# 3 Methodology + +# 3.1 Problem setting + +Suppose that we have a labeled dataset $\mathcal{X} = \{(x_n, y_n) : n \in (1, \dots, N)\}$ , where $x_n \in \mathbb{R}^d$ is the $n$ th labeled data point and $y_n \in \{1, \dots, L\}$ is the corresponding label. We also have an unlabeled dataset $\mathcal{U} = \{(u_m) : m \in (1, \dots, M)\}$ , where $u_m \in \mathbb{R}^d$ is the $m$ th unlabeled data point. We express the ratio of the amount of labeled data as $\beta = \frac{N}{M + N}$ . Generally, $\beta < 0.5$ , because label acquisition is costly and laborious. We denote the number of labeled data points of class $l$ as $N_l$ , i.e., $\sum_{l=1}^{L} N_l = N$ , and assume that the $L$ classes are sorted according to cardinality in descending order, i.e., $N_1 \geq N_2 \geq \dots \geq N_L$ . We denote the ratio of the class imbalance as $\gamma = \frac{N_1}{N_L}$ . Under class-imbalanced scenarios, $\gamma \gg 1$ . Following previous CIL studies, we define the half of the classes containing a large amount of data as the majority classes, and the other half of the classes, containing a small amount of data, as the minority classes. Following [34], we assume that $\mathcal{X}$ and $\mathcal{U}$ share the same class distribution, i.e., the labeled and unlabeled datasets are class-imbalanced to the same extent. From $\mathcal{X}$ and $\mathcal{U}$ , we generate minibatches $\mathcal{MB}_{\mathcal{X}} = \{(x_b, y_b) : b \in (1, \dots, B)\} \subset \mathcal{X}$ and $\mathcal{MB}_{\mathcal{U}} = \{(u_b) : b \in (1, \dots, B)\} \subset \mathcal{U}$ for each iteration of training, where $B$ is the minibatch size. Using these minibatches for training, we aim to learn a model $f: \mathbb{R}^d \to \{1, \dots, L\}$ that performs effectively on a class-balanced test set. + +# 3.2 Backbone SSL algorithm + +We attach the ABC to the backbone's representation layer, so that it can utilize the high-quality representations learned by the backbone. We use FixMatch [29] or ReMixMatch [3] as the backbone, as these two have achieved state-of-the-art SSL performance. FixMatch uses the classification loss calculated from the weakly augmented labeled data point $\alpha(x_b)$ generated by flipping and cropping the image, and the consistency regularization loss calculated from the weakly augmented unlabeled data point $\alpha(u_b)$ and strongly augmented unlabeled data point $\mathcal{A}(u_b)$ generated by Cutout [10] and RandomAugment [8]. ReMixMatch predicts the class label of the weakly augmented unlabeled data point $\alpha(u_b)$ using distribution alignment and sharpening, and assigns the predicted label to the strongly augmented unlabeled data point $\mathcal{A}(u_b)$ . These strongly augmented unlabeled data point $\mathcal{A}(u_b)$ and strongly augmented labeled data point $\mathcal{A}(x_b)$ are used to conduct mixup regularization. ReMixMatch also conducts consistency regularization in a manner similar to FixMatch and self-supervised learning using the rotation of the image [11, 39]. FixMatch and ReMixMatch have greatly improved the SSL performance by learning high-quality representations using strong data augmentation. However, these algorithms can be significantly biased toward the majority classes in class-imbalanced settings. + +Using FixMatch and ReMixMatch as the backbone of the proposed algorithm, we ensure that the ABC enjoys high-quality representations learned by the backbone, while replacing the backbone's biased classifier. To train the ABC, we reuse the weakly augmented data and strongly augmented data used by the backbone to decrease the computational cost. Although we use FixMatch and ReMixMatch as the backbone in this study, the ABC can also be combined with other DNN-based SSL algorithms, as long as they use weakly augmented data and strongly augmented data. + +# 3.3 ABC for class-imbalanced Semi-supervised learning + +To train the ABC to be balanced, we first generate $0/1$ mask $M(x_{b})$ for each labeled data point $x_{b}$ using a Bernoulli distribution $\mathcal{B}(\cdot)$ with the parameter set to be inversely proportional to the number of data points of each class. This setting makes $\mathcal{B}(\cdot)$ generate mask 1 with high probability for the data points in the minority classes, but with low probability for those in the majority classes. Then, the classification loss is multiplied by the generated mask, so that the ABC can be trained with a balanced classification loss. Multiplying the classification loss by the $0/1$ mask can be interpreted as oversampling of the data points in the minority classes, whereas it can be interpreted as undersampling of those in the majority classes. In representation learning, oversampling and undersampling techniques have shown overfitting and information loss problems, respectively. In contrast, the ABC can overcome these problems because it uses the representations learned by the backbone, which is trained on all data points in the minibatch. The use of the $0/1$ mask to construct the balanced loss, instead of directly creating a balanced subset, allows the backbone and the ABC to be trained from the same minibatches. Therefore, the representations of minibatches calculated for training the backbone can be used again for training the ABC. Consequently, the proposed algorithm only requires a slightly increased time cost compared to training the backbone alone. This is confirmed in Section 4.3. The overall procedure of balanced training with $0/1$ mask for the ABC attached to a representation layer of the backbone is presented in Figure 2. The classification loss for the ABC, $L_{cls}$ , with $0/1$ mask $M(\cdot)$ is expressed as + +$$ +L _ {c l s} = \frac {1}{B} \sum_ {b = 1} ^ {B} M \left(x _ {b}\right) \mathbf {H} \left(p _ {s} (y | \alpha \left(x _ {b}\right)), p _ {b}\right), \tag {1} +$$ + +$$ +M \left(x _ {b}\right) = \mathcal {B} \left(\frac {N _ {L}}{N _ {y _ {b}}}\right), \tag {2} +$$ + +where $\mathbf{H}$ is the standard cross-entropy loss, $\alpha(x_b)$ is an augmented labeled data point, $p_s(y|\alpha(x_b))$ is the predicted class distribution using the ABC for $\alpha(x_b)$ , and $p_b$ is the one-hot label for $x_b$ . + +![](images/0f17125dd8eef38bd5b8b9ebdab31e2bf821887de0ca7853ffd7dba2c403a934.jpg) +Figure 2: Overall procedure for balanced training of the ABC with a $0 / 1$ mask + +# 3.4 Consistency regularization for ABC + +To increase the margin between the decision boundary and the data points using unlabeled data, we conduct consistency regularization for the ABC, similar to the way in FixMatch. Specifically, we first obtain the predicted class distribution $p_{s}(y|\alpha (u_{b}))$ for a weakly augmented unlabeled data point $\alpha (u_{b})$ using the ABC and use it as a soft pseudo-label $q_{b}$ . Then, for two strongly augmented unlabeled data points $\mathcal{A}_1(u_b)$ and $\mathcal{A}_2(u_b)$ , we train the ABC to produce their predicted class distributions, $p_{s}(y|\mathcal{A}_{1}(u_{b}))$ and $p_{s}(y|\mathcal{A}_{2}(u_{b}))$ , to be close to $q_{b}$ . + +In class-imbalanced settings, because most unlabeled data points belong to majority classes, most weakly augmented unlabeled data points can be predicted as the majority classes. Then, consistency regularization would be conducted with a higher frequency for the majority classes, which can cause a classifier to be biased toward the majority classes. To prevent this issue, we conduct consistency regularization in a modified manner that is suitable for class-imbalance problems. Specifically, + +whereas FixMatch minimizes entropy by converting the predicted class distribution for a weakly augmented data point into a one-hot pseudo-label, we directly use the predicted class distribution as a soft pseudo-label. We do not pursue entropy minimization for the ABC because it can accelerate biased classification toward certain classes. Moreover, we once again generate $0/1$ mask $M(\cdot)$ for each unlabeled data point $u_b$ based on a soft pseudo label $q_b$ , and multiply the consistency regularization loss for $u_b$ by the generated mask, so that the ABC can be trained with a class-balanced consistency regularization loss. Note that existing resampling techniques are not applicable to unlabeled data, because they require a label for each data point. In contrast, we make it possible to resample unlabeled data by using the soft pseudo-label and the $0/1$ mask. The consistency regularization loss, $L_{con}$ , with $0/1$ mask $M(\cdot)$ is expressed as + +$$ +L _ {c o n} = \frac {1}{B} \sum_ {b = 1} ^ {B} \sum_ {k = 1} ^ {2} M (u _ {b}) \mathbf {I} (\max (q _ {b}) \geq \tau) \mathbf {H} \left(p _ {s} (y | \mathcal {A} _ {k} (u _ {b})) , q _ {b}\right), \tag {3} +$$ + +$$ +M \left(u _ {b}\right) = \mathcal {B} \left(\frac {N _ {L}}{N _ {\widehat {q} _ {b}}}\right), \tag {4} +$$ + +where $\mathbf{I}$ is the indicator function, $\max(q_b)$ is the highest predicted assignment probability for any class, representing the confidence of prediction, and $\tau$ is the confidence threshold. To avoid the unwanted effects of inaccurate soft pseudo-labels during consistency regularization, we only use the weakly augmented unlabeled data points whose confidence is higher than the threshold $\tau$ , similar to that in FixMatch. To take full advantage of few unlabeled data points with prediction confidence values that are higher than the confidence threshold $\tau$ in the early stage of training, we gradually decrease the parameter of the Bernoulli distribution $\mathcal{B}(\cdot)$ for $u_b$ from 1 to $N_L / N_{\widehat{q}_b}$ , where $\widehat{q}_b$ is the one-hot pseudo-label obtained from $q_b$ . Following previous studies [3, 24, 29, 4], we do not backpropagate gradients for pseudo-label prediction. The overall procedure for consistency regularization for the ABC is shown in Appendix A. + +# 3.5 End-to-end training + +Unlike a recent CIL trend to finetune a classifier in a balanced manner after representation learning is completed (i.e., decoupled learning of representations and a classifier) [17, 27], we obtain a balanced classifier by training the proposed algorithm end-to-end. We train the proposed algorithm with the sum of losses from Sections 3.3 and 3.4, and the loss for the backbone, $L_{\text{back}}$ . The total loss function $L_{\text{total}}$ is expressed as + +$$ +L _ {t o t a l} = L _ {c l s} + L _ {c o n} + L _ {b a c k}. \tag {5} +$$ + +Whereas we use the sum of the losses for the backbone and ABC for training the proposed algorithm, we predict the class labels of new data points using only the ABC. In our experiments in Sections 4.4 and 4.5, we show that the proposed algorithm trained end-to-end produces better performance than competing algorithms with decoupled learning of representations and a classifier, and we analyze possible reasons. We present the pseudo code of the proposed algorithm in Appendix B. + +# 4 Experiments + +# 4.1 Experimental setup + +We created class-imbalanced versions of CIFAR-10, CIFAR-100 [21], and SVHN [25] datasets to conduct experiments under various ratios of class imbalance $\gamma$ and various ratios of the amount of labeled data $\beta$ . For class-imbalance types, we first consider long-tailed (LT) imbalance in which the number of data points exponentially decreases from the largest to the smallest class, i.e., $N_{k} = N_{1} \times \gamma^{-\frac{k - 1}{L - 1}}$ , where $\gamma = \frac{N_{1}}{N_{L}}$ . We also consider step imbalance [5] in which the whole majority classes have the same amount of data and the whole minority classes also have the same amount of data. Two types of class imbalance for the considered datasets are illustrated in Appendix C. For the main setting, we set $\gamma = 100$ , $N_{1} = 1000$ , and $\beta = 20\%$ for CIFAR-10 and SVHN, and $\gamma = 20$ , $N_{1} = 200$ and $\beta = 40\%$ for CIFAR-100. Similar to [18], we set $\gamma$ of CIFAR-100 to be relatively small because CIFAR-100 has only 500 training data points for each class. To evaluate the + +performance of the proposed algorithm on large-scale datasets, we also conducted experiments on 7.5M data points of 256 by 256 images from the LSUN dataset [37]. + +We compared the performance of the proposed algorithm with that of various baseline algorithms. Specifically, we considered the following baseline algorithms: + +- Deep CNN (vanilla algorithm): This is trained on only labeled data with the cross-entropy loss. +- BALMS [27] (CIL algorithm): This state-of-the-art CIL algorithm does not use unlabeled data. +- VAT [24], ReMixMatch [3], and FixMatch [29] (SSL algorithms): These are state-of-the-art SSL algorithms, but do not consider class imbalance. +FixMatch+CReST+PDA and ReMixMatch+CReST+PDA (CISSL algorithms): CReST+PDA [34] mitigates class imbalance by using unlabeled data points classified as the minority classes with a higher probability than those classified as the majority classes. +- ReMixMatch+DARP and FixMatch+DARP (CISSL algorithms): These algorithms use DARP [18] to refine the pseudo labels obtained from ReMixMatch or FixMatch. +- ReMixMatch+DARP+cRT and FixMatch+DARP+cRT (CISSL algorithms): Compared to ReMix-Match+DARP and FixMatch+DARP, these algorithms finetune the classifier using cRT [17]. + +For the structure of the deep CNN used in the proposed and baseline algorithms, we used Wide ResNet-28-2 [38]. We trained the proposed algorithm for 250,000 iterations with a batch size of 64. The confidence threshold $\tau$ was set to 0.95 based on experiments with various values of $\tau$ in Appendix D. We used the Adam optimizer [20] with a learning rate of 0.002, and used Cutout [10] and RandomAugment [8] for strong data augmentation, following [18]. Similar to [3, 4], we evaluated the performance of the proposed algorithm using an exponential moving average of the parameters over iterations with a decay rate of 0.999, instead of scheduling the learning rate. In Tables 1-5, we used the overall accuracy and the accuracy only for minority classes as performance measures. We repeated the experiments five times under the main setting, and three times under the step imbalance and other settings of $\beta$ and $\gamma$ . We report the average and standard deviation of the performance measures over repeated experiments. For the vanilla algorithm, FixMatch+DARP+cRT, and ReMixMatch+DARP+cRT, which suffered from overfitting, we measured performance every 500 iterations and recorded the best performance. Further details of the experimental setup are described in Appendix E. + +# 4.2 Experimental results + +The performance of the competing algorithms under the main setting are summarized in Table 1. We can observe that the proposed algorithm achieved the highest overall performance, with improved performance for minority classes. Interestingly, VAT, an SSL algorithm, showed similar performance to the vanilla algorithm, and worse performance than BALMS, a CIL algorithm. Similarly, FixMatch and ReMixMatch, which do not consider class imbalance, showed poor performance for minority classes. Although BALMS mitigated class imbalance, it produced poor overall performance, as it did not use unlabeled data for training. This demonstrates the importance of using unlabeled data for training, even in the class-imbalanced setting. FixMatch+CReST+PDA and ReMixMatch+CReST+PDA mitigated class imbalance by using unlabeled data points classified as the minority classes with a higher probability, but produced lower performance than the proposed algorithm. This may be because even if all unlabeled data points classified as minority classes are additionally used for training, their amount is still less than that of the data in majority classes, while the proposed algorithm uses class-balanced minibatches by generating the $0/1$ mask. Fixmatch+DARP and ReMix-Match+DARP slightly mitigated class imbalance by refining biased pseudo-labels, but resulted in lower performance than the proposed algorithm. This may be because even perfect pseudo labels cannot change the underlying class-imbalanced distribution of the training data. By additionally using a rebalancing technique cRT, FixMatch(ReMixMatch)+DARP+cRT performed better than FixMatch(ReMixMatch)+DARP. However, FixMatch(ReMixMatch)+DARP+cRT still performed worse than FixMatch(ReMixMatch)+ABC, although it also uses high-quality representations learned by FixMatch(ReMixMatch) and techniques for mitigating class imbalance. The superior performance of FixMatch(ReMixMatch)+ABC over FixMatch(ReMixMatch)+DARP+cRT is probably because FixMatch(ReMixMatch)+ABC was trained end-to-end, and the ABC was also trained using unlabeled data. We discuss this in more detail in Sections 4.4 and 4.5. Overall, the algorithms combined with + +ReMixMatch performed better than the algorithms combined with FixMatch. In addition to the overall accuracy and minority-class-accuracy, we also compared the performance of the competing algorithms in terms of the geometric mean (G-mean) of class-wise accuracy under the main setting in Appendix F. + +Table 1: Overall accuracy/minority-class-accuracy under the main setting + +
CIFAR-10-LTSVHN-LTCIFAR-100-LT
Algorithmγ = 100, β = 20%γ = 100, β = 20%γ = 20, β = 40%
Vanilla55.3±1.30 / 33.9±1.8877.0±0.67 / 63.3±1.2540.1±1.15 / 25.2±0.95
VAT [24]55.3±0.88 / 28.2±1.5581.3±0.47 / 68.2±0.8840.4±0.34 / 24.8±0.38
BALMS [27]70.7±0.59 / 69.8±1.0387.6±0.53 / 85.0±0.6750.2±0.54 / 42.9±1.03
FixMatch [29]72.3±0.33 / 53.8±0.6388.0±0.30 / 79.4±0.5451.0±0.20 / 32.8±0.41
w/ CReST+PDA [34]76.6±0.46 / 61.4±0.8589.1±0.69 / 81.7±1.1851.6±0.29 / 36.4±0.46
w/ DARP [18]73.7±0.98 / 57.0±2.1288.6±0.19 / 80.5±0.5451.4±0.37 / 33.9±0.77
w/ DARP+cRT [18]78.1±0.89 / 66.6±1.5589.9±0.44 / 83.5±0.6154.7±0.46 / 41.2±0.42
w/ ABC81.1±0.82 / 72.0±1.7792.0±0.38 / 87.9±0.7356.3±0.19 / 43.4±0.42
ReMixMatch [3]73.7±0.39 / 55.9±0.8789.8±0.42 / 82.8±0.6854.0±0.29 / 37.1±0.37
w/ CReST+PDA [34]75.7±0.34 / 59.6±0.7690.9±0.20 / 85.2±0.3954.6±0.48 / 38.1±0.69
w/ DARP [18]74.4±0.41 / 56.9±0.6790.2±0.22 / 83.5±0.4054.5±0.33 / 37.7±0.58
w/ DARP+cRT [18]78.5±0.61 / 66.4±1.6892.1±0.48 / 87.6±0.7555.1±0.45 / 43.6±0.58
w/ ABC82.4±0.45 / 75.7±1.1893.9±0.16 / 92.5±0.457.6±0.26 / 46.7±0.50
+ +To evaluate the performance of the proposed algorithm in various settings, we conducted experiments using ReMixMatch, FixMatch, and the CISSL algorithms considered in Table 1, while changing the ratio of class imbalance $\gamma$ and the ratio of the amount of labeled data $\beta$ . The results for CIFAR-10 are presented in Table 2, and the results for SVHN and CIFAR-100 are presented in Appendix G. In Table 2, we can observe that the proposed algorithm achieved the highest overall accuracy with greatly improved performance for minority classes for all settings. Because FixMatch+DARP+cRT and ReMixMatch+DARP+cRT do not use unlabeled data for classifier tuning, the difference in performance between FixMatch(ReMixMatch)+DARP+cRT and the proposed algorithm increased as the ratio of the amount of labeled data $\beta$ decreased and as the ratio of class imbalance $\gamma$ increased. In addition, the difference in performance between FixMatch(ReMixMatch)+CReST+PDA and the proposed algorithm tended to increase as the ratio of class imbalance $\gamma$ increased, because the difference between the number of labeled data points belonging to the majority classes and the number of unlabeled data points classified as the minority classes increases with $\gamma$ . + +Table 2: Overall accuracy/minority-class accuracy for CIFAR-10 under various settings + +
CIFAR-10-LT
Algorithmγ = 100, β = 10%γ = 100, β = 30%γ = 50, β = 20%γ = 150, β = 20%
FixMatch [29]70.0±0.59/48.9±1.0474.9±0.63/58.2±1.2881.2±0.07/70.7±0.3668.5±0.60/45.8±1.15
w/ CReST+PDA [34]73.9±0.40/58.9±1.1477.6±0.73/64.0±1.3983.3±0.10/75.7±0.3970.0±0.82/49.4±1.52
w/ DARP+cRT [18]74.6±0.98/59.2±2.1279.0±0.25/67.7±0.9583.6±0.42/77.1±1.1973.2±0.85/57.1±1.13
w/ ABC77.2±1.60/65.7±2.8581.5±0.29/72.9±0.9685.2±0.51/80.2±0.6477.1±0.46/64.4±0.92
ReMixMatch [3]71.5±0.51/52.2±1.0875.8±0.10/59.4±0.1781.5±0.17/70.7±0.3269.9±0.23/48.4±0.60
w/ CReST+PDA [34]73.8±0.32/56.6±0.4378.6±0.73/64.8±1.4983.9±0.26/75.4±0.5271.3±0.77/50.8±1.59
w/ DARP+cRT [18]75.9±1.20/62.1±3.1081.0±0.16/70.7±0.7284.5±0.80/77.8±1.6773.9±0.59/57.4±1.45
w/ ABC79.8±0.36/70.8±0.9284.3±1.03/80.6±0.9787.5±0.31/84.6±1.1980.6±0.66/72.1±1.51
+ +We also conducted experiments under a step-imbalance setting, where the class imbalance was more noticeable. This setting assumes a more severely imbalanced class distribution than the LT imbalance settings, because half of the classes have very scarce data. The experimental results for CIFAR-10 are presented in Table 3, and the results for SVHN and CIFAR-100 are presented in Appendix H. In Table 3, we can see that the proposed algorithm achieved the best performance, and the performance margin is greater than that of the LT imbalance settings. ReMixMatch+CReST+PDA showed relatively low performance compared to the other algorithms. + +Table 3: Overall accuracy/minority-class accuracy on CIFAR-10 under a step imbalance setting + +
CIFAR-10-Step, γ = 100, β = 20%
Algorithmw/ -w/ CReST+PDA [34]w/ DARP+cRT [18]w/ ABC
FixMatch [29]54.0±0.84/ 11.8±1.7171.1±0.78/ 48.2±2.2669.8±1.51/ 45.1±2.7075.9±0.49/ 57.0±1.07
ReMixMatch [3]60.8±0.10/ 25.1±1.2864.6±0.97/ 33.5±2.0572.3±1.77/ 50.6±3.5376.4±1.70/ 65.7±1.30
+ +To evaluate the performance of the proposed algorithm on a large-scale dataset, we also conducted experiments on the LSUN dataset [37], which is naturally a long-tailed dataset. Among the algorithms considered in Tables 2 and 3, those combined with CReST were excluded for comparison, because CReST requires loading of the whole unlabeled data in the repeated process of updating pseudolabels, which is not possible for the large-scale LSUN dataset. Instead, we additionally considered FixMatch+cRT and ReMixMatch+cRT for comparison. The experimental results are presented in Table 4. The proposed algorithm showed better performance than the other baseline algorithms. DARP resulted in degradation of the performance, possibly because the scale of the LSUN dataset is very large. Specifically, DARP solves a convex optimization with all unlabeled data points to refine the pseudo labels. As the scale of the unlabeled dataset increases, this optimization problem becomes more difficult to solve and, consequently, the pseudo-labels could be refined inaccurately. Unlike the results for other datasets, the algorithms combined with FixMatch performed better than the algorithms combined with ReMixMatch. + +Table 4: Overall accuracy/minority-class accuracy for the large-scale LSUN dataset + +
LSUN, γ = 100, β = 20%
Algorithmw/ -w/ cRT [17]w/ DARP [18]w/ DARP+cRT [18]w/ ABC
FixMatch [29]73.1 / 55.377.0 / 71.571.0 / 51.875.8 / 69.578.9 / 75.5
ReMixMatch [3]69.4 / 49.175.4 / 69.565.6 / 44.172.1 / 67.576.9 / 69.5
+ +# 4.3 Complexity of the proposed algorithm + +The proposed algorithm requires additional parameters for the ABC, but the number of the additional parameters is negligible compared to the number of parameters of the backbone. For example, the ABC additionally required only $0.09\%$ and $0.87\%$ of the number of backbone parameters for CIFAR-10 with 10 classes and CIFAR-100 with 100 classes, respectively. Moreover, because the ABC shares the representation layer of the backbone, it does not significantly increase the memory usage and training time. Furthermore, we could train the proposed algorithm on the large-scale LSUN dataset without a significant increase in computation cost, because the entire training procedure could be carried out using minibatches of data. In contrast, the algorithms combined with DARP required convex optimization for all pseudo-labels, which significantly increased the computation cost as the number of classes or the amount of data increased. Similarly, it required significant time to train the algorithms combined with CReST, because CReST requires iterative re-training with a labeled set expanded by adding unlabeled data points with pseudo-labels. We present the floating point operations per second (FLOPS) for each algorithm using Nvidia Tesla-V100 in Appendix I. + +# 4.4 Qualitative analysis of high-quality representations and balanced classification + +The ABC can use high-quality representations learned by the backbone when performing balanced classification. To verify this, in Figure 3, we present t-distributed stochastic neighbor embedding (t-SNE) [31] of the representations of the CIFAR-10 test set learned by the ABC (without SSL backbone), FixMatch+ABC, and ReMixMatch+ABC on CIFAR-10-LT under the main setting. Different colors indicate different classes. As expected, "ABC (without SSL backbone)" failed to learn class-separable representations because sufficient data were not used for training while using the $0/1$ mask. In contrast, by training the backbone (FixMatch or ReMixMatch) together with the ABC, the proposed algorithm could use the entire data and learn high-quality representations. In this example, ReMixMatch produced more separable representations than FixMatch, which shows that the choice of the backbone affects the performance of the proposed algorithm, as expected. + +![](images/f3a6cc8854c2052b75adff1e9d6feb3088835f8f49df7014e90833da19579bd1.jpg) +Figure 3: t-SNE of the proposed algorithm and the ABC (without SSL backbone) + +![](images/3689a826b219b2eab6db43126bc245568c32dd53159950ecebf93d0d5bf41937.jpg) + +![](images/d4c8bc8dfdc60427470e9acfd2e2939325fefe1c286df033d04bda62ff2a29f3.jpg) + +The proposed algorithm can also mitigate class imbalance by using the ABC. To verify this, we compare the confusion matrices of the predictions on the test set of CIFAR-10 using ReMixMatch, ReMixMatch+DARP+cRT, and ReMiMatch+ABC trained on CIFAR-10 under the main setting in Figure 4. In the confusion matrices, the value in the $i$ th row and the $j$ th column represents the ratio of the amount of data belonging to the $i$ th class to the amount of data predicted as the $j$ th class. Each cell has a darker red color when the ratio is larger. We can see that ReMixMatch often misclassified data points in the minority classes (e.g., classes 8 and 9 into classes 0 and 1). This may be because ReMixMatch does not consider class imbalance, and thus biased pseudo-labels were used for training. ReMixMatch+DARP+cRT produced a more balanced class-distribution compared to ReMixMatch by additionally using DARP+cRT. However, a significant number of data points in the minority classes were still misclassified as majority classes. In contrast, ReMixMatch+ABC classified the test data points in the minority classes with higher accuracy, and produced a significantly more balanced class distribution than ReMixMatch+DARP+cRT, as shown in Figure 4 (c). As both ReMixMatch+DARP+cRT and ReMixMatch+ABC use ReMixMatch to learn representations, the performance gap between these two algorithms results from the different characteristics of the ABC versus DARP+cRT as follows. First, DARP+cRT does not use unlabeled data for training its classifier after representations learning is completed, whereas the ABC uses unlabeled data with unbiased pseudo-labels for its training. Second, whereas DARP+cRT decouples the learning of representations and training of a classifier, the ABC is trained end-to-end interactively with representations learned by the backbone. We also present the confusion matrices of the predictions on the test set of CIFAR-10 using FixMatch, FixMatch+DARP+cRT, and FixMatch+ABC as well as the confusion matrices of the pseudo-labels on the same dataset using ReMixMatch, ReMixMatch+DARP+cRT, ReMix-Match+ABC, FixMatch, FixMatch+DARP+cRT, and FixMatch+ABC in Appendix J. Moreover, we compare the ABC and the classifier of DARP+cRT in more detail using the validation loss plots in Appendix K. + +![](images/beaa7e909d9a519af7287029d772bc82081bb5f86f6b5d88fb9e733770a35094.jpg) +(a)ReMixMatch + +![](images/54bb9519d9aea7b47ba96e830156bffc61f3d3e6ef1d5986929503c189956584.jpg) +(b)ReMixMatch+DARP+cRT + +![](images/78526a4995c433c0a5d1adf93222720bdac59774d037934a6f0d299fd47a5bdc.jpg) +(c) ReMixMatch+ABC +Figure 4: Confusion matrices of the predictions on the test set of CIFAR-10 + +![](images/1d8b92e223d76a4e6e528aa662a2228c4ecff34ca66b7f21d5d4ec6030b58e80.jpg) + +# 4.5 Ablation study + +We conducted an ablation study on CIFAR-10-LT in the main setting to investigate the effect of each element of the proposed algorithm. The results for ReMixMatch+ABC are presented in Table 5, where each row indicates the proposed algorithm with the described conditions in that row. The results are summarized as follows. 1) If we did not gradually decrease the parameter of the Bernoulli distribution $\mathcal{B}(\cdot)$ when conducting consistency regularization, then an overbalance problem occurred + +because of unlabeled data misclassified as minority classes. 2) Without consistency regularization for the ABC, the decision boundary did not clearly separate each class. 3) Without using the $0/1$ mask for $L_{cls}$ and $L_{con}$ , the ABC was trained to be biased toward the majority classes. 4) Without confidence threshold $\tau$ for consistency regularization, training became unstable and, consequently, the ABC was trained to be biased toward certain classes. 5) Similarly, if hard pseudo-labels, instead of soft pseudo-labels, were used for consistency regularization, then the ABC was biased toward certain classes. 6) If the ABC was solely used without the backbone, the performance decreased because the ABC could not use high-quality representations learned by the backbone. 7) When we used a re-weighting technique [13] instead of a mask for the ABC, training became unstable because of abnormally large gradients calculated for training on the data of the minority classes. 8) The decoupled training of the backbone and ABC resulted in decreased classification performance, as was also analyzed in Section 4.4. Similarly, we present the results of the ablation study for FixMatch+ABC in Appendix L. + +Table 5: Ablation study for ReMixMatch+ABC on CIFAR-10-LT, $\gamma = {100},\beta = {20}\%$ + +
Ablation studyOverallMinority
ReMixMatch+ABC (proposed algorithm)82.475.7
Without gradually decreasing the parameter of B (·) for consistency regularization81.874.6
Without consistency regularization for the ABC79.466.9
Without using the 0/1 mask for the consistency regularization loss Lcon79.069.2
Without using the 0/1 mask for the classification loss Lcls74.457.8
Without using the confidence threshold τ for consistency regularization74.375.4
Using hard pseudo labels for consistency regularization70.275.1
Without training backbone (ABC without SSL backbone)68.756.2
Training the ABC with a re-weighting technique81.274.1
Decoupled training of the backbone and ABC79.572.3
+ +# 5 Conclusion + +We introduced the ABC, which is attached to a state-of-the-art SSL algorithm, for CISSL. The ABC can utilize high-quality representations learned by the backbone, while being trained to make class-balanced predictions. The ABC also utilizes unlabeled data by conducting consistency regularization in a modified way for class-imbalance problems. The experimental results obtained under various settings demonstrate that the proposed algorithm outperforms the baseline algorithms. We also conducted a qualitative analysis and an ablation study to verify the contribution of each element of the proposed algorithm. The proposed algorithm assumes that the labeled and unlabeled data are class-imbalanced to the same extent. In the future, we plan to release this assumption by adopting a module for estimating class distribution. Deep learning algorithms can be applied to many societal problems. However, if the training data are imbalanced, the algorithms could be trained to make socially biased decisions in favor of the majority groups. The proposed algorithm can contribute to solving these issues. However, there is also a potential risk that the proposed algorithm could be used as a tool to identify minorities and discriminate against them. It should be ensured that the proposed method cannot be used for any purpose that may have negative social impacts. + +# Acknowledgments + +This work was supported by the National Research Foundation of Korea (NRF) grant funded by the Korea government (MSIT) (2018R1C1B6004511, 2020R1A4A10187747). + +# References + +[1] An, J., Ying, L., and Zhu, Y. (2021). Why resampling outperforms reweighting for correcting sampling bias with stochastic gradients. In International Conference on Learning Representations. +[2] Barandela, R., Rangel, E., Sánchez, J. S., and Ferri, F. J. (2003). Restricted decontamination for the imbalanced training sample problem. In Iberoamerican congress on pattern recognition, pages 424-431. Springer. + +[3] Berthelot, D., Carlini, N., Cubuk, E. D., Kurakin, A., Sohn, K., Zhang, H., and Raffel, C. (2019a). Remixmatch: Semi-supervised learning with distribution matching and augmentation anchoring. In International Conference on Learning Representations. +[4] Berthelot, D., Carlini, N., Goodfellow, I., Papernot, N., Oliver, A., and Raffel, C. A. (2019b). Mixmatch: A holistic approach to semi-supervised learning. In Wallach, H., Larochelle, H., Beygelzimer, A., d'Alché-Buc, F., Fox, E., and Garnett, R., editors, Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc. +[5] Buda, M., Maki, A., and Mazurowski, M. A. (2018). A systematic study of the class imbalance problem in convolutional neural networks. Neural Networks, 106:249-259. +[6] Cao, K., Wei, C., Gaidon, A., Arechiga, N., and Ma, T. (2019). Learning imbalanced datasets with label-distribution-aware margin loss. In Wallach, H., Larochelle, H., Beygelzimer, A., d'Alché-Buc, F., Fox, E., and Garnett, R., editors, Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc. +[7] Chawla, N. V., Bowyer, K. W., Hall, L. O., and Kegelmeyer, W. P. (2002). Smote: synthetic minority over-sampling technique. Journal of artificial intelligence research, 16:321-357. +[8] Cubuk, E. D., Zoph, B., Shlens, J., and Le, Q. V. (2020). Randaugment: Practical automated data augmentation with a reduced search space. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, pages 702-703. +[9] Cui, Y., Jia, M., Lin, T.-Y., Song, Y., and Belongie, S. (2019). Class-balanced loss based on effective number of samples. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9268-9277. +[10] DeVries, T. and Taylor, G. W. (2017). Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552. +[11] Gidaris, S., Singh, P., and Komodakis, N. (2018). Unsupervised representation learning by predicting image rotations. In International Conference on Learning Representations. +[12] Grandvalet, Y. and Bengio, Y. (2005). Semi-supervised learning by entropy minimization. In Saul, L., Weiss, Y., and Bottou, L., editors, Advances in Neural Information Processing Systems, volume 17. MIT Press. +[13] He, H. and Garcia, E. A. (2009). Learning from imbalanced data. IEEE Transactions on knowledge and data engineering, 21(9):1263-1284. +[14] Huang, C., Li, Y., Loy, C. C., and Tang, X. (2016). Learning deep representation for imbalanced classification. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 5375-5384. +[15] Jamal, M. A., Brown, M., Yang, M.-H., Wang, L., and Gong, B. (2020). Rethinking class-balanced methods for long-tailed visual recognition from a domain adaptation perspective. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7610-7619. +[16] JAPKOWICZ, N. (2000). The class imbalance problem: Significance and strategies. In Proc. 2000 International Conference on Artificial Intelligence, volume 1, pages 111-117. +[17] Kang, B., Xie, S., Rohrbach, M., Yan, Z., Gordo, A., Feng, J., and Kalantidis, Y. (2020). Decoupling representation and classifier for long-tailed recognition. In International Conference on Learning Representations. +[18] Kim, J., Hur, Y., Park, S., Yang, E., Hwang, S. J., and Shin, J. (2020a). Distribution aligning refinery of pseudo-label for imbalanced semi-supervised learning. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M. F., and Lin, H., editors, Advances in Neural Information Processing Systems, volume 33, pages 14567-14579. Curran Associates, Inc. +[19] Kim, J., Jeong, J., and Shin, J. (2020b). M2m: Imbalanced classification via major-to-minor translation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 13896-13905. + +[20] Kingma, D. P. and Ba, J. (2015). Adam: A method for stochastic optimization. In ICLR, 2015. +[21] Krizhevsky, A. (2009). Learning multiple layers of features from tiny images. Technical report, Department of Computer Science, University of Toronto. +[22] Lee, D.-H. et al. (2013). Pseudo-label: The simple and efficient semi-supervised learning method for deep neural networks. In Workshop on challenges in representation learning, ICML, volume 3. +[23] Mikolov, T., Sutskever, I., Chen, K., Corrado, G. S., and Dean, J. (2013). Distributed representations of words and phrases and their compositionality. In Burges, C. J. C., Bottou, L., Welling, M., Ghahramani, Z., and Weinberger, K. Q., editors, Advances in Neural Information Processing Systems, volume 26. Curran Associates, Inc. +[24] Miyato, T., Maeda, S.-i., Koyama, M., and Ishii, S. (2018). Virtual adversarial training: a regularization method for supervised and semi-supervised learning. IEEE transactions on pattern analysis and machine intelligence, 41(8):1979-1993. +[25] Netzer, Y., Wang, T., Coates, A., Bissacco, A., Wu, B., and Ng, A. Y. (2011). Reading digits in natural images with unsupervised feature learning. In NIPS Workshop, 2011. +[26] Park, S., Park, J., Shin, S.-J., and Moon, I.-C. (2018). Adversarial dropout for supervised and semi-supervised learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32. +[27] Ren, J., Yu, C., sheng, s., Ma, X., Zhao, H., Yi, S., and Li, h. (2020). Balanced meta-softmax for long-tailed visual recognition. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M. F., and Lin, H., editors, Advances in Neural Information Processing Systems, volume 33, pages 4175–4186. Curran Associates, Inc. +[28] Ren, M., Zeng, W., Yang, B., and Urtasun, R. (2018). Learning to reweight examples for robust deep learning. In International Conference on Machine Learning, pages 4334-4343. PMLR. +[29] Sohn, K., Berthelot, D., Carlini, N., Zhang, Z., Zhang, H., Raffel, C. A., Cubuk, E. D., Kurakin, A., and Li, C.-L. (2020). Fixmatch: Simplifying semi-supervised learning with consistency and confidence. Advances in Neural Information Processing Systems, 33. +[30] Tarvainen, A. and Valpola, H. (2017). Mean teachers are better role models: Weight-averaged consistency targets improve semi-supervised deep learning results. In Guyon, I., Luxburg, U. V., Bengio, S., Wallach, H., Fergus, R., Vishwanathan, S., and Garnett, R., editors, Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc. +[31] Van der Maaten, L. and Hinton, G. (2008). Visualizing data using t-sne. Journal of machine learning research, 9(11). +[32] Verma, V., Lamb, A., Kannala, J., Bengio, Y., and Lopez-Paz, D. (2019). Interpolation consistency training for semi-supervised learning. In Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence, IJCAI-19, pages 3635-3641. International Joint Conferences on Artificial Intelligence Organization. +[33] Wang, Y.-X., Ramanan, D., and Hebert, M. (2017). Learning to model the tail. In Guyon, I., Luxburg, U. V., Bengio, S., Wallach, H., Fergus, R., Vishwanathan, S., and Garnett, R., editors, Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc. +[34] Wei, C., Sohn, K., Mellina, C., Yuille, A., and Yang, F. (2021). Crest: A class-rebalancing self-training framework for imbalanced semi-supervised learning. arXiv preprint arXiv:2102.09559. +[35] Yang, Y. and Xu, Z. (2020). Rethinking the value of labels for improving class-imbalanced learning. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M. F., and Lin, H., editors, Advances in Neural Information Processing Systems, volume 33, pages 19290-19301. Curran Associates, Inc. +[36] Yin, X., Yu, X., Sohn, K., Liu, X., and Chandraker, M. (2018). Feature transfer learning for deep face recognition with under-represented data. arXiv e-prints, pages arXiv-1803. + +[37] Yu, F., Zhang, Y., Song, S., Seff, A., and Xiao, J. (2015). Lsun: Construction of a large-scale image dataset using deep learning with humans in the loop. arXiv preprint arXiv:1506.03365. +[38] Zagoruyko, S. and Komodakis, N. (2016). Wide residual networks. arXiv preprint arXiv:1605.07146. +[39] Zhai, X., Oliver, A., Kolesnikov, A., and Beyer, L. (2019). S4l: Self-supervised semi-supervised learning. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 1476-1485. + +# Checklist + +1. For all authors... + +(a) Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope? [Yes] +(b) Did you describe the limitations of your work? [Yes] See Section 5. +(c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 5. +(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] + +2. If you are including theoretical results... + +(a) Did you state the full set of assumptions of all theoretical results? [N/A] +(b) Did you include complete proofs of all theoretical results? [N/A] + +3. If you ran experiments... + +(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] We included the code and instruction in the supplemental material. We will also upload the code at github with the copyright after the review process. +(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 4.1 and Appendix E. +(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] See Section 4.2. +(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] We summarize the resources and FLOPS in Section 4.2 and Appendix I. + +4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... + +(a) If your work uses existing assets, did you cite the creators? [Yes] We cited the creators of CIFAR-10, SVHN, CIFAR-100, LSUN in Section 4.1. +(b) Did you mention the license of the assets? [N/A] In their homepage, the creators of the datasets request to cite their work rather than mentioning the license. +(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] We included the code for training the proposed algorithm as the supplemental material. We will also upload it at github with the copyright after review process. +(d) Did you discuss whether and how consent was obtained from people whose data you're using/curating? [N/A] We used the benchmark datasets cited in Section 4.1 +(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] We used the benchmark datasets cited in Section 4.1 + +5. If you used crowdsourcing or conducted research with human subjects... + +(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] +(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] +(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] \ No newline at end of file diff --git a/abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/images.zip b/abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..af9f9ad2891c55d3b6c87a559a98a3486e5cb9e3 --- /dev/null +++ b/abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e2a2fe6b57a797fa85ddd07a0349f5b8635bc66f5c5985af2fdc7eeb2a93de2d +size 487164 diff --git a/abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/layout.json b/abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ff691179af62d747f78d06425216134e7ef2464b --- /dev/null +++ b/abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:52aca0b56ec6bcafc8a62f509c5b7de14dd6391323817243a6352b1bb19155b4 +size 391487 diff --git a/abntestingwithcontrolinthepresenceofsubpopulations/08e77774-2ec8-4983-a7db-f355e70f40c9_content_list.json b/abntestingwithcontrolinthepresenceofsubpopulations/08e77774-2ec8-4983-a7db-f355e70f40c9_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..570f712a9f8a86d1d0429e914ab0227715e667ba --- /dev/null +++ b/abntestingwithcontrolinthepresenceofsubpopulations/08e77774-2ec8-4983-a7db-f355e70f40c9_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9dc813e69f3f773d3b8170b2c237f7e4b87ff86f0c9f52587b1883e7d24a7df0 +size 73964 diff --git a/abntestingwithcontrolinthepresenceofsubpopulations/08e77774-2ec8-4983-a7db-f355e70f40c9_model.json b/abntestingwithcontrolinthepresenceofsubpopulations/08e77774-2ec8-4983-a7db-f355e70f40c9_model.json new file mode 100644 index 0000000000000000000000000000000000000000..3306ebf91690658fd2a01aa674d489b418d27b24 --- /dev/null +++ b/abntestingwithcontrolinthepresenceofsubpopulations/08e77774-2ec8-4983-a7db-f355e70f40c9_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:313f1897ef417600ef38e6e7bbc37a4847d06c974224797c23645e9ce99ed93d +size 85486 diff --git a/abntestingwithcontrolinthepresenceofsubpopulations/08e77774-2ec8-4983-a7db-f355e70f40c9_origin.pdf b/abntestingwithcontrolinthepresenceofsubpopulations/08e77774-2ec8-4983-a7db-f355e70f40c9_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..372fd8dbe1ef3f7b1960566186645c0d4940f64b --- /dev/null +++ b/abntestingwithcontrolinthepresenceofsubpopulations/08e77774-2ec8-4983-a7db-f355e70f40c9_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2117f5243cc638a1430ec2d1f5b00f30090db2180e623f5ebd37c37e6975b714 +size 424815 diff --git a/abntestingwithcontrolinthepresenceofsubpopulations/full.md b/abntestingwithcontrolinthepresenceofsubpopulations/full.md new file mode 100644 index 0000000000000000000000000000000000000000..f1127f467dd5fd71b797ca65af8998b001b02cb0 --- /dev/null +++ b/abntestingwithcontrolinthepresenceofsubpopulations/full.md @@ -0,0 +1,296 @@ +# A/B/n Testing with Control in the Presence of Subpopulations + +Yoan Russac + +CNRS, Inria, ENS + +Université PSL + +yoan.russac@ens.fr + +Christina Katsimerou + +Booking.com + +christina.katsimerou@booking.com + +Dennis Bohle + +Booking.com + +dennis.bohle@booking.com + +Olivier Cappé + +CNRS, Inria, ENS + +Université PSL + +olivier.cappe@cnrs.fr + +Aurelien Garivier + +UMPA, CNRS + +Inria, ENS Lyon + +aurelien.garivier@ens-lyon.fr + +Wouter M. Koolen + +Centrum Wiskunde & Informatica + +wmkoolen@cwi.nl + +# Abstract + +Motivated by A/B/n testing applications, we consider a finite set of distributions (called arms), one of which is treated as a control. We assume that the population is stratified into homogeneous subpopulations. At every time step, a subpopulation is sampled and an arm is chosen: the resulting observation is an independent draw from the arm conditioned on the subpopulation. The quality of each arm is assessed through a weighted combination of its subpopulation means. We propose a strategy for sequentially choosing one arm per time step so as to discover as fast as possible which arms, if any, have higher weighted expectation than the control. This strategy is shown to be asymptotically optimal in the following sense: if $\tau_{\delta}$ is the first time when the strategy ensures that it is able to output the correct answer with probability at least $1 - \delta$ , then $\mathbb{E}[\tau_{\delta}]$ grows linearly with $\log(1/\delta)$ at the exact optimal rate. This rate is identified in the paper in three different settings: (1) when the experimenter does not observe the subpopulation information, (2) when the subpopulation of each sample is observed but not chosen, and (3) when the experimenter can select the subpopulation from which each response is sampled. We illustrate the efficiency of the proposed strategy with numerical simulations on synthetic and real data collected from an A/B/n experiment. + +# 1 Introduction + +A/B/n testing is a website optimization procedure where multiple versions of the content (called "arms" below) are compared, often in order to find the one with the highest conversion rate. However, many e-commerce companies use A/B/n testing not only to deploy the best product implementation, but primarily to draw post-experiment inferences [11]. The decision-making involves, besides experiment results, factors such as the cost of scaling-up a solution, external data, or whether the implementation fits in a broader theme. In this setting, each of the arms better than the default product (which we will refer to as the "control" arm) is a contender for being deployed and the interest is not only in the best arm. + +Given the control and $K \geq 1$ alternative implementations (variants), the simplest idea is to distribute the traffic uniformly among the arms; the arms that appear to be significantly better than the control at the end of the experiment are considered for deployment. While well-established, this process can be inefficient in terms of resources. Some alternatives are soon obviously worse (or better) than the control and would require fewer samples than the alternatives closer to the control. A second related shortcoming of the basic A/B/n testing approach is that setting the duration of the experiment –when done in advance– necessitates a very conservative approach by choosing a run-length that is sufficiently long to differentiate even the smallest possible changes. + +To address these limitations, we consider in this work sequential testing policies that can both adjust the allocation of the samples and be stopped adaptively, in light of the data gathered during the experiment. In the terminology of multi-armed bandits, this corresponds to pure exploration problems (see, e.g., Chap. 33 of [15]). A pure exploration strategy will typically choose every minute (say), an allocation of traffic that favors arms for which the uncertainty is the highest. The experiment is stopped as soon as the significance is considered sufficient for every arm. Approaches have been developed in [8, 12, 10] for the identification of the single arm with the highest mean, a task called the Best Arm Identification (BAI) problem. In particular, [10] propose a strategy that is asymptotically optimal in the fixed confidence setting, meaning that, given a risk parameter $\delta$ , it finds the best arm with probability at least $1 - \delta$ , using an expected number of samples that is hardly improvable when $\delta$ is small. Later, [18] incorporated the special role of the control arm in BAI and proposed an algorithm that declares as winning arm the one with the highest mean only if it is significantly better than the control. In this paper, we propose a solution to the problem of identifying all the arms that are better than the control, in a framework that generalizes the fixed confidence setting. In order to provide useful tools for practical A/B/n testing, we address two additional issues. + +First, traditional stochastic bandit models are based on the assumption that the arm samples are i.i.d., whereas real world data streams usually show trends or some form of inhomogeneity. A particular case of interest for website optimization are the seasonal patterns caused by time-of-day or day-of-week variations. We henceforth include in our model observed covariates (e.g. the time of the day, but possibly also the country of origin, or controlled covariates like the order in which partners appear on the page, etc.) that stratify the observations into homogeneous subpopulations. We study different scenarios, depending on how much interaction is possible with these subpopulations. We provide a sample complexity analysis and an efficient algorithm in each case. In particular, we will show that using the subpopulation information efficiently can provide significant speedups of the decision-making. In the following, we will refer to the task of identifying the set of Arms that are Better than the Control in the presence of Subpopulations as the ABC-S problem. + +Second, the practice of A/B/n testing often differs from a pure sequential experiment in that the experimenter cannot always fix a risk $\delta$ at the beginning and passively wait for the stopping time of the experiment without any time limitation. To address this issue, [11] proposed to define some notion of sequential "p-values" that can be monitored as the experiment progresses and used to terminate it. This notion was further used in the BAI setting in [18]. In this contribution, we elaborate on this idea by sequentially updating a suggested solution to the ABC-S problem together with a risk assessment for this suggestion. We show that, for any stopping time, the probability that the suggested solution is incorrect is indeed lower than the risk assessment. When the stopping time is selected as in usual fixed-confidence pure exploration, we recover the exact same guarantees but this view of the problem also provides useful results, for instance, if the experiment needs to be terminated prematurely. + +Related work. Pure exploration strategies have been studied in various settings: the identification of the best arm [8, 10], the identification of the top $m$ arms [3, 12, 9] identifying the arms that are better than a threshold [16, 4], or identifying all $\epsilon$ -good arms [17]. As far as we know, this paper is the first to consider the problem of identifying all the arms better than a control. It is also the first to consider subpopulations in pure exploration tasks. While motivated by the example of online companies, we believe that the proposed algorithms are relevant to other domains where randomized controlled trials are used for learning. An example could be clinical trials: one may wish to identify all the alternative treatments that work better that some reference medical treatment. This would permit to choose among them taking into account different characteristics (some could be cheaper, using another molecule for avoiding allergy, etc.). + +Close to the notion of the control is the notion of threshold. Locatelli et al. [16] propose an algorithm for identifying all arms above a given threshold. Their algorithm samples according to the significance + +of a statistical test, and shares some similarities with the present article in the Gaussian case; however, the perspective is rather different: the authors consider the fixed-budget setting: the total number of samples is fixed, and the goal is then to minimize the probability of returning a wrong answer at the end. Here, the index of the control arm is known but its probability distribution is not. + +In our work, the quality of the different arms is assessed with a weighted combination of its subpopulations means. Minimizing the estimation error of a convex combination of means through adaptive sampling was considered in [2] with the introduction of a stratified estimator that will naturally appear in our analysis. + +The paper is organized as follows. In Section 2, we present the mathematical model and study the information-theoretic complexity of the problem, extending the lower bound of [10] to the ABC-S setting. We show how the complexity of the problem depends on the degree of interaction that one has with the subpopulations, introducing different modes of interaction to be defined in Figure 1 below. We also consider in detail the Gaussian case which gives rise to more interpretable results. Section 3 describes how to implement the proposed strategy, which involves the numerical resolution of non-trivial optimization problems. Finally, we provide the results of numerical experiments on synthetic and real data sets in Section 4. + +# 2 The complexity of the ABC-S problem + +# 2.1 Mathematical framework + +A problem instance consists of the following ingredients. Known to the learner are the number of arms $K \geq 1$ in addition to the designated control arm 0, the number of subpopulations $J$ (a standard bandit being $J = 1$ ), and the vector $\beta \in \mathbb{R}^J$ representing the relative importance of the subpopulations for the learning objective. We further make the stochastic assumption that samples from each arm $a$ (including the control) and subpopulation $i$ are drawn i.i.d. from an unknown probability distribution $\nu_{a,i}$ on $\mathbb{R}$ , whose mean we will denote by $\mu_{a,i}$ . The quality of arm $a$ is $\mu_a := \sum_{i=1}^J \beta_i \mu_{a,i}$ the combination of the means of the arms in the different populations. For $\beta \in \mathbb{R}^J$ we define the ABC-S problem as the correct identification of the set + +$$ +\mathcal {S} _ {\boldsymbol {\beta}} (\boldsymbol {\mu}) := \left\{a \in [ K ] \left| \sum_ {i = 1} ^ {J} \beta_ {i} \mu_ {a, i} > \sum_ {i = 1} ^ {J} \beta_ {i} \mu_ {0, i} \right. \right\}. +$$ + +At every time step $t$ , the algorithm selects an arm $A_{t}$ based on previous choices and outcomes and observes or selects (except when explicitly specified) the population type $I_{t}$ . Upon the selection of the arm $A_{t}$ a reward $X_{t}$ is obtained. This defines a sigma-field generated by the observations up to time $t$ denoted $\mathcal{F}_t = \sigma (I_1,X_1,\ldots ,I_t,X_t)$ . The number of times arm $a$ was selected for subpopulation $i$ at time $t$ is denoted $N_{a,i}(t)\coloneqq \sum_{s = 1}^{t}\mathbb{1}(A_s = a,I_s = i)$ and the number of draws of arm $a$ , $N_{a}(t)\coloneqq \sum_{s = 1}^{t}\mathbb{1}(A_{s} = a)$ . We define the gap with the control arm and arm $a, \Delta_a\coloneqq \mu_0 - \mu_a$ . + +Modes of interaction We consider four modes of interaction of the learner with the bandit, as specified in Figure 1 below. In any of the three passive modes of interaction (described in Figures 1b to 1d), we assume that the subpopulation $i$ represents a known proportion $\alpha_{i}$ of the total population, and hence that the sequence of subpopulations is drawn i.i.d. from the fixed and discrete distribution $I_{t} \sim \alpha = (\alpha_{1},\dots,\alpha_{J})$ with $\alpha \in \Sigma_{J} \coloneqq \{x \in [0,1]^{J} \mid \sum_{i} x_{i} = 1\}$ the $J$ -dimensional simplex. Here $\alpha$ is an exogenous parameter and can differ from $\beta$ which is inherent to the learning objective and is also assumed to be known. Although it is most natural in many applications to consider that $\beta = \alpha$ (it is even necessary in the oblivious mode to make the estimation of the $\mu_{a}$ 's feasible), Example 1 below describes a concrete scenario in which $\beta$ has negative components. + +The distributions $(\nu_{a,i})_{a,i}$ are assumed to belong the same one-parameter exponential family, $\mathcal{P} \coloneqq \{(\nu_{\theta})_{\theta}: d\nu_{\theta} / d\xi = \exp (\theta x - b(\theta))\}$ , with $\xi$ a reference measure on $\mathbb{R}$ and $b: \Theta \subset \mathbb{R} \mapsto \mathbb{R}$ . Every probability distribution $\nu_{\theta}$ in $\mathcal{P}$ is entirely defined by its mean $\dot{b}(\theta)$ [1]. We may hence identify any bandit instance with its matrix of means $\pmb{\mu} \in \mathbb{R}^{(K+1) \times J}$ . In addition, the Kullback-Leibler divergence between two distributions $\nu_{\theta}$ and $\nu_{\theta'} \in \mathcal{P}$ may be written in the following Bregman form: + +$$ +d (\mu , \mu^ {\prime}) = \operatorname {K L} \left(\nu_ {\theta}, \nu_ {\theta^ {\prime}}\right) = b \left(\theta^ {\prime}\right) - b (\theta) - \dot {b} (\theta) \left(\theta^ {\prime} - \theta\right), +$$ + +
1. See It ~ α1. Pick At1. Pick At
1. Pick At and It2. Pick At2. See It ~ α2. Do not see It ~ α
2. See Xt ~νAt,It3. See Xt ~νAt,It3. See Xt ~νAt,It3. See Xt ~νAt,It
(a) Active mode(b) Proportional mode(c) Agnostic mode(d) Oblivious mode.
+ +Figure 1: Modes of Interaction between Learner and Bandit in each round. In Active mode the learner determines the subpopulation, while in the right three passive modes it is sampled from $\alpha$ . + +where $\mu = \dot{b} (\theta)$ and $\mu^{\prime} = \dot{b} (\theta^{\prime})$ correspond to the means of the two distributions $\nu_{\theta}$ and $\nu_{\theta^{\prime}}$ . We also use the notation $\mathrm{kl}(p,q)$ to denote the KL divergence of two Bernoulli distributions of parameter $p$ and $q$ . + +We define $\mathcal{L} \coloneqq \{\pmb{\mu} : \forall a \in [K] \cup \{0\}, \forall i \in [J], \nu_{a,i} \in \mathcal{P}$ and $\mu_0 \neq \mu_a\}$ the set of identifiable instances where no arm has the same weighted mean as the control. At every time step, the policies we consider output a risk assessment $\hat{\delta}_t$ together with a recommendation $\hat{S}_t$ . We focus on safely calibrated policies, that are defined as satisfying the following property + +$$ +\forall \boldsymbol {\mu} \in \mathcal {L}, \forall \delta \in (0, 1), \quad \mathbb {P} _ {\boldsymbol {\mu}} \left(\exists t \geq 1: \hat {S} _ {t} \neq S _ {\beta} (\boldsymbol {\mu}) \cap \hat {\delta} _ {t} \leq \delta\right) \leq \delta . \tag {1} +$$ + +Finally, when fixing a level of risk $\delta$ , we consider the stopping time associated to the filtration $\mathcal{F}_t$ , $\tau_{\delta} = \inf \{t \geq 0, \hat{\delta}_t \leq \delta\}$ . The objective is then to minimize the expected number of rounds necessary to obtain a level of risk of at most $\delta$ . Contrary to usual $\delta$ -PAC algorithms if stopped before $\tau_{\delta}$ , the strategy still provides guarantees on the output set following Equation 1. In particular, safely calibrated policies have a sampling rule that does not depend on any pre-specified $\delta$ , and as such they are $\delta$ -PAC for any $\delta$ . + +Example 1 ([Largest Profit Identification problem 13, p24]). Consider a company choosing among $K$ product designs the model to mass produce. Each candidate design $k$ has an (equilibrium) sales price $\mu_{k,1}$ and production cost $\mu_{k,2}$ . The goal is to find the model $k$ with the largest profit $\mu_{k,1} - \mu_{k,2}$ . Prices and costs are currently unknown, but can be adaptively sampled. Sampling the "price" subpopulation $i = 1$ is typically implemented by performing user preference studies, taking questionnaires, etc. Samples from the "cost" subpopulation $i = 2$ involve rating manufacturing facilities, forecasting material and labor costs etc. This problem is interesting both in the BAI and ABC objectives. The importance vector is here $\beta = (1, -1)$ and $\alpha$ has to be set by the learner. + +# 2.2 General form of the sample complexity + +Depending on the mode of interaction from Figure 1, the learner has a set of sampling constraints to satisfy, here denoted $\mathcal{C}$ and precisely defined in the next section. We define $\mathrm{Alt}(\pmb{\mu})$ , the different problem instances where the set of arms better than the control differs from that of the instance $\pmb{\mu}$ . Formally, $\mathrm{Alt}_{\beta}(\pmb{\mu}) \coloneqq \{\pmb{\lambda} \in \mathcal{L} \mid S_{\beta}(\pmb{\lambda}) \neq S_{\beta}(\pmb{\mu})\}$ . This allows us to bound the sample complexity. + +Theorem 1. Let $\delta \in (0,1)$ and $\beta \in \mathbb{R}^J$ . For any strategy satisfying Equation 1 and any $\mu \in \mathcal{L}$ , the expected number of rounds for the ABC-S problem for the agnostic, proportional and active mode satisfies: + +$$ +\mathbb {E} _ {\boldsymbol {\mu}} \left[ \tau_ {\delta} \right] \geq T ^ {\star} (\boldsymbol {\mu}) \operatorname {k l} (\delta , 1 - \delta) \quad \text {a n d} \quad \lim _ {\delta \rightarrow 0} \inf _ {\ln (1 / \delta)} \frac {\mathbb {E} _ {\boldsymbol {\mu}} \left[ \tau_ {\delta} \right]}{\ln (1 / \delta)} \geq T ^ {\star} (\boldsymbol {\mu}). \tag {2} +$$ + +where (recalling that $\lambda_{a} = \sum_{i = 1}^{J}\beta_{i}\lambda_{a,i})$ + +$$ +\begin{array}{l} T ^ {\star} (\boldsymbol {\mu}) ^ {- 1} = \sup _ {\boldsymbol {w} \in \mathcal {C}} \inf _ {\boldsymbol {\lambda} \in \operatorname {A l t} _ {\beta} (\boldsymbol {\mu})} \sum_ {a = 0} ^ {K} \sum_ {i = 1} ^ {J} w _ {a, i} d \left(\mu_ {a, i}, \lambda_ {a, i}\right) (3) \\ = \sup _ {\boldsymbol {w} \in \mathcal {C}} \min _ {b \neq 0} \inf _ {\boldsymbol {\lambda} \in \mathcal {L}: \lambda_ {0} = \lambda_ {b}} \sum_ {a \in \{0, b \}} \sum_ {i = 1} ^ {J} w _ {a, i} d \left(\mu_ {a, i}, \lambda_ {a, i}\right). (4) \\ \end{array} +$$ + +This result is established in Appendix A. $T^{\star}$ characterizes the difficulty of the learning problem. + +# 2.3 Influence of the mode of interaction + +We consider the four different modes governing the sampling rule as outlined in Figure 1. In the agnostic mode (Fig. 1c) an arm is first selected, after which the subpopulation type is observed. Mathematically, this brings the equality $\mathbb{E}_{\mu}[N_{a,i}(T)] = \alpha_i\mathbb{E}_{\mu}[N_a(T)]$ established in Lemma 2 and the independence constraint on the weights $\pmb{w}\in \mathcal{C}_{\mathrm{agnostic}}\coloneqq \{w_{a,i} = \alpha_iu_a:(u_0,\dots ,u_K)\in \Sigma_{K + 1}\}$ . + +In the proportional mode (Fig. 1b), $A_{t}$ is chosen based on $\mathcal{F}_{t-1}$ and the current subpopulation $I_{t}$ . Here, the constraint is that the total number of pulls of the different arms in the subpopulation $i$ should respect the frequency of this subpopulation, i.e. $\sum_{a} \mathbb{E}_{\mu}[N_{a,i}(T)] = \alpha_{i} T$ . This induces a marginal constraint on the weights of the form $\boldsymbol{w} \in \mathcal{C}_{\mathrm{prop}} := \{\boldsymbol{w} \in \Sigma_{(K+1)J} \mid \forall i \leq J, \sum_{a} w_{a,i} = \alpha_{i}\}$ . This result is established in Lemma 3 reported in Appendix B. + +In the active mode (Fig. 1a), the learner has an additional degree of freedom—she can ask for any subpopulation type at any round. In that case, $\boldsymbol{w} \in \mathcal{C}_{\mathrm{active}} := \Sigma_{(K + 1)J}$ is unconstrained. + +By remarking that $\mathcal{C}_{\mathrm{agnostic}} \subset \mathcal{C}_{\mathrm{prop}} \subset \mathcal{C}_{\mathrm{active}}$ , and given the optimization program (3) solved to obtain the characteristic time, one immediately gets + +$$ +\forall \boldsymbol {\mu} \in \mathcal {L}, \quad T _ {\text {a c t i v e}} ^ {\star} (\boldsymbol {\mu}) \leq T _ {\text {p r o p o r t i a l}} ^ {\star} (\boldsymbol {\mu}) \leq T _ {\text {a g n o s t i c}} ^ {\star} (\boldsymbol {\mu}). \tag {5} +$$ + +Hence, as expected, the more control/information on the subpopulation the learner has, the faster she is able to identify the set of arms that are better than the control. + +To compare with the oblivious mode, in which the subpopulation information is not even observed, we have to assume that $\alpha = \beta$ . In that case, the arm rewards follow a mixture distribution: $X_{t}|A_{t} = a\sim \sum_{i = 1}^{J}\alpha_{i}\nu_{a,i}$ . In Proposition 4 reported in Appendix B.3, we properly define the characteristic time of an oblivious safely calibrated policy and prove that the joint convexity of Kullback-Leibler divergences implies that it is larger than its agnostic counterpart. This completes the picture of the ordering of the characteristic times by showing that, when $\alpha = \beta$ + +$$ +\forall \boldsymbol {\mu} \in \mathcal {L}, \quad T _ {\text {a c t i v e}} ^ {\star} (\boldsymbol {\mu}) \leq T _ {\text {p r o p o r t i a l}} ^ {\star} (\boldsymbol {\mu}) \leq T _ {\text {a g n o s t i c}} ^ {\star} (\boldsymbol {\mu}) \leq T _ {\text {o b l i v i o u s}} ^ {\star} (\boldsymbol {\mu}). \tag {6} +$$ + +Note that although we provide, in Section 3, algorithms to numerically compute the first three complexes, evaluating $T_{\text{oblivious}}^{\star}(\mu)$ would be much harder, as the mixture distributions can no more be parameterized by their mean only. Our current techniques do not yield a general-purpose practical algorithm that is asymptotically optimal in the oblivious mode for the ABC-S problem. In the Bernoulli case, however, as mixtures of Bernoulli distributions are Bernoulli distribution, one can use the single-population Bernoulli approach discussed in the next paragraph. For Gaussian distributions, one can use a suboptimal approach based on the observation that location mixtures of Gaussians with bounded means are sub-Gaussian (see Appendix B.3 for details). + +# 2.4 Single population and relationship with best arm identification + +In order to illustrate the nature of the ABC-S problem, we make a detour through the single population case, that is, when $J = 1$ . Given two weights $w_{a}, w_{b}$ and two means $\mu_{a}, \mu_{b}$ , we introduce the minimum weighted transportation cost for moving the means to a common position. + +$$ +d _ {\text {m i d}} (w _ {a}, \mu_ {a}, w _ {b}, \mu_ {b}) := \inf _ {v} w _ {a} d (\mu_ {a}, v) + w _ {b} d (\mu_ {b}, v) = w _ {a} d (\mu_ {a}, v _ {a, b} ^ {\star}) + w _ {b} d (\mu_ {b}, v _ {a, b} ^ {\star}) +$$ + +where $v_{a,b}^{*}$ , the optimal common location, is the weighted average, i.e. $v_{a,b}^{*} = \frac{w_{a}}{w_{a} + w_{b}}\mu_{a} + \frac{w_{b}}{w_{a} + w_{b}}\mu_{b}$ . + +Constructing an instance in the alternative When identifying all the arms better than a control, there are two different ways to obtain a close-by bandit model $\lambda$ in the alternative. The first option consists in taking an arm which does not belong to $S_{\beta}(\mu)$ and to augment its mean on the alternative model such that it becomes above the control (or to reduce the mean of the control). Otherwise, it is possible to take an arm that is better than the control in the bandit model $\mu$ and to shrink its mean such that it becomes lower than the control on the alternative (or augment the control). Note that the infimum over the alternative has the same expression in the two cases (see proof of Proposition 1 in Appendix A.2). + +There is a priori no link between a BAI problem and an ABC one. In particular, in the BAI problem there are only $K + 1$ possible choices for the best arm while when looking for $S_{\beta}(\pmb{\mu})$ there are up to + +$2^{K}$ different sets to consider. Yet, the next proposition shows that the characteristic time $T^{\star}$ of any ABC problem with $J = 1$ subpopulation shares strong similarities with that of BAI problems. + +Proposition 1. Let $\delta \in (0,1)$ and $\pmb{\mu} \in \mathcal{L}$ . For any strategy satisfying Equation 1, Equation 2 holds with + +$$ +T ^ {\star} (\boldsymbol {\mu}) ^ {- 1} = \sup _ {\boldsymbol {w} \in \Sigma_ {K + 1}} \inf _ {\boldsymbol {\lambda} \in \operatorname {A l t} _ {\beta} (\boldsymbol {\mu})} \sum_ {a = 0} ^ {K} w _ {a} d \left(\mu_ {a}, \lambda_ {a}\right) = \sup _ {\boldsymbol {w} \in \Sigma_ {K + 1}} \min _ {b \neq 0} d _ {\mathrm {m i d}} \left(w _ {0}, \mu_ {0}, w _ {b}, \mu_ {b}\right). +$$ + +The proof is reported in Appendix A.2. Note that the expression of the sample complexity is really close to the one in the BAI setting (Garivier and Kaufmann [10, Lemma 3]) except that we consider all the indices different from the control here instead of the indices different from the best arm. + +# 2.5 The Gaussian case + +In this section, we consider the Gaussian case which is of interest as the characteristic time admits a more explicit expression, making it possible to further investigate the differences between the various modes of interaction. We will state our results for the heteroscedastic case, in particular to get a closed-form proxy for the Bernoulli case, where each variance is a function of the (unknown) mean. + +A/B testing When $K = 1$ (one arm and the control arm), we are considering a standard A/B test with subpopulations and one can easily prove the following result (established in Appendix C). + +Proposition 2. For any $\pmb{\mu} \in \mathcal{L}$ with $K = 1$ and $\nu_{a,i} = \mathcal{N}(\mu_{a,j},\sigma_{a,j}^{2})$ one has + +1. $T_{\mathrm{agnostic}}^{\star}(\pmb {\mu}) = \frac{2\left(\sqrt{\sum_{i = 1}^{J}\frac{\beta_i^2\sigma_{0,i}^2}{\alpha_i}} + \sqrt{\sum_{i = 1}^{J}\frac{\beta_i^2\sigma_{1,i}^2}{\alpha_i}}\right)^2}{\Delta_1^2}$ and $w_{a,i}^{\star} = \frac{\alpha_i\sqrt{\sum_{i = 1}^{J}\frac{\beta_i^2\sigma_{a,i}^2}{\alpha_i}}}{\sqrt{\sum_{i = 1}^{J}\frac{\beta_i^2\sigma_{0,i}^2}{\alpha_i}} + \sqrt{\sum_{i = 1}^{J}\frac{\beta_i^2\sigma_{1,i}^2}{\alpha_i}}}$ +2. $T_{\mathrm{prop}}^{\star}(\pmb {\mu}) = \frac{2\sum_{i = 1}^{J}\frac{\beta_i^2}{\alpha_i}(\sigma_{0,i} + \sigma_{1,i})^2}{\Delta_1^2}$ and $\forall i\leq J,\forall a\in \{0,1\}$ , $w_{a,i}^{\star} = \frac{\alpha_i\sigma_{a,i}}{\sigma_{0,i} + \sigma_{1,i}}$ . +3. $T_{\mathrm{active}}^{\star}(\pmb {\mu}) = \frac{2\left(\sum_{i = 1}^{J}|\beta_{i}|(\sigma_{0,i} + \sigma_{1,i})\right)^{2}}{\Delta_{1}^{2}}$ and $\forall i\leq J,\forall a\in \{0,1\} ,w_{a,i}^{\star} = \frac{|\beta_i|\sigma_{a,i}}{\sum_{i = 1}^{J}|\beta_i|(\sigma_{0,i} + \sigma_{1,i})}$ + +The optimal allocations in the agnostic and proportional cases are constrained by the proportion of the different subpopulations $\alpha$ , whereas, for the active mode, the optimal weights only depend on $\beta$ . In general, the optimal weights also depend on the subpopulation variances, as is well-known in stratified sampling estimation. Note however, that when (a) the subpopulations all have a common variance $\sigma^2$ and (b) $\beta = \alpha$ , then the optimal allocations and the characteristic times are equal for the agnostic, the proportional and the active modes. In that case, $w_{a,i}^{\star} = \alpha_i / 2$ , which also corresponds to the well-known result in Gaussian A/B testing [14]. We have more generally observed that whenever the subpopulations have approximately the same variances, the agnostic and proportional modes yield very similar performances. + +Weight computation in the homoscedastic case Even in scenarios where all subpopulation variances are equal to $\sigma^2$ , the active mode remains very attractive in the cases where $\beta \neq \alpha$ . The following proposition shows that in that case, the optimal weights for the ABC-S problem can be computed efficiently. + +Proposition 3 (Efficient computation in the Gaussian case). With Gaussian distributions with a known variance $\sigma^2$ , letting $(u_0^\star, \ldots, u_K^\star) = \operatorname{argmax}_{u \in \Sigma_{K+1}} \min_{b \neq 0} \frac{\Delta_b^2}{2\left(\frac{1}{u_0} + \frac{1}{u_b}\right)}$ , the optimal weights for the active mode satisfy + +$$ +\forall a \in \{0, \dots , K \}, \forall i \leq J, w _ {a, i} ^ {\star} = u _ {a} ^ {\star} \frac {| \beta_ {i} |}{\sum_ {i = 1} ^ {J} | \beta_ {i} |}. +$$ + +If, in addition $\alpha = \beta$ , the above also holds for the agnostic and the proportional modes. + +The interesting part of Proposition 3 is that computing $(u_0^\star, \ldots, u_K^\star)$ can be done efficiently using Theorem 5 from [10]. The optimal weights of the ABC-S problem can be deduced from $u^\star$ without any further calculation. + +# 3 Algorithms + +To obtain our algorithms, we instantiate the Track-and-Stop algorithm template to our ABC-S problem. Garivier and Kaufmann [10] introduced Track-and-Stop and proved its asymptotic optimality in the BAI setting. Asymptotic optimality for general partition identification problems was subsequently established by Kaufmann and Koolen [13, Theorem 23] under the assumption of continuity of the oracle weights $\mu \mapsto w^{*}(\mu)$ . Degenne and Koolen [6] show that the continuity assumption holds for all single-answer problems, in the upper-hemicontinuity sense, which they show implies asymptotic optimality of the Track-and-Stop (T-a-S) algorithm. These results directly apply to our ABC-S problem. Degenne et al. [7] interpret T-a-S as a noisy sequential equilibrium computation for the max-min problem from the lower bound (e.g. Equation 3) and develop computationally attractive variants including lazy iterative solution of the $w^{*}$ problem, and optimistic gradients instead of forced exploration. + +The details of our implementation are given in Appendix F. In short, we use the simple standard $\Theta(\sqrt{t})$ forced exploration rounds, a mode/subpopulation aware upgrade of the D-tracking scheme [10] (which is empirically superior to C-tracking) and we approximately and incrementally compute the oracle weights using the AdaHedge vs Best Response iterative saddle point solver from [7]. We use one single learner, instead of one per possible answer, as advocated in [7, Section 4]. Note that we are not affected by the non-convergence of D-tracking from [7, Appendix E], as our problem has a unique $w^{*}$ because it is strictly concave in $w$ (see Appendix E). + +The sampling rule The high level overview of the algorithm is as follows. We are given the number of arms $K$ and subpopulations $J$ , the exponential family, the mode of interaction, the subpopulation importance coefficients $\beta$ and, for passive modes, their natural frequencies $\alpha$ . The algorithm then proceeds in rounds $t = 1,2,\ldots$ . Each round $t$ , it calculates the empirical frequencies $\hat{\mu}_t \in \mathbb{R}^{(K + 1) \times J}$ given by $\hat{\mu}_{a,i}(t) = \frac{1}{N_{a,i}(t)} \sum_{s=1}^{t} X_s \mathbf{1}\{A_s = a, I_s = i\}$ . It then computes (a suitable approximation of) the maximiser (i.e. the oracle policy) $\boldsymbol{w}_t = \boldsymbol{w}^*(\hat{\boldsymbol{\mu}}_t) \in \Sigma_{(K + 1) \times J}$ of problem (2). In the active mode, we "D-track" $\boldsymbol{w}_t$ , i.e. we sample $(A_t, I_t) \in \operatorname{argmax}_{a,i} N_{a,i}(t - 1) - t \boldsymbol{w}_t(a,i)$ . In the proportional mode, the subpopulation $I_t$ is given and we "D-track" the conditional distribution of $\boldsymbol{w}_t$ on arms given the subpopulation, i.e. $A_t \in \operatorname{argmax}_a N_{a,I_t}(t - 1) - t \alpha_{I_t} \boldsymbol{w}_t(a|I_t)$ , where $\boldsymbol{w}_t(a,i) = \alpha_i \boldsymbol{w}_t(a|i)$ . In the agnostic mode we "D-track" the marginal distribution of $\boldsymbol{w}_t$ on arms, i.e. $A_t \in \operatorname{argmax}_a N_a(t - 1) - t \boldsymbol{w}_t(a)$ . For each mode, this sampling strategy ensures that $N_{a,i}(t) \approx t \boldsymbol{w}_t(a,i) \approx t \boldsymbol{w}_a^*(\boldsymbol{\mu})$ , thus driving down the reported level of confidence as quickly as possible given the lower bound from Theorem 1. + +The recommendation Concluding each round, we recommend $S_{\beta}(\hat{\mu}_t)$ at confidence level $\hat{\delta}(t) = \min \{ \delta \in (0,1) | \Lambda(t) \geq \beta(t,\delta) \}$ obtained by inverting the threshold $\beta(t,\delta)$ at the GLR statistic + +$$ +\Lambda (t) = \min _ {b \neq 0} \inf _ {\lambda \in \mathcal {L}: \lambda_ {0} = \lambda_ {b}} \sum_ {a \in \{0, b \}} \sum_ {i = 1} ^ {J} N _ {a, i} (t) d \left(\hat {\mu} _ {a, i} (t), \lambda_ {a, i}\right). \tag {7} +$$ + +The threshold For the sharpest theoretically supported thresholds we refer to [13]. Namely, an ABC-S problem with $K$ -arms and $J$ -subpopulations has $2^{K}$ answers, and its rank [13, Definition 22] is $2J$ , as can be read off from (4). By [13, Proposition 23] we have validity for $\beta(t, \delta) = 6J \ln \ln t + \ln \frac{1}{\delta} + K + 2J \cdot O(\ln \ln \frac{1}{\delta})$ . In practice, we follow [10] and use instead the heavily stylized $\ln((1 + \ln t) / \delta)$ that omits several union bounds. + +Theorem 2. For every mode, Subpopulation Track-and-Stop is safely calibrated (Equation 1). Moreover, Subpopulation Track-and-Stop is asymptotically optimal and matches the lower bound from Theorem 1, in the sense that + +$$ +\text {f o r e v e r y b a n d i t} \boldsymbol {\mu} \in \mathcal {L}, \lim _ {\delta \rightarrow 0} \frac {\mathbb {E} [ \tau_ {\delta} ]}{\ln (1 / \delta)} = T ^ {\star} (\boldsymbol {\mu}). +$$ + +We include the proof in Appendix E. + +# 4 Experiments + +# 4.1 Simulations + +We conduct numerical experiments to evaluate the proposed algorithms, focusing on Bernoulli bandit models, which are ubiquitous in practical applications. + +In our experiments, in addition to our T-a-S algorithms with the various interaction modes, we include two more sampling rules for comparison: (1) uniform sampling as a baseline, and (2) the experimentally efficient Best Challenger heuristic inspired by [10], adapted to the ABC problem and denoted BC-ABC in the sequel. BC [10] for the BAI problem samples in every round the empirical best arm $\hat{a}_t$ or its best challenger, i.e. the arm $\hat{c}_t \neq \hat{a}_t$ at which the GLR statistic (Equation 7) reaches its minimum. Our BC-ABC adaptation samples in every round the control arm or the arm that yields the minimum GLR statistic $\Lambda(t)$ , in the agnostic interaction mode (since $\Lambda(t)$ is subpopulation independent). For clearer comparison between the sampling strategies, all algorithms use the Chernoff stopping criterion [10] to determine either when to stop or output the risk assessment at a given time. We also opted for sampling rules independent from the confidence parameter $\delta$ , because we are aiming for safely calibrated policies. + +We first illustrate the fact that the T-a-S algorithm provides a correct—but rather conservative—assessment of the risk of its decision whatever the time it is stopped at. To do so, we generated 1000 bandit instances uniformly at random from $[0, 1]$ with $K = 2$ arms. For each instance, we recorded the first time a certain risk assessment level is reached and the correctness of the algorithm's recommendation at that point. We map to each risk assessment level the proportion of errors across all instances. We chose two stopping rates that are not supported by theory but are recommended in practice [10]. Figure 2 (Left) illustrates the isotonic curve fitted on our observations and suggests that even the most lenient stopping threshold $\ln((\ln(t) + 1) / \delta)$ results in much lower empirical probability of error than the risk assessment. In the following, we use the stopping threshold $\ln((\ln(t) + 1) / \delta)$ . + +![](images/bdb1a3f461c5ba15be189617b9c0eb2d2f0e465a4021017636612aa32a9c3663.jpg) +Figure 2: (Left) Risk assessment calibration on a log-log scale. (Right) Stopping time boxplot for $\pmb{\mu} = [0.1\ 0.4\ 0.3; 0.2\ 0.5\ 0.2; 0.5\ 0.1\ 0.1] \in [0,1]^{(K+1)\times J}$ when $\beta = [1/3, 1/3, 1/3], \alpha = [0.4, 0.5, 0.1]$ with Bernoulli distributions. + +![](images/24d5d34b555d4efa117edac81c579f58eb324d3ba79a2d9363c973e8980e405f.jpg) + +In our second experiment $^1$ , we generated 3000 Bernoulli bandit instances with $K = 2$ and a random number of subpopulations $J$ between 2 and 10. Each subpopulation-arm's mean $\mu_{a,i}$ is drawn uniformly at random from [0, 1], and the subpopulation frequency vector $\alpha$ is drawn from a Dirichlet(10) distribution. Table 1 reports the average stopping time of each algorithm across all bandit instances. On average, the T-a-S algorithms at all modes stop at similar times, and all adaptive sampling methods terminate faster than uniform sampling. + +Table 1: Average stopping time. Description in text. + +
T-a-S (active)T-a-S (proportional)T-a-S (agnostic)BC-ABCUniform
1487115231154441527921586
+ +To better understand the role of $\beta$ and $\alpha$ , we ran the algorithms on a specific model (see Figure 2, Right) with $\alpha \neq \beta$ . In this case, the optimal proportions are constrained by the frequencies of the subpopulation for passive interaction modes. The expected number of samples needed to identify the ABC-S solution is lower for the active policy, which has an additional degree of freedom in its sampling strategy. The proportional interaction mode and the agnostic interaction modes perform similarly. As expected, all the proposed strategies outperform the uniform sampling rule. We contrast the stopping time with the lower bound $\mathrm{kl}(\delta, 1 - \delta)T^{*}(\pmb{\mu})$ , and with a more practical version, which indicates, approximately, the first time at which the GLR statistic crosses the threshold, i.e. solving $t = \ln((\ln(t) + 1) / \delta)T^{*}(\pmb{\mu})$ , as was done in [7]. All adaptive algorithms perform well on this instance, with their average runtime being very close to their respective practical bound. + +# 4.2 Application to A/B/n experiment + +We evaluate the algorithms on data collected from an actual A/B/n experiment, which compares different copies of a component of the webpage, in order to identify the ones better than the default copy. The metric of interest is whether the visitor clicked at least once during the experiment to the next page after getting exposed to one of the variants. For this setup we considered $K = 2$ copies competing against the control, with each copy being treated as an arm. Due to global traffic, the data exhibits strong seasonality patterns within a day, as seen in Figure 3a, in which every point corresponds to click-through rate per six hours (quarter of day) for 12 consecutive days. We treat the $J = 4$ seasons as i.i.d. subpopulations. Within each season we shuffled the data to eliminate the weekly trend. + +The summary statistics of the dataset, together with the characteristic times and the optimal weights for each T-a-S mode can be found in Appendix G. Note that the small gaps between the arm means makes this practical ABC-S problem much harder than the synthetically generated examples. + +We tested all algorithms described in Section 4.1. Each algorithm terminates when it reaches for the first time $\hat{\delta}_t \leq 0.1$ or outputs a risk assessment on the recommendation if it runs out of samples, which in this experiment occurs after $1.4 \cdot 10^7$ observations. Here, we weigh the importance $\beta$ of each season equally to its observed frequency $\alpha$ . Doing so, we do not expect large performance discrepancies between the different T-a-S interaction modes, which is confirmed by their characteristic times (Appendix G). The observations from Fig. 3b are similar to the results from the numerical simulations: adaptive sampling achieves lower sample complexity over uniform sampling and T-a-S for the active interaction mode terminates faster than for the passive modes. All algorithms yield the correct recommendation, but not with the same risk assessment. All T-a-S algorithms terminated within the available sample size, BC-ABC almost terminated and output a risk assessment slightly above 0.1 and uniform's risk assessment was 0.67. Of course, when viewing seasonality as a subpopulation, the active mode is unrealistic, but it is still informative to see that it can be very economical in hard problems in which sampling the subpopulations actively is an option. In this instance, proportional, agnostic and oblivious modes terminated at similar times. However, we would recommend using the proportional mode, given that we expect it to never perform worse than the other passive modes on average. One should not be surprised by the curve for the uniform sampling, this policy was stopped before convergence because it ran out of samples. + +Lastly, here we assumed that seasons occur in i.i.d. fashion, but in reality there is temporal dependence between them. This imposes extra constraints on the optimal weights and increases the sample complexity. However, we do not expect this to be detrimental for cases in which seasons alternate frequently and full cycles are observed often, as was the case with our example. + +# 5 Conclusion + +In this work, we considered the pure exploration task of identifying all the arms that are better than a control arm in the presence of subpopulations (ABC-S). We design asymptotically optimal policies for this problem under different assumptions on the mode of interaction between the learner and the bandit. We observed that the active mode, in which the learner decides which subpopulation it samples, may significantly reduce decision times. On the other hand, the other modes, in which the learner has to respect the natural proportions of the different subpopulations (i.e., in proportional and agnostic modes) produce more modest effects, except when the subpopulations differ significantly in + +![](images/5c8684b941d1d877034dc8d188b85f5708879fe848467dc8782e9a7314e3bf6f.jpg) +(a) Click-through rate per 6 hours for 12 days. + +![](images/b86728662ed96ea2a890ed43153365372956643ecd414d5bf5f51712b0873594.jpg) +(b) Risk assessment over time. +Figure 3: Real data and results. + +variances. Finally, we proposed a natural way to provide anytime decisions with risk guarantees in the Track-and-Stop framework. + +# 6 Potential Societal Impact + +The contributions presented in this work are mostly related to methods and, as such, do not have a direct expected societal impact. This being said, a potential concern that will need to be addressed more carefully in subsequent applications of these methods is the use of subpopulation information, which could be exploited to target specific user behaviour or characteristics. In the use case considered in Section 4.2, the subpopulations correspond to time slots that are used to model seasonality in the user responses, which does not raise any specific ethical concern. However, in cases where the subpopulations are formed using characteristics of individual users, the impact needs to be assessed more thoroughly. Note that in such cases, restricting to one of the more conservative modes of interaction (i.e. agnostic or even oblivious) may become necessary in order to prevent undue use of population-dependent information. + +# Acknowledgment + +The authors would like to thank the anonymous reviewers whose comments and questions helped improve the clarity of this manuscript. A. Garivier acknowledges the support of the Project IDEXLYON of the University of Lyon, in the framework of the Programme Investissements d'Avenir (ANR-16-IDEX-0005), and Chaire SeqALO (ANR-20-CHIA-0020). + +# References + +[1] O. Cappé, A. Garivier, O.-A. Maillard, R. Munos, G. Stoltz, et al. Kullback–leibler upper confidence bounds for optimal sequential allocation. Annals of Statistics, 41(3):1516–1541, 2013. +[2] A. Carpentier and R. Munos. Finite-time analysis of stratified sampling for monte carlo. In NIPS-Twenty-Fifth Annual Conference on Neural Information Processing Systems, 2011. +[3] L. Chen, J. Li, and M. Qiao. Nearly instance optimal sample complexity bounds for top-k arm selection. In Artificial Intelligence and Statistics, pages 101-110. PMLR, 2017. +[4] J. Cheshire, P. Menard, and A. Carpentier. The influence of shape constraints on the thresholding bandit problem. In Conference on Learning Theory, pages 1228-1275. PMLR, 2020. +[5] S. de Rooij, T. van Erven, P. Grünwald, and W. M. Koolen. Follow the leader if you can, Hedge if you must. Journal of Machine Learning Research, 15:1281-1316, Apr. 2014. +[6] R. Degenne and W. M. Koolen. Pure exploration with multiple correct answers. In Advances in Neural Information Processing Systems (NeurIPS) 32, pages 14591-14600. Dec. 2019. +[7] R. Degenne, W. M. Koolen, and P. Menard. Non-asymptotic pure exploration by solving games. In Advances in Neural Information Processing Systems (NeurIPS) 32, pages 14492-14501. Dec. 2019. +[8] E. Even-Dar, S. Mannor, Y. Mansour, and S. Mahadevan. Action elimination and stopping conditions for the multi-armed bandit and reinforcement learning problems. Journal of machine learning research, 7(6), 2006. +[9] V. Gabillon, M. Ghavamzadeh, and A. Lazaric. Best arm identification: A unified approach to fixed budget and fixed confidence. In NIPS-Twenty-Sixth Annual Conference on Neural Information Processing Systems, 2012. +[10] A. Garivier and E. Kaufmann. Optimal best arm identification with fixed confidence. In Conference on Learning Theory, pages 998-1027. PMLR, 2016. +[11] R. Johari, L. Pekelis, and D. J. Walsh. Always valid inference: Bringing sequential analysis to A/B testing. arXiv preprint arXiv:1512.04922, 2015. +[12] S. Kalyanakrishnan, A. Tewari, P. Auer, and P. Stone. Pac subset selection in stochastic multi-armed bandits. In ICML, volume 12, pages 655–662, 2012. +[13] E. Kaufmann and W. M. Koolen. Mixture martingales revisited with applications to sequential tests and confidence intervals. Preprint, Oct. 2018. +[14] E. Kaufmann, O. Cappé, and A. Garivier. On the complexity of best-arm identification in multi-armed bandit models. The Journal of Machine Learning Research, 17(1):1–42, 2016. +[15] T. Lattimore and C. Szepesvári. Bandit Algorithms. Cambridge University Press, 2020. doi: 10.1017/9781108571401. +[16] A. Locatelli, M. Gutzeit, and A. Carpentier. An optimal algorithm for the thresholding bandit problem. In International Conference on Machine Learning, pages 1690-1698. PMLR, 2016. +[17] B. Mason, L. Jain, A. Tripathy, and R. Nowak. Finding all $\{\epsilon\}$ -good arms in stochastic bandits. Advances in Neural Information Processing Systems, 2020. +[18] F. Yang, A. Ramdas, K. Jamieson, and M. J. Wainwright. A framework for Multi-A(rmed)/B(andit) testing with online FDR control. In Advances in Neural Information Processing Systems, 2017. \ No newline at end of file diff --git a/abntestingwithcontrolinthepresenceofsubpopulations/images.zip b/abntestingwithcontrolinthepresenceofsubpopulations/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9e660aa82c351b362d3fc71251e00453da212b04 --- /dev/null +++ b/abntestingwithcontrolinthepresenceofsubpopulations/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:60a839a8c5b9b38110146904d08507a97ed1246678fe0af2e93d79ecb9665cc4 +size 219577 diff --git a/abntestingwithcontrolinthepresenceofsubpopulations/layout.json b/abntestingwithcontrolinthepresenceofsubpopulations/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..8d4f3dea2dea97354e54ed615fbfef7d6fe4223a --- /dev/null +++ b/abntestingwithcontrolinthepresenceofsubpopulations/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e770c1da86012f25dbbd061f54a4a471489184b4077c7bb31df6d16af85d23e +size 428015 diff --git a/abtestingforrecommendersystemsinatwosidedmarketplace/77dc5e15-16d4-4322-9e68-8698111e2fdf_content_list.json b/abtestingforrecommendersystemsinatwosidedmarketplace/77dc5e15-16d4-4322-9e68-8698111e2fdf_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..82cb443aa68202bd4dced392b2896d747d523bee --- /dev/null +++ b/abtestingforrecommendersystemsinatwosidedmarketplace/77dc5e15-16d4-4322-9e68-8698111e2fdf_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b3ceaaf0590182a57d52c3b600d73615a51bd8fe2f4c7967fb897c4189b6354b +size 84147 diff --git a/abtestingforrecommendersystemsinatwosidedmarketplace/77dc5e15-16d4-4322-9e68-8698111e2fdf_model.json b/abtestingforrecommendersystemsinatwosidedmarketplace/77dc5e15-16d4-4322-9e68-8698111e2fdf_model.json new file mode 100644 index 0000000000000000000000000000000000000000..5dc9d86269f63e2ad76ae04b1cf174860badaabc --- /dev/null +++ b/abtestingforrecommendersystemsinatwosidedmarketplace/77dc5e15-16d4-4322-9e68-8698111e2fdf_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e26d97c18e2dfb1f3c27da96e6d0a6c4f6ffcf5bc92f84333370281ebd8d00e3 +size 103659 diff --git a/abtestingforrecommendersystemsinatwosidedmarketplace/77dc5e15-16d4-4322-9e68-8698111e2fdf_origin.pdf b/abtestingforrecommendersystemsinatwosidedmarketplace/77dc5e15-16d4-4322-9e68-8698111e2fdf_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e47acd11ec33b1b434bc0f8a57ecfe81a4936877 --- /dev/null +++ b/abtestingforrecommendersystemsinatwosidedmarketplace/77dc5e15-16d4-4322-9e68-8698111e2fdf_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b55c367a787bd714c76ffab2418659e9638095e7c1bdd15645b39c227cf567b4 +size 1056081 diff --git a/abtestingforrecommendersystemsinatwosidedmarketplace/full.md b/abtestingforrecommendersystemsinatwosidedmarketplace/full.md new file mode 100644 index 0000000000000000000000000000000000000000..35e08ca7513a3de823c6c4f9cb73a14213af32d2 --- /dev/null +++ b/abtestingforrecommendersystemsinatwosidedmarketplace/full.md @@ -0,0 +1,345 @@ +# A/B Testing for Recommender Systems in a Two-sided Marketplace + +Preetam Nandy, Divya Venugopalan, Chun Lo, Shaunak Chatterjee + +LinkedIn Corporation + +Mountain View, CA 94083 + +{pnandy, dvenugopalan, chunlo, shchatterjee}@linkedin.com + +# Abstract + +Two-sided marketplaces are standard business models of many online platforms (e.g., Amazon, Facebook, LinkedIn), wherein the platforms have consumers, buyers or content viewers on one side and producers, sellers or content-creators on the other. Consumer side measurement of the impact of a treatment variant can be done via simple online A/B testing. Producer side measurement is more challenging because the producer experience depends on the treatment assignment of the consumers. Existing approaches for producer side measurement are either based on graph cluster-based randomization or on certain treatment propagation assumptions. The former approach results in low-powered experiments as the producer-consumer network density increases and the latter approach lacks a strict notion of error control. In this paper, we propose (i) a quantification of the quality of a producer side experiment design, and (ii) a new experiment design mechanism that generates high-quality experiments based on this quantification. Our approach, called UniCoRn (Unifying Counterfactual Rankings), provides explicit control over the quality of the experiment and its computation cost. Further, we prove that our experiment design is optimal to the proposed design quality measure. Our approach is agnostic to the density of the producer-consumer network and does not rely on any treatment propagation assumption. Moreover, unlike the existing approaches, we do not need to know the underlying network in advance, making this widely applicable to the industrial setting where the underlying network is unknown and challenging to predict a priori due to its dynamic nature. We use simulations to validate our approach and compare it against existing methods. We also deployed UniCoRn in an edge recommendation application that serves tens of millions of members and billions of edge recommendations daily. + +# 1 Introduction + +Learning via experiments is one of the most powerful and popular ways to improve in many domains of life. In the tech industry, experiments are very commonplace to better understand user preferences and how to serve them best. Such experiments, known as A/B testing or bucket tests [561619], are performed by randomized allocation of a treatment and control variant to some population and measuring the average treatment effect (ATE) [14] relative to control. The populations receiving treatment and control are statistically identical since they were randomly selected. + +A/B testing is a powerful tool because of its design simplicity and ease of setup. It is accurate in applications where the behavior of a measurement unit (e.g., a user) is unaffected by the treatment allocated to any other measurement unit. This principle is called "Stable Unit Treatment Value Assumption" or SUTVA [11-13]. The SUTVA principle is reasonably accurate for experiments in 35th Conference on Neural Information Processing Systems (NeurIPS 2021). + +several viewer side applications of recommender systems (e.g., newsfeed ranking, search), where each viewer acts independently based only on what is shown to her. + +In marketplace settings, the SUTVA condition is often violated. A bipartite graph is a common abstraction for two-sided marketplaces. Let us consider the example of content recommendation in a newsfeed ranking application with content viewers and producers. While the effect of a ranking change (e.g., showing more visual content) conforms to SUTVA on the viewer side, the effect on the producer side (i.e., the impact on producers who post more/less visual content) does not. A producer's experience is affected by the allocation of treatment to all her potential viewers. For instance, a producer who primarily posts images will get more exposure (which directly affects her behavior) as more viewers are allocated to the new treatment. Sellers and buyers are an identical analogue to producers and consumers. Violations of SUTVA, especially on the producer or seller side experience, are commonplace in many marketplace experiments [8, 17] and form an important area of study, especially as marketplaces gain greater prominence. + +A popular approach in experiment design for marketplaces is to partition the graph into near separable clusters [10, 14, 18]. Then each cluster is considered an independent mini-graph, and randomized treatment allocation is done at the cluster level (i.e., all nodes in that cluster are allocated the same treatment). This works well in sparse graphs where many such clusters can be found without ignoring too many edges. A different approach [27], relevant especially in the advertising world, "creates" multiple copies of the universe by splitting the limited resources (e.g., daily budget) of entities on one side of the graph (e.g., advertisers). This works when the ecosystem has a periodic reset. + +Another recent approach designs an experiment by identifying a modified version of the treatment, which is allocated to a proportion of a node's network to mimic the effect on the node that allocating the original treatment to the node's entire network would have had. This works well for denser networks but makes assumptions on how the treatment effect propagates. Many of these approaches require knowing the network structure a priori, and hence do not work for dynamic graphs. + +In this work, we propose a novel and simple experiment design mechanism to generate high quality producer side experiments, where the quality is defined by a design inaccuracy measure that we introduce (see Definition 1). The mechanism also facilitates choosing a desired trade off between the experiment quality and the computational cost of running it. Our experiment design is shown to be optimal with respect to the inaccuracy measure. Our solution is applicable to any ranking system which forms the viewer side application in most marketplace problems. The key insight is that there is a unique viewer side ranking corresponding to each producer side treatment when all producers are allocated to that treatment. When producers are allocated to different treatment variants (e.g., to run treatment and control variants simultaneously), there are multiple possibly conflicting "counterfactual" rankings. By unifying the different counterfactual rankings (hence "UniCoRn") based on treatment allocation on the producer side, and careful handling of conflicts, we obtain a high quality experiment. A recent work [3] is a specific instance of our generalized design, relying on small producer ramps, which minimize chances of conflict between the counterfactual rankings. + +Our solution is designed to work at ramps of any size (higher ramps are often necessary for sufficient power). Furthermore, it improves upon the limitations of most prior approaches. It is agnostic to the density of the graph, does not depend on any assumptions on how the treatment effect propagates, and we do not need to know the structure of the graph a priori. One downside is the online computation cost of running an experiment using our design, and we provide a parameter to control this cost. + +The key contributions of our work are as follows: + +- An inaccuracy based metric to quantify the quality of an experiment and a novel producer side experiment design mechanism that unifies multiple counterfactual rankings. +- We prove the optimality of our experiment design, as well as bias and variance bounds. +- We show through extensive simulations how the method performs in various synthetic scenarios and against multiple existing approaches [3][9]. +- A real-world implementation of the proposal in an edge recommendation problem. + +The rest of the paper is structured as follows. Section 2 describes the problem setup in the context of a bipartite graph. The UniCoRn algorithm is presented in Section 3 along with an example demonstrating the different steps and certain theoretical properties of our method, including its optimality. In Section 4 we demonstrate the robustness of our method through detailed simulation studies, and we share our experience implementing UniCoRn in an edge recommendation application in one of the biggest social network platforms in the world. Finally, we conclude in Section 5 with a discussion of some extensions of our work and its general implications. + +# 2 Problem setup + +Let us consider a bipartite graph linking two types of entities - producers and consumers. A recommender system recommends an ordered set of items generated by the producers to each consumer, where items (e.g., connection recommendations, content recommendations or search recommendations) are ordered based on their estimated relevance in that consumer session[3] We use the terminology "consumer (or producer) side experience" to refer to a measurable quantity associated with a consumer (or producer) that depends on the rank assigned by the recommendation system. One can get an unbiased estimate of the consumer-side impact (with respect to a metric, outcome or response of interest) by randomly exposing two disjoint groups of consumers to the treatment model and the control model respectively and measuring the average difference between the treatment group and the control group. + +This classical A/B testing strategy does not work for measuring the producer side impact since that depends on the consumers' treatment assignment and should be ideally measured by allocating the same treatment to all the consumers connected to the producer in question. As illustrated in Figure 1a, satisfying this ideal condition simultaneously for all (or many) producers is not possible. For instance, consumer 3 is connected to producer 2 (in control) and producer 3 (in treatment). + +Notation and terminology: We consider an experimental design $\mathcal{D}$ with mutually exclusive sets of producers $P_0, \ldots, P_K$ corresponding to treatments $T_0, \ldots, T_K$ respectively. We refer to $T_0$ as control model (or recommender system) and all other $T_k$ as treatment model(s). The size of $P_k$ is determined by the ramp fraction (i.e., treatment assignment probability) of the corresponding models. Let $p_k, k = 1, \ldots, K$ denote the ramp fractions satisfying $\sum_{k=0}^K p_k = 1$ . An online experiment typically spans over a time window, in which each consumer can have zero to more than one sessions and each producer can produce zero to more than one items. We denote the set of all sessions and the set of all items by $\mathcal{S}$ and $\mathcal{I}$ respectively. In each session $s$ , the set of items under consideration is denoted by $\mathcal{I}_s$ , which is a subset of $\mathcal{I}$ . The counterfactual rank $R_k(i, \mathcal{I}_s)$ is the rank of item $i$ in consumer session $s$ with items $\mathcal{I}_s$ when all items are ranked by treatment $T_k$ . We denote the rank of item $i$ in the experimental design $\mathcal{D}$ by $R_{\mathcal{D}}(i, \mathcal{I}_s)$ . We use the notation $i \in P_k$ to denote that item $i$ belongs to a producer in $P_k$ . We reserve the use of the letters $k, i$ and $s$ for indexing a treatment variant, referring to an item and denoting a session. + +Design accuracy and cost: An experimental design to accurately measure the producer side experience should also have a reasonable computational cost (hereafter just "cost") of running the experiment. As Section 3 will show, the accuracy and the cost are conflicting characteristics of our experimental design. Thus, having the flexibility to explicitly trade-off accuracy against cost is desirable. To this end, we provide a quantification of these characteristics in terms of counterfactual rankings. To define accuracy, we compare the design rankings $R_{\mathcal{D}}(i,\mathcal{I}_s)$ with the ideal (but typically unrealizable) ranking $R^{*}(i,\mathcal{I}_{s})$ that equals $R_{k}(i,\mathcal{I}_{s})$ if $i\in P_k$ . An example is shown in Figure 1b + +Definition 1. The inaccuracy of the experimental design $\mathcal{D}$ is given by + +$$ +I n a c c u r a c y (\mathcal {D}) := \mathbb {E} \left(R _ {\mathcal {D}} (i, \mathcal {I} _ {s}) - R ^ {*} (i, \mathcal {I} _ {s})\right) ^ {2}, w h e r e R ^ {*} (i, \mathcal {I} _ {s}) = \sum_ {k = 0} ^ {\mathcal {K}} R _ {k} (i, \mathcal {I} _ {s}) 1 _ {\{i \in P _ {k} \}}. +$$ + +When no treatments are being evaluated online, each $i \in \mathcal{I}_s$ is scored only by the control model $T_0$ . Section 3 shows that each item might be scored multiple times using different treatment models in an experiment design. We quantify this computational expense as the cost of the design. + +![](images/24186f0a88b2e7da89bb4dca7e0d467f0c2e2dd673f3e245cb827702eef3aa24.jpg) +(1a) Bipartite graph of producers and consumers. Due to shared consumers between producers, it is infeasible to ensure all consumers connected to a producer get the same treatment as the producer. +(1b) Counterfactual Rankings. In (i), there are two mutually exclusive sets of producers $P_0$ and $P_1$ , each of size 4. In (ii), giving each item their ideal position in a unified ranking is not possible since there are conflicts. In (iii), there are no such conflicts and the ideal unified counterfactual ranking is realizable. +Now that we have an inaccuracy measure and a cost metric, we can define an experiment design algorithm that allows us to choose a desired balance between the two. + +![](images/5b04d33c2b9810a25f69e1c365cd962ba683afe90b0b60a96baa0c6c24f56cdf.jpg) +(i) Problem setup + +(ii) Unrealizable pair of counterfactual rankings +![](images/b0b86d0d52170d26e38ff58425ffbf2ba5abe0964cdfae89e0a3a4b03e34262d.jpg) +Definition 2. Let $N_{\mathcal{D}}(i, \mathcal{I}_s)$ denote the total number of times a scoring function (i.e., one of $T_k$ 's) needs to be applied to obtain a ranking of the items in $\mathcal{I}_s$ according to $\mathcal{D}$ . The cost of an experimental design $\mathcal{D}$ is given by $\text{Cost}(\mathcal{D}) := \mathbb{E}\left(N_{\mathcal{D}}(i, \mathcal{I}_s)\right)$ . + +![](images/f89937344b22396314bfc2fcc966557cd07fb65251a705e32f981d7946e180a3.jpg) +(iii) Realizable pair of counterfactual rankings + +# 3 UniCoRn: Unifying Counterfactual Rankings + +A typical recommender system comprises of a (possibly composite) model (machine learnt or otherwise) that assigns a relevance score to each candidate item. Items are then ranked according to their scores (higher the score, lower the rank; ties broken randomly). We want to measure the impact of a new recommender system $(T_{1})$ compared to the control recommender system $(T_{0})$ on producers (or sellers) in a two-sided marketplace via online A/B testing. Many recommender systems in industry have two phases: (i) a candidate generation phase, which considers a much larger set of candidates, followed by (ii) a ranking phase using a more sophisticated model with higher computation cost and hence often scoring much fewer items. Minor modifications needed to handle such multi-phase systems are covered in Section 4.3 Until then, we focus on single phase ranking systems. We also assume one treatment and one control for now, and extend to multiple treatments in Section 3.2 + +# 3.1 The UniCoRn algorithm + +For given disjoint producer sets $P_0$ and $P_1$ corresponding to $T_0$ and $T_1$ respectively, we present a class of experimental designs $UniCoRn(P_0, P_1, \alpha)$ parametrized by the tuning parameter $\alpha \in [0, 1]$ controlling the cost of the experiment. Recall that $\{R_k(i, \mathcal{I}')\}$ denotes a ranking of the items in $\mathcal{I}'$ according to $T_k$ in descending order (i.e. $T_k(i) \geq T_k(j)$ implies $R_k(i, \mathcal{I}') \leq R_k(j, \mathcal{I}')$ ) for $k = 0, 1$ . + +For each consumer session $s$ , the UniCoRn $(P_0, P_1, \alpha)$ algorithm provides a ranking $\{R_{\mathcal{D}_U}(i, \mathcal{I}_s)\}$ of the items in $\mathcal{I}_s$ such that the rank of item $i \in P_k$ is close to $R_k(i, \mathcal{I}_s)$ simultaneously for all $i \in \mathcal{I}_s$ and $k = 0, 1$ . Please note that the underlying consumer-producer graph is not needed to apply UniCoRn $(P_0, P_1, \alpha)$ . The detailed steps of UniCoRn are provided in Algorithm 1 and Figure 2a provides a visual walkthrough of UniCoRn using an example. The key components are: + +- Initial slot allocation (Step2): Identify positions allocated to all items using $T_0$ . +- Obtain mixing positions (Steps3-5): Identify the slots $\mathcal{L}$ to mix up and accommodate the two counterfactual rankings, and the slots that will not partake in this process. + +- $\alpha$ determines the fraction of $P_0$ items and slots that will be used in the mixing +- All items in $P_{1}$ and their corresponding slots participate in the mixing + +- Perform mixing (Steps 6 - 8): Obtain the relative rank of each item using the score according to that item's treatment assignment. Use these relative ranks to blend items (that were selected for mixing) from different groups with ties broken randomly (see Figure 2a). + +# Algorithm 1 UniCoRn $(P_0, P_1, \alpha)$ + +Require: producer sets $P_0, P_1$ , scoring models $T_0$ and $T_1$ and tuning parameter $\alpha$ ; + +Ensure: a ranking of items for each session $s$ ; + +1: for Each session $s$ with item set $\mathcal{I}_s$ do +2: Get a ranking of all items $\{R_0(i,\mathcal{I}_s)\}$ according to $T_{0}$ +3: Construct $P_0^*$ by randomly selecting producers from $P_0$ with probability $\alpha$ ; +4: Let $\mathcal{I}_{s,0},\mathcal{I}_{s,1}$ and $\mathcal{I}_{s,0}^{*}$ be the sets of items with producers in $P_0,P_1$ and $P_0^*$ respectively; +5: Find the rank positions $\mathcal{L} = \{R_0(i,\mathcal{I}_s):i\in \mathcal{I}_{s,1}\cup \mathcal{I}_{s,0}^*\}$ of the items in $\mathcal{I}_{s,1}\cup \mathcal{I}_{s,0}^{*}$ +6: Obtain rankings $\{R_0(i,\mathcal{I}_{s,1}\cup \mathcal{I}_{s,0}^*)\}$ and $\{R_{1}(i,\mathcal{I}_{s,1}\cup \mathcal{I}_{s,0}^{*})\}$ according to $T_{0}$ and $T_{1}$ ; +7: Compute the following rank-based score + +$$ +\operatorname {r a n k} _ {-} \operatorname {s c o r e} (i) = R _ {0} \left(i, \mathcal {I} _ {s, 1} \cup \mathcal {I} _ {s, 0} ^ {*}\right) 1 _ {\{i \in P _ {0} ^ {*} \}} + R _ {1} \left(i, \mathcal {I} _ {s, 1} \cup \mathcal {I} _ {s, 0} ^ {*}\right) 1 _ {\{i \in P _ {1} \}}; +$$ + +8: Rerank $\mathcal{I}_{s,1} \cup \mathcal{I}_{s,0}^*$ in the positions $\mathcal{L}$ based on rank_score(i) in ascending order (i.e., rank_score(i) $\leq$ rank_score(j) implies rank(i) $\leq$ rank(j)) while breaking ties randomly; + +In Algorithm we guarantee that in the final ranking (i) the ordering among the items in $P_0$ respects the $T_0$ based ranking, (ii) the ordering among the items in $P_1$ respects the $T_1$ based ranking, and (iii) the distribution of the rank of a randomly chosen item in $P_0$ is the same as the distribution of rank of a randomly chosen item in $P_1$ (i.e., no cannibalization) and the common distribution is $\text{Uniform}\{1, \dots, K\}$ if there are $k$ slots. It is easy to see that (i) and (ii) hold by design and (iii) follows from the fact that $\mathcal{L}$ is a uniform sample from $\{1, \dots, K\}$ as $P_0$ and $P_1$ are independent of the ranking distributions generated by $T_0$ and $T_1$ (due to randomized treatment allocation). + +![](images/1ace278070947d9b55af5f98eefb4febe43bd2cdf0b9848f3d655d827b56347d.jpg) +(i) A pair of counterfactual rankings +(ii) $\alpha = 0.5$ $\mathsf{P}_{\cdot 0}^{\star} = \{2,3\}$ $\mathsf{L} = \{2,3,5,6,7,8\}$ +(iii) Rank-score of L +(iv) Unified (v) ranking in ra +(v) Final ranking +(1) Unrealizable pair of counterfactual rankings +(ii) $\alpha = 0$ +(iii) $\alpha = 0.5$ +(iv) $\alpha = 1$ + +(2a) Algorithm $\boxed{1}$ with $\alpha = 0.5$ . (i) Complete rankings under $T_{0}$ and $T_{1}$ . (ii) $P_0^*$ sampled as $\{Item2, Item3\}$ . (iii) Separate ranking of $P_0^*$ using $R_0$ and $P_{1}$ using $R_{1}$ . (iv) Unified ranking of $\mathcal{L} = P_0^* \cup P_1$ with all ties broken in favor of the orange items $(P_{1})$ . (v) Final ranking obtained by placing items in $P_0 \setminus \mathcal{L}$ in their $R_0$ ranks, then remaining slots filled with the unified ranking of $\mathcal{L}$ . + +(2b) The impact of $\alpha$ . $\alpha \in [0,1]$ is an algorithm parameter that specifies the amount of flexibility in combining the two counter-factual rankings, with $\alpha = 0$ being the least flexible and $\alpha = 1$ being the most. As a result, $\alpha = 0$ incurs the highest inaccuracy but has the lowest cost, while $\alpha = 1$ is the most accurate and computationally expensive. + +The impact of $\alpha$ : We inserted $\alpha$ in our design to provide an explicit lever to control the balance between accuracy and cost. The more items (i.e., $|\mathcal{L}|$ ) we include in the mixing, the greater the accuracy. However, the mixing step requires every eligible item in $\mathcal{L}$ to be scored by every model, and hence the increased accuracy can come at a hefty cost. The implication of different choices of $\alpha$ in shown in Figure 2b, using the same example. All ties are broken in favor of items in $P_{1}$ . Let $c_{k}$ denote the computation cost of scoring all items (from all producers, that is) using $T_{k}$ , where the scoring cost of each item is the same. Then the total cost is given by $c_{0} + (\alpha p_{0} + p_{1})c_{1}$ . + +# 3.2 Handling multiple treatments + +Thus far, we have considered one treatment and one control. Simultaneous measurement of multiple treatments (against a control variant) can be achieved with a simple extension to the mixing selection step. The effect of each treatment can be observed by independently comparing the corresponding treatment population to the control population. As a quick recap of critical notation, $T_{0}$ denotes the control model. With $\mathcal{K}$ treatments in total and $p_{k}$ denoting the ramp fraction of $T_{k}$ , $\sum_{k=0}^{\mathcal{K}} p_{k} = 1$ . + +Greater mixing: This is the trivial extension of Algorithm 1. We first fix positions of $1 - \alpha$ fraction of items from $P_0$ and then mix the remaining $P_0$ items with all items from each $P_k$ for $k = 1, \dots, \mathcal{K}$ . This family of designs (by varying $\alpha$ ) has higher cost and lower inaccuracy. Hence, it is suitable for offline scoring applications and online applications without strict scoring latency constraints. The total (computation) cost is given by $c_0 + (1 - (1 - \alpha)p_0)\sum_{k \geq 1} c_k$ . + +Limited mixing: An alternative is to select $\mathcal{L}$ by picking $\alpha$ fraction of items from each $P_{k}$ including $k = 0$ . This reduces the cost in the mixing step since $\mathcal{L}$ is smaller and fewer items are scored by all models under consideration, but increases inaccuracy (compared to greater mixing) since lesser mixing happens. It is better suited for online applications with stricter latency requirements. The total computational cost is given by $c_{0} + \alpha \sum_{k\geq 1}c_{k} + (1 - \alpha)\sum_{k\geq 1}p_{k}c_{k}$ . + +Next, we analyze some theoretical properties of this design in the two treatment scenario. At $\alpha = 1$ , "greater" and "lesser" mixing scenarios are identical and the amount of mixing is the maximum possible. It is not surprising that this is also when the experiment design is provably optimal. + +# 3.3 Theoretical results + +We first prove the optimality of $UniCoRn(P_0, P_1, 1)$ with respect to the design inaccuracy measure given in Definition 1. Next, in Theorem 2 we provide bias and variance bounds for $UniCoRn(P_0, P_1, 1)$ and we show that our bounds are tight in the sense that the equality can be achieved in an adversarial situation. Proofs of all the results are given in the appendix. + +Theorem 1 (Optimality of UniCoRn $(P_0, P_1, 1)$ ). Let $\mathcal{D}_U$ be a design based on Algorithm with randomly chosen $P_0$ and $P_1$ , and with $\alpha = 1$ . Then for any other design $\mathcal{D}$ + +$$ +\mathbb {E} \left(R _ {\mathcal {D} _ {U}} (i, \mathcal {I} _ {s}) - R ^ {*} (i, \mathcal {I} _ {s}) \mid \mathcal {I} _ {s}\right) ^ {2} \leq \mathbb {E} \left(R _ {\mathcal {D}} (i, \mathcal {I} _ {s}) - R ^ {*} (i, \mathcal {I} _ {s}) \mid \mathcal {I} _ {s}\right) ^ {2}, \tag {1} +$$ + +where $R^{*}$ is as in Definition 7 with $\mathcal{K} = 1$ . Equation (1) implies the optimality of $\mathcal{D}_U$ with respect to the design inaccuracy measure given in Definition 7 i.e. Inaccuracy $(\mathcal{D}_U, T_0, T_1) \leq \text{Inaccuracy}(\mathcal{D}, T_0, T_1)$ for all $T_0, T_1$ and for all design $\mathcal{D}$ . The same results hold for the multiple treatment case described in Section 3.2. + +Theorem 2 (Bias and Variance Bounds). Let $\mathcal{D}_U$ be a design based on Algorithm [7] with randomly chosen $P_0$ and $P_1$ , and with $\alpha = 1$ . Then, for $k \in \{0,1\}$ , the conditional bias and the conditional variance of the observed rank $R_{\mathcal{D}_U}(i,\mathcal{I}_s)$ given $\mathcal{A}_{s,k,i,r} = \{\mathcal{I}_s,R^* (i,\mathcal{I}_s) = r,i \in P_k\}$ is given by + +1. $|\mathbb{E}\left(R_{\mathcal{D}_U}(i,\mathcal{I}_s) - R^* (i,\mathcal{I}_s)\mid \mathcal{A}_{s,k,i,r}\right)|\leq c(k,p_1),$ and +2. $\operatorname{Var}\left(R_{\mathcal{D}_U}(i, \mathcal{I}_s) \mid \mathcal{A}_{s,k,i,r}\right) \leq 2\min(r-1, |\mathcal{I}_s| - r)p_1(1 - p_1) + c(k,p_1)(1 - c(k,p_1))$ + +where $p$ is the probability of assigning an item to the treatment group $P_{1}$ , $R^{*}$ is as in Definition [1] with $\mathcal{K} = 1$ , and $c(k, p_{1}) = \{k(1 - p_{1}) + (1 - k)p_{1}\} / 2$ . The equality holds in both cases when $r \neq \frac{|\mathcal{I}_{s}| + 1}{2}$ and the treatment ranking $\{R_{1}(i, \mathcal{I}_{s})\}$ is the reverse of the control ranking $\{R_{0}(i, \mathcal{I}_{s})\}$ with probability one. + +For $UniCoRn(P_0, P_1, \alpha)$ with $\alpha < 1$ , for all $i \in P_0 \setminus P_0^*$ , we have $R_{\mathcal{D}}(i, \mathcal{I}_s) = R^*(i, \mathcal{I}_s)$ , implying zero bias and zero variance. For all $i \notin P_0 \setminus P_0^*$ , it is easy to see that $R_{\mathcal{D}}(i, \mathcal{I}_s)$ can be written as + +$$ +R _ {\mathcal {D}} (i, \mathcal {I} _ {s}) = X + (r - 1 - X) \times R _ {\mathcal {D}} (i, \mathcal {I} _ {s, 1} \cup \mathcal {I} _ {s, 0} ^ {*}) +$$ + +where $X$ has a Binomial $(r - 1, (1 - \alpha)(1 - p_1))$ distribution, and $X$ and $R_{\mathcal{D}}(i, \mathcal{I}_{s,1} \cup \mathcal{I}_{s,0}^*)$ are conditionally independent given the ordered set of items $D_{0,[|\mathcal{I}_{s}|]}$ according to $T_0$ . Therefore, the bias and bounds can be derived using the results in Theorem 2 We leave detailed computations to the interested reader. Next, we empirically evaluate the impact of $\alpha$ on design inaccuracy and implement UniCoRn to evaluate the producer side impact of a large-scale recommender system. + +# 4 Empirical Evaluation + +We analyze various aspects of the design inaccuracy in Section 4.1 followed by an analysis of the treatment effect estimation error with specific rank to response functions in Section 4.2 We conclude this section by sharing our experience of implementing UniCoRn in a large-scale edge recommendation application for one of the largest social networks with $750+$ million members, demonstrating the scalability of our algorithm. + +For Sections 4.1 and 4.2 we create a simulated environment with $L = 100$ positions to generate data for the empirical evaluation of $UniCoRn(P_0, P_1, \alpha)$ (in short, $UniCoRn(\alpha)$ ). First, we compare the design accuracy and the cost of the variants of $UniCoRn(\alpha)$ based on a number of values of $\alpha$ . Next, we compare the performances of $UniCoRn(\alpha)$ for $\alpha \in \{0, 0.2, 1\}$ , the counterfactual ranking method of [3] (we will refer to this as HaThucEtAl) and a modified version of OASIS [9] for estimating the average treatment effect. To the best of our knowledge, these are the only existing methods that do not require the underlying network to be known a priori. We implemented the Algorithms in R. + +# 4.1 Impact of $\alpha$ + +For a fixed treatment proportion $TP = |P_1| / (|P_0| + |P_1|)$ , the cost (Definition2) of UniCoRn(α) increases with $\alpha$ . We present the cost and inaccuracy results for different values of $TP$ , while taking the average over random choices $P_0$ and $P_1$ . We also consider four different simulation settings corresponding to different levels of correlation $\rho \in \{-1, -0.4, 0.2, 0.8\}$ between treatment and control scores for comparing the design accuracy. We generated the scores from a bivariate Gaussian distribution. More data generation details are in Appendix A.2 + +![](images/2e860f1f5d7495c4431a93563a97e27fb1f495604c3851bc0b2703273756c24a.jpg) +(3a) Average ranking errors for two measures of inaccuracy (MAE and RMSE) and for two different values of the treatment proportion (0.1 and 0.5) based on $N_{S} = 50000$ sessions with $L = 100$ slots each. + +![](images/eae7ae66233276dfae66db3a461a0a16dad99fce0c4baf4c23296f3d67ea1d3b.jpg) +(3b) Cost vs. (in)accuracy trade-off at different treatment proportions (TP). + +We consider two measures of inaccuracy (see Appendix A.2 for detailed definitions): (i) mean absolute error (MAE) and (ii) root mean squared error (RMSE). Figure 3a shows that the performance of UniCoRn(0) and UniCoRn(1) are roughly similar (or slightly better for UniCoRn(0)) with respect to MAE, but UniCoRn(1) outperforms UniCoRn(0) with respect to RMSE (validating Theorem 1). This is because $R_{\mathcal{D}}(i,\mathcal{I}_s) - R^* (i,\mathcal{I}_s) = 0$ for all items in $P_0$ for UniCoRn(0), but the errors corresponding to the items in $P_1$ are much larger for UniCoRn(0) compared to UniCoRn(1). Note that the slightly better performance of UniCoRn(0) with respect to MAE does not contradict the optimality result in Theorem 1 which is based on squared errors instead of absolute errors. Another interesting finding from Figure 3a is that a smaller value of $\rho$ (where -1 is the smallest value) corresponds to a more challenging design problem due to the increasing number of conflicts in the counterfactual rankings (cf. the last part of Theorem 2). + +The cost (Definition2) and inaccuracy (Definition1) trade-off for a fixed value of $\rho = 0.8$ is shown in Figure 3b for different values of the treatment proportion $TP$ . For each value of $TP$ , we obtain the plot by varying $\alpha \in [0,1]$ . Since we directly generated the scores from a bivariate Gaussian distribution, the cost show in Figure 3b is a hypothetical cost according to Definition2. As we see, designing an experiment with a higher $TP$ is more challenging than one with a lower $TP$ due to the increasing number of conflicts in the counterfactual rankings. Additionally, we see that experiments with a lower $TP$ are more sensitive to the choice of $\alpha$ . + +# 4.2 Comparison with existing methods + +Note that $HaThucEtAl$ is designed for small ramp experiments. Following the authors' guidelines [3], we will be limiting ourselves to the case where $10\%$ of the population is in control and $10\%$ of the population is in treatment. For $UniCoRn(\alpha)$ and $OASIS$ , we consider two different settings, namely (i) $10\%$ treatment and $90\%$ control and (ii) $50\%$ treatment and $50\%$ control. + +OASIS solves a constrained optimization problem to match each producer's total counterfactual scores and a post-experiment adjustment corrects for mismatches. However, we consider a modification of OASIS which is a score-based counterpart of the rank-based UniCoRn(1) algorithm. We assign a normalized counterfactual score to each item (i.e., no need for solving an optimization problem or for post-experiment correction). Following Section 5 of [9], we define normalized scores $p_k(s,i) = T_k(s,i) / \left(\sum_{i=1}^L T_k(s,i)\right)$ , for $k = 0,1$ . Then we define the counterfactual scores as $p^*(s,i) = \sum_{k \in \{0,1\}} p_k(s,i) 1_{\{i \in P_k\}}$ . + +We generate data from a simulated recommendation environment with $L = 100$ positions. Note that the computation cost shown in Figure 3a is hypothetical (based on Definition 2), as we generated the treatment and the control scores from (correlated) uniform distributions and hence we did not need to apply any scoring function. More data generation details are given in Appendix A.3. We consider the following two rank to response functions: + +$$ +\left(a v g _ {-} f n\right) Y _ {i} = \hat {E} \left[ \left(\frac {1 0}{\log \left(1 0 + R _ {\mathcal {D}} (i , \mathcal {I} _ {s})\right)}\right) ^ {2} \right] \text {a n d} \left(m a x _ {-} f n\right) Y _ {i} = \max \left\{\left(\frac {1 0}{\log \left(1 0 + R _ {\mathcal {D}} (i , \mathcal {I} _ {s})\right)}\right) ^ {2} \right\}, +$$ + +where the empirical average $\bar{E}$ and the max are over all items that appeared in a session and belong to producer $i$ . We chose the logarithmic decay function $\frac{10}{\log(10 + r)}$ to represent the value of a position (attention given to an item placed at position $r$ ) in a ranked list. Then we aggregate (using the average or the max function) the attention received by the items of a producer to define response functions. The treatment effects corresponding to avg_fn and max_fn are 0.16 and -0.87. + +![](images/7cd1930203c1010454dda39942f98338092efc041dfd0a0d95ee04d3a49a7468.jpg) +(4a) Errors in estimating the average treatment effect for two different rank to response functions and for two different values of the treatment proportion based on $N_{S} = 1000$ sessions with $L = 100$ slots each. + +![](images/d793caa8a0712f0c7744696e48dc92e7354e1a878590fec5dc0b0c99932cd0aa.jpg) +(4b) Hypothetical cost based on Definition2 for treatment proportion (TP) equals 0.1 and 0.5. + +Each iteration (based on 1000 sessions) including the data generation, reranking based on $UniCoRn(\alpha)$ for $\alpha \in \{0,0.2,1\}$ , $HaThucEtAl$ and OASIS, and the treatment effect estimation took 36 seconds on average on a Macbook Pro with 2.4 GHz 8-Core Intel Core i9 processor and 32 GB 2667 MHz DDR4 memory. We repeat this 100 times and summarize the results in Figure 4a. Both $UniCoRn(\alpha)$ outperform OASIS (even for $\alpha = 0$ ) in terms of the treatment effect estimation error, demonstrating the advantage of rank-based methods over score-based methods. $UniCorn(1)$ and $Unicorn(0.2)$ outperform $HaThucEtAl$ , as $HaThucEtAl$ exhibits a significantly higher variance due to its limitation to a $10\%$ treatment and $10\%$ control ramp. The performances of the variants of $UniCoRn(\alpha)$ are roughly equal for treatment proportion $(TP)$ 0.5, whereas $UniCoRn(\alpha)$ is more sensitive to the choice of $\alpha$ at $TP = 0.1$ . This is consistent with the findings in Figure 3b. Note that the sensitivity to the choice of $\alpha$ is more prominent when the rank to response function is max_fn. This is consistent with Figure 3a since avg_fn is a sub-linear function of the ranks, but max_fn is not. While accounting for the computational cost given in Figure 4b along with the estimation error in Figure 4a, the computationally cheapest method $UniCoRn(0)$ seems to be the best choice at $TP = 0.5$ whereas we need to choose the slightly more expensive variant $UniCoRn(0.2)$ to ensure an estimation quality as good as $UniCoRn(1)$ . + +# 4.3 Social Network application + +Edge recommendations in social media platforms enable members to connect or follow other members. Edges also bring two sides of a marketplace together, e.g., content producers and consumers where content propagates along existing edges. Thus, edge recommendation products (see Figure 5) + +in the Appendix for a toy example) play a vital role in shaping the experience of both producers and consumers. The consumers of edge recommendations are "viewers" and A/B tests can measure the viewer side impact of any ranking change. The candidates (i.e., items) recommended are "viewees", because they are the members that are viewed and receive a connection request. Edge recommendations may have a large viewee impact, with number of viewees impacted often outnumbering viewers. To measure the viewee side effect, we implemented UniCoRn in an online edge recommender system that serves tens of millions of members, and billions of edge recommendations daily. We chose $\alpha = 0$ (i.e., UniCoRn(0)) to minimize the online scoring latency increase. Next, we discuss two experiments conducted that cover candidate generation and scoring stage experiments. Key metrics include (i) Weekly Active Unique (WAU) users, i.e., number of unique users visiting in a week; and (ii) Sessions, i.e., number of user visits. + +Candidate generation experiment: Large-scale recommender systems often have a candidate generation phase, which uses a simpler algorithm to evaluate a much larger set of items. The best few are then scored in the second ranking phase, which uses more sophisticated and computationally intensive algorithms. The two phases together comprise the ranking mechanism and UniCoRn handles such scenarios with a simple extension. For any item $i$ selected by the control candidate selection model $C_0$ (or treatment $C_1$ ) but not by $C_1$ ( $C_0$ ), the second phase scoring by treatment $T_1(i)$ (or control $T_0(i)$ ) is set to $-\infty$ . The extension is detailed in the appendix (Section A.5). + +In edge recommendation problems, a popular candidate generation heuristic is number of shared edges. This heuristic favors candidates with large networks. To neutralize this advantage, we tested a variant based on a normalized version of shared edges (i.e., fraction of the candidate's network that are shared edges with the viewer) and measured the impact using UniCoRn(0). Thus, $C_0$ uses number of shared edges and $C_1$ uses the normalized version to generate candidates. The second phase ranking model was unchanged in this comparison, i.e., $M = T_0 = T_1$ . + +
MetricsDelta % (candidate generation)Delta % (ranking model)
Weekly Active Unique users+0.51%+0.13%
Sessions+0.57%+0.11%
+ +Table 1: Viewee side impact of a new candidate generation model (with the same ranking model as control) and a new ranking model (with the same candidate generation model as control), measured with $40\%$ viewer side traffic. All results are highly significant with p-value $< 0.001$ . + +Ranking model experiment: The ranking stage scores all candidates based on the model assignment of the viewers. Ranking models may be composite models optimizing for viewer and/or viewee side outcomes. In one such experiment, the treatment model $T_{1}$ optimized for viewee side retention, i.e., we boosted viewees likely to visit if they received an edge formation request. Using UniCoRn(0) and candidate set $I_{s}$ , we obtain the ranking $\{R_0(i,\mathcal{I}_s)\}$ according to $T_{0}$ and find the positions $\mathcal{L} = \{R_0(i,\mathcal{I}_s):i\in \mathcal{I}_{s,1}\}$ . Then, we rescore candidates in positions $\mathcal{L}$ according to $T_{1}$ to obtain rankings $\{R_1(i,\mathcal{I}_{s,1})\}$ and rerank them within $\mathcal{L}$ to obtain the final list. UniCoRn(0) is less costly because we rescore only the subset of candidates that belong to $P_{1}$ . + +UniCoRn(0)'s implementation: To generate the ranked list of viewees for a viewer, we first obtain the viewer treatment. If the viewer is not allocated to UniCoRn, we score all items using the allocated model (i.e., viewer treatment). This was also the flow prior to UniCoRn. If the viewer is allocated to UniCoRn, we then obtain the viewee treatment allocations for all viewees. The final ranking is obtained thus: (1) Score all items using a control model, (2) Obtain the viewee side treatment assignment for all viewees (i.e., items), (3) Score each viewee with the necessary treatments and blend using the scores (following Algorithm 1). The changes were implemented in Java in our distributed, real-time production serving system with no statistically significant serving latency added by this change. + +Results: Table1 shows viewee side results using $40\%$ of the viewers with UniCoRn(0) for both the candidate generation and ranking change experiments. For each viewee $i$ (dest-member or producer), we compute the response $Y_{i}$ defined as the total count of the metric of interest in the experiment window (e.g., the number of visits in the experiment time window). The “Delta %” in Table1 is the relative percentage difference between the average responses of the treatment and the control viewee + +groups under the UniCoRn(0) design. Both experiments showed a positive change in WAUs and sessions as they brought in more viewees onto the platform. Although the exact measurement fidelity could not be validated without the ground truth, we expected to observe a statistically significant positive impact. This is because we observed in a source-side experiment that the viewers tend to send invitations to more viewees under the treatment model than the control model, indicating a positive impact of the treatment model on the viewees. Note that these source-side measurements can be accurately obtained from a classical A/B testing setup on the viewer-side. + +# 5 Discussion + +A/B testing in social networks and two-sided marketplaces is extremely important to improve the experiences offered to various stakeholders. Our proposed experimentation design mechanism, UniCoRn, allows for high-quality producer side measurement with an explicit parameter to control the cost of the experiment at the expense of accuracy (or quality) loss in the measurement. Our experiment design is provably optimal, and our method has significant advantages over prior approaches: (i) It is agnostic to graph density (unlike, e.g., [15]), (ii) It makes no assumption on how the treatment effect propagates (unlike, e.g., [9]) or how the response depends on the treatment exposure (unlike, e.g., [10]), (iii) It lowers the variance of measurement (unlike, e.g., [3]), and (iii) It does not depend on knowing the graph structure a priori (unlike most existing methods, e.g., [9, 10, 15]). + +Limitations and Future work: Our experiment design framework focuses on capturing the difference in exposure distribution of the producers in the treatment group and the producers in the control group. Hence, the UniCoRn based treatment effect estimates would fail to capture some other types of differences between the treatment and the control. For example, a treatment may have an impact on a viewer's attention (e.g., the amount of time a viewer is spending on each session or the total number of viewer's sessions). This impact would not be captured by the UniCoRn design, where all viewers receive a mix of treatment and control ranking. + +The design accuracy measurement framework based on Definition1 does not directly translate to the accuracy in the producer side treatment effect estimation without additional assumptions on the ranking to response function. We deliberately refrain from making such assumptions to build a more generally applicable experiment accuracy based framework. In the appendix, we discuss some additional assumptions under which the optimality result given in Theorem1 can be extended to the treatment effect estimation problem. An interesting future direction could be to explore other types of loss functions in Definition1 and study their connections with treatment effect estimation accuracy. + +While UniCoRn is designed to measure the producer side effect, sometimes the two sides of a marketplace are the same set of users playing different roles (e.g., a content producer is also a content consumer). In such scenarios, it may be important to measure the combined consumer and producer side effect. Such a measurement can be obtained by having a small set of producers, who are allocated to treatment, have their consumer experience ranked entirely based on that same treatment. This set has to be relatively small since the producer side experience will only be accurate if a large fraction of the consumers are on UniCoRn (instead of pure treatment or pure control). + +A related problem is to balance the power of the measurement (via higher producer side ramps) with the risk (which increases with larger consumer side ramps). Also, our proposed methodology can be extended to multi-partite graphs (i.e., marketplaces with more than two sides, such as food delivery platforms that connect users with drivers with restaurants). Such an extension would depend on the dynamics between the different graph partitions (i.e., entity types in the marketplace). + +# 6 Acknowledgment + +We would like to thank Parag Agarwal, Kinjal Basu, Peter Chng, Albert Cui, Weitao Duan, Akashnil Dutta, Aastha Jain, Aastha Nigam, Smriti Ramakrishnan, Ankan Saha, Rose Tan, Ye Tu and Yan Wang for their support and insightful feedback during the development of this system. We would also like to thank the anonymous reviewers for their helpful comments which has significantly improved the paper. + +Finally, none of the authors received any third-party funding for this submission and there is no competing interest other than LinkedIn Corporation to which all authors are affiliated. + +# References + +[1] P. M. Aronow and J. A. Middleton. A class of unbiased estimators of the average treatment effect in randomized experiments. Journal of Causal Inference, 1(1):135-154, 2013. +[2] G. W. Basse, H. A. Soufiani, and D. Lambert. Randomization and the pernicious effects of limited budgets on auction experiments. In Artificial Intelligence and Statistics, pages 1412-1420. PMLR, 2016. +[3] V. Ha-Thuc, A. Dutta, R. Mao, M. Wood, and Y. Liu. A counterfactual framework for seller-side A/B testing on marketplaces. In Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval (SIGIR 2020), 2020. +[4] P. W. Holland. Statistics and causal inference. Journal of the American statistical Association, 81(396):945-960, 1986. +[5] R. Kohavi, A. Deng, R. Longbotham, and Y. Xu. Seven rules of thumb for web site experimenters. In Proceedings of the 20th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 1857–1866. ACM, 2014. +[6] R. Kohavi and R. Longbotham. Online controlled experiments and A/B testing. Encyclopedia of machine learning and data mining, 7(8):922-929, 2017. +[7] M. Liu, J. Mao, and K. Kang. Trustworthy online marketplace experimentation with budget-split design. arXiv preprint arXiv:2012.08724, 2020. +[8] C. Lo, E. De Longueur, A. Saha, and S. Chatterjee. Edge formation in social networks to nurture content creators. In Proceedings of The Web Conference 2020, pages 1999–2008, 2020. +[9] P. Nandy, K. Basu, S. Chatterjee, and Y. Tu. A/B testing in dense large-scale networks: Design and inference. In Proceedings of the Thirty-fourth Conference on Neural Information Processing Systems (NeurIPS 2020), 2020. +[10] J. Pouget-Abadie, K. Aydin, W. Schudy, K. Brodersen, and V. Mirrokni. Variance reduction in bipartite experiments through correlation clustering. In Advances in Neural Information Processing Systems 32, pages 13309–13319. Curran Associates, Inc., 2019. +[11] D. B. Rubin. Estimating causal effects of treatments in randomized and nonrandomized studies. Journal of educational Psychology, 66(5):688, 1974. +[12] D. B. Rubin. Bayesian inference for causal effects: The role of randomization. The Annals of Statistics, pages 34-58, 1978. +[13] D. B. Rubin. Formal mode of statistical inference for causal effects. Journal of statistical planning and inference, 25(3):279-292, 1990. +[14] G. Saint-Jacques, M. Varshney, J. Simpson, and Y. Xu. Using ego-clusters to measure network effects at LinkedIn. arXiv preprint arXiv:1903.08755, 2019. +[15] G. Saint-Jacques, M. Varshney, J. Simpson, and Y. Xu. Using ego-clusters to measure network effects at LinkedIn. arXiv: 1903.08755, 2019. +[16] D. Tang, A. Agarwal, D. O'Brien, and M. Meyer. Overlapping experiment infrastructure: More, better, faster experimentation. In Proceedings of the 16th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 17-26, 2010. +[17] Y. Tu, C. Lo, Y. Yuan, and S. Chatterjee. Feedback shaping: A modeling approach to nurture content creation. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 2241–2250, 2019. +[18] J. Ugander, B. Karrer, L. Backstrom, and J. Kleinberg. Graph cluster randomization: Network exposure to multiple universes. In Proceedings of the 19th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 329-337, 2013. +[19] Y. Xu, N. Chen, A. Fernandez, O. Sinno, and A. Bhasin. From infrastructure to culture: A/b testing challenges in large scale social networks. In Proceedings of the 21th ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, pages 2227-2236, 2015. + +# 7 Checklist + +1(a) Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope? + +Yes. Please see Sections 3 and 4. + +1(b) Have you read the ethics review guidelines and ensured that your paper conforms to them? + +Yes + +1(c) Did you discuss any potential negative societal impacts of your work? + +N/A + +1(d) Did you describe the limitations of your work? + +Yes. Please see section 5 + +2(a) Did you state the full set of assumptions of all theoretical results? + +Yes. + +2(b) Did you include complete proofs of all theoretical results? + +Yes. Please see the Appendix. + +3(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? + +Yes. All code, data, and instructions needed to reproduce the main experimental results are given in the supplementary materials. + +3(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? + +Yes. The details are given in Section 4 + +3(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? + +Yes. We have shown Box-plots. + +3(d) Did you include the amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? + +Yes. The details are given in Section 4 + +4(a) If your work uses existing assets, did you cite the creators? + +N/A. + +4(b) Did you mention the license of the assets? + +N/A. + +4(c) Did you include any new assets either in the supplemental material or as a URL? + +N/A + +4(d) Did you discuss whether and how consent was obtained from people whose data you're using/curating? + +N/A. + +4(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? + +N/A. + +5(a) Did you include the full text of instructions given to participants and screenshots, if applicable? + +N/A. + +5(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? + +N/A. + +5(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? + +N/A. \ No newline at end of file diff --git a/abtestingforrecommendersystemsinatwosidedmarketplace/images.zip b/abtestingforrecommendersystemsinatwosidedmarketplace/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..97ddb430edb22f8c4567252044aef1011199ca40 --- /dev/null +++ b/abtestingforrecommendersystemsinatwosidedmarketplace/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e29ac37a806ddcf6bd4b4fac393188042e4d0c582b2f3c05329f780dda4c20ec +size 305349 diff --git a/abtestingforrecommendersystemsinatwosidedmarketplace/layout.json b/abtestingforrecommendersystemsinatwosidedmarketplace/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..fed6324a5842c4f27a175644b487f26ce938a2c8 --- /dev/null +++ b/abtestingforrecommendersystemsinatwosidedmarketplace/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:012c2d11242e06b9a79bc485ad85a5aaef3346eb803a9838db8de194a24aab80 +size 594029 diff --git a/acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/e7d48d0a-77c0-4d72-89c3-125c14933553_content_list.json b/acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/e7d48d0a-77c0-4d72-89c3-125c14933553_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..595e769d1a8122dcbd931ae504980785315068b9 --- /dev/null +++ b/acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/e7d48d0a-77c0-4d72-89c3-125c14933553_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e9e467b6a402005746db7efe4b596e982e57e4cd5d79cdd5a573df2dab4d858e +size 85249 diff --git a/acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/e7d48d0a-77c0-4d72-89c3-125c14933553_model.json b/acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/e7d48d0a-77c0-4d72-89c3-125c14933553_model.json new file mode 100644 index 0000000000000000000000000000000000000000..61a3e68d3b39d0ac55a53bd9bcb51ff39f56e049 --- /dev/null +++ b/acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/e7d48d0a-77c0-4d72-89c3-125c14933553_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf55723d8ef68f03ab975b752adda5281c225b3c7e953df2c8e1db0e4c79652a +size 105236 diff --git a/acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/e7d48d0a-77c0-4d72-89c3-125c14933553_origin.pdf b/acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/e7d48d0a-77c0-4d72-89c3-125c14933553_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f3b4f4afa12ffb11b0ffcf79c73e78ec43b22f24 --- /dev/null +++ b/acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/e7d48d0a-77c0-4d72-89c3-125c14933553_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:161ed9410f4453f3fdd9a7d894036723f3b73f07a42d83e0239676440b533cc4 +size 542095 diff --git a/acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/full.md b/acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/full.md new file mode 100644 index 0000000000000000000000000000000000000000..25163e28e2b304e956c863dcccc4ca2f1c317254 --- /dev/null +++ b/acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/full.md @@ -0,0 +1,294 @@ +# AC/DC: Alternating Compressed/DeCompressed Training of Deep Neural Networks + +Alexandra Peste * IST Austria + +Eugenia Iofinova +IST Austria + +Adrian Vladu +CNRS & IRIF + +Dan Alistarh +IST Austria & Neural Magic + +# Abstract + +The increasing computational requirements of deep neural networks (DNNs) have led to significant interest in obtaining DNN models that are sparse, yet accurate. Recent work has investigated the even harder case of sparse training, where the DNN weights are, for as much as possible, already sparse to reduce computational costs during training. Existing sparse training methods are often empirical and can have lower accuracy relative to the dense baseline. In this paper, we present a general approach called Alternating Compressed/DeCompressed (AC/DC) training of DNNs, demonstrate convergence for a variant of the algorithm, and show that AC/DC outperforms existing sparse training methods in accuracy at similar computational budgets; at high sparsity levels, AC/DC even outperforms existing methods that rely on accurate pre-trained dense models. An important property of AC/DC is that it allows co-training of dense and sparse models, yielding accurate sparse-dense model pairs at the end of the training process. This is useful in practice, where compressed variants may be desirable for deployment in resource-constrained settings without re-doing the entire training flow, and also provides us with insights into the accuracy gap between dense and compressed models. The code is available at: https://github.com/IST-DASLab/ACDC. + +# 1 Introduction + +The tremendous progress made by deep neural networks in solving diverse tasks has driven significant research and industry interest in deploying efficient versions of these models. To this end, entire families of model compression methods have been developed, such as pruning [29] and quantization [22], which are now accompanied by hardware and software support [55, 8, 11, 43, 23]. + +Neural network pruning, which is the focus of this paper, is the compression method with arguably the longest history [38]. The basic goal of pruning is to obtain neural networks for which many connections are removed by being set to zero, while maintaining the network's accuracy. A myriad pruning methods have been proposed—please see [29] for an in-depth survey—and it is currently understood that many popular networks can be compressed by more than an order of magnitude, in terms of their number of connections, without significant accuracy loss. + +Many accurate pruning methods require a fully-accurate, dense variant of the model, from which weights are subsequently removed. A shortcoming of this approach is the fact that the memory and computational savings due to compression are only available for the inference, post-training phase, and not during training itself. This distinction becomes important especially for large-scale modern models, which can have millions or even billions of parameters, and for which fully-dense training can have high computational and even non-trivial environmental costs [53]. + +One approach to address this issue is sparse training, which essentially aims to remove connections from the neural network as early as possible during training, while still matching, or at least approximating, the accuracy of the fully-dense model. For example, the RigL technique [16] randomly + +removes a large fraction of connections early in training, and then proceeds to optimize over the sparse support, providing savings due to sparse back-propagation. Periodically, the method re-introduces some of the weights during the training process, based on a combination of heuristics, which requires taking full gradients. These works, as well as many recent sparse training approaches [4, 44, 32], which we cover in detail in the next section, have shown empirically that non-trivial computational savings, usually measured in theoretical FLOPs, can be obtained using sparse training, and that the optimization process can be fairly robust to sparsification of the support. + +At the same time, this line of work still leaves intriguing open questions. The first is theoretical: to our knowledge, none of the methods optimizing over sparse support, and hence providing training speed-up, have been shown to have convergence guarantees. The second is practical, and concerns a deeper understanding of the relationship between the densely-trained model, and the sparsely-trained one. Specifically, (1) most existing sparse training methods still leave a non-negligible accuracy gap, relative to dense training, or even post-training sparsification; and (2) most existing work on sparsity requires significant changes to the training flow, and focuses on maximizing global accuracy metrics; thus, we lack understanding when it comes to co-training sparse and dense models, as well as with respect to correlations between sparse and dense models at the level of individual predictions. + +Contributions. In this paper, we take a step towards addressing these questions. We investigate a general hybrid approach for sparse training of neural networks, which we call Alternating Compressed / DeCompressed (AC/DC) training. AC/DC performs co-training of sparse and dense models, and can return both an accurate sparse model, and a dense model, which can recover the dense baseline accuracy via fine-tuning. We show that a variant of AC/DC ensures convergence for general nonconvex but smooth objectives, under analytic assumptions. Extensive experimental results show that it provides state-of-the-art accuracy among sparse training techniques at comparable training budgets, and can even outperform post-training sparsification approaches when applied at high sparsities. + +AC/DC builds on the classic iterative hard thresholding (IHT) family of methods for sparse recovery [6]. As the name suggests, AC/DC works by alternating the standard dense training phases with sparse phases where optimization is performed exclusively over a fixed sparse support, and a subset of the weights and their gradients are fixed at zero, leading to computational savings. (This is in contrast to error feedback algorithms, e.g. [9, 40] which require computing fully-dense gradients, even though the weights themselves may be sparse.) The process uses the same hyper-parameters, including the number of epochs, as regular training, and the frequency and length of the phases can be safely set to standard values, e.g. 5–10 epochs. We ensure that training ends on a sparse phase, and return the resulting sparse model, as well as the last dense model obtained at the end of a dense phase. This dense model may be additionally fine-tuned for a short period, leading to a more accurate dense-finetuned model, which we usually find to match the accuracy of the dense baseline. + +We emphasize that algorithms alternating sparse and dense training phases for deep neural networks have been previously investigated [33, 25], but with the different goal on using sparsity as a regularizer to obtain more accurate dense models. Relative to these works, our goals are two-fold: we aim to produce highly-accurate, highly-sparse models, but also to maximize the fraction of training time for which optimization is performed over a sparse support, leading to computational savings. Further, we are the first to provide convergence guarantees for variants of this approach. + +We perform an extensive empirical investigation, showing that AC/DC provides consistently good results on a wide range of models and tasks (ResNet [28] and MobileNets [30] on the ImageNet [49] / CIFAR [36] datasets, and Transformers [56, 10] on WikiText [42]), under standard values of the training hyper-parameters. Specifically, when executed on the same number of training epochs, our method outperforms all previous sparse training methods in terms of the accuracy of the resulting sparse model, often by significant margins. This comes at the cost of slightly higher theoretical computational cost relative to prior sparse training methods, although AC/DC usually reduces training FLOPs to $45 - 65\%$ of the dense baseline. AC/DC is also close to the accuracy of state-of-the-art posttraining pruning methods [37, 52] at medium sparsities $(80\%$ and $90\%)$ ; surprisingly, it outperforms them in terms of accuracy, at higher sparsities. In addition, AC/DC is flexible with respect to the structure of the "sparse projection" applied at each compressed step: we illustrate this by obtaining semi-structured pruned models using the 2:4 sparsity pattern efficiently supported by new NVIDIA hardware [43]. Further, we show that the resulting sparse models can provide significant real-world speedups for DNN inference on CPUs [12]. + +An interesting feature of AC/DC is that it allows for accurate dense/sparse co-training of models. Specifically, at medium sparsity levels (80% and 90%), the method allows the co-trained dense + +model to recover the dense baseline accuracy via a short fine-tuning period. In addition, dense/sparse co-training provides us with a lens into the training dynamics, in particular relative to the sample-level accuracy of the two models, but also in terms of the dynamics of the sparsity masks. Specifically, we observe that co-trained sparse/dense pairs have higher sample-level agreement than sparse/dense pairs obtained via post-training pruning, and that weight masks still change later in training. + +Additionally, we probe the accuracy differences between sparse and dense models, by examining their "memorization" capacity [60]. For this, we perform dense/sparse co-training in a setting where a small number of valid training samples have corrupted labels, and examine how these samples are classified during dense and sparse phases, respectively. We observe that the sparse model is less able to "memorize" the corrupted labels, and instead often classifies the corrupted samples to their true (correct) class. By contrast, during dense phases model can easily "memorize" the corrupted labels. (Please see Figure 2b for an illustration.) This suggests that one reason for the higher accuracy of dense models is their ability to "memorize" hard-to-classify samples. + +# 2 Related Work + +There has recently been tremendous research interest into pruning techniques for DNNs; we direct the reader to the recent surveys of [21] and [29] for a more comprehensive overview. Roughly, most DNN pruning methods can be split as (1) post-training pruning methods, which start from an accurate dense baseline, and remove weights, followed by fine-tuning; and (2) sparse training methods, which perform weight removal during the training process itself. (Other categories such as data-free pruning methods [39, 54] exist, but they are beyond our scope.) We focus on sparse training, although we will also compare against state-of-the-art post-training methods. + +Arguably, the most popular metric for weight removal is weight magnitude [24, 26, 62]. Better-performing approaches exist, such as second-order metrics [38, 27, 14, 52], or Bayesian approaches [46], but they tend to have higher computational and implementation cost. + +The general goal of sparse training methods is to perform both the forward (inference) pass and the backpropagation pass over a sparse support, leading to computational gains during the training process as well. One of the first approaches to maintain sparsity throughout training was Deep Rewiring [4], where SGD steps applied to positive weights are augmented with random walks in parameter space, followed by inactivating negative weights. To maintain sparsity throughout training, randomly chosen inactive connections are re-introduced in the "growth" phase. Sparse Evolutionary Training (SET) [44] introduces a non-uniform sparsity distribution across layers, which scales with the number of input and output channels, and trains sparse networks by pruning weights with smallest magnitude and re-introducing some weights randomly. RigL [16] prunes weights at random after a warm-up period, and then periodically performs weight re-introduction using a combination of connectivity- and gradient-based statistics, which require periodically evaluating full gradients. RigL can lead to state-of-the-art accuracy results even compared to post-training methods; however, to achieve high accuracy it requires significant additional data passes (e.g. 5x) relative to the dense baseline. Top-KAST [32] alleviated the drawback of periodically having to evaluate dense gradients by updating the sparsity masks using gradients of reduced sparsity relative to the weight sparsity. The latter two methods set the state-of-the-art for sparse training: when executing for the same number of epochs as the dense baseline, they provide computational reductions the order of 2x, while the accuracy of the resulting sparse models is lower than that of leading post-training methods, executed at the same sparsity levels. To our knowledge, none of these methods have convergence guarantees. + +Another approach towards faster training is training sparse networks from scratch. The masks are updated by continuously pruning and re-introducing weights. For example, [40] uses magnitude pruning after applying SGD on the dense network, whereas [13] update the masks by re-introducing weights with the highest gradient momentum. STR [37] learns a separate pruning threshold for each layer and allows sparsity both during forward and backward passes; however, the desired sparsity can not be explicitly imposed, and the network has low sparsity for a large portion of training. These methods can lead to only limited computational gains, since they either require dense gradients, or the sparsity level cannot be imposed. By comparison, our method provides models of similar or better accuracy at the same sparsity, with computational reductions. We also obtain dense models that match the baseline accuracy, with a fraction of the baseline FLOPs. + +The idea of alternating sparse and dense training phases has been examined before in the context of neural networks, but with the goal of using temporary sparsification as a regularizer. Specifically, + +Dense-Sparse-Dense (DSD) [25] proposes to first train a dense model to full accuracy; this model is then sparsified via magnitude; next, optimization is performed over the sparse support, followed by an additional optimization phase over the full dense support. Thus, this process is used as a regularization mechanism for the dense model, which results in relatively small, but consistent accuracy improvements relative to the original dense model. In [33], the authors propose a similar approach to DSD, but alternate sparse phases during the regular training process. The resulting process is similar to AC/DC, but, importantly, the goal of their procedure is to return a more accurate dense model. (Please see their Algorithm 1.) For this, the authors use relatively low sparsity levels, and gradually increase sparsity during optimization; they observe accuracy improvements for the resulting dense models, at the cost of increasing the total number of epochs of training. By contrast, our focus is on obtaining accurate sparse models, while reducing computational cost, and executing the dense training recipe. We execute at higher sparsity levels, and on larger-scale datasets and models. In addition, we also show that the method works for other sparsity patterns, e.g. the 2:4 semi-structured pattern [43]. + +More broadly, the Lottery Ticket Hypothesis (LTH) [19] states that sparse networks can be trained in isolation from scratch to the same performance as a post-training pruning baseline, by starting from the "right" weight and sparsity mask initializations, optimizing only over this sparse support. However, initializations usually require the availability of the fully-trained dense model, falling under post-training methods. There is still active research on replicating these intriguing findings to large-scale models and datasets [21, 20]. Previous work [21, 62] have studied progressive sparsification during regular training, which may also achieve training time speed-up, after a sufficient sparsity level has been achieved. However, AC/DC generally achieves a better trade-off between validation accuracy and training time speed-up, compared to these methods. + +Parallel work by [45] investigates a related approach, but focusing on low-rank decompositions for Transformer models. Both their analytical approach and their application domain are different to the ones of the current work. + +# 3 Alternating Compressed / DeCompressed (AC/DC) Training + +# 3.1 Background and Assumptions + +Obtaining sparse solutions to optimization problems is a problem of interest in several areas [7, 6, 17], where the goal is to minimize a function $f: \mathbb{R}^N \to \mathbb{R}$ under sparsity constraints: + +$$ +\min _ {\theta \in \mathbb {R} ^ {N}} f (\theta) \quad \text {s . t .} \quad \| \theta \| _ {0} \leq k. \tag {1} +$$ + +For the case of $\ell_2$ regression, $f(\theta) = \| b - A\theta \| _2^2$ , a solution has been provided by Blumensath and Davies [6], known as the Iterative Hard Thresholding (IHT) algorithm, and subsequent work [17, 18, 58] provided theoretical guarantees for the linear operators used in compressed sensing. The idea consists of alternating gradient descent (GD) steps and applications of a thresholding operator to ensure the $\ell_0$ constraint is satisfied. More precisely, $T_{k}$ is defined as the "top-k" operator, which keeps the largest $k$ entries of a vector $\theta$ in absolute value, and replaces the rest with 0. The IHT update at step $t + 1$ has the following form: + +$$ +\theta_ {t + 1} = T _ {k} \left(\theta_ {t} - \eta \nabla f \left(\theta_ {t}\right)\right). \tag {2} +$$ + +Most convergence results for IHT assume deterministic gradient descent steps. For DNNs, stochastic methods are preferred, so we describe and analyze a stochastic version of IHT. + +Stochastic IHT. We consider functions $f: \mathbb{R}^N \to \mathbb{R}$ , for which we can compute stochastic gradients $g_{\theta}$ , which are unbiased estimators of the true gradient $\nabla f(\theta)$ . Define the stochastic IHT update as: + +$$ +\theta_ {t + 1} = T _ {k} \left(\theta_ {t} - \eta g _ {\theta_ {t}}\right). \tag {3} +$$ + +This formulation covers the practical case where the stochastic gradient $g_{\theta}$ corresponds to a mini-batch stochastic gradient. Indeed, as in practice $f$ takes the form $f(\theta) = \frac{1}{m}\sum_{i=1}^{m}f(\theta ;x_i)$ , where $S = \{x_1,\dots,x_m\}$ are data samples, the stochastic gradients obtained via backpropagation take the form $\frac{1}{|B|}\sum_{i\in B}\nabla f(\theta ;x_i)$ , where $B$ is a sampled mini-batch. We aim to prove strong convergence bounds for stochastic IHT, under common assumptions that arise in the context of training DNNs. + +Analytical Assumptions. Formally, our analysis uses the following assumptions on $f$ . + +![](images/c8dd9e08112281a2e3b2a6bdab1a044ebbed46f3ce81012f65fd8223057a8be3.jpg) +Figure 1: The AC/DC training process. After a short warmup we alternatively prune to maximum sparsity and restore the pruned weights. The plot shows the sparsity and validation accuracy throughout the process for a sample run on ResNet50/ImageNet at $90\%$ sparsity. + +1) Unbiased gradients with variance $\sigma$ : $\mathbb{E}[g_{\theta}|\theta] = \nabla f(\theta)$ , and $\mathbb{E}[\| g_{\theta} - \nabla f(\theta)\|^2] \leq \sigma^2$ . +2) Existence of a $k^*$ -sparse minimizer $\theta^{*}\colon \exists \theta^{*}\in \arg \min_{\theta}f(\theta)$ , s.t. $\| \theta^{*}\|_{0}\leq k^{*}$ . +3) For $\beta > 0$ , the $\beta$ -smoothness condition when restricted to $t$ coordinates $((t, \beta)$ -smoothness): + +$$ +f (\theta + \delta) \leq f (\theta) + \nabla f (\theta) ^ {\top} \delta + \frac {\beta}{2} \| \delta \| ^ {2}, \text {f o r a l l} \theta , \delta \text {s . t .} \| \delta \| _ {0} \leq t. \tag {4} +$$ + +4) For $\alpha > 0$ and number of indices $r$ , the $r$ -concentrated Polyak-Lojasiewicz $((r, \alpha)$ -CPL condition: + +$$ +\left\| T _ {r} (\nabla f (\theta)) \right\| \geq \frac {\alpha}{2} (f (\theta) - f \left(\theta^ {*}\right)), \text {f o r a l l} \theta . \tag {5} +$$ + +The first assumption is standard in stochastic optimization, while the existence of very sparse minimizers is a known property in over-parametrized DNNs [19], and is the very premise of our study. Smoothness is also a standard assumption, e.g. [40]—we only require it along sparse directions, which is a strictly weaker assumption. The more interesting requirement for our convergence proof is the $(r,\alpha)$ -CPL condition in Equation (5), which we now discuss in detail. + +The standard Polyak-Lojasiewicz (PL) condition [34] is common in non-convex optimization, and versions of it are essential in the analysis of DNN training [41, 2]. Its standard form states that small gradient norm, i.e. approximate stationarity, implies closeness to optimum in function value. We require a slightly stronger version, in terms of the norm of the gradient contributed by its largest coordinates in absolute value. This restriction appears necessary for the success of IHT methods, as the sparsity enforced by the truncation step automatically reduces the progress ensured by a gradient step to an amount proportional to the norm of the top- $k$ gradient entries. This strengthening of the PL condition is supported both theoretically, by the mean-field view, which argues that gradients are sub-gaussian [50], and by empirical validations of this behaviour [1, 51]. + +We are now ready to state our main analytical result. + +Theorem 1. Let $f: \mathbb{R}^N \to \mathbb{R}$ be a function with a $k^*$ -sparse minimizer $\theta^*$ . Let $\beta > \alpha > 0$ be parameters, let $k = C \cdot k^* \cdot (\beta / \alpha)^2$ for some appropriately chosen constant $C$ , and suppose that $f$ is $(2k + 3k^*, \beta)$ -smooth and $(k^*, \alpha)$ -CPL. For initial parameters $\theta_0$ and precision $\epsilon > 0$ , given access to stochastic gradients with variance $\sigma$ , stochastic IHT (3) converges in $O\left(\frac{\beta}{\alpha} \cdot \ln \frac{f(\theta_0) - f(\theta^*)}{\epsilon}\right)$ iterations to a point $\theta$ with $\| \theta \|_0 \leq k$ , such that + +$$ +\mathbb {E} \left[ f \left(\theta\right) - f \left(\theta^ {*}\right) \right] \leq \epsilon + \frac {1 6 \sigma^ {2}}{\alpha}. +$$ + +Assuming a fixed objective function $f$ and tolerance $\epsilon$ , we can obtain lower loss and faster running time by either increasing the support $k$ demanded from our approximate minimizer $\theta$ relative to the optimal $k^*$ , or by reducing the gradient variance. We provide a complete proof of this result in the Supplementary Material. Our analysis approach also works in the absence of the CPL condition (Theorem 3), in which case we prove that a version of the algorithm can find sparse nearly-stationary points. As a bonus, we also simplify existing analyses for IHT and extend them to the stochastic case (Theorem 2). Another interpretation of our results is in showing that, under our assumptions, error feedback [40] is not necessary for recovering good sparse minimizers; this has practical implications, as it allows us to perform fully-sparse back-propagation in sparse optimization phases. Next, we discuss our practical implementation, and its connection to these theoretical results. + +Algorithm 1 Alternating Compressed/Decompressed (AC/DC) Training +Require: Weights $\theta \in \mathbb{R}^N$ , data $S$ , sparsity $k$ , compression phases $\mathcal{C}$ , decompression phases $\mathcal{D}$ +1: Train the weights $\theta$ for $\Delta_w$ epochs +2: while epoch $\leq$ max epochs do +3: if entered a compression phase then +4: $\theta \gets T_k(\theta, k)$ +5: $m \gets 11[\theta_i \neq 0]$ +6: end if +7: if entered a decompression phase then +8: $m \gets 11_N$ +9: end if +10: $\theta \gets \theta \odot m$ +11: $\tilde{\theta} \gets \{\theta_i | m_i \neq 0, 1 \leq i \leq N\}$ +12: for x mini-batch in $S$ do +13: $\theta \gets \theta - \eta \nabla_{\tilde{\theta}} f(\theta; x)$ +14: end for +15: epoch $\leftarrow$ epoch +1 +16: end while +17: return $\theta$ + +# 3.2 AC/DC: Applying IHT to Deep Neural Networks + +AC/DC starts from a standard DNN training flow, using standard optimizers such as SGD with momentum [48] or Adam [35], and it preserves all standard training hyper-parameters. It will only periodically modify the support for optimization. Please see Algorithm 1 for pseudocode. + +We partition the set of training epochs into compressed epochs $\mathcal{C}$ , and decompressed epochs $\mathcal{D}$ . We begin with a dense warm-up period of $\Delta_w$ consecutive epochs, during which regular dense (decompressed) training is performed. We then start alternating compressed optimization phases of length $\Delta_c$ epochs each, with decompressed (regular) optimization phases of length $\Delta_d$ epochs each. The process completes on a compressed fine-tuning phase, returning an accurate sparse model. Alternatively, if our goal is to return a dense model matching the baseline accuracy, we take the best dense checkpoint obtained during alternation, and fine-tune it over the entire support. In practice, we noticed that allowing a longer final decompressed phase of length $\Delta_D > \Delta_d$ improves the performance of the dense model, by allowing it to better recover the baseline accuracy after fine-tuning. Please see Figure 1 for an illustration of the schedule. + +In our experiments, we focus on the case where the compression operation is unstructured or semi-structured pruning. In this case, at the beginning of each sparse optimization phase, we apply the top-k operator across all of the network weights to obtain a mask $M$ over the weights $\theta$ . The top-k operator is applied globally across all of the network weights, and will represent the sparse support over which optimization will be performed for the rest of the current sparse phase. At the end of the sparse phase, the mask $M$ is reset to all-1s, so that the subsequent dense phase will optimize over the full dense support. Furthermore, once all weights are re-introduced, it is beneficial to reset to 0 the gradient momentum term of the optimizer; this is particularly useful for the weights that were previously pruned, which would otherwise have stale versions of gradients. + +Discussion. Moving from IHT to a robust implementation in the context of DNNs required some adjustments. First, each decompressed phase can be directly mapped to a deterministic/stochastic IHT step, where, instead of a single gradient step in between consecutive truncations of the support, we perform several stochastic steps. These additional steps improve the accuracy of the method in practice, and we can bound their influence in theory as well, although they do not necessarily provide better bounds. This leaves open the interpretation of the compressed phases: for this, notice that the core of the proof for Theorem 1 is in showing that a single IHT step significantly decreases the expected value of the objective; using a similar argument, we can prove that additional optimization steps over the sparse support can only improve convergence. Additionally, we show convergence for a variant of IHT closely following AC/DC (please see Corollary 1 in the Supplementary Material), but the bounds do not improve over Theorem 1. However, this additional result confirms that the good experimental results obtained with AC/DC are theoretically motivated. + +# 4 Experimental Validation + +Goals and Setup. We tested AC/DC on image classification tasks (CIFAR-100 [36] and ImageNet [49]) and on language modelling tasks [42] using the Transformer-XL model [10]. The goal is to examine the validation accuracy of the resulting sparse and dense models, versus the induced sparsity, as well as the number of FLOPs used for training and inference, relative to other sparse training methods. Additionally, we compare to state-of-the-art post-training pruning methods [52]. We also examine prediction differences between the sparse and dense models. We use PyTorch [47] for our implementation, Weights & Biases [5] for experimental tracking, and NVIDIA GPUs for training. All reported image classification experiments were performed in triplicate by varying the random seed; we report mean and standard deviation. Due to computational limitations, the language modelling experiments were conducted in a single run. + +ImageNet Experiments. On the ImageNet dataset [49], we test AC/DC on ResNet50 [28] and MobileNetV1 [30]. In all reported results, the models were trained for a fixed number of 100 epochs, using SGD with momentum. We use a cosine learning rate scheduler and training hyper-parameters following [37], but without label smoothing. The models were trained and evaluated using mixed precision (FP16). On a small subset of experiments, we noticed differences in accuracy of up to $0.2 - 0.3\%$ between AC/DC trained with full or mixed precision. However, the differences in evaluating the models with FP32 or FP16 are negligible (less than $0.05\%$ ). Our dense ResNet50 baseline has $76.84\%$ validation accuracy. Unless otherwise specified, weights are pruned globally, based on their magnitude and in a single step. Similar to previous work, we did not prune biases, nor the Batch Normalization parameters. The sparsity level is computed with respect to all the parameters, except the biases and Batch Normalization parameters and this is consistent with previous work [16, 52]. + +For all results, the AC/DC training schedule starts with a "warm-up" phase of dense training for 10 epochs, after which we alternate between compression and de-compression every 5 epochs, until the last dense and sparse phase. It is beneficial to allow these last two "fine-tuning" phases to run longer: the last decompression phase runs for 10 epochs, whereas the final 15 epochs are the compression fine-tuning phase. We reset SGD momentum at the beginning of every decompression phase. In total, we have an equal number of epochs of dense and sparse training; see Figure (2a) for an illustration. We use exactly the same setup for both ResNet50 and MobileNetV1 models, which resulted in high-quality sparse models. To recover a dense model with baseline accuracy using AC/DC, we finetune the best dense checkpoint obtained during training; practically, this replaces the last sparse fine-tuning phase with a phase where the dense model is fine-tuned instead. + +Table 1: ResNet50/ImageNet, medium sparsity results. + +
MethodSparsity (%)Top-1 Acc. (%)GFLOPs InferenceEFLOPs Train
Dense076.848.23.14
\( AC/DC \)8076.3 ± 0.10.29×0.65×
\( RigL_{1×} \)8074.6 ± 0.060.23×0.23×
\( RigL_{1×} (ERK) \)8075.1 ± 0.050.42×0.42×
Top-KAST80 fwd, 50 bwd75.030.23×0.32×
STR79.5576.190.19×-
WoodFisher8076.760.25×-
\( AC/DC \)9075.03 ± 0.10.18×0.58×
\( RigL_{1×} \)9072.0 ± 0.050.13×0.13×
\( RigL_{1×} (ERK) \)9073.0 ± 0.040.24×0.25×
Top-KAST90 fwd, 80 bwd74.760.13×0.16×
STR90.2374.310.08×-
WoodFisher9075.210.15×-
+ +Table 2: ResNet50/ImageNet, high sparsity results. + +
MethodSparsity (%)Top-1 Acc. (%)GFLOPs InferenceEFLOPs Train
Dense076.848.23.14
\( AC/DC \)9573.14 ± 0.20.11×0.53×
\( RigL_{1×} \)9567.5 ± 0.10.08×0.08×
\( RigL_{1×} (ERK) \)9569.7 ± 0.170.12×0.13×
Top-KAST95 fwd, 50 bwd71.960.08×0.22×
STR94.870.970.04×-
WoodFisher9572.120.09×-
\( AC/DC \)9868.44 ± 0.090.06×0.46×
Top-KAST98 fwd, 90 bwd67.060.05×0.08×
STR97.7862.840.02×-
WoodFisher9865.550.05×-
+ +ResNet50 Results. Tables 1& 2 contain the validation accuracy results across medium and high global sparsity levels, as well as inference and training FLOPs. Overall, AC/DC achieves higher validation accuracy than any of the state-of-the-art sparse training methods, when using the same number of epochs. At the same time, due to dense training phases, AC/DC has higher FLOP requirements relative to RigL or Top-KAST at the same sparsity. At medium sparsities (80% and 90%), AC/DC sparse models are slightly less accurate than the state-of-the-art post-training methods (e.g. WoodFisher), by small margins. The situation is reversed at higher sparsities, where AC/DC produces more accurate models: the gap to the second-best methods (WoodFisher / Top-KAST) is of more than 1% at 95% and 98% sparsity. + +Of the existing sparse training methods, Top-KAST is closest in terms of validation accuracy to our sparse model, at $90\%$ sparsity. However, Top-KAST does not prune the first and last layers, + +Figure 2: Accuracy vs. sparsity during training, for the ResNet50/ImageNet experiment (left) and accuracy on the corrupted samples for ResNet20/CIFAR10, w.r.t. the true class (right). +![](images/7aeee93635e16696095026d90a4aa0e602b0e332ef81b2790fb25c9dd3872a5a.jpg) +(a) Sparsity pattern and validation accuracy vs. number (b) Percentage of samples with corrupted training labels of epochs (ResNet50/ImageNet). classified to their true class (ResNet20/CIFAR10). + +![](images/55811c40df9e67abc8607954d896266cebbe4f56db1b03d427829c7bb0330a29.jpg) + +whereas the results in the tables do not restrict the sparsity pattern. For fairness, we executed AC/DC using the same layer-wise sparsity distribution as Top-KAST, for both uniform and global magnitude pruning. For $90\%$ global pruning, results for AC/DC improved; the best sparse model reached $75.64\%$ validation accuracy (0.6% increase over Table 1), while the best dense model had $76.85\%$ after fine-tuning. For uniform sparsity, our results were very similar: $75.04\%$ validation accuracy for the sparse model and $76.43\%$ - for the fine-tuned dense model. We also note that Top-KAST has better results at $98\%$ when increasing the number of training epochs 2 times, and considerably fewer training FLOPs (e.g. $15\%$ of the dense FLOPs). For fairness, we compared against all methods on a fixed number of 100 training epochs and we additionally trained AC/DC at high sparsity without pruning the first and last layers. Our results improved to $74.16\%$ accuracy for $95\%$ sparsity, and $71.27\%$ for $98\%$ sparsity, both surpassing Top-KAST with prolonged training. We provide a more detailed comparison in the Supplementary Material, which also contains results on CIFAR-100. + +An advantage of AC/DC is that it provides both sparse and dense models at cost below that of a single dense training run. For medium sparsity, the accuracy of the dense-finetuned model is very close to the dense baseline. Concretely, at $90\%$ sparsity, with $58\%$ of the total (theoretical) baseline training FLOPs, we obtain a sparse model which is close to state of the art; in addition, by fine-tuning the best dense model, we obtain a dense model with $76.56\%$ (average) validation accuracy. The whole process takes at most $73\%$ of the baseline training FLOPs. In general, for $80\%$ and $90\%$ target sparsity, the dense models derived from AC/DC are able to recover the baseline accuracy, after finetuning, defined by replacing the final compression phase with regular dense training. The complete results are presented in the Supplementary Material, in Table 6. + +The sparsity distribution over layers does not change dramatically during training; yet, the dynamic of the masks has an important impact on the performance of AC/DC. Specifically, we observed that masks update over time, although the change between consecutive sparse masks decreases. Furthermore, a small percentage of the weights remain fixed at 0 even during dense training, which is explained by filters that are pruned away during the compressed phases. Please see the Supplementary Material for additional results and analysis. + +We additionally compare AC/DC with Top-KAST and RigL, in terms of the validation accuracy achieved depending on the number of training FLOPs. We report results at uniform sparsity, which ensures that the inference FLOPs will be the same for all methods considered. For AC/DC and Top-KAST, the first and last layers are kept dense, whereas for RigL, only the first layer is kept dense; however, this has a negligible impact on the number of FLOPs. Additionally, we experiment with extending the number of training iterations for AC/DC at $90\%$ and $95\%$ sparsity two times, similarly to Top-KAST and RigL which also provide experiments for extended training. The comparison between AC/DC, Top-KAST and RigL presented in Figure 3 shows that AC/DC is similar or surpasses Top-KAST 2x at $90\%$ and $95\%$ sparsity, and RigL 5x at $95\%$ sparsity both in terms of training FLOPs and validation accuracy. Moreover, we highlight that extending the number of training iterations two times results in AC/DC models with uniform sparsity that surpass all existing methods at both $90\%$ and $95\%$ sparsity; namely, we obtain $76.1\%$ and $74.3\%$ validation accuracy with $90\%$ and $95\%$ uniform sparsity, respectively. + +Compared to purely sparse training methods, such as Top-KAST or RigL, AC/DC requires dense training phases. The length of the dense phases can be decreased, with a small impact on the accuracy of the sparse model. Specifically, we use dense phases of two instead of five epochs in length, and we + +![](images/553c4844f9d475128ea17179d842f21cca85ad702a5277c759926334f941cf21.jpg) +Figure 3: Training FLOPs vs validation accuracy for AC/DC, RigL and Top-KAST, with uniform sparsity, at $90\%$ and $95\%$ sparsity levels. (ResNet50/ImageNet). + +![](images/ca758f3724162aaca00605d0d2081536fcc32e1921e8d130e2a6618ce9febca5.jpg) + +no longer extend the final decompressed phase prior to the finetuning phase. For $90\%$ global sparsity, this resulted in $74.6\%$ validation accuracy for the sparse model, using $44\%$ of the baseline FLOPs. Similarly, for uniform sparsity, we obtain $74.7\%$ accuracy on the $90\%$ sparse model, with $40\%$ of the baseline FLOPs; this value can be further improved to $75.8\%$ validation accuracy when extending two times the number of training iterations. Furthermore, at $95\%$ uniform sparsity, we reach $72.8\%$ accuracy with $35\%$ of the baseline training FLOPs. + +MobileNet Results. We perform the same experiment, using exactly the same setup, on the MobileNetV1 architecture [30], which is compact and thus harder to compress. On a training budget of 100 epochs, our method finds sparse models with higher Top-1 validation accuracy than existing sparse- and post-training methods, on both $75\%$ and $90\%$ sparsity levels (Table 3). Importantly, AC/DC uses exactly the same hyper-parameters used for training the dense baseline [37]. Similar to ResNet50, at $75\%$ sparsity, the dense-finetuned model recovers the baseline performance, while for $90\%$ it is less than $1\%$ below the baseline. The only method which obtains higher accuracy for the same sparsity is the version of RigL [16] which executes for 5x more training epochs than the dense baseline. However, this version also uses more computation than the dense model. We limit ourselves to a fixed number of 100 epochs, the same used to train the dense baseline, which would allow for savings in training time. Moreover, RigL does not prune the first layer and the depth-wise convolutions, whereas for the results reported we do not impose any sparsity restrictions. Overall, we found that keeping these layers dense improved our results on $90\%$ sparsity by almost $0.5\%$ . Then, our results are quite close to $\mathrm{RigL}_{2\times}$ , with half the training epochs, and less training FLOPs. We provide a more detailed comparison in the Supplementary Material. + +Table 3: MobileNetV1/ImageNet sparsity results + +
MethodSparsity (%)Top-1 Acc. (%)GFLOPs InferenceEFLOPs Train
Dense071.781.10.44
AC/DC7570.3 ± 0.070.34×0.64×
RigL1× (ERK)7568.390.52×0.53×
STR75.2868.350.18×-
WoodFisher75.2870.090.28×-
AC/DC9066.08 ± 0.090.18×0.56×
RigL1× (ERK)9063.580.27×0.29×
STR89.0162.10.07×-
WoodFisher8963.87--
+ +Table 4: Transformer-XL/WikiText sparsity results + +
MethodSparsity (%)Perplexity SparsePerplexity DensePerplexity Finetuned Dense
Dense0-18.95-
AC/DC8020.6520.2419.54
AC/DC80, 50 embed.20.8320.2519.68
Top-KAST80, 0 bwd19.8--
Top-KAST80, 60 bwd21.3--
AC/DC9022.3221.020.28
AC/DC90, 50 embed.22.8421.3420.41
Top-KAST90, 80 bwd25.1--
+ +Semi-structured Sparsity. We also experiment with the recent 2:4 sparsity pattern (2 weights out of each block of 4 are zero) proposed by NVIDIA, which ensures inference speedups on the Ampere architecture. Recently, [43] showed that accuracy can be preserved under this pattern, by re-doing the entire training flow. Also, [61] proposed more general N:M structures, together with a method for training such sparse models from scratch. We applied AC/DC to the 2:4 pattern, performing training from scratch and obtained sparse models with $76.64\% \pm 0.05$ validation accuracy, i.e. slightly below the baseline. Furthermore, the dense-finetuned model fully recovers the baseline performance $(76.85\%$ accuracy). We additionally experiment with using AC/DC with global pruning at $50\%$ ; in this case we obtain sparse models that slightly improve the baseline accuracy to $77.05\%$ . This confirms our intuition that AC/DC can act as a regularizer, similarly to [25]. + +Language Modeling. Next, we apply AC/DC to compressing NLP models. We use Transformer-XL [10], on the WikiText-103 dataset [42], with the standard model configuration with 18 layers and 285M parameters, trained using the Lamb optimizer [57] and standard hyper-parameters, which we + +describe in the Supplementary Material. The same Transformer-XL model trained on WikiText-103 was used in Top-KAST [32], which allows a direct comparison. Similar to Top-KAST, we did not prune the embedding layers, as this greatly affects the quality, without reducing computational cost. (For completeness, we do provide results when embeddings are pruned to $50\%$ sparsity.) Our sparse training configuration consists in starting with a dense warm-up phase of 5 epochs, followed by alternating between compression and decompression phases every 3 epochs; we follow with a longer decompression phase between epochs 33-39, and end with a compression phase between epochs 40-48. The results are shown in Table 4. Relative to Top-KAST, our approach provides significantly improved test perplexity at $90\%$ sparsity, as well as better results at $80\%$ sparsity with sparse back-propagation. The results confirm that AC/DC is scalable and extensible. We note that our hyper-parameter tuning for this experiment was minimal. + +Output Analysis. Finally, we probe the accuracy difference between the sparse and dense-finetuned models. We first examined sample-level agreement between sparse and dense-finetuned pairs produced by AC/DC, relative to model pairs produced by gradual magnitude pruning (GMP). Co-trained model pairs consistently agree on more samples relative to GMP: for example, on the $80\%$ -pruned ResNet50 model, the AC/DC model pair agrees on the Top-1 classification of $90\%$ of validation samples, whereas the GMP models agree on $86\%$ of the samples. The differences are better seen in terms of validation error $(10\%$ versus $14\%)$ , which indicate that the dense baseline and GMP model disagree on $40\%$ more samples compared to the AC/DC models. A similar trend holds for the cross-entropy between model outputs. This is a potentially useful side-effect of the method; for example, in constrained environments where sparse models are needed, it is important to estimate their similarity to the dense ones. + +Second, we analyze differences in "memorization" capacity [60] between dense and sparse models. For this, we apply AC/DC to ResNet20 trained on a variant of CIFAR-10 where a subset of 1000 samples have randomly corrupted class labels, and examine the accuracy on these samples during training. We consider $90\%$ and $95\%$ sparsity AC/DC runs. Figure 2b shows the results, when the accuracy for each sample is measured with respect to the true, un-corrupted label. During early training and during sparse phases, the network tends to classify corrupted samples to their true class, "ignoring" label corruption. However, as training progresses, due to dense training phases and lower learning rate, networks tend to "memorize" these samples, assigning them to their corrupted class. This phenomenon is even more prevalent at $95\%$ sparsity, where the network is less capable of memorization. We discuss this finding in more detail in the Supplementary Material. + +Practical Speedups. One remaining question regards the potential of sparsity to provide real-world speedups. While this is an active research area, e.g. [15], we partially address this concern in the Supplementary Material, by showing inference speedups for our models on a CPU inference platform supporting unstructured sparsity [12]: for example, our $90\%$ sparse ResNet50 model provides 1.75x speedup for real-time inference (batch-size 1) on a resource-constrained processor with 4 cores, and 2.75x speedup on 16 cores at batch size 64, versus the dense model. + +# 5 Conclusion, Limitations, and Future Work + +We introduced AC/DC—a method for co-training sparse and dense models, with theoretical guarantees. Experimental results show that AC/DC improves upon the accuracy of previous sparse training methods, and obtains state-of-the-art results at high sparsities. Importantly, we recover near-baseline performance for dense models and do not require extensive hyper-parameter tuning. We also show that AC/DC has potential for real-world speed-ups in inference and training, with the appropriate software and hardware support. The method has the advantage of returning both an accurate standard model, and a compressed one. Our model output analysis confirms the intuition that sparse training phases act as a regularizer, preventing the (dense) model from memorizing corrupted samples. At the same time, they prevent the memorization of hard samples, which can affect accuracy. + +The main limitations of AC/DC are its reliance on dense training phases, which limits the achievable training speedup, and the need for tuning the length and frequency of sparse/dense phases. We believe the latter issue can be addressed with more experimentation (we show some preliminary results in Section 4 and Appendix B.1); however, both the theoretical results and the output analysis suggest that dense phases may be necessary for good accuracy. We plan to further investigate this in future work, together with applying AC/DC to other compression methods, such as quantization, as well as leveraging sparse training on hardware that could efficiently support it, such as Graphcore IPUs [23]. + +# Acknowledgments and Disclosure of Funding + +This project has received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme (grant agreement No 805223 ScaleML), and a CNRS PEPS grant. This research was supported by the Scientific Service Units (SSU) of IST Austria through resources provided by Scientific Computing (SciComp). We would also like to thank Christoph Lampert for his feedback on an earlier version of this work, as well as for providing hardware for the Transformer-XL experiments. + +# References + +[1] Dan Alistarh, Torsten Hoefler, Mikael Johansson, Sarit Khirirat, Nikola Konstantinov, and Cedric Renggli. The convergence of sparsified gradient methods. In Conference on Neural Information Processing Systems (NeurIPS), 2018. +[2] Zeyuan Allen-Zhu, Yuanzhi Li, and Zhao Song. A convergence theory for deep learning via overparameterization. In International Conference on Machine Learning (ICML), pages 242-252. PMLR, 2019. +[3] Kyriakos Axiotis and Maxim Sviridenko. Sparse convex optimization via adaptively regularized hard thresholding. In International Conference on Machine Learning (ICML), pages 452-462. PMLR, 2020. +[4] Guillaume Bellec, David Kappel, Wolfgang Maass, and Robert Legenstein. Deep rewiring: Training very sparse deep networks. International Conference on Learning Representations (ICLR), 2018. +[5] Lukas Biewald. Experiment Tracking with Weights and Biases, 2020. Software available from wandb.com. +[6] Thomas Blumensath and Mike E Davies. Iterative thresholding for sparse approximations. Journal of Fourier analysis and Applications, 14(5-6):629-654, 2008. +[7] Emmanuel J Candes and Terence Tao. Near-optimal signal recovery from random projections: Universal encoding strategies? IEEE transactions on information theory, 52(12):5406-5425, 2006. +[8] Tianqi Chen, Thierry Moreau, Ziheng Jiang, Lianmin Zheng, Eddie Yan, Haichen Shen, Meghan Cowan, Leyuan Wang, Yuwei Hu, Luis Ceze, et al. TVM: An automated end-to-end optimizing compiler for deep learning. In 13th USENIX Symposium on Operating Systems Design and Implementation (OSDI 18), pages 578-594, 2018. +[9] Matthieu Courbariaux, Itay Hubara, Daniel Soudry, Ran El-Yaniv, and Yoshua Bengio. Binarized neural networks: Training deep neural networks with weights and activations constrained to +1 or -1. arXiv preprint arXiv:1602.02830, 2016. +[10] Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdinov. Transformer-XL: Attentive language models beyond a fixed-length context. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, 2019. +[11] Robert David, Jared Duke, Advait Jain, Vijay Janapa Reddi, Nat Jeffries, Jian Li, Nick Kreeger, Ian Nappier, Meghna Natraj, Shlomi Regev, et al. TensorFlow Lite Micro: Embedded machine learning on TinyML systems. arXiv preprint arXiv:2010.08678, 2020. +[12] DeepSparse. NeuralMagic DeepSparse Inference Engine, 2021. +[13] Tim Dettmers and Luke Zettlemoyer. Sparse networks from scratch: Faster training without losing performance. arXiv preprint arXiv:1907.04840, 2019. +[14] Xin Dong, Shangyu Chen, and Sinno Jialin Pan. Learning to prune deep neural networks via layer-wise optimal brain surgeon. arXiv preprint arXiv:1705.07565, 2017. +[15] Erich Elsen, Marat Dukhan, Trevor Gale, and Karen Simonyan. Fast sparse convnets. In Conference on Computer Vision and Pattern Recognition (CVPR), pages 14629-14638, 2020. +[16] 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 (ICML), pages 2943-2952. PMLR, 2020. +[17] Simon Foucart. Hard thresholding pursuit: an algorithm for compressive sensing. SIAM Journal on Numerical Analysis, 49(6):2543-2563, 2011. + +[18] Simon Foucart. Sparse recovery algorithms: sufficient conditions in terms of restricted isometry constants. In Approximation Theory XIII: San Antonio 2010, pages 65-77. Springer, 2012. +[19] Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. In International Conference on Learning Representations (ICLR), 2019. +[20] Jonathan Frankle, Gintare Karolina Dziugaite, Daniel Roy, and Michael Carbin. Linear mode connectivity and the lottery ticket hypothesis. In International Conference on Machine Learning (ICML), pages 3259-3269. PMLR, 2020. +[21] Trevor Gale, Erich Elsen, and Sara Hooker. The state of sparsity in deep neural networks. arXiv preprint arXiv:1902.09574, 2019. +[22] Amir Gholami, Sehoon Kim, Zhen Dong, Zhewei Yao, Michael W Mahoney, and Kurt Keutzer. A survey of quantization methods for efficient neural network inference. arXiv preprint arXiv:2103.13630, 2021. +[23] Graphcore. Graphcore Poplar SDK 2.0, 2021. +[24] Masafumi Hagiwara. A simple and effective method for removal of hidden units and weights. Neurocomputing, 6(2):207 - 218, 1994. Backpropagation, Part IV. +[25] Song Han, Jeff Pool, Sharan Narang, Huizi Mao, Enhao Gong, Shijian Tang, Erich Elsen, Peter Vajda, Manohar Paluri, John Tran, et al. DSD: Dense-sparse-dense training for deep neural networks. International Conference on Learning Representations (ICLR), 2017. +[26] Song Han, Jeff Pool, John Tran, and William J Dally. Learning both weights and connections for efficient neural networks. In Conference on Neural Information Processing Systems (NeurIPS), pages 1135-1143, 2015. +[27] Babak Hassibi, David G Stork, and Gregory J Wolff. Optimal brain surgeon and general network pruning. In IEEE international conference on neural networks, pages 293-299. IEEE, 1993. +[28] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Conference on Computer Vision and Pattern Recognition (CVPR), pages 770-778, 2016. +[29] 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. arXiv preprint arXiv:2102.00554, 2021. +[30] Andrew G Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andretto, and Hartwig Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017. +[31] Prateek Jain, Ambuj Tewari, and Purushottam Kar. On iterative hard thresholding methods for high-dimensional M-estimation. In Conference on Neural Information Processing Systems (NeurIPS), pages 685–693, 2014. +[32] Siddhant Jayakumar, Razvan Pascanu, Jack Rae, Simon Osindero, and Erich Elsen. Top-KAST: Top-K always sparse training. Conference on Neural Information Processing Systems (NeurIPS), 33:20744-20754, 2020. +[33] Xiaojie Jin, Xiaotong Yuan, Jiashi Feng, and Shuicheng Yan. Training skinny deep neural networks with iterative hard thresholding methods. arXiv preprint arXiv:1607.05423, 2016. +[34] Hamed Karimi, Julie Nutini, and Mark Schmidt. Linear convergence of gradient and proximal-gradient methods under the Polyak-Lojasiewicz condition. In Joint European Conference on Machine Learning and Knowledge Discovery in Databases, pages 795–811. Springer, 2016. +[35] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. International Conference on Learning Representations (ICLR), 2015. +[36] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. +[37] 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 (ICML), pages 5544-5555. PMLR, 2020. +[38] Yann LeCun, John S Denker, and Sara A Solla. Optimal brain damage. In Conference on Neural Information Processing Systems (NeurIPS), pages 598-605, 1990. + +[39] Namhoon Lee, Thalaiyasingam Ajanthan, and Philip HS Torr. SNIP: Single-shot network pruning based on connection sensitivity. International Conference on Learning Representations (ICLR), 2019. +[40] Tao Lin, Sebastian U Stich, Luis Barba, Daniil Dmitriev, and Martin Jaggi. Dynamic model pruning with feedback. In International Conference on Learning Representations (ICLR), 2019. +[41] Chaoyue Liu, Libin Zhu, and Mikhail Belkin. Toward a theory of optimization for over-parameterized systems of non-linear equations: the lessons of deep learning. arXiv preprint arXiv:2003.00307, 2020. +[42] Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. arXiv preprint arXiv:1609.07843, 2016. +[43] 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. +[44] Decebal Constantin Mocanu, Elena Mocanu, Peter Stone, Phuong H Nguyen, Madeleine Gibescu, and Antonio Liotta. Scalable training of artificial neural networks with adaptive sparse connectivity inspired by network science. Nature communications, 9(1):1-12, 2018. +[45] Amirkeivan Mohtashami, Martin Jaggi, and Sebastian U Stich. Simultaneous training of partially masked neural networks. arXiv preprint arXiv:2106.08895, 2021. +[46] Dmitry Molchanov, Armenii Ashukha, and Dmitry Vetrov. Variational dropout sparsifies deep neural networks. In International Conference on Machine Learning (ICML), pages 2498-2507. PMLR, 2017. +[47] 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, high-performance deep learning library. In Conference on Neural Information Processing Systems (NeurIPS). 2019. +[48] Ning Qian. On the momentum term in gradient descent learning algorithms. Neural networks, 12(1):145-151, 1999. +[49] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115(3):211-252, 2015. +[50] Alexander Shevchenko and Marco Mondelli. Landscape connectivity and dropout stability of SGD solutions for over-parameterized neural networks. In International Conference on Machine Learning (ICML), pages 8773-8784. PMLR, 2020. +[51] Shaohuai Shi, Xiaowen Chu, Ka Chun Cheung, and Simon See. Understanding top-k sparsification in distributed deep learning. arXiv preprint arXiv:1911.08772, 2019. +[52] Sidak Pal Singh and Dan Alistarh. Woodfisher: Efficient second-order approximation for neural network compression. Conference on Neural Information Processing Systems (NeurIPS), 33, 2020. +[53] Emma Strubell, Ananya Ganesh, and Andrew McCallum. Energy and policy considerations for modern deep learning research. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 13693-13696, 2020. +[54] Hidenori Tanaka, Daniel Kunin, Daniel L Yamins, and Surya Ganguli. Pruning neural networks without any data by iteratively conserving synaptic flow. Conference on Neural Information Processing Systems (NeurIPS), 33, 2020. +[55] Han Vanholder. Efficient inference with TensorRT. NVIDIA GTC On-Demand. Slides available at https://on-demand-gtc.gputechconf.com/gtcnew/sessionview.php?sessionName=23425-efficient+inference+with+tensorrt, 2017. +[56] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Conference on Neural Information Processing Systems (NeurIPS), pages 6000-6010, 2017. +[57] 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. In International Conference on Learning Representations (ICLR), 2020. + +[58] Xiaotong Yuan, Ping Li, and Tong Zhang. Gradient hard thresholding pursuit for sparsity-constrained optimization. In International Conference on Machine Learning (ICML), pages 127-135. PMLR, 2014. +[59] Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In British Machine Vision Conference (BMVC). British Machine Vision Association, 2016. +[60] Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. International Conference on Learning Representations (ICLR), 2017. +[61] 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. International Conference on Learning Representations (ICLR), 2021. +[62] 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. \ No newline at end of file diff --git a/acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/images.zip b/acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9e9ef9497aa8df35a5f9ddaf4fba93357b9d51d3 --- /dev/null +++ b/acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07bd084f82669e936b23a66692ce5bf1534d5cc0045048ba53435020d1c07071 +size 228434 diff --git a/acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/layout.json b/acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7a0d3e35e8f163992fe68b43a2d3d0f10bc30ae8 --- /dev/null +++ b/acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7e486b38f76115acd02560f1256e5d32cdf25703f0240fcd73afd8e1ff371350 +size 435870 diff --git a/acgclossyactivationcompressionwithguaranteedconvergence/cdea0826-f065-4d36-aab4-fb57bd5292fa_content_list.json b/acgclossyactivationcompressionwithguaranteedconvergence/cdea0826-f065-4d36-aab4-fb57bd5292fa_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..4c8a718df7fd26c74a22abc72c68704626ffcad1 --- /dev/null +++ b/acgclossyactivationcompressionwithguaranteedconvergence/cdea0826-f065-4d36-aab4-fb57bd5292fa_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d687b5566845e53e581ecc1da781809c5a156448e454560a10785b39e2719c36 +size 90038 diff --git a/acgclossyactivationcompressionwithguaranteedconvergence/cdea0826-f065-4d36-aab4-fb57bd5292fa_model.json b/acgclossyactivationcompressionwithguaranteedconvergence/cdea0826-f065-4d36-aab4-fb57bd5292fa_model.json new file mode 100644 index 0000000000000000000000000000000000000000..04083521371acb97309cfd7db9d5d2453a30e99c --- /dev/null +++ b/acgclossyactivationcompressionwithguaranteedconvergence/cdea0826-f065-4d36-aab4-fb57bd5292fa_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b432bd02e1287e1457a6c29a121bf1aa25fe7795370507451d529eb54fcef10 +size 114861 diff --git a/acgclossyactivationcompressionwithguaranteedconvergence/cdea0826-f065-4d36-aab4-fb57bd5292fa_origin.pdf b/acgclossyactivationcompressionwithguaranteedconvergence/cdea0826-f065-4d36-aab4-fb57bd5292fa_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..85a43f0a9795f121eca59ec28bde6e5ee81f2e1d --- /dev/null +++ b/acgclossyactivationcompressionwithguaranteedconvergence/cdea0826-f065-4d36-aab4-fb57bd5292fa_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40057e83cdb84dfb3a1daeca7d35c41094961bd554318a910b03d2768b034798 +size 609967 diff --git a/acgclossyactivationcompressionwithguaranteedconvergence/full.md b/acgclossyactivationcompressionwithguaranteedconvergence/full.md new file mode 100644 index 0000000000000000000000000000000000000000..36945866cc20fd6ddba28b282a49d5e9abea030c --- /dev/null +++ b/acgclossyactivationcompressionwithguaranteedconvergence/full.md @@ -0,0 +1,373 @@ +# AC-GC: Lossy Activation Compression with Guaranteed Convergence + +R. David Evans + +Dept. of Electrical and Computer Engineering + +University of British Columbia + +Vancouver, BC V6T 1Z4 + +rdevans@ece.ubc.ca + +Tor M. Aamodt + +Dept. of Electrical and Computer Engineering + +University of British Columbia + +Vancouver, BC V6T 1Z4 + +aamodt@ece.ubc.ca + +# Abstract + +Parallel hardware devices (e.g., graphics processor units) have limited high-bandwidth memory capacity. This negatively impacts the training of deep neural networks (DNNs) by increasing runtime and/or decreasing accuracy when reducing model and/or batch size to fit this capacity. Lossy compression is a promising approach to tackling memory capacity constraints, but prior approaches rely on hyperparameter search to achieve a suitable trade-off between convergence and compression, negating runtime benefits. In this paper we build upon recent developments on Stochastic Gradient Descent convergence to prove an upper bound on the expected loss increase when training with compressed activation storage. We then express activation compression error in terms of this bound, allowing the compression rate to adapt to training conditions automatically. The advantage of our approach, called AC-GC, over existing lossy compression frameworks is that, given a preset allowable increase in loss, significant compression without significant increase in error can be achieved with a single training run. When combined with error-bounded methods, AC-GC achieves $15.1 \times$ compression with an average accuracy change of $0.1\%$ on text and image datasets. AC-GC functions on any model composed of the layers analyzed and, by avoiding compression rate search, reduces overall training time by $4.6 \times$ over SuccessiveHalving. + +# 1 Introduction + +Stochastic Gradient Descent (SGD) has proven efficient and effective for optimizing Deep and Convolutional Neural Networks (DNNs and CNNs). However, due to deeper and automatically generated networks [20, 22, 44, 52], improvement of accuracy has caused a rapid increase in training memory requirements, which are dominated by the temporary storage of activations between the forward and backward pass of the back-propagation algorithm [45, 48]. Reducing memory consumption leads to faster training and, thus, more effective research of DNN models and applications. However, doing this by decreasing the batch size has many drawbacks. On parallel processors, such as GPUs, a small batch size can lead to poor compute saturation, and reduced training throughput [47]. Smaller batch sizes also introduce errors that impact convergence and accuracy [18]. Over 50GB of memory is required to train some networks, e.g., GPIPE [22]. + +Many works have examined reducing activation storage overheads. Lossy compression of activations in memory can reduce memory footprint without network modifications [6, 14, 25, 27]. Error bounded lossy compression (EBC) [27] has bounded activation error, however, it uses an empirical study to select an error target. Activations can also be offloaded to an external memory (e.g. CPU DRAM), using either an uncompressed link [31, 45] or compressed link [14, 46]. Activation compression and offloading have performance overheads from $5\%$ to $60\%$ [7, 14, 25, 27, 45]. Reduced precision + +training has the side effect of reducing activation size [9, 51, 57]. Finally, restructuring networks to be reversible [17] or efficient scheduling of network layers [8] can reduce memory use. + +Prior lossy and reduced precision approaches [6, 9, 14, 25, 51, 57] utilize automated searches or hand-tuning to determine compression rates, which increase training time and have the potential to select poor compression/accuracy trade-offs. Ideally, an activation compression method has + +high compression and minimal decrease in trained accuracy. Tuning to achieve this is prohibitively expensive. For instance, selecting a fixed-point integer (fixpoint) compression rate for ImageNet/ResNet50 using Grid Search uses 16 training runs (Figure 1). Using SuccessiveHalving [26] can decrease training time, however even with aggressive resource allocations (e.g. 24 GPU-days, Figure 1) total training time is still high. With low resource settings, methods such as SuccessiveHalving [26] and Hyperband [36] allocate little time to some configurations, increasing the likelihood that compression + +![](images/8e4c354748e2fb67983d285a1961c3079b7f65732431a2d292bf24c240503ba5.jpg) +Figure 1: Activation compression rate search cost for ImageNet/ResNet50 [20]. Each box indicates a different compression from 1- to 16-bit fixpoint. + +artifacts [6, 25] can be missed, resulting in poor accuracy. Additionally, when tuning hyperparameters, lossy compression makes it difficult to determine the cause of degraded accuracy. Finally, prior compression methods have an unknown impact on convergence behavior. + +In this work, we present a framework for lossy Activation Compression with Guaranteed Convergence (AC-GC). To our knowledge, our work is the first to prove convergence bounds on SGD with activation compression. AC-GC involves allowing an increase in the bound on the expected loss, which we trade-off for increased compression. We formulate this as a constrained optimization problem: maximizing compression subject to a bounded increase in loss. Doing so allows using a single hyperparameter to correlate convergence bounds with the activation error, which creates compression methods that are iteration, network, and dataset agnostic. Having convergence bounds known a priori allows a user to set a tolerable error rate before training, avoiding compression rate search cost entirely. Our contributions: + +- We prove convergence bounds on SGD under error bounded activation compression with weak assumptions on convexity. +- We express activation compression and convergence as a constrained optimization problem and analyze the activation error tolerance of common DNN layers within this framework. +- We combine these error bounds with fixpoint, image, and error bounded compression, to create methods with guaranteed convergence and a compression/accuracy trade-off known prior to training. + +# 2 Preliminaries + +DNNs are commonly used on problems involving a sum, for instance, minimize the total error on a set of training images. The loss $\mathcal{L}$ for such a problem takes the form + +$$ +\mathcal {L} (\theta) = \sum_ {n} f \left(\theta , X _ {n}\right) \tag {1} +$$ + +where $f$ represents the loss of one example input $X_{n}$ with weights $\theta$ . + +Stochastic Gradient Descent (SGD) is typically used to optimize these finite sums, using the iteration + +$$ +\theta^ {(t + 1)} = \theta^ {(t)} - \alpha \nabla_ {\theta} f \left(\theta^ {(t)}, X _ {n _ {t}}\right) \tag {2} +$$ + +where $\alpha$ is the learning rate, $t$ is the iteration, $\nabla_{\theta}f$ represents the gradient of $f$ with respect to $\theta$ , and $n_t$ is a randomly chosen training example index from the distribution over $n$ such that $\mathbb{E}[\nabla_{\theta}f(\theta^{(t)},X_{n_t})] = \nabla_{\theta}\mathcal{L}(\theta^{(t)})$ . + +Figure 2a shows the computation graph for the back-propagation [48] algorithm for a single DNN layer without compression. Back-propagation is often used as it allows efficient calculation of + +![](images/7be896ac65bd5ae6bcb8645a39d5b8c81d4f4f588b55e1105bb31754f7ebac6b.jpg) +Figure 2: Computation graph for training of a DNN layer. Activations are a) stored between the forward (left) and backward pass (right) or b) compressed (C) in the forward pass, and decompressed (D) in the backward pass. Red indicates paths potentially affected by compression errors. + +![](images/0b04abb08cedc3b1deb02f545bae46a68327253f6785888462c310dc1b1d96f0.jpg) +a) Direct activation storage + +![](images/978464c0c0c44576ec2488fd2d9c0ec704966904d5906a70175a21396b10621c.jpg) +b) With activation compression + +parameter gradients at the expense of storing activations [48]. A DNN layer is any linear or non-linear function, e.g., a convolution or ReLU activation. The functions fwd, bwd_param, bwd_ACT are algorithmic implementations of the layer function and the gradients w.r.t. $\theta$ and $X$ . In the forward pass, each layer calculates an output activation $Y = \mathrm{fwd}(X)$ which is fed to subsequent layers. These activations are temporarily stored after use to avoid a performance penalty from recalculating them in the backward pass. To our knowledge, all frameworks opt to store activations [42, 53]. In the backward pass, parameter gradients and activation gradients are calculated using bwd_param and bwd_ACT. Parameter gradients are used to update the parameters (Eqn. (2)), and activation gradients are sent downward to the next layer. Depending on the layer type and its derivatives, the bwd_param and bwd_ACT functions may require activations to be stored. For example, it is computationally efficient to store the input $X$ for convolution layers [42, 53]. The many layer types place a diverse set of constraints on the activation storage. + +Activation compression addresses one of the most significant contributors to memory consumption in DNNs. In the forward pass, an activation can be lazily compressed after its last usage (C, Figure 2b). Eagerly compressing activations would require storing both a compressed and uncompressed copy until its last use. In the backward pass, activations are decompressed before their first use (D, Figure 2b). The backward pass begins only after the forward pass is completed for all layers, resulting in a large reuse distance for stored activations. Compression can thus be performed off the critical path in parallel with compute, with low performance overheads from $4\% -30\%$ [7, 25], provided that sufficient resources are available. + +We denote the uncompressed activation as $X = (x_{nchw}) \in \mathbb{R}^{N \times C \times H \times W}$ , where $N, C, H$ , and $W$ represent the batch size, channel, height and width, respectively. In the uncompressed backward pass, gradients are calculated from the saved activations, parameters, and gradients from the upward layer (Figure 2 with a); we write this as $\nabla_{\theta}f(\theta, X) = \mathtt{bwd\_param}(X, \theta, \nabla_Yf(\theta, X))$ . + +Lossy compression involves discarding some information of the activation to increase the compression rate. In information theory, this is referred to as the rate-distortion trade-off. In our model, the rate refers to the activation error, and the distortion refers to resulting impacts on gradient error and thus accuracy after training. We model lossy compression between the forward and backward pass as an independent perturbation on each value in the activation, $\Delta X\in \mathbb{R}^{N\times C\times H\times W}$ . Thus, in the compressed backward pass, the perturbed activation is $X + \Delta X$ . We denote the approximate gradient resulting from lossy error as $\hat{\nabla}_{\theta}f(\theta ,X)\coloneqq \mathrm{bwd\_param}(X + \Delta X,\theta ,\nabla_{Y}f(\theta ,X))$ , and the corresponding gradient error as $\Delta \nabla_{\theta}f(\theta ,X)\coloneqq \hat{\nabla}_{\theta}f(\theta ,X) - \nabla_{\theta}f(\theta ,X)$ . + +# 3 Guaranteed Convergence + +This section details how gradient error $\Delta \nabla_{\theta}f(\theta ,X)$ impacts convergence of SGD. Following this, the lossy compression error $\Delta X$ can be expressed in terms of the gradient error, and the compression rate for many methods can be determined. For example, the bitwidth $b$ of fixpoint compression of an activation with range $(-1,1)$ is + +$$ +b \geq - \log_ {2} | \Delta x _ {n c h w} | + \dots \tag {3} +$$ + +![](images/3bb6e4868d40c62505c1d6af4ef6d52d235c1e59ca51358b4f6c6e6708dbf722.jpg) +Figure 3: SGD convergence behavior. a) and b) without compression, c) this work, and d) ResNet50 training with $\alpha = 0.25$ and fixpoint activation compression (average over five runs, shaded indicates the minimum and maximum training loss). + +![](images/9eef9a163a2fc789dc118508cceefb5ffd6dcd5c42b83dfd814b21334e51d415.jpg) + +![](images/7ab845628c447bfdfb08b2ebf9c9f5fd9ecb6c861e88843548a23a7202e10685.jpg) + +![](images/e82dfcddbed3d8f8fe67ea8372a4172edf24ee60a0c718037e204595fdf50cbf.jpg) + +where the remaining terms are constants determined by the rounding mode, sign, etc. Any compression method with bounded activation error for a given rate can be combined with the error bounds from this work to guarantee convergence (Sections 3.2 and 4). + +# 3.1 SGD Convergence + +We will briefly summarize uncompressed convergence of SGD from Karimi et al. [28]. Consider training using $t$ iterations of SGD with loss $\mathcal{L}(\theta^{(t)})$ , with a constant learning rate $\alpha$ and initial point $\theta^{(0)}$ . We assume that $\mathcal{L}$ has an optimal point $\theta^{(*)}$ and satisfies $\mathbb{E}[\| \nabla_{\theta}f(\theta ,X_{n_t})\|^2 ]\leq V^2$ for all $\theta$ and some $V^2$ . We refer to $V^2$ as the variance. With some assumptions and problem-defined constants $C_1$ and $C_2$ (Appendix A), Karimi et al. [28] demonstrate that the expected error at iteration $t$ is + +$$ +\mathbb {E} \left[ \mathcal {L} \left(\theta^ {(t)}\right) - \mathcal {L} \left(\theta^ {(*)}\right) \right] \leq \left(1 - C _ {1} \alpha\right) ^ {t} \left(\mathcal {L} \left(\theta^ {(0)}\right) - \mathcal {L} \left(\theta^ {(*)}\right)\right) + C _ {2} \alpha V ^ {2} \tag {4} +$$ + +Initially when training, fast convergence occurs as $(1 - C_1\alpha)^t$ approaches zero (Figure 3a). Later in training, $C_2\alpha V^2$ dominates, resulting in an approximately constant expected error (Figure 3b). The key observation of this result is that the final loss scales with gradient variance, $\mathbb{E}[\mathcal{L}(\theta^{(\infty)})]\propto V^2$ . + +Many DNN classes fall under this progress bound as it uses relatively weak assumptions and does not require a convex $f$ . DNNs using ReLU activations are Lipschitz continuous [55]. Furthermore, those with an L2 loss are piecewise strongly convex, which implies that the required Polyak-Lojasiewic condition is satisfied locally [40]. Networks this does not apply to could use another progress bound [3, 28, 41]. + +# 3.2 Compressed Convergence + +Lossy compression trades accuracy for compression. This trade-off can be empirically observed with fixpoint compression on CIFAR10/ResNet50 (Figure 3d and Section 6). Our method functions by allowing the loss to increase by some multiplicative error $(1 + e^{2})$ , where $e^2 \geq 0$ , and determining how much compression can be extracted from the change (Figure 3c). The error $1 + e^{2}$ is chosen such that the compressed loss converges to the uncompressed loss as $e^2 \to 0$ . + +Our process for translating the loss bound into maximum activation errors is illustrated in Figure 4a. This section outlines how the loss can be bounded by bounding the gradient error or using an intermediate bounding function $D(\Delta X)$ to simplify the problem. We follow this in Section 4 by deriving an activation error $\Delta X^{(*)}$ for each network layer that satisfies this bound. $e^2$ becomes the sole hyperparameter in our method, and selection determines the maximum increase in loss and the compression rate. + +Compressed convergence with increased loss can be viewed as an uncompressed problem with an increased gradient variance bound, $(1 + e^{2})V^{2}$ . To determine the activation error which satisfies this gradient variance, we must express the variance in terms of a bound on the gradient error $\| \Delta \nabla_{\theta}f(\theta ,X)\| ^2$ . Theorem 1 demonstrates that a maximum gradient error of $e^2 V^2$ satisfies the $(1 + e^{2})$ loss bound. There may be multiple regions where the gradient error is below $e^2 V^2$ (Figure 4b), which would require iterative solvers to determine suitable activation errors. To apply our technique in practice we introduce a convex function $D(\Delta X)\geq \| \Delta \nabla_{\theta}f(\theta ,X)\| ^2$ , which provides a flexible + +![](images/3b9f35e0c2105c9561b36841f62a6c83f408303df524bf4a717d731c79a2a32d.jpg) +Figure 4: a) Flowchart of derivations for obtaining the maximum activation error $\Delta X^{(*)}$ as a function of the loss bound $1 + e^2$ . b) 1D Example for the relationship between the error bound, bounding function, and gradient error for an activation error $\Delta x$ . Shaded area satisfies the loss bound, and the hatched area satisfies $D(\Delta x) \leq e^2 V^2$ . + +![](images/7270c4fcd13becd2baa9aca9977fd940a5a6b6241b33ccafaee123c3d6ed2396.jpg) + +proxy for the gradient error (Figure 4b). Using $D(\Delta X)$ allows defining the problem so that it has a unique solution. The gradient variance bound, bounding function, and gradient error are related in Theorem 1. + +Theorem 1. Given $f$ which obeys (4), and a convex function $D(\Delta X)$ which bounds the gradient error from above for all $X, \theta$ , and $\Delta X$ : + +$$ +\left\| \Delta \nabla_ {\theta} f (\theta , X) \right\| ^ {2} \leq D (\Delta X) \tag {5} +$$ + +then any activation error $\Delta X^{(*)}$ where $D(\Delta X^{(*)})\leq e^{2}V^{2}$ satisfies + +$$ +\mathbb {E} \left[ \| \hat {\nabla} _ {\theta} f \left(\theta , X _ {n _ {t}}\right) \| ^ {2} \right] \leq \left(1 + e ^ {2}\right) V ^ {2} \tag {6} +$$ + +assuming that $\mathbb{E}[\| \Delta \nabla_{\theta}f(\theta ,X_{n_t})\| ] = 0$ for all $\theta$ , with positive value $e^2$ , and variance $V^2$ satisfying $\mathbb{E}[\| \nabla_{\theta}f(\theta ,X_{n_t})\| ^2 ]\leq V^2$ . All expectations are taken over the training examples $n_t$ . + +Proof: See Appendix A. + +Figure 4b demonstrates the relationship between the various bounds, as well as the motivation for the bounding function. The gradient error is derived from per-layer equations, and in many cases is highly non-convex. Due to this, local minima can cause difficulties when optimizing with the constraint $\| \Delta \nabla_{\theta}f(\theta ,X)\| ^2\leq e^2 V^2$ (Figure 4b). $D(\Delta X)$ is defined to be convex, making the region defined by the constraint a closed region (hatched, Figure 4b). Although the original constraint could tolerate a higher activation error (and thus compression), using a bounding function provides favorable conditions for obtaining a closed-form solution for the activation error. + +# 4 Framework for Activation Compression + +For our evaluation of AC-GC, we develop activation error bounds for various commonly used DNN layers and apply them to several recent networks. This section summarizes bounds for common layers, and derivations and additional layer bounds are provided in Appendix B. Calculating compression error from the gradient error bound $e^2 V^2$ requires expressing and solving for the compression/convergence trade-off. We tackle this by formulating the trade-off as a constrained optimization problem: maximizing the compression subject to bounded gradient error. The problem must be solved once per layer type and can be formally defined as + +$$ +\Delta X ^ {*} = \underset {\Delta X} {\operatorname {a r g m a x}} B (\Delta X) \quad \text {s . t .} \quad D (\Delta X) = e ^ {2} V ^ {2} \tag {7} +$$ + +$$ +\text {w h e r e} D (\Delta X) \geq \| \Delta \nabla_ {\theta} f (\theta , X) \| ^ {2} \tag {8} +$$ + +where $B(\Delta X)$ is a continuous convex function that measures compression rate as a function of the activation error $\Delta X\in \mathbb{R}^{N\times C\times H\times W}$ . A closed-form solution can be found for many systems of this type using the method of Lagrange multipliers. The constraint $D(\Delta X)\leq e^2 V^2$ defines a convex region of potential activation errors where the convergence constraint is satisfied (hatched, Figure 4b). + +However, as both the $B(\Delta X)$ and $D(\Delta X)$ functions are convex, the maximum value must occur along the boundary, hence the equality constraint $D(\Delta X) = e^{2}V^{2}$ in (7) $(\Delta x^{(*)},$ Figure 4b). The convexity of $D(\Delta X)$ also implies that $\Delta X^{(*)}$ is the maximum activation error, i.e., any error $(\Delta X)^{2}\leq (\Delta X^{(*)})^{2}$ also satisfies the variance bound (6). + +Many compression methods use a variation of fixpoint. Hence, we select $B$ to measure the number of bits removed from the activation when compressed with reduced precision fixpoint (9). Rounding mode and sign are constant factors that do not affect the result, however, we ignore clipping. The target compression method loosely influences the objective, hence, non-fixpoint methods may fare better with another error objective. + +$$ +B (\Delta X) := \sum_ {n, c, h, w} ^ {N, C, H, W} \log | \Delta x _ {n c h w} | \tag {9} +$$ + +To derive AC-GC error bounds for DNN layers not presented in this work, one can: + +1. Derive $\| \Delta \nabla_{\theta}f(\theta ,X)\| ^2$ for the layer type +2. Choose a suitable convex bounding function, $D(\Delta X)\geq \| \Delta \nabla_{\theta}f(\theta ,X)\| ^2$ +3. Obtain the maximum error $\Delta X^{(*)}$ by solving (7) using the method of Lagrange multipliers + +For the sake of brevity, we will summarize the notation, assumptions, and AC-GC error bounds for fully connected, convolution, and batch normalization layers (Table 1). We aim to locate closed-form solutions with low computation overheads, although tighter bounding functions likely exist. Henceforth we omit arguments of $f$ and use the following definitions: Batch size $N$ , input channels $C$ , output channels $K$ , input and output activations $X$ and $Y$ , and compression error $\Delta X$ . + +A) Fully Connected: Table 1A relates the error for guaranteed convergence with compression error for a fully connected layer, with weights $\theta = (\theta_{kc})\in \mathbb{R}^{K\times C}$ , input activation $X = (x_{nc})\in \mathbb{R}^{N\times C}$ , and output activation gradient $\nabla_Yf = (\partial f / \partial y_{nk})\in \mathbb{R}^{N\times K}$ . As the error bound $(e^2 V^2 /2)$ decreases, the compression must decrease to compensate. All activations for a fully connected layer have the same error tolerance. + +B) Convolution: Convolution with no padding follows a similar trend to linear layers, with the addition of stride $T$ , a filter size of $R \times S$ , and increased dimensions $X = (x_{nchw}) \in \mathbb{R}^{N \times C \times H \times W}$ and $\nabla_Y f = (\partial f / \partial y_{nkhw}) \in \mathbb{R}^{N \times K \times H \times W}$ . We assume an average usage of activations due to stride, as uneven usage leads to uneven compression, which would require tracking per-element compression rates. Comparing linear and convolution reveals that convolutions have a lower error tolerance due to the increased number of activations $(HW)$ and weights $(RS)$ . + +To fully cover cases encountered in CNNs, we also derive error bounds for cases where activation errors affect multiple convolution layers (e.g., in ResNets [20]). + +C) Batch Normalization: Batch normalization [24] re-normalizes the activation from per-channel standard deviation $\sigma \in \mathbb{R}^C$ to a learned $\gamma \in \mathbb{R}^C$ . There is a different dependence on activation error from convolution and linear layers. Instead of causing errors in the parameter gradient $\nabla_{\gamma}f$ exclusively, activation error propagates to the activation gradient $\nabla_Xf$ and then to all subsequent layers in the network. To avoid bounding all weights in the network, we isolate the layer and bound the convergence of the batch normalization activations using + +$$ +\left\| \Delta \nabla_ {X} f \right\| ^ {2} \leq e ^ {2} V ^ {2} \tag {10} +$$ + +Arriving at a closed-form solution further requires a bound on the parameter gradient error within the layer using positive values $(g_c^2) \geq (\hat{\nabla}_\gamma f)^2$ (Appendix B). Although not observed for the networks in this work, as network parameter gradients are not directly bounded, the convergence bounds on networks with batch normalization may be violated. + +Layer Normalization: This layer type is similar to batch normalization and requires a similar set of assumptions and derivations (Appendix B). + +ReLU, Dropout, Max Pooling, and Summation: Summation does not require storage of any activation, and the remaining layers (Dropout, Max Pooling, and ReLU) only require a bitmask to calculate their respective gradients. For instance, ReLU requires the storage of the bitmask $X \geq 0$ [14, 25], and Max Pooling requires a bitmask of the locations of maximal values. As these layers have an efficient lossless high compression method available, we do not analyze them. + +Table 1: Guaranteed convergence equations for common network layers. See Appendices for full derivations and assumptions. Empty sums are over all indices, i.e. $\sum := \sum_{n,c,h,w}^{N,C,H,W}$ . $M := NHW$ + +
QUANTITYA) FULLY CONNECTEDB) CONVOLUTIONC) BATCHNORMALIZATION
D(ΔX):=||∇Yf||2||ΔX||2RS/T2||∇Yf||2||ΔX||2∑2γc2gc2/M2σc4Δxchw
Δxnchw=(*)2e2V2/2NC||∇Yf||2e2V2T2/2RSMC||∇Yf||2e2V2Mσc4/Cγc2gc2
+ +# 5 Practical Automatic Lossy Compression + +Using the AC-GC error bounds, we create convergence bounded compression methods with automatic compression rates, collectively referred to as AutoX. The first two methods (AutoQuant and AutoCuSZ) adapt scaled fixpoint [14] and error-bounded compression [27], which have bounded errors for a given compression rate. The errors for these methods are unbiased provided that unbiased rounding to fixpoint is used [5, 27]. The third method (AutoJPEG) uses lossy JPEG compression [14]. We bound JPEG error using an empirical error-compression relationship using activations sampled from uncompressed training of CIFAR10/ResNet50 [20]. Samples are used offline with JPEG compression to establish the compression-error relationship. This empirical compression-error relationship is used to calculate the JPEG compression levels, which approximately satisfy the error bounds in Table 1. We chain quantization and JPEG with lossless Zero Value Compression [46] to compress sparse activations better, creating AutoQuantZ and AutoJPEGZ. + +As all AutoX used some form of fixpoint, we can express activation error in terms of bits. For any layer type, the relationship between bitwidth $b$ and the convergence bound can be described as + +$$ +b \geq - \log_ {2} | \Delta x _ {n c h w} | + \dots = - \log_ {2} | e | - \log_ {2} \| \nabla_ {\theta} f \| + \dots \tag {11} +$$ + +Using the results from Table 1, it can be seen that the bitwidth scales additively with the batch size as $+\log_2(N)$ for convolution layers, and $-\log_2(N)$ for normalization layers. + +Two issues with using AC-GC in a compression method are: 1) the various norms required are computationally expensive, and 2) the formulation assumes exact gradient information is available during the forward pass. We address both issues by statistically estimating activation error bounds. Instead of evaluating at every iteration, statistics are calculated at the end of every recalculation interval, specified in iterations. In the forward pass, a summary (mean or maximum) of the last ten recalculations is used when calculating the errors. This also allows approximating $V^2 \approx \| \nabla_\theta f \|^2$ . Although some quantities are available in the forward pass, we estimate all of the activations, parameters, and gradients to avoid performing norm calculations at every iteration. Despite norms being estimated, we do not observe that the convergence bound (6) is violated for any network examined. A few training iterations can be used to verify correctness of the norm estimates (Figure 5c). + +# 6 Evaluation + +We examine activation compression by modifying the Chainer framework [53] to compress and decompress activations during training. We measure compression rates every 100 iterations, and otherwise perform paired compression/decompression to maintain the highest performance for our experiments. We focus our analysis on CNNs with image and text datasets, as they have large activation memory requirements, but avoid the largest networks [22, 52] due to limited resources. We create a performance implementation based off Chen et al. [7] to measure throughput. + +For ImageNet [11], CIFAR10 [2] and Div2K [1], we use SGD and 0.9 momentum for VGG16 [50], ResNets (RN18 and RN50) [20], Wide ResNet (WRN) [59], and VDSR [29]. IMDB [39] and Text Copy [4] are trained using ADAM with CNN [53], RNN [53], and transformer heads [54]. All image datasets are augmented with random sizing, flip, and crop, as well as whitening and PCA for ImageNet [30], and $8 \times 8$ cutout for CIFAR10 [12]. Learning rates, batch sizes, and epochs are 0.05, 128, 300 (CIFAR10, [49]), 0.1, 64, 105 (ImageNet, [58]), 0.1, 32, 110 (Div2K, grid search), 2.0, 64, 100 (Text Copy, [4]), and 0.001, 64, 20 (IMDB, [53]). + +![](images/d3b388d28a0592aeecc072ede8985dd538ff0e497a8bf44483f55a7869d70dcb.jpg) +Figure 5: a-b) Average loss over the 10th epoch on MNIST/LeNet, where shaded regions indicate the min/max loss over five runs. a) Loss as function of $e$ . Under compression, the empirical loss (AQ max: AutoQuant with a maximum summary) falls below the theoretical loss bound $(1 + e^2)\mathcal{L}$ . b) Loss where statistics are calculated every recalculation interval iterations. The max or mean of the last ten intervals is used to calculate the bitwidth. c) Ratio of compressed to uncompressed gradients for the first convolution for ImageNet/ResNet18, where the compressed gradient is used to update the parameters. Clusters indicate the first 50 iterations of every ten epochs. + +All forward and backward pass calculations use floating-point, using activations that have been compressed and decompressed between the two passes. Baseline refers to uncompressed training, i.e., 32-bit floating-point activations. GridQuantZ uses the same implementation of AutoQuantZ, however, it uses grid search over eight bit-widths of 2, 3, 4, 6, 8, 10, 12 and 16 bits, and then chooses the lowest with accuracy within $0.1\%$ of the baseline. These grid points were selected to give good coverage of low and medium bit-widths, and are approximately logarithmic-spaced. SuccessiveHalving [26] and Hyperband [36] produce similar accuracy/compression to grid search but take less time. Unless otherwise stated, all experiments use $e^2 = 0.5$ , parameter estimates from the mean of a ten entry window, and a recalculation interval of 100 iterations. A value of $e^2 = 0.5$ allows a small increase in loss over the baseline $(+50\%)$ , but other values could be chosen depending on the desired error tolerance. Appendices C and D contain additional detail on hyperparameters and implementations. + +# 6.1 Parameter Sensitivity + +We isolate the impacts of parameter estimation and $e$ selection by training LeNet [33] on MNIST [32], and RN18 [20] on ImageNet [11]. We train MNIST to convergence by using SGD with no momentum, a learning rate of 0.001, a batch size of 64, and 10 epochs. + +The effect of $e$ , recalculation interval, and summary method are evaluated by training MNIST/Lenet with different configurations of AutoQuant (AQ) (Figures 5a and 5b). Decreasing $e$ (which increases bitwidth) causes the loss to increase, however, the average loss does not violate the bound in Theorem 1 (Figure 5a). In general, all networks examined with $e^2 = 0.5$ have loss changes below $2\%$ and validation score changes below $0.5\%$ (Sections 6.2 and 6.3), which demonstrates that AC-GC error bounds are not violated. Both interval and summary method have a minimal impact on the training loss for MNIST (Figure 5b). As there is an insignificant change in loss, we use the mean for AC-GC as it has higher compression. + +We evaluate ImageNet/ResNet18 using a dual training approach to ensure the correctness of parameter estimation (Figure 5c). This involves training using AutoQuant, while evaluating the true weight gradients $\nabla_{\theta}f$ offline and comparing against their compressed counterpart $\hat{\nabla}_{\theta}f$ . The ratio is $\approx 1$ for the duration of training, and does not violate the bound for $e^2 = 0.5$ (i.e., $\leq 1.5$ ). The mean ratio is less than one, likely due to decreased activation variance from compression to a discrete set of values. We observe similar behavior for the other layers in the network (not shown). + +# 6.2 CIFAR10, Div2K and IMDB + +We compare the AutoX methods with fixpoint grid search (GridQuantZ), and with prior works on lossy JPEG compression [14] (Table 2). Grid search requires oracle knowledge of the baseline, and $8 \times$ the training iterations of any other method in Table 2. Compared to GridQuantZ, AutoQuantZ uses a single run of training, and provides a similar compression rate of $7.5 \times$ . AutoCuSZ has a + +Table 2: Test/validation score and compression rate (bracketed) for fixpoint with grid search (GridQuantZ), AutoX methods, and JPEG-ACT (optL5H from [14]), averaged over 3 runs (ImageNet) or 5 runs (remainder). The highest accuracy and compression are bolded. Trained using 900 GPU-days (RTX 2080 Ti). N/A indicates either not run in [14], or lack of spatial activations. + +
MODELBASEAUTO QUANTZAUTO CUSZAUTO JPEGZJPEG- ACT[14]GRID QUANTZ
CIFAR10 % TOP-1 TEST ACCURACY
VGG93.693.5 (7.4×)93.5 (9.4×)92.9 (12.5×)92.4 (11.9×)93.5 (6.3×)
RN5094.995.0 (4.2×)94.7 (15.5×)94.3 (9.2×)94.4 (7.5×)95.0 (5.7×)
WRN95.895.9 (6.5×)95.8 (14.6×)95.3 (11.7×)94.2 (10.9×)96.0 (7.6×)
DIV2K BEST VAL. PSNR
VDSR36.136.1 (5.1×)35.8 (25.2×)36.1 (7.9×)35.4 (9.1×)36.0 (6.7×)
IMDB % BEST VAL. ACCURACY
CNN61.461.6 (12.2×)61.8 (19.3×)61.4 (11.2×)N/A61.7 (16.5×)
LSTM60.360.1 (10.0×)60.9 (8.8×)N/AN/A60.4 (14.7×)
TEXT COPY % BEST TEST ACCURACY
TRANS98.898.6 (7.1×)98.3 (12.7×)N/AN/A98.9 (5.1×)
IMAGENET % TOP-1 CENTER CROP VAL. ACCURACY
RN1868.668.5 (4.2×)68.1 (6.8×)68.1 (8.1×)67.3 (7.2×)68.5 (2.9×)
RN5072.372.7 (4.8×)72.5 (10.1×)71.5 (8.5×)71.6 (5.9×)72.5 (4.9×)
AVERAGE %-POINT CHANGE AND COMPRESSION RATIO
ALL0+0.0 (7.5×)-0.1 (15.1×)-0.6 (10.5×)-1.0 (7.4×)+0.1 (7.8×)
+ +compression $2.0 \times$ higher than JPEG-ACT, while maintaining accuracy to within 0.1 of the baseline on average. With a suitable error bound, CuSZ can extract significant compression from zeros and spatial information. On non-spatial data and non-image datasets (Text Copy and IMDB, Table 2) we observe that AutoCuSZ extracts similarly high compression with little accuracy change. Finally, AutoJPEGZ vs. JPEG-ACT demonstrates that using AC-GC error bounds gives higher accuracy and compression than using heuristics to select JPEG hyperparameters. In general, we find that using $e^2 > 0.5$ decreases accuracy, leaving little reason to modify it. + +# 6.3 ImageNet + +On ImageNet training with ResNets (Table 2), the AutoX methods obtain a high accuracy. Our ImageNet accuracies are lower than other works as we do not use random scaling (which improves performance), and we report 1-crop accuracy. Our 10-crop accuracy for the ResNet50 baseline is $75.2\%$ . Reduced compression rates on ResNet18 vs. ResNet50 are due to a lower sparsity in ReLU activations, which we hypothesize is caused by the different bottleneck structures of the two networks [20]. The higher-than-baseline accuracy of AutoQuantZ (Table 2) is caused by a large standard deviation for the ImageNet baseline ( $\pm 0.21$ ). On ImageNet, AutoCuSZ gives a high compression in exchange for a small decrease in accuracy, $0.15\%$ points. AutoQuantZ provides high accuracy, at a moderate compression rate of $0.7\times$ , with a $1.2\%$ point better accuracy than JPEG-ACT. However, the primary advantage of AutoX methods is that the pre-training bound on loss increases. + +# 6.4 Overheads + +The AutoX methods require error bound calculation (common to all methods) and compression. Our unoptimized AutoQuantZ implementation achieves throughput of $1.66 \times (N = 128)$ vs. naive swapping to the CPU ( $N = 128$ ), and $0.64 \times$ vs. uncompressed training ( $N = 32$ ) (ImageNet/ResNet50). Our primary contribution, AC-GC error bound calculation, uses $0.4\%$ of total training time. This is negligible when compared to compression overhead, e.g., $4\%$ for fixpoint [14, 25], $17\%$ for CuSZ [27], $33\%$ for ActNN-L3 [7], or $13\%$ for hardware accelerated JPEG [14]. Unoptimized AutoQuantZ is $23\%$ slower compared to ActNN-L3 [7]. Compression rate search time is decreased by $4.6 \times$ when compared to SuccessiveHalving (Figure 1). + +Table 3: Comparison with prior works on CIFAR10 (C10) and ImageNet (IN). $\pm$ indicates standard deviation, if available. Accuracy is presented relative to the baseline accuracy of each work. * Does not include $2\times$ memory reduction from recalculating activations, which is orthogonal to this work. + +
AUTO CUSZWAGE [57]BAA* [6]JPEG- ACT[14]ULP [51]EBC [27]ACTNN -L3[7]
DATASETINC10INININININ
MODELRN50VGG16RN152RN50RN50RN50RN152
METHODAUTO8-BIT4-BITJPEG4-BITCUSZ2-BIT
-CUSZ+RECALC.+ZVCMIX. PREC.
Acc. (%)-0.2±0.2-0.3-0.5-0.1-0.3-0.9-0.2
COMPR.10.1×5.9×11.0×12×
+ +# 7 Related Works + +We compare AutoCuSZ with the most recent works in activation compression [6, 14, 25, 27] and reduced precision training [51, 57] (Table 3). AutoCuSZ obtains better accuracy and compression than most works, with the added benefit of not requiring a search over compression rates. BAA [6] presents a technique of recalculating activations similar to Chen et al. [8], which could be combined with any method in Table 3, including the AutoX methods. AutoCuSZ obtains higher compression and accuracy than EBC [27], demonstrating that AC-GC error bounds are better than hand-tuning in this case. WAGE [57] and ULP [51] and reduced precision training with theoretical convergence bounds [35, 37] reduce training compute through reduced precision, however, have lower accuracy due to accumulating errors in both the forward and backward pass. AutoX methods can potentially be combined with low precision training and other techniques to reduce memory requirements further. + +ActNN is most similar to this work in that it invokes gradient variance to partition bits among compressed activations [7]. However, ActNN approaches the problem in an opposite manner to this work: it finds the highest accuracy for a given compression rate. The ActNN approach works well when the goal is to fit within a memory budget. Our approach allows for selecting the target loss increase a priori, and gaining information on the uncompressed accuracy from a single training run. AC-GC will also converge similarly to the uncompressed case on an unknown model, providing assurances that loss changes are due to model/hyperparameter configuration, not compression. Additionally, ActNN is specific to group-wise fixpoint compression, whereas AC-GC is quick to adapt to any lossy compression method (including group-wise fixpoint). On ImageNet/ResNets, AutoCuSZ and AutoQuantZ obtain half the accuracy change of ActNN-L3, albeit at $0.9 \times$ and $0.4 \times$ the compression, respectively. + +Works targeting inference, such as precision reduction [10, 15, 23, 34], compression [13, 19, 38, 56], and sparsification [16, 43] increase memory requirements due to tracking additional state. Other works that directly address memory can be grouped into scheduling [8, 25], offloading [31, 45], and restructuring [17, 21]. Generally, these come with a performance or model-flexibility penalty. Any non-lossy method is partially orthogonal to compression and can be potentially combined with AC-GC for increased memory reduction. + +# 8 Conclusions + +The AC-GC automatic compression methods described in this work provide high compression rates with error trade-offs known before training. Avoiding compression rate search comes at a computational overhead of only $0.4\%$ , many times less than tuning techniques. Provided that the assumptions of AC-GC hold, it can be further combined with any lossy compression method, layer, or network to guarantee convergence with high activation compression. Although convergence is theoretically guaranteed, some factors could impact convergence, such as floating-point errors. By lowering training costs, this framework allows for training larger models and faster exploration of the machine learning field's landscape. Detailed derivations and implementations can be found in the supplemental material. Code is available https://github.com/rdevans0/acgc. + +# Funding Transparency Statement + +This research was funded in part by the Computing Hardware for Emerging Intelligent Sensory Applications (COHESA) project financed under the National Sciences and Engineering Research Council of Canada (NSERC); grant number NETGP485577-15. + +# References + +[1] Agustsson, E. and Timofte, R. NTIRE 2017 Challenge on Single Image Super-Resolution: Dataset and Study. In 2017 IEEE Conference on Computer Vision and Pattern Recognition Workshops (CVPRW), pp. 1122–1131, July 2017. doi: 10.1109/CVPRW.2017.150. +[2] Alex Krizhevsky and Geoffrey Hinton. Learning Multiple Layers of Features from Tiny Images. PhD thesis, University of Toronto, Toronto, Canada, 2009. +[3] Bach, F. and Moulines, E. Non-strongly-convex smooth stochastic approximation with convergence rate $\mathrm{O}(1 / \mathfrak{n})$ . Advances in Neural Information Processing Systems, 26:773-781, 2013. +[4] Bartz, C. chainer-transformer. https://github.com/Bartzi/chainer-transformer/blob/master/LIC ENSE, January 2021. +[5] Burks, A. W., Goldstine, H. H., and von Neumann, J. Preliminary Discussion of the Logical Design of an Electronic Computing Instrument. In Randell, B. (ed.), The Origins of Digital Computers: Selected Papers, Texts and Monographs in Computer Science, pp. 399-413. Springer, Berlin, Heidelberg, 1982. ISBN 978-3-642-61812-3. doi: 10.1007/978-3-642-61812-3_32. +[6] Chakrabarti, A. and Moseley, B. Backprop with Approximate Activations for Memory-efficient Network Training. Advances in Neural Information Processing Systems, 32, 2019. +[7] Chen, J., Zheng, L., Yao, Z., Wang, D., Stoica, I., Mahoney, M. W., and Gonzalez, J. E. Actnn: Reducing training memory footprint via 2-bit activation compressed training. arXiv:2104.14129 [cs.LG], April 2021. +[8] Chen, T., Xu, B., Zhang, C., and Guestrin, C. Training Deep Nets with Sublinear Memory Cost. arXiv:1604.06174 [cs], April 2016. +[9] Courbariaux, M., Bengio, Y., and David, J.-P. Training deep neural networks with low precision multiplications. arXiv:1412.7024 [cs], December 2014. +[10] Courbariaux, M., Bengio, Y., and David, J.-P. BinaryConnect: Training Deep Neural Networks with binary weights during propagations. In Cortes, C., Lawrence, N. D., Lee, D. D., Sugiyama, M., and Garnett, R. (eds.), Advances in Neural Information Processing Systems 28, pp. 3123-3131. Curran Associates, Inc., 2015. +[11] Deng, J., Dong, W., Socher, R., Li, L., 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, June 2009. doi: 10.1109/CVPR.2009.5206848. +[12] DeVries, T. and Taylor, G. W. Improved Regularization of Convolutional Neural Networks with Cutout. arXiv:1708.04552 [cs], November 2017. +[13] Ding, C., Liao, S., Wang, Y., Li, Z., Liu, N., Zhuo, Y., Wang, C., Qian, X., Bai, Y., Yuan, G., Ma, X., Zhang, Y., Tang, J., Qiu, Q., Lin, X., and Yuan, B. CirCNN: Accelerating and Compressing Deep Neural Networks Using Block-circulant Weight Matrices. In Proceedings of the 50th Annual IEEE/ACM International Symposium on Microarchitecture, MICRO-50 '17, pp. 395–408, New York, NY, USA, 2017. ACM. ISBN 978-1-4503-4952-9. doi: 10.1145/3123939.3124552. +[14] Evans, R. D., Liu, L., and Aamodt, T. M. JPEG-ACT: Accelerating Deep Learning via Transform-based Lossy Compression. In 2020 ACM/IEEE 47th Annual International Symposium on Computer Architecture (ISCA), pp. 860-873, May 2020. doi: 10.1109/ISCA45697.2020.00075. +[15] Fang, J., Shafiee, A., Abdel-Aziz, H., Thorsley, D., Georgiadis, G., and Hassoun, J. H. Posttraining Piecewise Linear Quantization for Deep Neural Networks. In Vedaldi, A., Bischof, H., Brox, T., and Frahm, J.-M. (eds.), Computer Vision – ECCV 2020, Lecture Notes in Computer Science, pp. 69–86, Cham, 2020. Springer International Publishing. ISBN 978-3-030-58536-5. doi: 10.1007/978-3-030-58536-5. + +[16] Frankle, J. and Carbin, M. The Lottery Ticket Hypothesis: Finding Sparse, Trainable Neural Networks. arXiv:1803.03635 [cs], March 2019. +[17] Gomez, A. N., Ren, M., Urtasun, R., and Grosse, R. B. The Reversible Residual Network: Backpropagation Without Storing Activations. In Guyon, I., Luxburg, U. V., Bengio, S., Wallach, H., Fergus, R., Vishwanathan, S., and Garnett, R. (eds.), Advances in Neural Information Processing Systems 30, pp. 2214-2224. Curran Associates, Inc., 2017. +[18] Goyal, P., Dollár, P., Girshick, R., Noordhuis, P., Wesolowski, L., Kyrola, A., Tulloch, A., Jia, Y., and He, K. Accurate, Large Minibatch SGD: Training ImageNet in 1 Hour. arXiv:1706.02677 [cs], June 2017. +[19] Han, S., Mao, H., and Dally, W. J. Deep Compression: Compressing Deep Neural Networks with Pruning, Trained Quantization and Huffman Coding. arXiv:1510.00149 [cs], October 2015. +[20] He, K., Zhang, X., Ren, S., and Sun, J. Deep Residual Learning for Image Recognition. arXiv:1512.03385 [cs], December 2015. +[21] Howard, A. G., Zhu, M., Chen, B., Kalenichenko, D., Wang, W., Weyand, T., Andreetto, M., and Adam, H. MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications. arXiv:1704.04861 [cs], April 2017. +[22] Huang, Y., Cheng, Y., Bapna, A., First, O., Chen, D., Chen, M., Lee, H., Ngiam, J., Le, Q. V., Wu, Y., and Chen, Z. GPipe: Efficient Training of Giant Neural Networks using Pipeline Parallelism. In Wallach, H., Larochelle, H., Beygelzimer, A., d\text{text}quotesingle Alché-Buc, F., Fox, E., and Garnett, R. (eds.), Advances in Neural Information Processing Systems 32, pp. 103-112. Curran Associates, Inc., 2019. +[23] Hubara, I., Courbariaux, M., Soudry, D., El-Yaniv, R., and Bengio, Y. Binarized Neural Networks. In Lee, D. D., Sugiyama, M., Luxburg, U. V., Guyon, I., and Garnett, R. (eds.), Advances in Neural Information Processing Systems 29, pp. 4107-4115. Curran Associates, Inc., 2016. +[24] Ioffe, S. and Szegedy, C. Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift. In International Conference on Machine Learning, pp. 448-456. PMLR, June 2015. +[25] Jain, A., Phanishayee, A., Mars, J., Tang, L., and Pekhimenko, G. Gist: Efficient Data Encoding for Deep Neural Network Training. In 2018 ACM/IEEE 45th Annual International Symposium on Computer Architecture (ISCA), pp. 776-789, June 2018. doi: 10.1109/ISCA.2018.00070. +[26] Jamieson, K. and Talwalkar, A. Non-stochastic Best Arm Identification and Hyperparameter Optimization. arXiv:1502.07943 [cs, stat], February 2015. +[27] Jin, S., Li, G., Song, S. L., and Tao, D. A Novel Memory-Efficient Deep Learning Training Framework via Error-Bounded Lossy Compression. arXiv:2011.09017 [cs], November 2020. +[28] Karimi, H., Nutini, J., and Schmidt, M. Linear Convergence of Gradient and Proximal-Gradient Methods Under the Polyak-Lojasiewicz Condition. In Frasconi, P., Landwehr, N., Manco, G., and Vreeken, J. (eds.), Machine Learning and Knowledge Discovery in Databases, Lecture Notes in Computer Science, pp. 795–811, Cham, 2016. Springer International Publishing. ISBN 978-3-319-46128-1. doi: 10.1007/978-3-319-46128-1_50. +[29] Kim, J., Lee, J. K., and Lee, K. M. Accurate Image Super-Resolution Using Very Deep Convolutional Networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1646–1654, 2016. +[30] Krizhevsky, A., Sutskever, I., and Hinton, G. E. ImageNet classification with deep convolutional neural networks. In Proceedings of the 25th International Conference on Neural Information Processing Systems - Volume 1, NIPS'12, pp. 1097-1105, Red Hook, NY, USA, December 2012. Curran Associates Inc. +[31] Kwon, Y. and Rhu, M. Beyond the memory wall: A case for memory-centric HPC system for deep learning. In Proceedings of the 51st Annual IEEE/ACM International Symposium on Microarchitecture, MICRO-51,pp.148-161,Fukuoka, Japan, October 2018.IEEE Press.ISBN 978-1-5386-6240-3.doi:10.1109/MICRO.2018.00021. +[32] LeCun, Y. and Cortes, C. MNIST handwritten digit database. http://yann.lecun.com/exdb/mnist/, 2010. + +[33] Lecun, Y., Bottou, L., Bengio, Y., and Haffner, P. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324, November 1998. ISSN 1558-2256. doi: 10.1109/5.726791. +[34] Li, F., Zhang, B., and Liu, B. Ternary Weight Networks. arXiv:1605.04711 [cs], May 2016. +[35] Li, H., De, S., Xu, Z., Studer, C., Samet, H., and Goldstein, T. Training quantized nets: A deeper understanding. In Proceedings of the 31st International Conference on Neural Information Processing Systems, NIPS'17, pp. 5813-5823, Red Hook, NY, USA, December 2017. Curran Associates Inc. ISBN 978-1-5108-6096-4. +[36] Li, L., Jamieson, K., DeSalvo, G., Rostamizadeh, A., and Talwalkar, A. Hyperband: A novel bandit-based approach to hyperparameter optimization. The Journal of Machine Learning Research, 18(1):6765-6816, January 2017. ISSN 1532-4435. +[37] Li, Z. and De Sa, C. M. Dimension-Free Bounds for Low-Precision Training. In Advances in Neural Information Processing Systems, volume 32. Curran Associates, Inc., 2019. +[38] Lin, Y., Han, S., Mao, H., Wang, Y., and Dally, W. J. Deep Gradient Compression: Reducing the Communication Bandwidth for Distributed Training. arXiv:1712.01887 [cs, stat], December 2017. +[39] Maas, A. L., Daly, R. E., Pham, P. T., Huang, D., Ng, A. Y., and Potts, C. Learning word vectors for sentiment analysis. In Proceedings of the 49th Annual Meeting of the Association for Computational Linguistics: Human Language Technologies - Volume 1, HLT '11, pp. 142-150, USA, June 2011. Association for Computational Linguistics. ISBN 978-1-932432-87-9. +[40] Milne, T. Piecewise Strong Convexity of Neural Networks. Advances in Neural Information Processing Systems, 32:12973-12983, 2019. +[41] Nedic, A. and Bertsekas, D. Convergence Rate of Incremental Subgradient Algorithms. In Uryasev, S. and Pardalos, P. M. (eds.), Stochastic Optimization: Algorithms and Applications, Applied Optimization, pp. 223-264. Springer US, Boston, MA, 2001. ISBN 978-1-4757-6594-6. doi: 10.1007/978-1-4757-6594-6_11. +[42] Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga, L., Desmaison, A., Kopf, A., Yang, E., DeVito, Z., Raison, M., Tejani, A., Chilamkurthy, S., Steiner, B., Fang, L., Bai, J., and Chintala, S. PyTorch: An Imperative Style, High-Performance Deep Learning Library. Advances in Neural Information Processing Systems, 32:8026-8037, 2019. +[43] Raihan, M. A. and Aamodt, T. M. Sparse Weight Activation Training. arXiv:2001.01969 [cs, stat], October 2020. +[44] Real, E., Aggarwal, A., Huang, Y., and Le, Q. V. Regularized Evolution for Image Classifier Architecture Search. Proceedings of the AAAI Conference on Artificial Intelligence, 33(01): 4780-4789, July 2019. ISSN 2374-3468. doi: 10.1609/aaai.v33i01.33014780. +[45] Rhu, M., Gimelshein, N., Clemons, J., Zulfiqar, A., and Keckler, S. W. vDNN: Virtualized Deep Neural Networks for Scalable, Memory-Efficient Neural Network Design. arXiv:1602.08124 [cs], July 2016. +[46] Rhu, M., O'Connor, M., Chatterjee, N., Pool, J., Kwon, Y., and Keckler, S. W. Compressing DMA Engine: Leveraging Activation Sparsity for Training Deep Neural Networks. In 2018 IEEE International Symposium on High Performance Computer Architecture (HPCA), pp. 78-91, February 2018. doi: 10.1109/HPCA.2018.00017. +[47] Rogers, T. G., Johnson, D. R., O'Connor, M., and Keckler, S. W. A variable warp size architecture. In 2015 ACM/IEEE 42nd Annual International Symposium on Computer Architecture (ISCA), pp. 489-501, June 2015. doi: 10.1145/2749469.2750410. +[48] Rumelhart, D. E., Hinton, G. E., and Williams, R. J. Learning representations by backpropagating errors. Nature, 323(6088):533-536, October 1986. ISSN 1476-4687. doi: 10.1038/323533a0. +[49] Saito, S. Chainer-cifar10: Various CNN models including for CIFAR10 with Chainer. https://github.com/mitmul/chainer-cifar10, May 2018. +[50] Simonyan, K. and Zisserman, A. Very Deep Convolutional Networks for Large-Scale Image Recognition. arXiv:1409.1556 [cs], September 2014. + +[51] Sun, X., Wang, N., Chen, C.-Y., Ni, J., Agrawal, A., Cui, X., Venkataramani, S., El Maghraoui, K., Srinivasan, V. V., and Gopalakrishnan, K. Ultra-low precision 4-bit training of deep neural networks. In Larochelle, H., Ranzato, M., Hadsell, R., Balcan, M. F., and Lin, H. (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 1796-1807. Curran Associates, Inc., 2020. +[52] Tan, M. and Le, Q. EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks. In International Conference on Machine Learning, pp. 6105-6114. PMLR, May 2019. +[53] Tokui, S., Okuta, R., Akiba, T., Niitani, Y., Ogawa, T., Saito, S., Suzuki, S., Uenishi, K., Vogel, B., and Yamazaki Vincent, H. Chainer: A Deep Learning Framework for Accelerating the Research Cycle. In Proceedings of the 25th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, KDD '19, pp. 2002-2011, New York, NY, USA, July 2019. Association for Computing Machinery. ISBN 978-1-4503-6201-6. doi: 10.1145/3292500.3330756. +[54] Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L., and Polosukhin, I. Attention is All you Need. In Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017. +[55] Virmaux, A. and Scaman, K. Lipschitz regularity of deep neural networks: Analysis and efficient estimation. Advances in Neural Information Processing Systems, 31:3835-3844, 2018. +[56] Wang, Y., Xu, C., You, S., Tao, D., and Xu, C. CNNpack: Packing Convolutional Neural Networks in the Frequency Domain. In Lee, D. D., Sugiyama, M., Luxburg, U. V., Guyon, I., and Garnett, R. (eds.), Advances in Neural Information Processing Systems 29, pp. 253-261. Curran Associates, Inc., 2016. +[57] Wu, S., Li, G., Chen, F., and Shi, L. Training and Inference with Integers in Deep Neural Networks. In International Conference on Learning Representations, February 2018. +[58] Wu, W. Reproduce ResNet-v2 (Identity Mappings in Deep Residual Networks) with MXNet. https://github.com/ tornadomeet/ResNet, January 2021. +[59] Zagoruyko, S. and Komodakis, N. Wide Residual Networks. arXiv:1605.07146 [cs], May 2016. + +# Checklist + +1. For all authors... + +(a) Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope? [Yes] See Section 6 +(b) Did you describe the limitations of your work? [Yes] See Section 6 +(c) Did you discuss any potential negative societal impacts of your work? [No] This work has the positive impact of decreasing training times, which decreases overall carbon footprint and allows for research of models which benefit society. However, depending on how these models are used there is a possibility of negative impacts such as surveillance, privacy concerns, or job loss. +(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] + +2. If you are including theoretical results... + +(a) Did you state the full set of assumptions of all theoretical results? [Yes] See Section 3, Appendix A, and the assumptions from Karimi et al. [28], Section 3.3 +(b) Did you include complete proofs of all theoretical results? [Yes] See Appendix A + +3. If you ran experiments... + +(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] See Section 6, Appendices C and D, and the code available at https://github.com/rdevans0/acgc +(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 6 and Appendix D + +(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] See Appendix E due to space limitations +(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Table 2. This work used an internal cluster. + +4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... + +(a) If your work uses existing assets, did you cite the creators? [Yes] We cite the original works for all datasets, models and hyperparameters in Section 6 +(b) Did you mention the license of the assets? [No] All are public use +(c) Did you include any new assets either in the supplemental material or as a URL? [No] +(d) Did you discuss whether and how consent was obtained from people whose data you're using/curating? [No] This is discussed in the original publications on these datasets +(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [No] This is discussed in the original publications on these datasets + +5. If you used crowdsourcing or conducted research with human subjects... + +(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] This work does not involve human subjects +(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] +(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] \ No newline at end of file diff --git a/acgclossyactivationcompressionwithguaranteedconvergence/images.zip b/acgclossyactivationcompressionwithguaranteedconvergence/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..2d0e0bd76826f4a002ce72f87bd7cc168f53f647 --- /dev/null +++ b/acgclossyactivationcompressionwithguaranteedconvergence/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d8680d32c6f6262ed0a2257784ebce74c9981a2308fb2a5cba37579ef6944fa5 +size 428668 diff --git a/acgclossyactivationcompressionwithguaranteedconvergence/layout.json b/acgclossyactivationcompressionwithguaranteedconvergence/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..f7648d82d3adddaa7565bbb0562b4c6b2b09048c --- /dev/null +++ b/acgclossyactivationcompressionwithguaranteedconvergence/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:188edc1dc2cc845fff8dfd5fec50f454706a4d0d0fcfed8f402ab328e1e711f6 +size 514959 diff --git a/afasterdecentralizedalgorithmfornonconvexminimaxproblems/b0e8dcfe-e3b3-40e8-9e3a-9cf865dce49c_content_list.json b/afasterdecentralizedalgorithmfornonconvexminimaxproblems/b0e8dcfe-e3b3-40e8-9e3a-9cf865dce49c_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..8f50ba0e7e81a09deffa9b3040c135af733f693d --- /dev/null +++ b/afasterdecentralizedalgorithmfornonconvexminimaxproblems/b0e8dcfe-e3b3-40e8-9e3a-9cf865dce49c_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7067c931d64b8502f4e20e97c73b2ab0541f14ea0ea3b00926ab2dc604f7f558 +size 79788 diff --git a/afasterdecentralizedalgorithmfornonconvexminimaxproblems/b0e8dcfe-e3b3-40e8-9e3a-9cf865dce49c_model.json b/afasterdecentralizedalgorithmfornonconvexminimaxproblems/b0e8dcfe-e3b3-40e8-9e3a-9cf865dce49c_model.json new file mode 100644 index 0000000000000000000000000000000000000000..edd882cfe26ae409ee3163fff5ea56740840feea --- /dev/null +++ b/afasterdecentralizedalgorithmfornonconvexminimaxproblems/b0e8dcfe-e3b3-40e8-9e3a-9cf865dce49c_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa026f039655061e5a5087690f6b76de739bf80be15aeb7a9da3394c8246c3e9 +size 102404 diff --git a/afasterdecentralizedalgorithmfornonconvexminimaxproblems/b0e8dcfe-e3b3-40e8-9e3a-9cf865dce49c_origin.pdf b/afasterdecentralizedalgorithmfornonconvexminimaxproblems/b0e8dcfe-e3b3-40e8-9e3a-9cf865dce49c_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..253eecc9a5a471ee7d9d851d17f8a50c3cc0303e --- /dev/null +++ b/afasterdecentralizedalgorithmfornonconvexminimaxproblems/b0e8dcfe-e3b3-40e8-9e3a-9cf865dce49c_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb2194fdcc67d00ce5e10370245d959075ac8ae8ca82e75e6e5d0c98e1e789c2 +size 606909 diff --git a/afasterdecentralizedalgorithmfornonconvexminimaxproblems/full.md b/afasterdecentralizedalgorithmfornonconvexminimaxproblems/full.md new file mode 100644 index 0000000000000000000000000000000000000000..50d0f3be1d477405935e4c926f37ec2638e5f854 --- /dev/null +++ b/afasterdecentralizedalgorithmfornonconvexminimaxproblems/full.md @@ -0,0 +1,361 @@ +# A Faster Decentralized Algorithm for Nonconvex Minimax Problems + +Wenhan Xian, Feihu Huang, Yanfu Zhang, Heng Huang + +Electrical and Computer Engineering, University of Pittsburgh, Pittsburgh, PA 15213 wex37@pitt.edu, huangfeihu2018@gmail.com, yaz91@pitt.edu, heng.huang@pitt.edu + +# Abstract + +In this paper, we study the nonconvex-strongly-concave minimax optimization problem on decentralized setting. The minimax problems are attracting increasing attentions because of their popular practical applications such as policy evaluation and adversarial training. As training data become larger, distributed training has been broadly adopted in machine learning tasks. Recent research works show that the decentralized distributed data-parallel training techniques are specially promising, because they can achieve the efficient communications and avoid the bottleneck problem on the central node or the latency of low bandwidth network. However, the decentralized minimax problems were seldom studied in literature and the existing methods suffer from very high gradient complexity. To address this challenge, we propose a new faster decentralized algorithm, named as DM-HSGD, for nonconvex minimax problems by using the variance reduced technique of hybrid stochastic gradient descent. We prove that our DM-HSGD algorithm achieves stochastic first-order oracle (SFO) complexity of $O(\kappa^3\epsilon^{-3})$ for decentralized stochastic nonconvex-strongly-concave problem to search an $\epsilon$ -stationary point, which improves the exiting best theoretical results. Moreover, we also prove that our algorithm achieves linear speedup with respect to the number of workers. Our experiments on decentralized settings show the superior performance of our new algorithm. + +# 1 Introduction + +Minimax optimization has enormous applications in machine learning tasks such as Generative Adversarial Net (GAN) [8], adversarial training [26] and multi-agent reinforcement learning [43]. Specifically, in minimax optimization, variable $x$ aims to minimize a payoff loss function $f(x,y): \mathbb{R}^{d_1} \times \mathbb{R}^{d_2} \to \mathbb{R}$ while variable $y$ tries to maximize the loss, which can be formulated as + +$$ +\min _ {x \in \mathcal {X}} \max _ {y \in \mathcal {Y}} f (x, y), \tag {1} +$$ + +where $\mathcal{X} \subseteq \mathbb{R}^{d_1}$ and $\mathcal{V} \subseteq \mathbb{R}^{d_2}$ . In the past a few decades, there are plenty of works to study minimax optimization problems in a variety of research fields and many methods have been developed. The most intuitive solution is Gradient Descent Ascent (GDA) algorithm [6, 29] with equal stepsize $\eta_x = \eta_y$ . Asymptotic and nonasymptotic convergence analysis has been provided when $f$ is convex in $x$ and concave in $y$ . Recently, many deterministic and stochastic gradient algorithms for nonconvex-strongly-concave and nonconvex-concave problems were proposed. Some algorithms improve the performance of vanilla GDA method by adopting different stepsize on $x$ and $y$ , such as [10, 19], where the stepsize of $y$ is typically larger than the stepsize of $x$ . Some algorithms update $x$ and $y$ at different frequency, such as [14, 25, 32]. These kind of algorithms usually involve a nested loop structure that updates $y$ more frequently than $x$ to make $f(x,y)$ close to function $\Phi(x)$ , which is defined by + +$$ +\Phi (x) = \max _ {y \in \mathcal {Y}} f (x, y). \tag {2} +$$ + +As more large-scale machine learning problems are arising, distributed training becomes a popular and crucial framework because of its ability and efficiency to deal with large data. It is desired to generalize minimax optimization to distributed training to solve large-scale minimax problems. In distributed optimization, the original centralized optimization suffers from a bottleneck communication problem, i.e. the communication traffic on the busiest central node, especially when the network is large [18, 51]. To tackle this communication issue, decentralized optimization was proposed and has emerged as a promising technique. It is a kind of distributed machine learning training paradigm that does not rely on the centralized network topology. Different worker nodes collaboratively utilize their own local data to implement large-scale training tasks and at each iteration they only have to communicate with their neighbors. Decentralized algorithms have been shown to enhance the communication efficiency by avoiding the communication overhead problem. Decentralized methods are also advantageous when the network suffers from communication restriction or has low bandwidth between some nodes and the central node. Besides, it is also an essential method in some situations where data are geographically distributed and centralized data processing is not available or there are concerns to preserve data privacy [48]. + +Recently many works were proposed to improve the performance of decentralized training. D-PSGD [18] theoretically justifies the potential advantage of decentralized algorithm. $D^2$ [38] improves the convergence rate to outperform D-PSGD by eliminating the influence of data variance among different workers. D-SPIDER-SFO [33] incorporates $D^2$ and SPIDER [7, 44], which is a kind of variance reduction technique [15], to further reduce the gradient complexity. DQSFW [45] studies decentralized constrained problem with Frank-Wolfe method. GT-HSGD [46] extends hybrid stochastic gradient descent to decentralized setting, which is a variance-reduced approach that does not compute mega batch periodically. However, the decentralized minimax optimization is still very limited and existing methods suffer from very high gradient complexity [21, 41]. Thus, we are motivated to design an accelerated decentralized algorithm for minimax problems. + +In this paper, thus, we propose a faster Decentralized Minimax Hybrid Stochastic Gradient Descent (DM-HSGD) algorithm to solve the following decentralized stochastic minimax optimization problem: + +$$ +\min _ {x \in \mathbb {R} ^ {d _ {1}}} \max _ {y \in \mathcal {Y}} f (x, y) = \frac {1}{n} \sum_ {i = 1} ^ {n} f _ {i} (x, y), \quad f _ {i} (x, y) := \mathbb {E} _ {\xi^ {(i)} \sim D _ {i}} F _ {i} (x, y; \xi^ {(i)}) \tag {3} +$$ + +where $n$ is the number of worker nodes, $\mathcal{Y}$ is a convex set. Here the local component objective function $F_{i}(x,y;\xi^{(i)})$ is $L$ -smooth, nonconvex in $x$ , and strongly-concave in $y$ . $D_{i}$ is the data distribution on the $i$ -th node. In this paper, the data distribution can be non-identical. Random variable $\xi^{(i)}$ is an index sampled from the local data. We summarize our contributions as follows: + +(1) In this paper, we propose a new accelerated decentralized stochastic first-order algorithm, named as DM-HSGD, to solve the decentralized nonconvex-strongly-concave minimax optimization problems. Our algorithm is the first stochastic gradient algorithm to solve general decentralized minimax problem on non-identical distributed data with theoretical guarantees. Besides, our algorithm does not require large batch size or nested loop which makes it more practical and efficient to implement. +(2) We provide a completed proof to guarantee the convergence of our algorithm to solve decentralized stochastic minimax optimization. Under nonconvex-strongly-concave condition, our algorithm obtains SFO complexity of $O(\kappa^3 \epsilon^{-3})$ to search an $\epsilon$ -stationary point of function $\Phi(x) = \max_{y \in \mathcal{Y}} f(x, y)$ . This result is faster than the complexity of previous decentralized minimax algorithms [21, 41]. Moreover, we also prove that our method achieves linear speedup as the number of workers $n$ increases, which verifies its ability to solve large-scale problems. + +The rest of this paper will be organized as follows. In Section 2, we will introduce related works. In Section 3, we will introduce our new DM-HSGD algorithm. In Section 4, we will show the main theorems of convergence and complexity analysis. In Section 5, we will discuss our experimental results, and Section 6 will conclude the paper. + +Table 1: Comparison of Related Algorithms for Minimax Optimization + +
NameSFODecentralizedStochasticImplementationReference
SGDAO(κ3ε-4)×single-loop[19]
SGDmaxO(κ3ε-4 log(1/ε))×double-loop[19]
SREDAO(κ3ε-3)×double-loop[25]
Acc-MDAO(κ3ε-3)×single-loop[11]
DPOSGO(ε-12)✓ (iid)single-loop[21]
GT/DAO(Nε-2 log(1/ε))✓ (non-iid)×double-loop[41]
DM-HSGDO(κ3ε-3)✓ (non-iid)single-loopOurs
+ +# 2 Related Works + +# 2.1 Centralized Minimax Optimization + +In recent years, many algorithms for solving minimax optimization were proposed, and the majority of them were studied under the nonconvex-strongly-concave condition. SGDmax [14] is a double loop algorithm that achieves SFO complexity of $O(\kappa^{3}\epsilon^{-4}\log (1 / \epsilon))$ where $\kappa = L / \mu$ is the condition number. Proximally Guided Stochastic Mirror Descent and Variance Reduction (PGSMD/PGSVRG) [34] are double loop algorithms that achieve SFO complexity of $O(\kappa^{3}\epsilon^{-4})$ for stochastic problem and $O(\kappa^2 N\epsilon^{-2})$ for finite-sum problem where $N$ is the number of samples. Multistep GDA (MGDA) [32] is a double loop algorithm and HiBSA [23] is a single loop algorithm. Both MGDA and HiBSA are deterministic hence they can only solve finite-sum problems. Both of them achieve SFO complexity of $O(\kappa^4 N\epsilon^{-2})$ . Proximal Dual Implicit Accelerated Gradient (ProxDIAG) is a deterministic triple loop algorithm whose SFO complexity for finite-sum problem is $O(\kappa^{1 / 2}N\epsilon^{-2})$ . + +SGDA [19], Stochastic Recursive gradiEnt Descent Ascent (SREDA) [25], and Hybrid Variance-Reduced SGD [40] are more related to our work. SGDA is a single loop algorithm to solve nonconvex-strongly-concave and nonconvex-concave minimax problems. For nonconvex-strongly-concave problem, it requires $O(\kappa^3 \epsilon^{-4})$ SFO complexity to find an $\epsilon$ -stationary point of $\Phi(x)$ . In this paper, we will prove that our method achieves a better SFO complexity. + +SREDA [25] is a double loop algorithm that achieves $O(\kappa^3 \epsilon^{-3})$ SFO complexity. It accelerates SGDA by using SPIDER, which is a variance reduction technique and utilizes the newest gradient information [7, 30]. SREDA also involves a separated initialization algorithm called PiSARAH [31] to ensure the convergence. More recently, [13] proposed an efficient mirror descent ascent algorithm for nonconvex-strongly-concave minimax optimization with nonsmooth regularization based on Bregman distance and variance reduced technique of SPIDER. In our paper, we use another variance-reduced technique named STORM or hybrid stochastic gradient descent [3] to accelerate the algorithm. We will discuss the challenges of using SPIDER on decentralized settings in Section 3. Different from SREDA, our method only requires a large batch at the first iteration. Except the first iteration, we can use either a single sample or a mini-batch to calculate the stochastic gradient. However, SREDA loads a mega-batch with size $O(\epsilon^{-2})$ periodically (every $q$ iterations) and needs $O(\epsilon^{-1})$ gradient oracles at each iteration, which is not practical for large-scale problems. Besides, the maximizer in SREDA is a nested loop to update variable $y$ and if we count the loop of SPIDER then SREDA is actually a triple algorithm. On the contrary, there is no nested loop in our DM-HSGD, which makes our method more efficient and convenient to implement. Moreover, unlike SREDA, our method does not require a separated initialization algorithm to calculate a precise initial value for $y$ . + +Hybrid Variance-Reduced SGD algorithm also takes advantage of hybrid stochastic gradient descent to accelerate minimax optimization. For example, [40, 11] applied the Hybrid Variance-Reduced SGD to minimax problems. More recently, [9, 12] proposed some efficient adaptive gradient descent ascent methods for nonconvex-strongly-concave minimax optimization based on momentum techniques including Hybrid Variance-Reduced SGD. + +# 2.2 Decentralized Minimax Optimization + +At decentralized setting, most minimax algorithms were proposed for convex-concave problem [17, 28]. In [22] a nonconvex-nonconcave algorithm DPPSP was proposed. However, it is not + +gradient-based and the closed-form solution to the subproblem is not ensured in our problem. Hence we will not discuss it in this paper. Decentralized Parallel Optimistic Stochastic Gradient (DPOSG) [21] is the first algorithm applicable to a general decentralized minimax problem with theoretical guarantees. It is a single loop minimax algorithm that generalizes Optimistic Stochastic Gradient (OSG) [2] to decentralized training. However, DPOSG has some obvious drawbacks. The first one is that the gradient complexity $O(\epsilon^{-12})$ is too high and we are motivated to design a faster algorithm. The second one is that DPOSG only works in the case where the data distribution is identical. When the data distribution is non-identical, the Lemma 3 in [21] is not satisfied. Actually the assumption of identical data distribution is not satisfied at most decentralized training tasks. Thus, in this paper, we do not use this assumption. + +More recently, [41] studied decentralized nonconvex-strongly-concave minimax problems and proposed a double loop deterministic Gradient Tracking/Descent-Ascent algorithm which extends the vanilla GDA to decentralized setting and combines it with gradient tracking. It achieves a gradient complexity of $O(\epsilon^{-2})$ . However, in large-scale machine learning tasks such as deep neural network, generally the full gradient is unavailable and the application of deterministic algorithms is very restricted. If we convert Gradient Tracking/Descent-Ascent to stochastic gradient version, the SFO complexity should be at least $O(\epsilon^{-4})$ , which is the same result as SGD in nonconvex optimization. Under the same conditions, our new algorithm achieves a better SFO complexity of $O(\epsilon^{-3})$ . + +[24] studied decentralized reinforcement learning problem based on distributed constrained Markov decision process model and proposed a decentralized policy gradient optimization method named Safe Dec-PG, which achieves SFO complexity of $O(\epsilon^{-4})$ . However, the problem studied in [24] has a special form that is linear in $y$ . In this paper, we focus on general minimax problem. [1] is a simultaneous work of our work that studies a more general decentralized variational inequality problem with higher complexity. We summarize the comparison of related algorithms for general minimax optimization in Table 1. For decentralized algorithms DPOSG, GT/DA, and DM-HSGD, we also discuss whether they can converge on non-identical distributed data. + +# 3 Proposed New Algorithm + +# 3.1 Preliminaries + +Before we propose our algorithms, we will introduce the notations used in this paper and some important concepts. We use lower case $x_{t}^{(i)}$ and $y_{t}^{(i)}$ to represent the column vector parameters on $i$ -th worker node. We use upper case $X_{t}$ and $Y_{t}$ to represent the $n$ -column matrix formed by $x_{t}^{(i)}$ and $y_{t}^{(i)}$ respectively, which means $X_{t} = [x_{t}^{(1)}, x_{t}^{(2)}, \ldots, x_{t}^{(n)}]$ and $Y_{t} = [y_{t}^{(1)}, y_{t}^{(2)}, \ldots, y_{t}^{(n)}]$ . Column vectors $u_{t}^{(i)}, v_{t}^{(i)}, g_{t}^{(i)}$ and $h_{t}^{(i)}$ are gradient estimators used in our algorithms. Upper case $U_{t}, V_{t}, G_{t}$ and $H_{t}$ are matrices of which the $i$ -th column is $u_{t}^{(i)}, v_{t}^{(i)}, g_{t}^{(i)}$ and $h_{t}^{(i)}$ respectively. Lower case with a bar represents the mean vector. Upper case with a bar represents the matrix that each column is the mean vector. For example, $\bar{x}_{t} = \frac{1}{n}\sum_{i=1}^{n}x_{t}^{(i)}$ and $\bar{X}_{t} = [\bar{x}_{t},\bar{x}_{t},\dots,\bar{x}_{t}]$ . We define the optimal maximum value of $y$ as: + +$$ +y ^ {*} (\cdot) = \underset {y \in \mathcal {Y}} {\arg \max } f (\cdot , y), \quad \hat {y} _ {t} = \underset {y \in \mathcal {Y}} {\arg \max } f (\bar {x} _ {t}, y) \tag {4} +$$ + +Note that when $f$ is strongly-concave in $y$ , $\hat{y}_t$ is unique. We also define: + +$$ +\delta_ {t} = \left\| \hat {y} _ {t} - \bar {y} _ {t} \right\| ^ {2} \tag {5} +$$ + +Bold number 0 and 1 are $n \times 1$ column vectors that each entry is 0 and 1, respectively. For matrices, we use $\| \cdot \|_F$ to denote Frobenius norm and $\| \cdot \|_2$ to denote spectral norm. We use $\nabla_x$ and $\nabla_y$ to denote the partial derivative with respect to $x$ and $y$ . + +Mixing matrix $W$ represents the weights of averaging among the communication network topology. It is doubly stochastic which satisfies: + +$$ +W \mathbf {1} = W ^ {T} \mathbf {1} = \mathbf {1} \tag {6} +$$ + +We should notice that here matrix $W$ is not assumed to be symmetric so that the communication network is not restricted to undirected graph. + +# Algorithm 1 DM-HSGD + +Input: mixing matrix $W$ , initial value $x_0^{(i)} = x_0$ , $y_0^{(i)} = y_0$ , $v_{-1}^{(i)} = g_{-1}^{(i)} = 0$ , $u_{-1}^{(i)} = h_{-1}^{(i)} = 0$ + +Parameter: stepsize $\eta_{x}$ $\eta_{y}$ weight $\beta_{x},\beta_{y}$ , batch size $b_{0}$ , iteration $T$ + +Output: $\bar{x}_{\zeta}$ , where $\zeta$ is chosen randomly from $\{1,2,\dots,T\}$ + +1: On i-th node: +2: for $t = 0,1,\ldots ,T - 1$ do +3: if $t = 0$ then +4: $g_{t}^{(i)} = \nabla_{x}F_{i}(x_{t}^{(i)},y_{t}^{(i)};\xi_{x,t}^{(i)})$ $|\xi_{x,t}^{(i)}| = b_0$ +5: $h_t^{(i)} = \nabla_yF_i(x_t^{(i)},y_t^{(i)};\xi_{y,t}^{(i)})$ $|\xi_{y,t}^{(i)}| = b_0$ +6: else +7: $g_{t}^{(i)} = \nabla_{x}F_{i}(x_{t}^{(i)},y_{t}^{(i)};\xi_{t}^{(i)}) + (1 - \beta_{x})(g_{t - 1}^{(i)} - \nabla_{x}F_{i}(x_{t - 1}^{(i)},y_{t - 1}^{(i)};\xi_{t}^{(i)}))$ +8: $h_t^{(i)} = \nabla_yF_i(x_t^{(i)},y_t^{(i)};\xi_t^{(i)}) + (1 - \beta_y)(h_{t - 1}^{(i)} - \nabla_yF_i(x_{t - 1}^{(i)},y_{t - 1}^{(i)};\xi_t^{(i)}))$ +9: end if + +10: Communicate with neighbors and update gradient estimator as follows + +11: $v_{t}^{(i)} = \sum_{j=1}^{n} w_{ij}(v_{t-1}^{(j)} + g_{t}^{(j)} - g_{t-1}^{(j)})$ +12: $u_{t}^{(i)} = \sum_{j = 1}^{n}w_{ij}(u_{t - 1}^{(j)} + h_{t}^{(j)} - h_{t - 1}^{(j)})$ +13: Communicate with neighbors and update model parameter as follows +14: $x_{t + 1}^{(i)} = \sum_{j = 1}^{n}w_{ij}(x_t^{(j)} - \eta_xv_t^{(j)})$ +15: $y_{t + \frac{1}{2}}^{(i)} = \sum_{j = 1}^{n}w_{ij}(y_t^{(j)} + \eta_yu_t^{(j)})$ $y_{t + 1}^{(i)} = P\mathcal{Y}(y_{t + \frac{1}{2}}^{(i)})$ +16: end for + +# 3.2 Decentralized Minimax Hybrid Stochastic Gradient Descent + +In this subsection, we introduce our new Decentralized Minimax Hybrid Stochastic Gradient Descent (DM-HSGD) algorithm. Our algorithm is a single loop minimax algorithm (summarized in Algorithm 1) which does not contain a nested loop structure. + +The initial points of different nodes are the same, i.e. $x_0^{(i)} = x_0$ and $y_0^{(i)}$ . $g_t^{(i)}$ and $h_t^{(i)}$ are the gradient estimators with respect to $x$ and $y$ on $i$ -th node. $g_t^{(i)}$ and $h_t^{(i)}$ are computed in the same way as STORM [3]. When $t = 0$ , we load a large batch with size $b_0$ to calculate the stochastic gradient (lines 4 and 5 in Algorithm 1). When $t > 0$ , we can use either a single sample or a mini-batch to calculate the gradient (lines 7 and 8 in Algorithm 1). $g_t^{(i)}$ can also be written as + +$$ +g _ {t} ^ {(i)} = \beta_ {x} \nabla_ {x} F _ {i} (x _ {t} ^ {(i)}, y _ {t} ^ {(i)}; \xi_ {t} ^ {(i)}) + (1 - \beta_ {x}) \left(g _ {t - 1} ^ {(i)} - \nabla_ {x} F _ {i} (x _ {t - 1} ^ {(i)}, y _ {t - 1} ^ {(i)}; \xi_ {t} ^ {(i)}) + \nabla_ {x} F _ {i} (x _ {t} ^ {(i)}, y _ {t} ^ {(i)}; \xi_ {t} ^ {(i)})\right) (7) +$$ + +which is a linear combination of the gradient estimators of stochastic gradient descent (the first part) and SPIDER (the second part). As we have mentioned, SPIDER is a variance-reduced method that utilizes the newest gradient information. Thus, estimator Eq. (7) is also called hybrid stochastic gradient descent. It is the same with $h_t^{(i)}$ . Then each worker communicates with their neighbors to compute gradient estimator $v_t^{(i)}$ and $u_t^{(i)}$ . Here we use gradient tracking [5, 47] to reduce the consensus error (lines 11 and 12 in Algorithm 1). We will discuss why gradient tracking is necessary in our method at next subsection. After we obtain $u_t^{(i)}$ and $v_t^{(i)}$ , each worker communicates with their neighbors again and updates the model parameters $x$ and $y$ . Here $P_{\mathcal{Y}}(\cdot)$ represents the projection onto convex set $\mathcal{Y}$ . In the theoretical analysis, we define $Y_{-\frac{1}{2}} = Y_0$ . + +# 3.3 Discussions on STORM and Gradient Tracking + +In this subsection, we will discuss the intuition of our algorithm and explain why we choose STORM and gradient tracking rather than generalizing SREDA for decentralized setting. The first reason is that SREDA requires large batch or full batch periodically, which is expensive and even unavailable. Besides, there are too many nested loops in SREDA and it is not efficient or convenient. From the view of theoretical analysis, normalization or projection are likely to cause divergence in decentralized training on non-identical data distribution, which is indicated by the following Example 1. Therefore, in the circumstance of this paper, SPIDER will probably not converge to a stationary point. Besides, + +SREDA adopts smaller stepsize at the beginning and larger stepsize at the end when $\| v_{t} \|$ becomes small enough. However, when the data distribution is non-identical, $\| v_{t} \|$ may not tend to 0 and the stepsize of SREDA will probably always keep small. In contrast, STORM can avoid these issues and we use STORM to accelerate the decentralized minimax algorithm. + +In the standard decentralized framework D-PSGD [18], the consensus error satisfies $\| X_{t} - \bar{X}_{t}\|_{F}\leq O(\epsilon)$ when the stepsize $\eta$ is $O(\epsilon)$ and $t$ is large enough. The following Example 2 is a simple example to show that this bound is tight and there are cases where consensus error $\| X_{t} - \bar{X}_{t}\|_{F}$ is exactly $\Theta (\eta)$ when the data distribution is non-identical. However, according to the analysis of STORM [3] without gradient tracking, the error term $e_t = \bar{g}_t - \nabla_xf(\bar{x}_t,\bar{y}_t)$ between the averaged update direction and the correct direction is supposed to satisfy: + +$$ +\left\| e _ {t} \right\| ^ {2} \leq \left(1 - \beta_ {x}\right) \left\| e _ {t - 1} \right\| ^ {2} + O \left(\eta_ {x} ^ {4}\right). \tag {8} +$$ + +Nevertheless, the consensus error $\| X_{t} - \bar{X}_{t}\|_{F}^{2}$ is only $O(\eta_x^2)$ and cannot be as small as $O(\eta_x^4)$ if there is no gradient tracking. Therefore, to inherit the analysis framework of STORM, the gradient tracking in our algorithm is essential. + +Example 1. Assume $f(x) = f_{1}(x) + f_{2}(x)$ , where $x = (a, b) \in R^{2}$ . $f_{1}(x) = a$ and $f_{2}(x) = \sqrt{3}b$ are defined on two different nodes. Let $W$ be the uniform weighted mixing matrix. We can compute $v_{1} = (1,0)$ and $v_{2} = (0, \sqrt{3})$ . The ideal averaged gradient direction is $v^{*} = (1/2, \sqrt{3}/2)$ . However, if we do normalization before making consensus, the obtained gradient estimator is $v = (1/2, 1/2)$ , which is deviated from $v^{*}$ . + +Example 2. Suppose there are two sequences $\{p_t\}$ and $\{q_t\}$ defined on two different nodes with $p_0 = q_0$ . They are updated by $p_{t + \frac{1}{2}} = p_t - \eta a$ and $q_{t + \frac{1}{2}} = q_t - \eta b$ at each iteration respectively where $a$ and $b$ are fixed gradient directions. As data distribution is non-identical, we have $a \neq b$ . Assume the mixing matrix is + +$$ +W = \left[ \begin{array}{c c} 2 / 3 & 1 / 3 \\ 1 / 3 & 2 / 3 \end{array} \right] +$$ + +Then we have + +$$ +p _ {t + 1} - q _ {t + 1} = \frac {1}{3} \left(p _ {t} - q _ {t}\right) - \frac {\eta}{3} (a - b) = \frac {1}{3 ^ {t + 1}} \left(p _ {0} - q _ {0}\right) - \eta \left(\sum_ {s = 1} ^ {t + 1} \frac {1}{3 ^ {s}}\right) (a - b) = \frac {\eta}{2} \left(1 - \frac {1}{3 ^ {t + 1}}\right) (b - a) \tag {9} +$$ + +Therefore, $\lim_{t\to \infty}\| p_t - q_t\| = \frac{\eta}{2}\| a - b\|$ + +# 4 Convergence Analysis + +In this section, we will show the main theorems of our convergence analysis. The theoretical results show that the SFO complexity of our algorithm is $O(\kappa^3 \epsilon^{-3})$ , which is the same as the best result in centralized minimax problem [25]. First we will introduce the following assumptions. + +Assumption 1. (Lipschitz Gradient). Each component function $F_{i}(x,y;\xi)$ is $L$ -smooth, which means there exists a constant $L$ such that for any $(x,y)$ and $(x',y')$ , we have + +$$ +\| \nabla F _ {i} (x, y; \xi) - \nabla F _ {i} (x ^ {\prime}, y ^ {\prime}; \xi) \| ^ {2} \leq L ^ {2} (\| x - x ^ {\prime} \| ^ {2} + \| y - y ^ {\prime} \| ^ {2}) +$$ + +Assumption 2. (Bounded Variance). The gradient of each component function $F_{i}(x,y;\xi)$ is an unbiased estimator of $\nabla f_{i}(x,y)$ and has bounded variance, i.e., + +$$ +\mathbb {E} \| \nabla F _ {i} (x, y; \xi) - \nabla f _ {i} (x, y) \| ^ {2} \leq \sigma < + \infty +$$ + +Assumption 3. (Lower Bound). The function $\Phi (\cdot)$ is lower bounded, i.e., $\inf_x\Phi (x) = \Phi^* > - \infty$ + +Assumption 4. (Spectral Gap). The doubly stochastic matrix $W$ satisfies $\| W - \frac{11^T}{n} \|_2 = \lambda \in [0,1)$ . + +Assumption 5. (Strongly Concave). The function $f_{i}(x,y)$ is $\mu$ -strongly-concave in $y$ . That is, there exists a constant $\mu > 0$ , for any $x, y$ and $y'$ , we have + +$$ +f _ {i} (x, y) \leq f (x, y ^ {\prime}) + \left\langle \nabla_ {y} f (x, y ^ {\prime}), y - y ^ {\prime} \right\rangle - \frac {\mu}{2} \| y - y ^ {\prime} \| ^ {2} +$$ + +These are very common and mild assumptions that are frequently assumed in previous works. Assumptions 1, 2 and 3 are also used in minimax methods [25] and [19]. Assumption 4 is used in [46]. Typically, the spectral gap assumption is stated as $W$ is symmetric and $|\lambda_2| < 1$ , $|\lambda_n| < 1$ where $\lambda_1 \geq \lambda_2 \geq \dots \geq \lambda_n$ are the eigenvalues of $W$ [16, 18, 51]. Our Assumption 4 is automatically satisfied if the typical spectral gap assumption holds (see Lemma 16 in [16]). Assumption 5 is the definition of strong concavity. + +In nonconvex-strongly-concave problem, we use $\epsilon$ -stationary point of $\Phi(x)$ , i.e. $\| \nabla \Phi(x) \| \leq \epsilon$ as the convergence criterion. From Lemma 4.3 in [19], we know $\Phi(x)$ is differentiable and $(L + \kappa L)$ -smooth and $y^{*}(\cdot)$ is $\kappa$ -Lipschitz, which means $\| y^{*}(x_{1}) - y^{*}(x_{2}) \| \leq \kappa \| x_{1} - x_{2} \|$ for any $x_{1}, x_{2} \in \mathbb{R}^{d_{1}}$ . Furthermore, we have: + +$$ +\nabla \Phi (\bar {x} _ {t}) = \nabla_ {x} f (\bar {x} _ {t}, \hat {y} _ {t}) + \nabla_ {y} f (\bar {x} _ {t}, \hat {y} _ {t}) \cdot \partial y ^ {*} (\bar {x} _ {t}) = \nabla_ {x} f (\bar {x} _ {t}, \hat {y} _ {t}) \tag {10} +$$ + +since $\nabla_y f(\bar{x}_t, \hat{y}_t) = 0$ . This criterion is broadly used in the analysis of nonconvex-strongly-concave minimax optimization [19, 39]. Now we will provide the main theorems of our convergence analysis. Completed proof can be found in the Supplementary Material. + +Theorem 1. Let Assumptions 1 to 5 hold. When parameters $\beta_{x} = \frac{\epsilon\min\{1,n\epsilon\}}{20}$ , $\beta_{y} = \frac{\epsilon\min\{1,n\epsilon\}}{500\kappa^{2}}$ , $\eta_{x} = \frac{(1 - \lambda)^{2}\min\{1,n\epsilon\}}{2000\kappa^{3}L}$ , $\eta_{y} = \frac{(1 - \lambda)^{2}\min\{1,n\epsilon\}}{500\kappa L}$ , $b_{0} = \frac{400}{\min\{1,n\epsilon\}}$ , $T = \frac{4000\kappa^{3}\epsilon^{-2}}{(1 - \lambda)^{2}\min\{1,n\epsilon\}}$ , our Algorithm 1 satisfies + +$$ +\begin{array}{l} \frac {1}{T} \sum_ {t = 0} ^ {T - 1} \mathbb {E} \| \nabla \Phi (\bar {x} _ {t}) \| ^ {2} \leq L (\Phi (x _ {0}) - \Phi^ {*}) \epsilon^ {2} + \sigma^ {2} \epsilon^ {2} + L ^ {2} \delta_ {0} \epsilon^ {2} + \frac {\epsilon^ {2}}{n} \sum_ {i = 1} ^ {n} \mathbb {E} \| \nabla_ {x} f _ {i} (x _ {0}, y _ {0}) \| ^ {2} \\ + \frac {\epsilon^ {2}}{n} \sum_ {i = 1} ^ {n} \mathbb {E} \| \nabla_ {y} f _ {i} \left(x _ {0}, y _ {0}\right) \| ^ {2} \tag {11} \\ \end{array} +$$ + +Corollary 1. When the parameters are defined as Theorem 1, we can see $\frac{1}{T}\sum_{t=0}^{T-1}\mathbb{E}\|\nabla\Phi(\bar{x}_t)\|^2 \leq O(\epsilon^2)$ . Therefore, if $n \leq O(\epsilon^{-1})$ , the SFO complexity of Algorithm 1 is $O(\kappa^3\epsilon^{-3})$ . If $n > O(\epsilon^{-1})$ , the SFO complexity is $O(\kappa^3 n\epsilon^{-2})$ . Besides, from the proof of Theorem 1 we can see error $\| \bar{y}_t - y^*(\bar{x}_t) \|^2$ is also bounded by the right side of Eq. (11). + +Theorem 1 is the theoretical result when $T$ is determined by $\epsilon$ . If the number of iteration $T$ is not fixed, we have the following conclusion. + +Theorem 2. Let Assumptions 1 to 5 hold. We set the parameters as $T = \frac{4000\kappa^3T_0}{(1 - \lambda)^2}$ , $\beta_{x} = \frac{n^{1 / 3}}{20T_{0}^{2 / 3}}$ , $\beta_{y} = \frac{n^{1 / 3}}{500\kappa^{2}T_{0}^{2 / 3}}$ , $\eta_{x} = \frac{(1 - \lambda)^{2}n^{2 / 3}}{2000\kappa^{3}T_{0}^{1 / 3}L}$ , $\eta_{y} = \frac{(1 - \lambda)^{2}n^{2 / 3}}{500\kappa T_{0}^{1 / 3}L}$ , $b_{0} = \frac{T_{0}^{1 / 3}}{n^{2 / 3}}$ , where we suppose $T_{0} \geq 10n^{2}$ . Then our algorithm satisfies + +$$ +\begin{array}{l} \frac {1}{T} \sum_ {t = 0} ^ {T - 1} \mathbb {E} \| \nabla \Phi (\bar {x} _ {t}) \| ^ {2} \leq \frac {L (\Phi (x _ {0}) - \Phi^ {*}) + \sigma^ {2} + L ^ {2} \delta_ {0}}{(n T _ {0}) ^ {2 / 3}} + \frac {\frac {1}{n} \sum_ {i = 1} ^ {n} \mathbb {E} \| \nabla_ {x} f _ {i} (x _ {0} , y _ {0}) \| ^ {2}}{T _ {0}} \\ + \frac {\frac {1}{n} \sum_ {i = 1} ^ {n} \mathbb {E} \| \nabla_ {y} f _ {i} \left(x _ {0} , y _ {0}\right) \| ^ {2}}{T _ {0}} \tag {12} \\ \end{array} +$$ + +Corollary 2. From Theorem 2, we know $\frac{1}{T}\sum_{t=0}^{T-1}\mathbb{E}\|\nabla\Phi(\bar{x}_t)\|^2 \leq O\left(\frac{1}{(nT_0)^{2/3}}\right) + O\left(\frac{1}{T_0}\right)$ when parameters are defined as above. As we suppose $T_0 \geq O(n^2)$ , the dominating term in the convergence rate is $O\left(\frac{1}{(nT_0)^{2/3}}\right)$ , which indicates the linear speedup of our algorithm. + +# 5 Experiments + +# 5.1 Robust Logistic Regression + +We conduct the experiment of decentralized robust logistic regression1 task as the first experiment, which was proposed in [49] and was also conducted in the related work [25]. Given dataset + +$\{(a_i, b_i)\}_{i=1}^n$ , where $a_i \in \mathbb{R}^d$ is the feature and $b_i \in \{-1, 1\}$ is the label, the robust logistic regression problem is formulated as follows: + +$$ +\min _ {x \in \mathbb {R} ^ {d}} \max _ {y \in \Delta_ {n}} f (x, y) = \sum_ {i = 1} ^ {n} y _ {i} l _ {i} (x) - V (y) + g (x) \tag {13} +$$ + +where $y_{i}$ is the $i$ -th component of variable $y$ . $l_{i}(x)$ is the logistic loss function which is defined by $l_{i}(x) = \log (1 + \exp (-b_{i}a_{i}^{T}x))$ . $V(y)$ is a divergence measure defined by $V(y) = \frac{1}{2}\lambda_1\| ny - \mathbf{1}\|^2$ . $\Delta_{n}$ represents the simplex in $\mathbb{R}^n$ , which means + +$$ +\Delta_ {n} = \left\{y \in \mathbb {R} ^ {n} \mid 0 \leq y _ {i} \leq 1, \sum_ {i = 1} ^ {n} y _ {i} = 1 \right\} \tag {14} +$$ + +$g(x)$ is a nonconvex regularization with form $g(x) = \lambda_2\sum_{i=1}^{d}\frac{\alpha x_i^2}{1 + \alpha x_i^2}$ . Following the experimental settings in [25, 49], we let $\lambda_1 = \frac{1}{n^2}$ , $\lambda_2 = 0.001$ and $\alpha = 10$ in our experiment. + +Table 2: Descriptions of datasets used in our experiment + +
Namea9acovtypeijCNN1phishingrcv1w8a
N3256158101249990110552024249749
d12354226847236300
+ +We conduct our experiment on six real-world training datasets "a9a", "covtype", "ijcnn1", "phishing", "rcv1" and "w8a", which can be downloaded from LIBSVM $^2$ repository. The description of datasets is listed in Table 2 where $N$ is the number of samples and $d$ is the number of features. We implement our code on an MPI cluster where each node is equipped with 12-core Intel Xeon E5-2620 v3 2.40 GHz processor. + +![](images/452a54e76badb3967b2803429d988cbe047550a4b1262947031694c70162c305.jpg) +(a) + +![](images/f9990dca077f84a33febae3bf53fc6794bb6b2d36c2bc670aecea6f757327322.jpg) +(b) + +![](images/0b99aa9f8ad8fd1f3fae592d3a324521a9fb60b758c6d25fb08f4dd0ca2c891c.jpg) +(c) + +![](images/5999996bafeae2c2c51c1aa3202e8f89fa4f31c671fd36bdbe6b54b97c68c46f.jpg) +(d) + +![](images/6245e33330d1dce9f531e69f84744e9dec444c10c4f0aa98c7ba8a6daaf84319.jpg) +(e) + +![](images/f0c6cebbacac514e5142381d01070558705a35af2795bf491b4bdfa03dff56f6.jpg) +(f) +Figure 1: Results of our decentralized robust logistic regression task. Figure (a) to (f) show the value of $\Phi(x)$ with respect to the number of gradient oracles divided by $10^3$ . Figure (a), (b), (c), (d), (e) and (f) are experimental results on "a9a", "covtype", "ijcnn1", "phishing", "rcv1" and "w8a" respectively. + +We compare our DM-HSGD algorithm with baseline algorithms: SGDA [19], SREDA [25], DPOSG [21], and stochastic Gradient Tracking/Descent Ascent (SGTDA) [41]. We consider the algorithms + +for solving stochastic problem. We set the number of worker nodes to $n = 20$ and use the ring-based topology as the communication network. For each algorithm, we grid search the learning rates $\eta_{x}$ and $\eta_{y}$ from $\{0.1, 0.01, 0.001, 0.0001\}$ . The mini-batch size is set to 20. The number of iterations in the nested loop for double-loop algorithms is set to $K = 5$ . For DM-HSGD, we set the batch size of the first iteration to $b_{0} = 10000$ . $\beta_{x}$ and $\beta_{y}$ are set to 0.01. For SREDA, we set $\epsilon = 0.1$ in the factor $\frac{\epsilon}{\|v_t\|}$ , period $q = 50$ and large batch size $S_{1} = 1000$ . We compare the value of $\Phi(x)$ with respect to the number of gradient oracles among different algorithms, which can also be calculated by the projection onto simplex $\Delta_{n}$ . The experimental results are shown in Figure 1. From the experimental results in Figure 1, we can see our new DM-HSGD algorithm converges faster than other baseline algorithms, which verifies the performance of our method. + +# 5.2 Policy Evaluation + +Our second experiment is the decentralized policy evaluation (PE) task. PE is an important task in reinforcement learning, which aims to estimate the value function of a given policy. The most intuitive and frequently used method for PE is temporal-difference (TD) method that relies on the Bellman equation [4]. However, traditional TD method, which is probably not true gradient descent method as pointed out in [20] and [37], are shown to be unstable in the case of off-policy sampling or nonlinear function approximation. [36] first proposed a method to optimize the objective function of mean-squared projected Bellman error (MSPBE) and MSPBE is proven to achieve asymptotic convergence with arbitrary nonlinear smooth function approximation in [27]. In [42], the MSPBE objective function with nonlinear approximation is converted into a nonconvex-strongly-concave minimax problem by Fenchel's duality. The problem can be formulated as: + +$$ +\min _ {\theta} \max _ {w} L (\theta , w) = \frac {1}{n N _ {i}} \sum_ {i = 1} ^ {n} \sum_ {j = 1} ^ {N _ {i}} L _ {j} ^ {(i)} (\theta , w), +$$ + +$$ +L _ {j} ^ {(i)} (\theta , w) = \langle w, \left[ R _ {i} \left(s _ {j}, a _ {j}\right) + \gamma V _ {\theta} \left(s _ {j + 1}\right) - V _ {\theta} \left(s _ {j}\right) \right] g _ {\theta} \left(s _ {j}\right) \rangle - \frac {1}{2} \left(w ^ {T} g _ {\theta} \left(s _ {j}\right)\right) ^ {2} \tag {15} +$$ + +where $s_j$ is a state and $a_j$ is an action. $R_i$ represents the reward and $\gamma \in (0,1)$ is the discount factor. $V$ is a value function that maps the state space to a real number. $\theta$ is the parameter to estimate the value function. Function $g_\theta$ is the gradient of $V_\theta$ and parameter $w$ is yield by Fenchel's duality. + +Mountaincar [35] is a preliminary task in reinforcement learning. [42] and [43] ran offline PE task of this problem with primal-dual MSPBE, where the objective function is formulated as Eq. (15). Following the experimental settings in [42], we use Sarsa [35] to generate trajectories of transitions $(s_i, a_i, s_{i+1}, r_i)$ with $d$ features and $N = 5000$ samples on each worker node. We parameterize value function $V_\theta$ as a 2-layer neural network with $H$ hidden neurons. We use Sigmoid function as activation and set discount factor to $\gamma = 0.95$ . This experiment is run on an MPI cluster where each node is equipped with 12-core Intel Xeon E5-2620 v3 2.40 GHz processor. + +![](images/4af362cdb6ec66eecc11a8fab4e903a4e423d66204439d051eba6f2981a8d87e.jpg) +(a) + +![](images/3e7a2a104b66ce0a36bcbd34a665049386e134b9f25870625f705c44b189847a.jpg) +(b) +Figure 2: Results of our policy evaluation task. Figures (a), (b) and (c) show the value of $\Phi(\theta)$ with respect to the number of gradient oracles divided by $10^3$ . In Figures, (a) $d = 200$ , $H = 50$ ; (b) $d = 300$ , $H = 100$ ; (c) $d = 400$ , $H = 200$ . + +![](images/7747393e92edf6f7a20e5f67f85b38cfdf7e88c8e8e149006cf468baf1da6b80.jpg) +(c) + +We compare our DM-HSGD algorithm with baseline algorithms: SGDA [19], SREDA [25], DPOSG [21], and stochastic Gradient Tracking/Descent Ascent (SGTDA) [41]. We also consider algorithms + +for solving stochastic problem. We set the number of worker nodes to $n = 20$ . We also use a ring-based topology with uniform weights as the communication network in this task. For each algorithm, we grid search the learning rates $\eta_{x}$ and $\eta_{y}$ from $\{0.1, 0.01, 0.001, 0.0001\}$ . The mini-batch size is set to 20. The number of iterations in the nested loop for double-loop algorithms is set to $K = 5$ . For DM-HSGD, we set the batch size of the first iteration to $b_{0} = 2500$ . $\beta_{x}$ and $\beta_{y}$ are set to 0.01. For SREDA, we set $\epsilon = 0.1$ in the factor $\frac{\epsilon}{\|v_t\|}$ , period $q = 50$ and large batch size $S_{1} = 1000$ . We compare the value of $\Phi(\theta)$ with respect to the number of gradient oracles among different algorithms, which can be calculated by quadratic optimization. The experimental results are shown in Figure 2. + +Figure 2 (a), (b) and (c) show that our DM-HSGD algorithm achieves the fastest convergence regarding the number of gradient oracles. From the experimental result, we can also see that nested loop algorithm for minimax optimization usually consumes more gradient complexity during the training process than single-loop algorithm. + +# 6 Conclusion + +In this paper, we proposed a novel accelerated decentralized minimax algorithm, Decentralized Minimax Hybrid Stochastic Gradient Descent (DM-HSGD), to solve the stochastic nonconvex-strongly-concave minimax optimization problems. We prove that our new method obtains SFO complexity of $O(\kappa^3\epsilon^{-3})$ which outperforms the existing results in decentralized minimax optimization and matches state-of-the-art in centralized minimax optimization. Our method also achieves linear speedup with respect to the number workers, which shows its ability to solve large-scale problems. We also conduct experiments on two machine learning tasks, decentralized robust logistic regression and policy evaluation to validate the superior performance of our algorithm. In our future work, we will explore the decentralized nonconvex-concave minimax optimization without the strong concavity so that it can solve a broader range of problems including the loss functions that are linear in $y$ . We will probably consider the methods that add a perturbation such as Catalyst [50]. + +# Acknowledgments and Disclosure of Funding + +This work was partially supported by NSF IIS 1845666, 1852606, 1838627, 1837956, 1956002, OIA 2040588. + +# References + +[1] Aleksandr Beznosikov, Pavel Dvurechensky, Anastasia Koloskova, Valentin Samokhin, Sebastian U Stich, and Alexander Gasnikov. Decentralized local stochastic extra-gradient for variational inequalities. arXiv preprint arXiv:2106.08315, 2021. +[2] Chao-Kai Chiang, Tianbao Yang, Chia-Jung Lee, Mehrdad Mahdavi, Chi-Jen Lu, Rong Jin, and Shenghuo Zhu. Online optimization with gradual variations. Conference on Learning Theory, 2012. +[3] Ashok Cutkosky and Francesco Orabona. Momentum-based variance reduction in non-convex sgd. Neural Information Processing Systems (NeurIPS), 2019. +[4] Christoph Dann, Gerhard Neumann, and Jan Peters. Policy evaluation with temporal differences: A survey and comparison. Journal of Machine Learning Research, 2014. +[5] Paolo Di Lorenzo and Gesualdo Scutari. Next: In-network nonconvex optimization. IEEE Transactions on Signal and Information Processing over Networks, 2(2):120-136, 2016. +[6] Simon S. Du and Wei Hu. Linear convergence of the primal-dual gradient method for convex-concave saddle point problems without strong convexity. International Conference on Artificial Intelligence and Statistics (AISTATS), 2019. +[7] Cong Fang, Chris Junchi Li, Zhouchen Lin, and Tong Zhang. Spider: Near-optimal non-convex optimization via stochastic path integrated differential estimator. Neural Information Processing Systems (NeurIPS), 2018. + +[8] Ian J. Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. Neural Information Processing Systems (NeurIPS), 2014. +[9] Zhishuai Guo, Yi Xu, Wotao Yin, Rong Jin, and Tianbao Yang. On stochastic moving-average estimators for non-convex optimization. arXiv preprint arXiv:2104.14840, 2021. +[10] 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. Neural Information Processing Systems (NeurIPS), 2017. +[11] Feihu Huang, Shangqian Gao, Jian Pei, and Heng Huang. Accelerated zeroth-order and first-order momentum methods from mini to minimax optimization. Journal of Machine Learning Research, 22:1-70, 2021. +[12] Feihu Huang and Heng Huang. Adagda: Faster adaptive gradient descent ascent methods for minimax optimization. arXiv preprint arXiv:2106.16101, 2021. +[13] Feihu Huang, Xidong Wu, and Heng Huang. Efficient mirror descent ascent methods for nonsmooth minimax problems. Advances in Neural Information Processing Systems, 34, 2021. +[14] Chi Jin, Praneeth Netrapalli, and Michael I. Jordan. What is local optimality in nonconvex-nonconcave minimax optimization? arXiv:1902.00618v2, 2019. +[15] R. Johnson and T. Zhang. Accelerating stochastic gradient descent using predictive variance reduction. Neural Information Processing Systems (NeurIPS), 2013. +[16] Anastasia Koloskova, Sebastian Stich, and Martin Jaggi. Decentralized stochastic optimization and gossip algorithms with compressed communication. In International Conference on Machine Learning, pages 3478-3487. PMLR, 2019. +[17] Alec Koppel, Felicia Y. Jakubiec, and Alejandro Ribeiro. A saddle point algorithm for networked online convex optimization. IEEE Transactions on Signal Processing, 2015. +[18] 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. Neural Information Processing Systems (NeurIPS), 2017. +[19] Tianyi Lin, Chi Jin, and Michael I. Jordan. On gradient descent ascent for nonconvex-concave minimax problems. arXiv:1906.00331v4, 2019. +[20] Bo Liu, Ji Liu, Mohammad Ghavamzadeh, Sridhar Mahadevan, and Marek Petrik. Finite-sample analysis of proximal gradient td algorithms. Conference on Uncertainty in Artificial Intelligence, 2015. +[21] Mingrui Liu, Wei Zhang, Youssef Mroueh, Xiaodong Cui, Jerret Ross, Tianbao Yang, and Payel Das. A decentralized parallel algorithm for training generative adversarial nets. Smooth Games Optimization and Machine Learning Workshop (NeurIPS), 2019. +[22] Weijie Liu, Aryan Mokhtari, Asuman Ozdaglar, Sarath Pattathil, Zebang Shen, and Nenggan Zheng. A decentralized proximal point-type method for saddle point problems. arXiv:1910.14380v1, 2019. +[23] Songtao Lu, Ioannis Tsaknakis, Mingyi Hong, and Yongxin Chen. Hybrid block successive approximation for one-sided non-convex min-max problems: Algorithms and applications. arXiv:1902.08294v1, 2019. +[24] Songtao Lu, Kaiqing Zhang, Tianyi Chen, Tamer Basar, and Lior Horesh. Decentralized policy gradient descent ascent for safe multi-agent reinforcement learning. Association for the Advancement of Artificial Intelligence (AAAI), 2021. +[25] Luo Luo, Haishan Ye, and Tong Zhang. Stochastic recursive gradient descent ascent for stochastic nonconvex-strongly-concave minimax problems. Neural Information Processing Systems (NeurIPS), 2020. + +[26] Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. International Conference on Learning Representations (ICLR), 2018. +[27] Hamid Reza Maei, Csaba Szepesvári, Shalabh Bhatnagar, Doina Precup, David Silver, and Richard S. Sutton. Convergent temporal-difference learning with arbitrary smooth function approximation. Neural Information Processing Systems (NeurIPS), 2010. +[28] David Mateos-Núñez and Jorge Cortés. Distributed subgradient methods for saddle-point problems. IEEE Conference on Decision and Control, 2015. +[29] Arkadi Nemirovski. Prox-method with rate of convergence $\mathrm{o}(1 / t)$ for variational inequalities with lipschitz continuous monotone operators and smooth convex-concave saddle point problems. SIAM Journal on Optimization, 2004. +[30] Lam M. Nguyen, Jie Liu, Katya Scheinberg, and Martin Takáč. Sarah: A novel method for machine learning problems using stochastic recursive gradient. arXiv:1703.00102v2, 2017. +[31] Lam M. Nguyen, Katya Scheinberg, and Martin Takáč. Inexact sarah algorithm for stochastic optimization. arXiv:1811.10105, 2018. +[32] Maher Nouiehed, Maziar Sanjabi, Tianjian Huang, and Jason D. Lee. Solving a class of nonconvex min-max games using iterative first order methods. *Neural Information Processing Systems (NeurIPS)*, 2019. +[33] Taoxing Pan, Jun Liu, and Jie Wang. D-spider-sfo: A decentralized optimization algorithm with faster convergence rate for nonconvex problems. Association for the Advancement of Artificial Intelligence (AAAI), 2020. +[34] Hassan Rafique, Mingrui Liu, Qihang Lin, and Tianbao Yang. Non-convex min-max optimization: Provable algorithms and applications in machine learning. arXiv:1810.02060v3, 2018. +[35] Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction. MIT Press, 1998. +[36] Richard S. Sutton, Hamid Reza Maei, Doina Precup, Shalabh Bhatnagar, David Silver, Csaba Szepesvári, and Eric Wiewiora. Fast gradient-descent methods for temporal-difference learning with linear function approximation. International Conference on Machine Learning (ICML), 2009. +[37] Csaba Szepesvári. Algorithms for Reinforcement Learning. Synthesis Lectures on Artificial Intelligence and Machine Learning, 2010. +[38] Hanlin Tang, Xiangru Lian, Ming Yan, Ce Zhang, and Ji Liu. $d^2$ : Decentralized training over decentralized data. International Conference on Machine Learning (ICML), 2018. +[39] Kiran Koshy Thekumprampil, Prateek Jain, Praneeth Netrapalli, and Sewoong Oh. Efficient algorithms for smooth minimax optimization. Neural Information Processing Systems (NeurIPS), 2019. +[40] Q. Tran-Dinh, D. Liu, and L.M. Nguyen. Hybrid variance-reduced sgd algorithms for minimax problems with nonconvex-linear function. Neural Information Processing Systems (NeurIPS), 2020. +[41] Ioannis Tsaknakis, Mingyi Hong, and Sijia Liu. Decentralized min-max optimization: Formulations, algorithms and applications in network poisoning attack. In ICASSP 2020-2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 5755-5759. IEEE, 2020. +[42] Hoi-To Wai, Mingyi Hong, Zhuoran Yang, Zhaoran Wang, and Kexin Tang. Variance reduced policy evaluation with smooth function approximation. Neural Information Processing Systems (NeurIPS), 2019. + +[43] Hoi-To Wai, Zhuoran Yang, Zhaoran Wang, and Mingyi Hong. Multi-agent reinforcement learning via double averaging primal-dual optimization. Neural Information Processing Systems (NeurIPS), 2018. +[44] Zhe Wang, Kaiyi Ji, Yi Zhou, Yingbin Liang, and Vahid Tarokh. Spiderboost: A class of faster variance-reduced algorithms for nonconvex optimization. arXiv:1810.10690v2, 2018. +[45] Wenhan Xian, Feihu Huang, and Heng Huang. Communication-efficient frank-wolfe algorithm for nonconvex decentralized distributed learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pages 10405-10413, 2021. +[46] Ran Xin, Usman A. Khan, and Soummya Kar. A hybrid variance-reduced method for decentralized stochastic non-convex optimization. arXiv:2102.06752, 2021. +[47] Jinming Xu, Shanying Zhu, Yeng Chai Soh, and Lihua Xie. Augmented distributed gradient methods for multi-agent optimization under uncoordinated constant step sizes. In 2015 54th IEEE Conference on Decision and Control (CDC), pages 2055-2060. IEEE, 2015. +[48] Feng Yan, Shreyas Sundaram, S. Vishwanathan, and Yuan Qi. Distributed autonomous online learning: Regrets and intrinsic privacy-preserving properties. IEEE Transactions on Knowledge and Data Engineering, 2013. +[49] Yan Yan, Yi Xu, Qihang Lin, Lijun Zhang, and Tianbao Yang. Stochastic primal-dual algorithms with faster convergence than $O(1 / \sqrt{T})$ for problems without bilinear structure. arXiv:1904.10112, 2019. +[50] Junchi Yang, Siqi Zhang, Negar Kiyavash, and Niao He. A catalyst framework for minimax optimization. In NeurIPS, 2020. +[51] Kun Yuan, Qing Ling, and Wotao Yin. On the convergence of decentralized gradient descent. SIAM Journal on Optimization, 2016. \ No newline at end of file diff --git a/afasterdecentralizedalgorithmfornonconvexminimaxproblems/images.zip b/afasterdecentralizedalgorithmfornonconvexminimaxproblems/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b7881897ebcbefe0ff6e876f06565e533157e1a0 --- /dev/null +++ b/afasterdecentralizedalgorithmfornonconvexminimaxproblems/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7b18e9e19c519561e8b308ea4991919ad60a676c0445b6234db07d5e12b72a9 +size 336042 diff --git a/afasterdecentralizedalgorithmfornonconvexminimaxproblems/layout.json b/afasterdecentralizedalgorithmfornonconvexminimaxproblems/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..f10d2fd8f0d731ea6eaedda7ee9bac455088b4b5 --- /dev/null +++ b/afasterdecentralizedalgorithmfornonconvexminimaxproblems/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:16e82e24a6ecb316dd5af6cdb9bb248ffb735666b0a10475a88a1a78358acf36 +size 591799 diff --git a/afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/52112131-c964-4798-81d9-c7b36dd828ab_content_list.json b/afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/52112131-c964-4798-81d9-c7b36dd828ab_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..d6b7bfa71a9e274bc1c4e365c28ec482918b9a4a --- /dev/null +++ b/afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/52112131-c964-4798-81d9-c7b36dd828ab_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8dce1ceee21ad7eeeeeb77d635385a101734039543b87ae5ac20eb4e87deca18 +size 86132 diff --git a/afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/52112131-c964-4798-81d9-c7b36dd828ab_model.json b/afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/52112131-c964-4798-81d9-c7b36dd828ab_model.json new file mode 100644 index 0000000000000000000000000000000000000000..913c8c3e07338f672168a778e11d049f24dbe59b --- /dev/null +++ b/afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/52112131-c964-4798-81d9-c7b36dd828ab_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c13fe065c35e7403aada48b8f15502cf44b13a82e0ee5349d385948a7d79f5b6 +size 108484 diff --git a/afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/52112131-c964-4798-81d9-c7b36dd828ab_origin.pdf b/afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/52112131-c964-4798-81d9-c7b36dd828ab_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6531b7c2b0680d76902bf4fe4f66ab371afee0bb --- /dev/null +++ b/afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/52112131-c964-4798-81d9-c7b36dd828ab_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa75c183f1241ef91ed0f693bf4fa1b4e9214f62e4208d066b8d1bc766511e80 +size 376422 diff --git a/afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/full.md b/afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..c333c98ec580ba4a8f920722017df39140def46b --- /dev/null +++ b/afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/full.md @@ -0,0 +1,316 @@ +# A Faster Maximum Cardinality Matching Algorithm with Applications in Machine Learning + +Nathaniel Lahn* + +School of Computing and Information Sciences + +Radford University + +Radford, VA 24142 + +nlahn@radford.edu + +Sharath Raghvendra + +Department of Computer Science + +Virginia Tech Blacksburg, VA 24061 + +sharathr@vt.edu + +Jiacheng Ye + +Department of Computer Science + +Virginia Tech Blacksburg, VA 24061 + +yjc0513@vt.edu + +# Abstract + +Maximum cardinality bipartite matching is an important graph optimization problem with several applications. For instance, maximum cardinality matching in a $\delta$ -disc graph can be used in the computation of the bottleneck matching as well as the $\infty$ -Wasserstein and the Lévy-Prokhorov distances between probability distributions. For any point sets $A, B \subset \mathbb{R}^2$ , the $\delta$ -disc graph is a bipartite graph formed by connecting every pair of points $(a, b) \in A \times B$ by an edge if the Euclidean distance between them is at most $\delta$ . Using the classical Hopcroft-Karp algorithm, a maximum-cardinality matching on any $\delta$ -disc graph can be found in $\tilde{O}(n^{3/2})$ time. In this paper, we present a simplification of a recent algorithm (Lahn and Raghvendra, JoCG 2021) for the maximum cardinality matching problem and describe how a maximum cardinality matching in a $\delta$ -disc graph can be computed asymptotically faster than $O(n^{3/2})$ time for any moderately dense point set. As applications, we show that if $A$ and $B$ are point sets drawn uniformly at random from a unit square, an exact bottleneck matching can be computed in $\tilde{O}(n^{4/3})$ time. On the other hand, experiments suggest that the Hopcroft-Karp algorithm seems to take roughly $\Theta(n^{3/2})$ time for this case. This translates to substantial improvements in execution time for larger inputs. + +# 1 Introduction + +Computing a maximum cardinality matching is a fundamental graph optimization problem. With origins in economics and logistics, matchings have found numerous applications. Computing popular distances between distributions, such as the Wasserstein distance as well as the Lévy-Prokhorov distance, can be reduced to a bipartite matching problem. In this paper, we consider the $\delta$ -disc graph matching which is the following: + +Given two sets $A$ and $B$ of $n$ two-dimensional points and a parameter $\delta > 0$ , a $\delta$ -disc graph $G_{\delta}$ is a bipartite graph obtained by connecting any pair of vertices $(a, b) \in A \times B$ with an edge provided that the Euclidean distance between $a$ and $b$ is at most $\delta$ , i.e., $\| a - b \| \leq \delta$ . Let $m$ be the number of edges + +in the graph $G_{\delta}$ . A matching $M$ is a set of vertex-disjoint edges in $G_{\delta}$ . In the $\delta$ -disc graph matching problem, we wish to compute a maximum cardinality matching in $G_{\delta}$ , i.e., a matching that has the largest number of edges. + +Any algorithm for computing a $\delta$ -disc graph matching can also be used to compute a bottleneck matching as well as the Lévy-Prokhorov distance, both of which are defined next. Let $M \subseteq A \times B$ be any perfect matching of $A$ and $B$ , which is a matching where every vertex of $A$ is matched, i.e., $|M| = n$ . The edge of $M$ with the largest Euclidean length is its bottleneck edge. The bottleneck matching is a perfect matching $M^{*}$ whose bottleneck edge length is minimized. The Euclidean length of the bottleneck edge of $M^{*}$ is the bottleneck distance between $A$ and $B$ . + +Distances between distributions: Next, consider the case where $A$ and $B$ define discrete distributions $\mathcal{P}_A$ and $\mathcal{P}_B$ and let every point $a \in A$ (resp. $b \in B$ ) carry a probability of $1/n$ , i.e., $\mathcal{P}_A(a) = 1/n$ (resp. $\mathcal{P}_B(b) = 1/n$ ). The $\infty$ -Wasserstein distance between $\mathcal{P}_A$ and $\mathcal{P}_B$ , denoted by $W_{\infty}(\mathcal{P}_A, \mathcal{P}_B)$ , is simply the bottleneck distance between the point sets $A$ and $B$ . The Lévy-Prokhorov distance between $\mathcal{P}_A$ and $\mathcal{P}_B$ is defined as follows: For $\varepsilon > 0$ and any subset $X \subseteq A$ (resp. $Y \subseteq B$ ), let $X^{\varepsilon} = \{b \in B \mid \exists a \in X \text{ such that } \|a - b\| \leq \varepsilon\}$ (resp. $Y^{\varepsilon} = \{a \in A \mid \exists b \in Y \text{ such that } \|a - b\| \leq \varepsilon\}$ ). Note that $X^{\varepsilon} \subseteq B$ and $Y^{\varepsilon} \subseteq A$ . We say that the Lévy-Prokhorov [34] distance $\pi(\mathcal{P}_A, \mathcal{P}_B)$ is equal to the smallest value of $\varepsilon$ for which the following property is true: + +$$ +\forall X \subseteq A, \mathcal {P} _ {A} (X) \leq \mathcal {P} _ {B} \left(X ^ {\varepsilon}\right) + \varepsilon \text {a n d}, \forall Y \subseteq B, \mathcal {P} _ {B} (Y) \leq \mathcal {P} _ {A} \left(Y ^ {\varepsilon}\right) + \varepsilon ; +$$ + +here $\mathcal{P}_A(X) = \sum_{a\in X}\mathcal{P}_A(a) = |X| / n$ and $\mathcal{P}_B(Y) = \sum_{b\in Y}\mathcal{P}_B(b) = |Y| / n$ . We can, therefore, write this condition as + +$$ +\forall X \subseteq A, | X | \leq | X ^ {\varepsilon} | + \varepsilon n \text {a n d} \forall Y \subseteq B, | Y | \leq | Y ^ {\varepsilon} | + \varepsilon n. \tag {1} +$$ + +Determining if the exact bottleneck distance (equivalently $W_{\infty}(\mathcal{P}_A,\mathcal{P}_B)$ ) is $\leq \delta$ can be done by simply finding the maximum cardinality matching $M$ in $G_{\delta}$ . It is easy to see that $M$ is perfect if and only if the bottleneck distance is at most $\delta$ . Similarly, by applying Hall's theorem, one can show that $\pi (\mathcal{P}_A,\mathcal{P}_B)\leq \varepsilon$ if and only if the maximum cardinality matching $M$ in $G_{\varepsilon}$ has a size of at least $(1 - \varepsilon)n$ . Thus, the $\delta$ -disc graph matching directly relates to computing $\infty$ -Wasserstein distance as well as the Lévy-Prokhorov distance between probability distributions. + +Computing $\delta$ -disc graph matching: One can use any of-the-shelf matching algorithm [18, 31, 33, 39] to compute a maximum cardinality matching in a $\delta$ -disc graph. For instance, using the well-known Hopcroft-Karp algorithm will lead to an execution time of $O(m\sqrt{n})$ on any $\delta$ -disc graph. The HK-Algorithm executes in phases. Each phase takes $O(m)$ time, and, in the worst-case, the algorithm converges to a maximum matching in $O(\sqrt{n})$ phases. The best-known exact algorithm for computing the exact bottleneck matching combines geometric data structures with the HK-algorithm in order to reduce the execution time of each phase from $O(m)$ to $\tilde{O}(n)$ . As a result, they obtain an exact bottleneck matching in $\tilde{O}(n^{3/2})$ time. + +Inspired by a series of algorithms for weighted matching in graphs with small separators [4, 27], Lahn and Raghevendra [28] presented a weighted approach to the maximum cardinality matching problem. This LR algorithm identifies a set of "edge separators" incident on $\omega$ "boundary vertices". These edges are assigned a weight of 1 and all other edges receive a weight of 0. A property satisfied by these separator vertices is that after their removal, every connected component in the graph has no more than $r$ vertices. Then, they present an algorithm to compute a perfect matching in $O(m\sqrt{r} + m\sqrt{\omega} + mr\omega / n\log n)$ time. As an application of their result, they show how to compute the bottleneck distance of any point sets $A$ and $B$ within a multiplicative factor of $(1 + \varepsilon)$ in $\tilde{O}(n^{4/3}\mathrm{poly}(1/\varepsilon))$ time. The LR algorithm assigns dual weights to vertices and is similar in style to the Kuhn-Munkres [24] and Gabow-Tarjan [15] algorithms. The dual weights on vertices play a vital role in the proofs of correctness and efficiency of the LR algorithm. + +In this paper, we make the following contributions: + +- We remove the need to maintain dual weights in the LR algorithm, resulting in a significantly simpler algorithm. + +- Using this algorithm, we show how to find a maximum cardinality matching in a unit-disc graph $G_{\delta}$ in time $\tilde{O}(n^{4/3}k^{1/3})$ where $k$ is the maximum number of points of $A \cup B$ contained in any disc of radius $\delta$ . Note that our algorithm is asymptotically faster than the classical Hopcroft-Karp based algorithm when $k = o(\sqrt{n})$ . +- Using our algorithm for $\delta$ -disc graph matching, we show how to compute the exact bottleneck distance between point sets $A$ and $B$ . When $\mathcal{P}_A$ and $\mathcal{P}_B$ are discrete distributions with each point having probability $1/n$ , the bottleneck distance can be used to compute the distances $W_{\infty}(\mathcal{P}_A, \mathcal{P}_B)$ and $\pi(\mathcal{P}_A, \mathcal{P}_B)$ . We are not aware of any previous polynomial time algorithms to compute the Lévy-Prokhorov distance. When $A, B$ are chosen uniformly at random from a unit square, our algorithm for the exact bottleneck distance runs in $\tilde{O}(n^{4/3})$ time. All previous algorithms take $\Omega(n^{3/2})$ time. +- We run experiments for the case where $A$ and $B$ are chosen uniformly at random from a unit square. Our experiments suggest that the Hopcroft-Karp algorithm on $G_{\delta}$ takes $\Theta(n^{3/2})$ time. In contrast, our algorithm runs substantially faster and executes in $\tilde{O}(n^{4/3})$ time. + +Note that, for the HK-algorithm, the upper bound of $O(\sqrt{n})$ phases is only in the worst-case. As noted by Motwani [32], the Hopcroft-Karp algorithm converges, with high probability, to a maximum matching in $O(\log n)$ phases for expander graphs in general and Erdős-Rényi random graphs in particular. Similarly, does the HK algorithm execute asymptotically fewer than $\sqrt{n}$ iterations when used to compute bottleneck matchings? Interestingly, our experiments suggest that the answer to this question may be in the negative. Based on our experimental results, when $A$ and $B$ are drawn uniformly at random from a unit square and when $\delta$ is set to the bottleneck distance, the number of phases seem to grow at the rate of $\Omega(\sqrt{n})$ . Therefore, bottleneck matching on random point sets may represent a natural hard instance for the HK-Algorithm. In this paper, we show how to overcome the $\Omega(n^{3/2})$ barrier for uniformly distributed point sets by developing an $\tilde{O}(n^{4/3})$ time algorithm. + +For any $\varepsilon > 0$ and any point set $A \cup B$ , the LR algorithm can also be used to compute a multiplicative $(1 + \varepsilon)$ -approximation of the bottleneck matching in $\tilde{O}(n^{4/3} \mathrm{poly}(1/\varepsilon))$ time. This is done by using a grid where the side-length of each cell is a function of $\varepsilon$ . The algorithm rounds every point to the closest cell center and finds a $\delta$ -disc graph matching using the LR algorithm. See Section 6 of [28] for details. One can also use a similar approach to compute a multiplicative $(1 + \varepsilon)$ approximation of the Lévy-Prokhorov distance. Replacing the original LR algorithm with our dual-free implementation leads to simpler approximation algorithms. + +Applications: Wasserstein distance has found numerous applications in machine learning and computer vision [3, 5, 8, 10, 14, 36]. Due to these applications, computing approximations of Wasserstein distances has received substantial attention [2, 9, 12, 26, 30, 35]. However, exact algorithms (even for discrete distributions) have a relatively high execution time [15, 24, 39]. The Lévy-Prokhorov distance have been extensively studied for its theoretical properties [11, 38]. For instance, Lévy-Prokhorov distance metrizes weak convergence on any separable metric space [19]. However, a brute-force algorithm based on the definition of this metric will require a search on exponentially many possible subsets causing it to seldom be used in practice [16]. However, we use Hall's theorem to show that the computation of the Lévy-Prokhorov metric reduces to the $\delta$ -disc graph matching problem and so, it is only as hard as computing the $\infty$ -Wasserstein distance, at least for discrete distributions of the type $\mathcal{P}_A$ and $\mathcal{P}_B$ described above. + +In this paper, we provide exact algorithms for computing the $\infty$ -Wasserstein and the Lévy-Prokhorov distances for 2-dimensional discrete distributions. Our algorithms can be useful in several scenarios. For instance, one can estimate Lévy-Prokhorov distances between any two fixed-dimensional continuous distributions by simply computing the distances between samples drawn from these distributions. From the fact that the Lévy-Prokhorov distance metrizes weak convergence, for large enough samples we can get accurate distance estimates. Faster high-precision algorithms are critical in obtaining such estimates; see [7, 6]. For high dimensional discrete distributions, Wasserstein distance is sometimes estimated by embedding them into a lower dimensional space and computing high precision solution in this space. For example, see the sliced Wasserstein distance [23]. + +In the emerging area of topological data analysis, high dimensional point clouds are characterized by two-dimensional point sets called persistence diagrams where each point represents the so-called birth and death times of a topological feature. Different high-dimensional point clouds can be compared by computing the bottleneck distance between the corresponding diagrams [17, 22, 1]. This has + +led to development of practical implementations of bottleneck matching algorithms [17, 22]. More recently, other Wasserstein distances between persistence diagrams have also been considered. See for instance [25, 40]. + +The special case of computing bottleneck matching for point sets $A$ and $B$ that are drawn uniformly at random from a unit square has also received considerable attention. For instance, it has been used in the context of testing pseudo-random generators, average case analysis of bin packing algorithms [29], and also in statistics for analyzing the Glivenko-Cantelli convergence of empirical measures [37]. $\delta$ -disc graphs have other applications as well, including in the modeling of the topology of ad-hoc wireless networks [20]. + +# 2 Matching algorithms + +In this section, we present and compare two algorithms for solving the maximum cardinality matching problem on an arbitrary graph: The Hopcroft-Karp (HK) algorithm [18], and the LR algorithm [28]. In section 2.1, we introduce the basic definitions used by most combinatorial matching algorithms and give an overview of the HK algorithm. In section 2.2, we present the LR algorithm, highlighting the differences it has from the HK algorithm. + +# 2.1 Preliminaries + +Given any matching $M$ , let $A_F$ and $B_F$ denote the vertices of $A$ and $B$ respectively that are not matched in $M$ . We refer to these vertices as free vertices. An alternating path $P$ is a path that alternates between edges that are in the matching and those that are not in the matching. An augmenting path is an alternating path that starts and ends at a free vertex. We define the length of $P$ as the number of edges in $P$ . + +We can augment a matching $M$ along an augmenting path $P$ by updating the matching to $M \gets M \oplus P$ ; where $\oplus$ denotes the symmetric difference operator. It is easy to see that augmenting a matching along an augmenting path $P$ increases the size of the matching $M$ by 1. Furthermore, it can be shown that $G$ has no augmenting paths with respect to a matching $M$ if and only if $M$ has maximum cardinality. These observations are the basis of the following commonly-used approach for computing a maximum-cardinality matching: repeatedly compute an augmenting path $P$ with respect to $M$ and augment $M$ along $P$ until $M$ has maximum cardinality. Since the largest possible matching has size at most $n$ , any such algorithm will arrive at a maximum-cardinality matching after $n$ augmentations. This is the approach used by the classical Ford-Fulkerson and HK algorithms as well as the recent LR algorithm. However, the algorithms differ in the details of how these augmenting paths are found. + +Residual graph: Given a matching $M$ , the residual graph $G_{M}$ is a directed graph that assists in finding augmenting paths. The graph $G_{M}$ contains the same set of vertices $V$ as $G$ . For any edge $(a, b)$ in $G$ , if $(a, b) \in M$ then we add an edge directed from $a$ to $b$ to $G_{M}$ . Otherwise, we add an edge directed from $b$ to $a$ to $G_{M}$ . Furthermore, we create a source vertex $s$ and a sink vertex $t$ with the following additional edges. For each free vertex $b \in B_{F}$ , we add an edge $(s, b)$ directed from the source $s$ to $b$ in $G_{M}$ and for each free vertex $a \in A_{F}$ we add an edge from $a$ to the sink $t$ in $G_{M}$ . Note that, for the residual graph, we use $(u, v)$ to denote an edge directed from $u$ to $v$ . On the other hand, for the undirected graph $G$ , we may use $(u, v)$ and $(v, u)$ interchangeably to represent the same edge between vertices $u$ and $v$ . Consider any directed path $P$ from $s$ to $t$ in the residual graph. Note that removing $s$ and $t$ from $P$ will result in an augmenting path. In the Ford-Fulkerson algorithm, a single augmenting path can be found in $O(m)$ time using any common graph search algorithm such as breadth-first search (BFS) or depth-first search (DFS), leading to an $O(mn)$ time algorithm. The HK and LR algorithms both improve upon this running time by finding potentially many augmenting paths in each iteration. + +HK algorithm: Initially, let $M = \emptyset$ . The HK algorithm executes in phases. A phase is divided up into two stages. The first stage executes a BFS starting from $s$ and identifies the length of the shortest path (path with the fewest edges) in $G_{M}$ from $s$ to every other vertex in $G_{M}$ . Let $\ell_{u}$ be the length of the shortest path from $s$ to $u$ and let $\ell = \ell_{t}$ . The algorithm then computes an admissible graph $\mathcal{A}$ consisting of all edges $(u,v)$ in $G_{M}$ such that (a) $\ell_{u}$ and $\ell_{v}$ are at most $\ell$ and (b) $\ell_{v} = \ell_{u} + 1$ . Note that these edges capture the set of all minimum-length augmenting paths in $G_{M}$ . The second + +stage iteratively conducts multiple partial DFSs that start from $s$ and terminate early if a path to $t$ is found. Following the termination of a partial-DFS, all edges visited by it are removed from the residual graph. The algorithm proceeds to the next phase if a partial-DFS terminates without finding a path from $s$ to $t$ . It can be shown that, in each phase, the HK algorithm finds a maximal set of vertex-disjoint shortest augmenting paths in $G_M$ . Each phase involves execution of a single BFS and multiple partial DFSs. Since no two executions of DFS visit the same edge, the combined execution time of the multiple partial DFSs is bounded by $O(m)$ . + +Hopcroft and Karp showed that the length of the shortest augmenting path increases by at least 1 after each phase. Therefore, after $\sqrt{n}$ phases, the shortest augmenting path has length at least $\sqrt{n}$ . Using this, they showed that there are no more than $\sqrt{n}$ free vertices remaining, all of which can be matched by augmenting along an additional $O(\sqrt{n})$ augmenting paths. Thus, the total number of phases executed by the algorithm is $O(\sqrt{n})$ . Since each phase takes $O(m)$ time, the total time taken by the algorithm is $O(m\sqrt{n})$ . Somewhat surprisingly, Hopcroft and Karp [18] also showed that the total length of all $n$ augmenting paths, across all phases, is only $O(n\log n)$ . + +# 2.2 A simplified implementation of the LR algorithm + +Recently, Lahn and Raghvendra presented an algorithm [28] to compute a maximum cardinality matching. Their algorithm resembles the Kuhn-Munkres algorithm for weighted matching. In this section, we present a cleaner implementation of the LR algorithm. These simplifications result in a closer resemblance to the HK algorithm. Unlike the LR algorithm, our algorithm does not maintain any dual weights. In the following, we describe and contrast our algorithm with the HK-algorithm. + +Apart from a bipartite graph $G(V, E)$ , we are also given a subset $E_S \subseteq E$ of "separator edges" as input. For any separator edge $(u, v) \in E_S$ , we denote the vertices $u$ and $v$ as boundary vertices. Let $B$ be the set of all boundary vertices. The analysis of the algorithm depends on $\omega = |B|$ and another parameter $r$ that is defined next. Consider the graph $G'(V, E \setminus E_S)$ . Let $\mathbb{P} = \{\mathcal{P}_1, \ldots, \mathcal{P}_t\}$ be the set of connected components of $G'$ and let $\mathcal{V}_i$ and $\mathcal{E}_i$ be the set of vertices and edges of $\mathcal{P}_i$ for all $1 \leq i \leq t$ . We refer to each $\mathcal{P}_i$ in $G'$ as a piece of the original graph $G$ . Let $r = \max_{i \in \mathbb{P}} |\mathcal{V}_i|$ , i.e., the size of the piece of $G$ with the largest number of vertices. + +Setting weights on the edges of the graph $G$ and its residual graph $G_{M}$ : For any edge $(u, v) \in E$ , we assign it a weight $w(u, v)$ . For any separator edge $(u, v) \in E_{S}$ , we set $w(u, v)$ to 1. For any other edge $(u', v') \in E \setminus E_{S}$ , we set $w(u', v')$ to 0. Every edge $(u, v)$ in the residual graph inherits the weight of the corresponding edge $(u, v)$ in $G(V, E)$ . All edges incident on the source $s$ and the sink $t$ in $G_{M}$ receive a weight of 0. For any path $P$ , its weight is simply the sum of the weights of its edges. + +Preprocessing: In the preprocessing step, our algorithm finds a maximum cardinality matching for each piece by applying the HK-Algorithm. Let $M$ be the union of these matchings computed across all pieces. At the end of this step, the difference $|M^{*}| - |M|$ is $O(\omega)$ , where $M^{*}$ is the maximum cardinality matching in $G$ . So, our algorithm has to find an additional $O(\omega)$ augmenting paths in order to compute a maximum cardinality matching. + +The remaining $O(\omega)$ unmatched vertices are subsequently matched in phases. Like the HK algorithm, each phase of our algorithm consists of two stages. These stages somewhat resemble the stages of the HK algorithm. We highlight the differences in the description below. + +Stage 1: In the first stage, our algorithm finds, for any vertex $v \in V$ , the minimum weight path from $s$ to $v$ in the residual graph $G_{M}$ using the weights $w(\cdot, \cdot)$ . Note that, since every edge weight is either 0 or 1, a standard BFS implementation can be modified to support such a minimum-weight search algorithm in $O(m)$ time by simply prioritizing edges of weight 0 over edges of weight 1. We call this modified version of BFS, $0/1$ BFS. For any vertex $v \in V$ , let $\ell_{v}$ be the weight from $s$ to $v$ in $G_{M}$ as computed by the $0/1$ BFS and let $\ell = \ell_{t}$ . Any edge $(u, v)$ of $G_{M}$ is admissible if $\ell_{u}, \ell_{v} \leq \ell$ and $\ell_{v} = \ell_{u} + w(u, v)$ . The admissible graph $\mathcal{A}$ is identical to $G_{M}$ , except it contains only admissible edges. Similar to the HK algorithm, it can be shown that the admissible graph $\mathcal{A}$ captures every minimum-weight augmenting path. + +Stage 2: The second stage of our algorithm finds a set of shortest augmenting paths (by weight). It does so by iteratively conducting partial-DFSs from $s$ until no augmenting path is found. Each partial-DFS immediately terminates if an augmenting path $P$ is found. Let $\mathcal{K}$ be the set of affected pieces, which are pieces that contain at least one edge of $P$ . Unlike in the HK-Algorithm, the + +matching $M$ is immediately augmented along $P$ and every edge visited by this partial-DFS that does not belong to an affected piece is deleted. Note that any edge from an affected piece that was visited by this partial-DFS does not get deleted and could be revisited by a later partial-DFS. In other words, edges in an affected piece can be visited multiple times within the same phase. + +Differences with HK algorithm: The main differences between our algorithm and the HK algorithm are: + +(1) Our algorithm assigns weights of 0 and 1 to the edges. No weights are assigned in the HK algorithm. +(2) Our algorithm has a preprocessing step that computes a maximum cardinality matching within each piece. +(3) In Stage 1, our algorithm executes a $0/1$ -BFS instead of the BFS executed by HK algorithm. +(4) In Stage 2 of our algorithm, the partial-DFS reuses edges from affected pieces. As a result, in each phase, our algorithm may find augmenting paths that are not vertex-disjoint. + +Differences (1) - (3) between HK algorithm and our algorithm do not impact the execution time of the algorithm by any more than a small constant factor. See Section F of the supplement for a discussion on this. The critical difference between the two algorithms is (4). Unlike the HK algorithm, Stage 2 of our algorithm reuses edges from affected pieces and computes a set of augmenting paths that are not necessarily vertex-disjoint. This allows for computing many more augmenting paths within each phase. + +As we show later, the total number of phases executed as well as the augmenting paths computed by our algorithm are identical to those computed by the LR algorithm. Therefore, the analysis of Lahn and Raghevendra can be directly applied to our algorithm. They show that after each phase, the weight of the shortest augmenting path increases by at least one. After $\sqrt{\omega}$ phases, they show that there are $O(\sqrt{\omega})$ free vertices which can be matched using an additional $O(\sqrt{\omega})$ phases. Thus the total number of phases can be bounded by $O(\sqrt{\omega})$ . + +Edge revisits cause the execution time of a phase to increase. Note that an edge can be revisited only if it was inside an affected piece when it was most recently visited. Lahn and Raghvendra show that the total number of affected pieces is $O(\omega \log \omega)$ (a piece that is affected $k$ times is counted $k$ times in this sum). For graphs that admit recursive separators (such as planar and graphs with excluded minors), they show that the number of edges for any piece can be bounded by $O(mr / n)$ leading to an $O\left(\frac{mr\omega}{n}\log \omega\right)$ bound on the total number of revisits. + +Theorem 1. Consider a graph $G$ and a set of separator edges. Suppose each piece has at most $O(mr / n)$ edges. Our algorithm computes a maximum cardinality matching in $O(m\sqrt{r} + m\sqrt{\omega} + \frac{mr\omega}{n}\log n)$ time. + +For our algorithm, the assumption on an upper bound on the number of edges within each piece can be eliminated when graphs, such as those considered in this paper, support a dynamic data structure $\mathcal{D}$ of the following form: $\mathcal{D}$ can store any subset $A' \subseteq A$ of vertices and, given any query vertex $b \in B$ , it can return a vertex $a \in A'$ that minimizes the weight of the edge $(b, a)$ . Note that the weight of $(b, a)$ will be 1 only if every edge from $b$ to any vertex $a' \in A'$ has a weight of 1. If no edge exists between $b$ and any vertex of $A'$ , then the data structure returns NULL. Suppose that $\mathcal{D}$ supports arbitrary insertions and deletions from $A'$ , as well as queries, each in $\Phi(n)$ time. Then, one can use this data structure to dynamically maintain the set of unvisited nodes of $A$ during a 0/1 BFS or DFS. Consequently, one can execute 0/1 BFS and DFS in time $O(n\Phi(n))$ . As a result, the execution time of our algorithm can be improved to $O(n\Phi(n)\sqrt{r} + n\Phi(n)\sqrt{\omega} + r\omega\Phi(n)\log n)$ . In contrast, using $\mathcal{D}$ to execute a Hungarian Search inside the LR algorithm seems challenging. + +Theorem 2. Given a graph $G$ that supports a dynamic nearest neighbor data structure with query and update time of $\Phi(n)$ , a maximum cardinality matching can be computed by our algorithm in $O(\Phi(n)(n\sqrt{r} + n\sqrt{\omega} + r\omega\log n))$ . The HK algorithm computes a maximum cardinality matching in $O(n^{3/2}\Phi(n))$ time. + +Equivalency to original LR algorithm: The original algorithm maintains a dual weight $y(v)$ for every vertex $v \in A \cup B$ at any point during the algorithm. For any edge $(a, b) \in (A \times B) \cap E$ , the dual weights satisfy the following: + +$$ +y (b) - y (a) \leq w (a, b) \quad \text {i f} (a, b) \notin M, \tag {2} +$$ + +$$ +y (a) - y (b) = w (a, b) \quad \text {i f} (a, b) \in M. \tag {3} +$$ + +Additionally, their algorithm maintains the invariants that all free vertices of $B_F$ have the same dual weight of $y_{\mathrm{max}} = \max_{v \in A \cup B} y(v)$ and all free vertices of $A$ have the same dual weight of 0. The slack $s(a, b)$ of any edge $(a, b) \in (A \times B) \cap E$ is defined as follows: if $(a, b) \notin M$ , then $s(a, b) = w(a, b) - y(b) + y(a)$ ; otherwise, $(a, b) \in M$ and $s(a, b) = 0$ . + +In the original LR algorithm, the first stage adjusts the dual weights so that there is at least one zero-slack augmenting path in $G_{M}$ . The second stage takes the subgraph consisting of zero slack edges and repeatedly executes a DFS from $s$ . This DFS stops early if a path to $t$ , i.e., an augmenting path, is found. After augmenting along a path, all edges visited by the DFS are deleted, unless they were in an affected piece. + +Note that the only fundamental difference between the original version of the LR algorithm and our simplified version is the fact that we compute minimum-weight augmenting paths while they compute zero-slack augmenting paths. The following lemma, whose proof appears in Section A of the supplement, shows that the a zero slack path computed in the LR algorithm is also a minimum weight path. It follows that the two versions of the algorithm are equivalent. + +Lemma 1. During Stage 2 of the LR algorithm, an augmenting path has zero slack if and only if it has minimum weight. + +# 3 Applications + +In this section, we show how our algorithm can be applied to efficiently compute a maximum cardinality matching on a $\delta$ -disc graph, an optimal bottleneck matching, as well as the Lévy-Prokhorov distance between distributions. All applications considered are for point sets $A, B \subset \mathbb{R}^2$ . For all applications, one can build a data structure $\mathcal{D}$ from Theorem 2 with $\Phi(n) = \log^{O(1)} n$ by using a dynamic Euclidean nearest neighbor data structure; see Section H.3 of the supplement for details + +# 3.1 $\delta$ -disc graph matching + +Let $P = A \cup B$ . Let $\mathbb{B}(p)$ be a ball centered at $p$ with radius $\delta$ . Consider $k = \max_{p \in \mathbb{R}^2} |\mathbb{B}(p) \cap P|$ , i.e., $k$ is the largest number of points of $A \cup B$ inside any ball of radius $\delta$ . We refer to $k$ as the $\delta$ -density of the point set $P$ . We show that a maximum cardinality matching in a $\delta$ -disc graph can be computed using our algorithm in $\tilde{O}(n^{4/3}k^{1/3})$ time. Thus, when the $\delta$ -density $k = o(\sqrt{n})$ , our algorithm outperforms the HK algorithm. + +Theorem 3. For any point set $P = A \cup B$ and a parameter $\delta > 0$ , a maximum cardinality matching in the $\delta$ -disc graph defined on $P$ can be computed in $\tilde{O}(n^{4/3}k^{1/3})$ time, where $k$ is the $\delta$ -density of $P$ . + +This result also extends to the case where the points of $A$ and $B$ are independently and identically distributed random variables drawn from distributions $\mathcal{P}_A$ and $\mathcal{P}_B$ respectively. We say that a distribution $\mathcal{P}$ has a $\delta$ -density of $k$ if, for any ball $\mathbb{B}(p)$ of radius $\delta$ , the probability that a point drawn from $\mathcal{P}$ lies inside the ball is at most $k / n$ . + +Theorem 4. Let $A, B$ be drawn iid from distributions $\mathcal{P}_A$ and $\mathcal{P}_B$ respectively. For a parameter $\delta > 0$ , a maximum cardinality matching in the $\delta$ -disc graph defined on $A \cup B$ can be computed, with high probability, in $\tilde{O}(n^{4/3}k^{1/3})$ time, where $k$ is the maximum of the $\delta$ -density of $\mathcal{P}_A$ and $\mathcal{P}_B$ . + +Proof of Theorem 3: We show how a set of separator edges can be generated so that $\omega = O(n^{2/3}k^{2/3})$ and $r = O(n^{2/3}/k^{1/3})$ . From Theorem 2 and since $n\sqrt{r} = O(n^{4/3}/k^{1/6})$ , $n\sqrt{\omega} = O(n^{4/3}k^{1/3})$ , and, $r\omega = O(n^{4/3}k^{1/3})$ , the execution time of the LR algorithm can be bounded by $\tilde{O}(n^{4/3}k^{1/3})$ . Next, we describe how to generate the separator edges $E_S$ . + +We use a grid $\mathbb{G}$ to generate the separator edges. Any grid consists of a set of equispaced horizontal and vertical lines that partition $\mathbb{R}^2$ into cells. Each cell is a square and any grid can be seen as a + +set of these squares. Let $\mathcal{L}(\mathbb{G})$ denote the side-length of any cell $C\in \mathbb{G}$ . We say that a cell $C$ is non-empty if $C\cap P\neq \emptyset$ . Let $\theta = \lceil n^{1 / 3} / k^{2 / 3}\rceil$ . To generate our pieces, we choose a grid $\mathbb{G}$ where the side-length of each cell is set to $\mathcal{L}(\mathbb{G}) = \theta \delta$ . The separator edge set $E_{S}$ consists of all edges of the $\delta$ -disc graph that have their endpoints in different cells. All such edges are assigned a weight of 1. Any edges whose endpoints are contained within the same cell of $\mathbb{G}$ are in $E\setminus E_S$ and are assigned a weight of 0. Any point that has at least one separator edge incident on it becomes a boundary vertex. To generate $\mathbb{G}$ , we check $O(\theta)$ possible vertical and horizontal shifts and pick the one that minimizes the number of boundary vertices. We provide the details of generating $\mathbb{G}$ in Section B.1 of the supplement. Our choice of $\mathbb{G}$ guarantees that $\omega = O(n^{2 / 3}k^{2 / 3})$ for any point set, independent of its $\delta$ -density. We show this in Section B.2 of the supplement. + +Bounding $r$ : By this definition, the number of vertices of any piece is bounded by the maximum number of points that can lie inside any cell of $\mathbb{G}$ , i.e., $\max_{C \in \mathbb{G}} |C \cap P|$ . Note that we can cover any cell of $\mathbb{G}$ with $\Theta(\theta^2)$ balls of radius $\delta$ each. Due to the $\delta$ -density of $P$ being $k$ , each of these balls can contain at most $k$ points and the total number of points inside any cell can be bounded by $O(\theta^2 k) = O(n^{2/3}/k^{1/3})$ as desired. In other words, $r = O(n^{2/3}/k^{1/3})$ . + +Proof of Theorem 4: The construction of the grid here will be identical to the one in the proof of Theorem 3. Note also that the bound on $\omega$ provided in that proof depends only on the construction of $\mathbb{G}$ and not on the $\delta$ -density of the point set. Therefore, the same bound continues to hold here as well. In Section C of the supplement, we use the $\delta$ -density of $\mathcal{P}_A$ and $\mathcal{P}_B$ along with Chernoff's bound to prove that $r = O(n^{2/3}/k^{1/3})$ points with high probability. + +# 3.2 Bottleneck distance + +In this section, we assume that $A$ and $B$ are points drawn uniformly at random from a unit square. From the work of Leighton and Shor [29], we know that, for appropriate constants $c_{\mathrm{min}}$ and $c_{\mathrm{max}}$ , the optimal bottleneck distance is at least $\delta_{\mathrm{min}} = \frac{c_{\mathrm{min}} \log^{3/4}(n)}{\sqrt{n}}$ and at most $\delta_{\mathrm{max}} = \frac{c_{\mathrm{max}} \log^{3/4}(n)}{\sqrt{n}}$ with very high probability (probability exceeding $1 - 1/n^{\alpha}$ for some $\alpha = \Omega(\sqrt{\log n})$ ). Observe that the optimal bottleneck distance will be equal to the length of some edge of $A \times B$ . As in the work of Efrat et al. [13], our algorithm will use a selection algorithm of Katz and Sharir [21] to find the $j$ th smallest edge, $1 \leq j \leq n^2$ in $O(n^{4/3} \log^2 n)$ time. Let $d(j)$ be the length of the $j$ th smallest edge returned by their algorithm. This allows us to execute a binary search over the edges of $A \times B$ , ordered by their length. Let $g_{\mathrm{min}} = 1$ and $g_{\mathrm{max}} = n^2$ . We repeat the following process until $g_{\mathrm{max}} = g_{\mathrm{min}} + 1$ : We choose $j = \left\lfloor (g_{\mathrm{max}} + g_{\mathrm{min}}) / 2 \right\rfloor$ and find the $j$ th smallest edge whose length is denoted by $d(j)$ . If $d(j) \geq \delta_{\mathrm{max}}$ , we set $g_{\mathrm{max}} \gets j$ . If $d(j) \leq \delta_{\mathrm{min}}$ , we set $g_{\mathrm{min}} \gets j$ . Otherwise, $\delta_{\mathrm{min}} \leq d(j) \leq \delta_{\mathrm{max}}$ , and we find the maximum cardinality matching in a $\delta$ -disc graph where $\delta$ is set to $d(j)$ . If we obtain a perfect matching, we set $g_{\mathrm{max}} = j$ . Otherwise, the maximum matching is not perfect, and we set $g_{\mathrm{min}} = j$ . When the algorithm terminates, $d(g_{\mathrm{max}})$ is the optimal bottleneck distance. + +Analysis: The algorithm makes $O(\log n)$ many guesses. These guesses are found by a selection algorithm that runs in $O(n^{4/3} \log^2 n)$ time. For each guess $j$ where $\delta_{\min} \leq d(j) \leq \delta_{\max}$ , we must compute a maximum-cardinality matching on a $\delta$ -disc graph, which takes $O(n^{4/3} k^{1/3})$ time using the LR algorithm. Since, $\mathcal{P}(A)$ and $\mathcal{P}(B)$ are the uniform distribution, their $\delta$ -density increases as $\delta$ increases. Therefore, the $\delta_{\max}$ -density of $\mathcal{P}(A)$ and $\mathcal{P}(B)$ will be an upperbound on the $\delta$ -density for any execution of the LR algorithm. The probability that any random point lies within any ball of radius $\delta_{\max}$ is at most $(2\delta_{\max})^2$ , which is $\Theta (\log^{3/2}(n)/n)$ . Therefore, the $\delta_{\max}$ -density of $\mathcal{P}(A)$ and $\mathcal{P}(B)$ is at most $k = O(\log^{3/2}(n))$ . Applying Theorem 4 gives the following: + +Theorem 5. Let $A, B$ be drawn uniformly at random from a unit square. An optimal bottleneck matching can be computed between $A$ and $B$ , with high probability, in $\tilde{O}(n^{4/3})$ time. + +Practical considerations: The algorithm described uses two black-boxes that are impractical and have hidden high constants in the Big-O notation. (a) the algorithm relies on a dynamic nearest neighbor data structure, and, (b) the algorithm uses the selection algorithm of Katz and Sharir [21]. In Section D of the supplement, we address both (a) and (b) by presenting more practical alternatives. + +# 3.3 Lévy-Prokhorov distance + +In this section, we show that we can use our algorithm for the $\delta$ -disc graph matching to also compute the Lévy-Prokhorov distance. + +We describe a simple algorithm to decide if $\pi(\mathcal{P}_A, \mathcal{P}_B)$ greater than or at most $\varepsilon$ . We compute a maximum cardinality matching $M$ in an $\varepsilon$ -disc graph. Let $A_F$ and $B_F$ be the free vertices with respect to $M$ . Then, we say that the distance is greater than $\varepsilon$ if $|A_F| > \varepsilon n$ . Otherwise, we say that the distance is at most $\varepsilon$ . Using a binary search similar to the one described in Section 3.2, we can determine the distance in $\tilde{O}(n^{4/3}k^{1/3})$ time. + +Proof via Hall's theorem: Given any bipartite graph $G(A \cup B, E)$ , for any set $X \subseteq A$ , the neighborhood $\mathcal{N}(X)$ is the set of all vertices of $B$ that share an edge with at least one vertex of $X$ . Thus, $X^{\varepsilon}$ is the neighborhood of $X$ in an $\varepsilon$ -disc graph. The deficiency of a graph with respect to $A$ is $\mu(A) = \max_{X \subseteq A} |X| - \mathcal{N}(X)$ . Hall's theorem says that a bipartite graph has a perfect matching if and only if the deficiency of the graph with respect to $A$ is non-positive. Hall's theorem can be generalized to the following. + +Lemma 2. For any bipartite graph $G(A \cup B, E)$ , where $|A| = |B| = n$ , and for any integer $k > 0$ , the deficiency with respect to $A$ or $B$ is $k$ if and only if the maximum cardinality matching is of size $n - k$ . + +The proof of this generalization follows in a straight-forward way from the Hall's theorem. For the sake of completion, we provide this proof in Section E of the supplement. Next, we show that the algorithm described here correctly computes the Lévy-Prokhorov distance. + +Recollect that, our algorithm returns the distance to be greater than $\varepsilon$ if $|A_F| > \varepsilon n$ . By Lemma 2, we conclude that the deficiency of the graph is greater than $\varepsilon n$ , i.e., there is a set $X \subseteq A$ such that $|X| - |X^{\varepsilon}| > \varepsilon n$ . Thus, Equation 1 does not hold and the distance is greater than $\varepsilon$ . + +Our algorithm returns a distance at most $\varepsilon$ if $|A_F| \leq \varepsilon n$ . In this case, from Lemma 2, the deficiency of the graph with respect to $A$ is less than $\varepsilon n$ , i.e., for every subset $X \subseteq A$ , $|X| - |X^{\varepsilon}| \leq \varepsilon n$ . Note that $|A_F| = |B_F| \leq \varepsilon n$ and so an identical argument applies for $B$ as well. Thus, Equation 1 holds and the distance is at most $\varepsilon$ . We conclude that the algorithm terminates with the correct $\varepsilon$ . + +Theorem 6. Let the point sets $A$ and $B$ , $|A| = |B| = n$ describe two distributions $\mathcal{P}_A$ and $\mathcal{P}_B$ where each point has a probability of $1/n$ associated with it. The Lévy-Prokhorov distance $\pi(\mathcal{P}_A, \mathcal{P}_B)$ can be computed in $\tilde{O}(n^{4/3} k^{1/3})$ time where $k$ is the $\delta$ -density of $A \cup B$ . + +# 4 Experimental results + +In this section, we compare the performance of the HK and LR algorithms when applied to computing an exact bottleneck matching between equal-sized point sets $A$ , $B \subset \mathbb{R}^2$ drawn uniformly at random from a unit square, where $n = |A| + |B|$ . + +Experimental setup: For each value of $n$ in $\{100, 1000, 5000, 10000, 50000, 100000, 500000, 1000000, 1500000\}$ , we execute 10 runs. For each run, we uniformly sample points from a unit square to obtain the point sets $A$ and $B$ . Next, we compute a bottleneck matching between $A$ and $B$ separately, using both the HK algorithm and our algorithm, and record performance metrics for both algorithms. We execute our experiments on a server running CentOS Linux 7, with 12 Intel E5-2683v4 cores and 128GB of RAM. $^3$ + +When guessing the bottleneck distance for each run, instead of enforcing that the number of guesses is $O(\log n)$ it is sufficient in practice to continue the binary search on $\delta$ until the relative error becomes less than a sufficiently small value $\varepsilon$ (see Section D of the supplement). Both the HK-based algorithm and the LR-based algorithm use the same strategy for guessing the bottleneck distance in the experiments. + +Experimental results: For each figure, the data presented for each value of $n$ is averaged over all 10 runs. Error bars represent a single standard deviation. Figure 1 presents the actual running time of both algorithms, summed over all guesses of the bottleneck distance. For datasets with more than $10^{6}$ points, our algorithm takes roughly half as much time as the HK algorithm and the gap seems + +![](images/dc4250fe0bafe0ee2736e51b42bc250bf93195c8c12e41ef42e0d71831fddc94.jpg) +Figure 1: A running time comparison between the HK algorithm and our algorithm. Left: Comparison of actual running time. Right: Comparison of total number of edge visits. + +![](images/aafbaf18ac8be529372ea5ff3998ca5f42f89bc9777224e7b634c35783240d66.jpg) + +![](images/82973993e3ddd94e361e54995f8365ae29f4f42894336da267577f39109cdcc4.jpg) +Figure 2: Data for number of phases for the final bottleneck guess. Left: A comparison of the number of phases for the HK algorithm and our algorithm. Right: $\sqrt{n}$ divided by the number of phases executed by the HK algorithm. + +![](images/b690cabc935b98bb3dc73d059228458e3c272f500047877f30df1e4701e25868.jpg) + +to grow as the input size increases. However, the actual running times can be affected by several factors including the exact implementation details and execution environment. Therefore, we focus on comparing metrics that are accurate independent of the exact implementation details. Recall that both algorithms combine variants of BFS and DFS to compute augmenting paths. As a result, the total number times edges are visited during each algorithm acts as an implementation-independent proxy of the running time. Figure 1 shows the total number of edge visits for both algorithms. Note that this data seems to follow a similar trend to the actual running times of the algorithms. + +Next, we summarize our observations that help account for this difference in performance of the two algorithms. For more details, see Section G of the supplement. Recall that there are four main differences (1) - (4) between the HK algorithm and our algorithm. As discussed in Section F of the supplement, differences (1) - (3) do not have any direct significant impact on the relative running times of the two algorithms; the most significant difference is (4) - Stage 2 of the our algorithm reuses edges from affected pieces. This reuse of edges has two main effects on the efficiency of the our algorithm. First, we find that our algorithm executes significantly fewer phases than the HK algorithm. Specifically, as the guess of the bottleneck distance approaches the actual bottleneck distance, our results suggest that the number of phases executed by the HK algorithm seems to grow at a rate of $\Theta (\sqrt{n})$ - exhibiting its worst-case analysis. In contrast, the number of phases executed by our algorithm grows at a much slower rate (see Figure 2). This explains why the our algorithm runs faster than the HK algorithm. The second impact of allowing for edge revisits is that a single edge can be revisited, perhaps many times, during a single phase. Despite this, the total number of edges visited by our algorithm is still significantly less than the total number of edges visited by the HK algorithm (see Figure 1). + +# 5 Conclusion + +We consider the maximum cardinality matching problem and present a simplification of a recent algorithm by Lahn and Raghevendra [28]. In particular, we eliminate the need to maintain dual weights in their algorithm. This not only leads to a simpler algorithm but also results in new and improved exact algorithms for computing the $\delta$ -disc graph matching, bottleneck matching, as well as the $\infty$ -Wasserstein and the Lévy-Prokhorov distances, in low-density settings. We would like to conclude by stating the following open question: Can we design a parallel combinatorial algorithm to compute a $\delta$ -disc graph matching? + +Acknowledgements We would like to acknowledge, Advanced Research Computing (ARC) at Virginia Tech, which provided us with the computational resources used to run the experiments. Research presented in this paper was funded by NSF CCF-1909171. We would like to thank the anonymous reviewers for their useful feedback. + +# References + +[1] A. Adcock, D. Rubin, and G. Carlsson, Classification of hepatic lesions using the matching metric, Computer vision and image understanding, 121 (2014), 36-42. +[2] J. Altschuler, J. Weed, and P. Rigollet, Near-linear time approximation algorithms for optimal transport via sinkhorn iteration, Neural Information Processing Systems, 2017, pp. 1961-1971. +[3] M. Arjovsky, S. Chintala, and L. Bottou, Wasserstein GAN, arXiv:1701.07875v3 [stat.ML], (2017). +[4] M. K. Asathulla, S. Khanna, N. Lahn, and S. Raghevendra, A faster algorithm for minimum-cost bipartite perfect matching in planar graphs, ACM Trans. Algorithms, 16 (2020), 2:1-2:30. +[5] J.-D. Benamou, G. Carlier, M. Cuturi, L. Nenna, and G. Peyre, Iterative bregman projections for regularized transportation problems, SIAM Journal on Scientific Computing, 37 (2015), A1111-A1138. +[6] E. Bernton, P. E. Jacob, M. Gerber, and C. P. Robert, On parameter estimation with the Wasserstein distance, Information and Inference: A Journal of the IMA, 8 (2019), 657-676. +[7] G. Beugnot, A. Geneva, K. Greenewald, and J. Solomon, Improving approximate optimal transport distances using quantization, arXiv preprint arXiv:2102.12731, (2021). +[8] J. Bigot, R. Gouet, T. Klein, A. López, et al., Geodesic PCA in the wasserstein space by convex PCA, Annales de l'Institut Henri Poincaré, Probabilités et Statistiques, Vol. 53, Institut Henri Poincaré, 2017, pp. 1-26. +[9] J. Blanchet, A. Jambulapati, C. Kent, and A. Sidford, Towards optimal running times for optimal transport, arXiv:1810.07717 [cs.DS], (2018). +[10] M. Cuturi and A. Doucet, Fast computation of wasserstein barycenters, International Conference on Machine Learning, 2014, pp. 685-693. +[11] R. M. Dudley, Distances of probability measures and random variables, The Annals of Mathematical Statistics, 39 (1968), 1563-1572. +[12] P. Dvurechensky, A. Gasnikov, and A. Kroshnin, Computational optimal transport: Complexity by accelerated gradient descent is better than by sinkhorn's algorithm, International Conference on Machine Learning, 2018, pp. 1366-1375. +[13] A. Efrat, A. Itai, and M. J. Katz, Geometry helps in bottleneck matching and related problems, Algorithmica, 31 (2001), 1-28. +[14] R. Flamary, M. Cuturi, N. Courty, and A. Rakotomamonjy, Wasserstein discriminant analysis, Machine Learning, 107 (2018), 1923-1945. +[15] H. N. Gabow and R. E. Tarjan, Faster scaling algorithms for network problems, SIAM Journal on Computing, 18 (1989), 1013-1036. +[16] A. L. Gibbs and F. E. Su, On choosing and bounding probability metrics, International statistical review, 70 (2002), 419-435. +[17] F. Godi, Bottleneck distance, in: GUDHI User and Reference Manual, GUDHI Editorial Board, 3.4.1 edition, 2021. +[18] J. E. Hopcroft and R. M. Karp., An $n^{5/2}$ algorithm for maximum matchings in bipartite graphs., SIAM Journal on Computing, 2 (1905), 1973-231. + +[19] P. J. Huber, Robust Statistics, New York: John Wiley and Sons, 1981. +[20] M. L. Huson and A. Sen, Broadcast scheduling algorithms for radio networks, Proceedings of MILCOM'95, Vol. 2, IEEE, 1995, pp. 647-651. +[21] M. J. Katz and M. Sharir, An expander-based approach to geometric optimization, SIAM Journal on Computing, 26 (1997), 1384-1408. +[22] M. Kerber, D. Morozov, and A. Nigmetov, Geometry helps to compare persistence diagrams, Journal of Experimental Algorithms (JEA), 22 (2017), 1-20. +[23] S. Kolouri, K. Nadjahi, U. Simsekli, R. Badeau, and G. Rohde, Generalized sliced wasserstein distances, Advances in Neural Information Processing Systems (H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, eds.), Vol. 32, Curran Associates, Inc., 2019. +[24] H. W. Kuhn, The hungarian method for the assignment problem, Naval Research Logistics Quarterly, 2 (1955), 83-97. +[25] T. Lacombe, M. Cuturi, and S. Oudut, Large scale computation of means and clusters for persistence diagrams using optimal transport, Advances in Neural Information Processing Systems (S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett, eds.), Vol. 31, Curran Associates, Inc., 2018. +[26] N. Lahn, D. Mulchandani, and S. Raghvendra, A graph theoretic additive approximation of optimal transport, Advances in Neural Information Processing Systems 32, 2019, pp. 13813-13823. +[27] N. Lahn and S. Raghevendra, A faster algorithm for minimum-cost bipartite matching in minor-free graphs, Proceedings of the Thirtieth Annual ACM-SIAM Symposium on Discrete Algorithms, 2019, pp. 569-588. +[28] N. Lahn and S. Raghvendra, A weighted approach to the maximum cardinality bipartite matching problem with applications in geometric settings, Journal of Computational Geometry, 11 (2021). Special Issue of Selected Papers from SoCG 2019. +[29] F. T. Leighton and P. W. Shor, Tight bounds for minimax grid matching, with applications to the average case analysis of algorithms, Proceedings of the 18th Annual ACM Symposium on Theory of Computing, ACM, 1986, pp. 91-103. +[30] T. Lin, N. Ho, and M. I. Jordan, On efficient optimal transport: An analysis of greedy and accelerated mirror descent algorithms, arXiv:1901.06482 [cs.DS], (2019). +[31] A. Madry, Navigating central path with electrical flows: From flows to matchings, and back, 54th Annual IEEE Symposium on Foundations of Computer Science, 2013, pp. 253-262. +[32] R. Motwani, Average-case analysis of algorithms for matchings and related problems, J. ACM, 41 (1994), 1329-1356. +[33] M. Mucha and P. Sankowski, Maximum matchings via gaussian elimination, 45th Annual IEEE Symposium on Foundations of Computer Science, 2004, pp. 248-255. +[34] Y. V. Prokhorov, Convergence of random processes and limit theorems in probability theory, Teor. Veroyatnost. i Primenen., 1 (1956), 177-238. [English translation: Theory Probab. Appl. 1 (1956), 157-214]. +[35] K. Quanrud, Approximating optimal transport with linear programs, Symposium on Simplicity of Algorithms, Vol. 69, 2019, pp. 6:1-6:9. +[36] R. Sandler and M. Lindenbaum, Nonnegative matrix factorization with earth mover's distance metric for image analysis, IEEE Transactions on Pattern Analysis and Machine Intelligence, 33 (2011), 1590-1602. +[37] P. W. Shor and J. E. Yukich, Minimax Grid Matching and Empirical Measures, The Annals of Probability, 19 (1991), 1338 - 1348. + +[38] V. Strassen, The existence of probability measures with given marginals, The Annals of Mathematical Statistics, 36 (1965), 423-439. +[39] J. van den Brand, Y. T. Lee, Y. P. Liu, T. Saranurak, A. Sidford, Z. Song, and D. Wang, Minimum cost flows, mdps, and $\ell_1$ -regression in nearly linear time for dense instances, 2021. +[40] S. Vishwanath, K. Fukumizu, S. Kuriki, and B. K. Sriperumbudur, Robust persistence diagrams using reproducing kernels, Advances in Neural Information Processing Systems (H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, eds.), Vol. 33, Curran Associates, Inc., 2020, pp. 21900-21911. + +# Checklist + +1. For all authors... + +(a) Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope? [Yes] +(b) Did you describe the limitations of your work? [Yes] Any limitations of the work should be apparent from the descriptions of the relevant problem statements that have been included. +(c) Did you discuss any potential negative societal impacts of your work? [N/A] We are not aware of any potential negative societal impacts of this work. +(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] Our paper does not involve human subjects or sensitive data, and we are not aware of any relevant ethical concerns. + +2. If you are including theoretical results... + +(a) Did you state the full set of assumptions of all theoretical results? [Yes] +(b) Did you include complete proofs of all theoretical results? [Yes] Some proofs are included in the supplemental materials. + +3. If you ran experiments... + +(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] +(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [N/A] Our experiments are focused on analyzing running times of algorithms, and are not concerned with training on data sets. +(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] For applicable charts, we included error bars that represent a single standard deviation. +(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] + +4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... + +(a) If your work uses existing assets, did you cite the creators? [N/A] We do not use existing assets. +(b) Did you mention the license of the assets? [N/A] We do not use existing assets. +(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] We include code in the supplemental materials. +(d) Did you discuss whether and how consent was obtained from people whose data you're using/curating? [N/A] We did not use existing data. +(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] Our only input data consists of randomly generated geometric points. + +5. If you used crowdsourcing or conducted research with human subjects... + +(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] +(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] +(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] \ No newline at end of file diff --git a/afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/images.zip b/afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..4b81305e1fa9d14e26ac8c156362b3a317e49f76 --- /dev/null +++ b/afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fa16fd19fafac73d0386cb5132bd802d020b20cad62b6d2ea46e985d223f3c88 +size 60326 diff --git a/afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/layout.json b/afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..c2cff09798fd35d5f371642d433a8b262fabfbfb --- /dev/null +++ b/afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c58121d2adf284a89d8470ac9998f426fddb16613d4a8bc93c1416fc900524fb +size 837200 diff --git a/afecactiveforgettingofnegativetransferincontinuallearning/7ea88ec5-7a8f-4240-899d-5add09d673b3_content_list.json b/afecactiveforgettingofnegativetransferincontinuallearning/7ea88ec5-7a8f-4240-899d-5add09d673b3_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..b6fbe95b5b90b3baad5c3625d938397779d1550a --- /dev/null +++ b/afecactiveforgettingofnegativetransferincontinuallearning/7ea88ec5-7a8f-4240-899d-5add09d673b3_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67dcb867a1ec6c82e70435f0cefc61e0ea4642abb20facf96c4b277119beda70 +size 82122 diff --git a/afecactiveforgettingofnegativetransferincontinuallearning/7ea88ec5-7a8f-4240-899d-5add09d673b3_model.json b/afecactiveforgettingofnegativetransferincontinuallearning/7ea88ec5-7a8f-4240-899d-5add09d673b3_model.json new file mode 100644 index 0000000000000000000000000000000000000000..9e4a23fa5f0de5b6958b8961208c3a320756130e --- /dev/null +++ b/afecactiveforgettingofnegativetransferincontinuallearning/7ea88ec5-7a8f-4240-899d-5add09d673b3_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dabe1bddc410c7c77088507ce51a33e9eb749dfcead27b58db57771701a65ef5 +size 100218 diff --git a/afecactiveforgettingofnegativetransferincontinuallearning/7ea88ec5-7a8f-4240-899d-5add09d673b3_origin.pdf b/afecactiveforgettingofnegativetransferincontinuallearning/7ea88ec5-7a8f-4240-899d-5add09d673b3_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..cb493d1273d5ef798421c2312f968f84c22019d5 --- /dev/null +++ b/afecactiveforgettingofnegativetransferincontinuallearning/7ea88ec5-7a8f-4240-899d-5add09d673b3_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c4650b28ac70b52e9efe9d511d8b1d89a9f34886a8e092b561019f5924d5360 +size 6564111 diff --git a/afecactiveforgettingofnegativetransferincontinuallearning/full.md b/afecactiveforgettingofnegativetransferincontinuallearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..c0aee3b830889bb68773b8c64e867e56f2e21b40 --- /dev/null +++ b/afecactiveforgettingofnegativetransferincontinuallearning/full.md @@ -0,0 +1,362 @@ +# AFEC: Active Forgetting of Negative Transfer in Continual Learning + +Liyuan Wang $^{1,2,3}$ + +Mingtian Zhang4 + +Zhongfan Jia + +Qian Li1,2 + +Kaisheng Ma + +Chenglong Bao + +Jun Zhu $^{3*}$ + +Yi Zhong $^{1,2*}$ + +$^{1}$ School of Life Sciences, IDG/McGovern Institute for Brain Research, Tsinghua University. + +$^{2}$ Tsinghua-Peking Center for Life Sciences. $^{3}$ Dept. of Comp. Sci. & Tech., Institute for AI, BNRist Center, THBI Lab, Tsinghua University. $^{4}$ AI Center, University College London. + +$^{5}$ IIIS, Tsinghua University. $^{6}$ Yau Mathematical Sciences Center, Tsinghua University. {wly19, jzf20}@ mails.tsinghua.edu.cn, mingtian.zhang.17@ucl.ac.uk {liqian8, kaisheng, clbao, dcszj, zhongyithu} @tsinghua.edu.cn + +# Abstract + +Continual learning aims to learn a sequence of tasks from dynamic data distributions. Without accessing to the old training samples, knowledge transfer from the old tasks to each new task is difficult to determine, which might be either positive or negative. If the old knowledge interferes with the learning of a new task, i.e., the forward knowledge transfer is negative, then precisely remembering the old tasks will further aggravate the interference, thus decreasing the performance of continual learning. By contrast, biological neural networks can actively forget the old knowledge that conflicts with the learning of a new experience, through regulating the learning-triggered synaptic expansion and synaptic convergence. Inspired by the biological active forgetting, we propose to actively forget the old knowledge that limits the learning of new tasks to benefit continual learning. Under the framework of Bayesian continual learning, we develop a novel approach named Active Forgetting with synaptic Expansion-Convergence (AFEC). Our method dynamically expands parameters to learn each new task and then selectively combines them, which is formally consistent with the underlying mechanism of biological active forgetting. We extensively evaluate AFEC on a variety of continual learning benchmarks, including CIFAR-10 regression tasks, visual classification tasks and Atari reinforcement tasks, where AFEC effectively improves the learning of new tasks and achieves the state-of-the-art performance in a plug-and-play way. + +# 1 Introduction + +The ability to continually learn numerous tasks from dynamic data distributions is critical for deep neural networks, which needs to remember the old tasks by avoiding catastrophic forgetting [18] while effectively learn each new task by improving forward knowledge transfer [17]. Due to the dynamic data distributions, forward knowledge transfer might be either positive or negative, and is difficult to determine without accessing to the old training samples. If the forward knowledge transfer is negative, i.e., learning a new task from the old knowledge is worse than learning the new task on a randomly-initialized network [36, 17], then precisely remembering the old tasks will severely interfere with the learning of the new task, thus decreasing the performance of continual learning. + +By contrast, biological neural networks can effectively learn a new experience on the basis of remembering the old experiences, even if they conflict with each other [18, 5]. This advantage, called memory flexibility, is achieved by active forgetting of the old knowledge that interferes with the learning of a new experience [29, 5]. The latest data suggested that the underlying mechanism of biological active forgetting is to regulate the learning-triggered synaptic expansion and synaptic convergence (Fig. 1, see Appendix A for neuroscience background and our biological data). Specifically, the biological synapses expand additional functional connections to learn a new experience together with the previously-learned functional connections (synaptic expansion). Then, all the functional connections are pruned to the amount before learning (synaptic convergence). + +Inspired by the biological active forgetting, we propose to actively forget the old knowledge that interferes with the learning of new tasks without significantly increasing catastrophic forgetting, so as to benefit continual learning. Specifically, we adopt Bayesian continual learning and actively forget the posterior distribution that absorbs all the information of the old tasks with a forgetting + +![](images/10312ddd7d667e805ac0a186391f962a2ce3ff6ba50e4d9e680fa14b0d7160d8.jpg) +Silent Connection + +![](images/8c99f6b7d68994224be8dc9788872e7d9d40a776178c60c9ad4e024831c4ed5a.jpg) +Functional Connection + +![](images/185312c09d34c8148531d032ca556e3ca98b11088bc6b203e445f3fc03d932a0.jpg) +Task A + +![](images/f7a5acfe519a4dee5b264463ef7de742507937e3b145cf07ef892c7bb81b69fd.jpg) +Figure 1: The biological active forgetting is achieved by regulating the learning-triggered synaptic expansion-convergence. + +![](images/37bc44323b8960d8927bd25ae49ac579e0e0f7022e0378fa11e0bf8aeea84236.jpg) +Task B + +![](images/91ce88513e0d902687aeeadfdc80a8827825f6af9b2502fe1e3c5ef7a4f126fb.jpg) +Expansion + +![](images/b958bd9aa8e0de092b7f888194523f17e1d4ba06a432c9a3ed5b0e64072f4226.jpg) +Convergence + +factor to better learn each new task. Then, we derive a novel method named Active Forgetting with synaptic Expansion-Convergence (AFEC), which is formally consistent with the underlying mechanism of biological active forgetting at synaptic structures. Beyond regular weight regularization approaches [12, 13, 35, 2], which selectively penalize changes of the important parameters for the old tasks, AFEC dynamically expands parameters only for each new task to avoid potential negative transfer from the main network, while the forgetting factor regulates a penalty to selectively merge the main network parameters with the expanded parameters, so as to learn a better overall representation of both the old tasks and the new task. + +We extensively evaluate AFEC on continual learning of CIFAR-10 regression tasks, a variety of visual classification tasks, and Atari reinforcement tasks [10], where AFEC achieves the state-of-the-art (SOTA) performance. We empirically validate that the performance improvement results from effectively improving the learning of new tasks without increasing catastrophic forgetting. Further, AFEC can be a plug-and-play method that significantly boosts the performance of representative continual learning strategies, such as weight regularization [12, 13, 35, 2] and memory replay [21, 9, 6]. + +Our contributions include: (1) We draw inspirations from the biological active forgetting and propose a novel approach to actively forget the old knowledge that interferes with the learning of new tasks for continual learning; (2) Extensive evaluation on a variety of continual learning benchmarks shows that our method effectively improves the learning of new tasks and achieves the SOTA performance in a plug-and-play way; and (3) To the best of our knowledge, we are the first to model the biological active forgetting and its underlying mechanism at synaptic structures, which suggests a potential theoretical explanation of how the underlying mechanism of biological active forgetting achieves its function of forgetting the past and continually learning conflicting experiences [29, 5]. + +# 2 Related Work + +Continual learning needs to minimize catastrophic forgetting and maximize forward knowledge transfer. Existing work in continual learning mainly focuses on mitigating catastrophic forgetting. Representative approaches include: weight regularization [12, 13, 35, 2], which selectively penalizes changes of the previously-learned parameters; parameter isolation [24, 10], which allocates a dedicated parameter subspace for each task; and memory replay [21, 28, 9], which approximates and recovers the old data distributions through storing old training data, their embedding or learning a generative model. In particular, Adaptive Group Sparsity based Continual Learning (AGS-CL) [10] proposed to regularize the group sparsity with separation of the important nodes for the old tasks to prevent catastrophic forgetting, which takes advantages of weight regularization and parameter isolation, and achieved the SOTA performance on various continual learning benchmarks. + +Several studies suggested that forward knowledge transfer is critical for continual learning [17, 4], which might be either positive or negative due to the dynamic data distributions. Although it is highly nontrivial to mitigate potential negative transfer while overcoming catastrophic forgetting, the efforts that specifically consider this challenging issue are limited. [3] developed a method to mitigate negative transfer when fine-tuning tasks on a pretrained network. For the scenario where the old tasks can be learned again, [26] learned an additional active column to better exploit potential positive transfer. [22] tried to maximize transfer and minimize interference from a memory buffer containing a few old training data. Similarly, [6, 16, 33] attempted to more effectively balance stability and plasticity with the memory buffer in class incremental learning, while [32] stored and updated the old features. By contrast, since pretraining or old training data might not be available in continual learning, we mainly focus on a more restrict yet realistic setting that a neural network incrementally learns a sequence of tasks from scratch, without storing old training data. Further, we extend our method to the scenarios where pretraining or memory buffer can be used, as well as the scenarios other than classification tasks, such as regression tasks and reinforcement tasks. + +# 3 Method + +In this section, we first describe the framework of Bayesian continual learning [12, 20]. Under such framework, we propose an active forgetting strategy, which is formally consistent with the underlying mechanism of biological active forgetting at synaptic structures. + +# 3.1 Basics of Bayesian Continual Learning + +Continual learning needs to remember the old tasks and learn each new task effectively. Let's consider a simple case that a neural network with parameter $\theta$ continually learns two independent tasks, task $A$ and task $B$ , from their training datasets $D_A^{train}$ and $D_B^{train}$ [12]. The training dataset of each task is only available when learning the task. + +Bayesian Learning: After learning $D_A^{train}$ , the posterior distribution + +$$ +p (\theta | D _ {A} ^ {t r a i n}) = \frac {p (D _ {A} ^ {t r a i n} | \theta) p (\theta)}{p (D _ {A} ^ {t r a i n})} +$$ + +incorporates the knowledge of task $A$ . Then, we can get the predictive distribution for the test data of task $A$ : + +$$ +p \left(D _ {A} ^ {t e s t} \mid D _ {A} ^ {t r a i n}\right) = \int p \left(D _ {A} ^ {t e s t} \mid \theta\right) p \left(\theta \mid D _ {A} ^ {t r a i n}\right) d \theta . +$$ + +As the posterior $p(\theta | D_A^{train})$ is generally intractable (except very special cases), we must resort to approximation methods, such as the Laplace approximation [12] or other approaches of approximate inference [20]. Let's take Laplace approximation as an example. If $p(\theta | D_A^{train})$ is smooth and majorly peaked around the mode $\theta_A^* = \arg \max_{\theta} \log p(\theta | D_A^{train})$ , we can approximate it with a Gaussian distribution whose mean is $\theta_A^*$ and covariance is the inverse Hessian of the negative log posterior (detailed in Appendix B.1). + +Bayesian Continual Learning: Next, we want to incorporate the new task into the posterior, which uses the posterior $p(\theta | D_A^{train})$ as the prior of the next task [12]: + +$$ +p \left(\theta \mid D _ {A} ^ {\text {t r a i n}}, D _ {B} ^ {\text {t r a i n}}\right) = \frac {p \left(D _ {B} ^ {\text {t r a i n}} \mid \theta\right) p \left(\theta \mid D _ {A} ^ {\text {t r a i n}}\right)}{p \left(D _ {B} ^ {\text {t r a i n}}\right)}. \tag {1} +$$ + +Then we can test the performance of continual learning by evaluating + +$$ +p \left(D _ {A} ^ {\text {t e s t}}, D _ {B} ^ {\text {t e s t}} \mid D _ {A} ^ {\text {t r a i n}}, D _ {B} ^ {\text {t r a i n}}\right) = \int p \left(D _ {A} ^ {\text {t e s t}}, D _ {B} ^ {\text {t e s t}} \mid \theta\right) p \left(\theta \mid D _ {A} ^ {\text {t r a i n}}, D _ {B} ^ {\text {t r a i n}}\right) d \theta . \tag {2} +$$ + +Similarly, $p(\theta | D_A^{train}, D_B^{train})$ can be approximated by a Gaussian using Laplace approximation whose mean is the mode of the posterior: + +$$ +\begin{array}{l} \theta_ {A, B} ^ {*} = \arg \max _ {\theta} \log p (\theta | D _ {A} ^ {t r a i n}, D _ {B} ^ {t r a i n}) (3) \\ = \arg \max _ {\theta} \log p \left(D _ {B} ^ {t r a i n} | \theta\right) + \log p (\theta | D _ {A} ^ {t r a i n}) - \underbrace {\log p \left(D _ {B} ^ {t r a i n}\right)} _ {\text {c o n s t .}}. (4) \\ \end{array} +$$ + +This MAP estimation is also known as the Elastic Weight Consolidation (EWC) [12]: + +$$ +L _ {\mathrm {E W C}} (\theta) = L _ {\mathrm {B}} (\theta) + \frac {\lambda}{2} \sum_ {i} F _ {A, i} \left(\theta_ {i} - \theta_ {A, i} ^ {*}\right) ^ {2}, \tag {5} +$$ + +where $L_{\mathrm{B}}(\theta)$ is the loss for task $B$ and $i$ is the label of each parameter. $F_{A}$ is the Fisher Information matrix (FIM) of $\theta_{A}^{*}$ on $D_{A}^{train}$ (the computation is detailed in Appendix B.1), which indicates the "importance" of parameter $i$ for task $A$ . The hyperparameter $\lambda$ explicitly controls the penalty that selectively merges each $\theta_{i}$ to $\theta_{A,i}^{*}$ to alleviate catastrophic forgetting. + +# 3.2 Active Forgetting with Synaptic Expansion-Convergence + +However, if precisely remembering task $A$ interferes with the learning of task $B$ , e.g., task $A$ and task $B$ are too different, it might be useful to actively forget the original data, similar to the biological strategy of active forgetting. Based on this inspiration, we introduce a forgetting factor $\beta$ and replace $p(\theta | D_A^{train})$ that absorbs all the information of $D_A^{train}$ with a weighted product distribution [8][9]: + +$$ +p _ {m} (\theta | D _ {A} ^ {t r a i n}, \beta) = \frac {p (\theta | D _ {A} ^ {t r a i n}) ^ {(1 - \beta)} p (\theta) ^ {\beta}}{Z}, \tag {6} +$$ + +where we use $m$ to denote that we are 'mixing' $p(\theta |D_A^{train})$ and $p(\theta)$ to produce the new distribution $p_m$ . $Z$ is the normalizer that depends on $\beta$ , which keeps $p_m(\theta |D_A^{train},\beta)$ following a Gaussian distribution if $p(\theta |D_A^{train})$ and $p(\theta)$ are both Gaussian (detailed in Appendix B.2). When $\beta \to 0$ , $p_m$ will be dominated by $p(\theta |D_A^{train})$ and remember all the information about task $A$ . When $\beta \to 1$ , $p_m$ will actively forget all the information about task $A$ . Modified from Eqn. (2), our target becomes: + +$$ +p \left(D _ {A} ^ {t e s t}, D _ {B} ^ {t e s t} \mid D _ {A} ^ {t r a i n}, D _ {B} ^ {t r a i n}, \beta\right) = \int p \left(D _ {A} ^ {t e s t}, D _ {B} ^ {t e s t} \mid \theta\right) p \left(\theta \mid D _ {A} ^ {t r a i n}, D _ {B} ^ {t r a i n}, \beta\right) d \theta . \tag {7} +$$ + +We first need to determine $\beta$ , which decides how much information from task $A$ is forgotten to maximize the probability of learning task $B$ well. A good $\beta$ should be as follows: + +$$ +\beta^ {*} = \arg \max _ {\beta} p (D _ {B} ^ {t r a i n} | D _ {A} ^ {t r a i n}, \beta) = \arg \max _ {\beta} \int p (D _ {B} ^ {t r a i n} | \theta) p _ {m} (\theta | D _ {A} ^ {t r a i n}, \beta) d \theta . \qquad (8) +$$ + +Since the integral is difficult to solve, we can make a grid search to determine $\beta$ , which should be between 0 and 1. Next, $p(\theta | D_A^{train}, D_B^{train}, \beta)$ can also be approximated by a Gaussian using Laplace approximation (the proof is detailed in Appendix B.3), and the MAP estimation is + +$$ +\begin{array}{l} \theta_ {A, B} ^ {*} = \arg \max _ {\theta} \log p (\theta | D _ {A} ^ {t r a i n}, D _ {B} ^ {t r a i n}, \beta) \\ = \arg \max _ {\theta} (1 - \beta) (\log p \left(D _ {B} ^ {t r a i n} | \theta\right) + \log p (\theta | D _ {A} ^ {t r a i n})) + \beta \log p (\theta | D _ {B} ^ {t r a i n}) + c o n s t.. \tag {9} \\ \end{array} +$$ + +Then we obtain the loss function of Active Forgetting with synaptic Expansion-Convergence (AFEC): + +$$ +L _ {\mathrm {A F E C}} (\theta) = L _ {\mathrm {B}} (\theta) + \frac {\lambda}{2} \sum_ {i} F _ {A, i} \left(\theta_ {i} - \theta_ {A, i} ^ {*}\right) ^ {2} + \frac {\lambda_ {e}}{2} \sum_ {i} F _ {e, i} \left(\theta_ {i} - \theta_ {e, i} ^ {*}\right) ^ {2}. \tag {10} +$$ + +$\theta_{e}^{*}$ are the optimal parameters for the new task and $F_{e}$ is the FIM of $\theta_{e}^{*}$ (the computation is detailed in Appendix B.1). As shown in Fig. 2, we first learn a set of expanded parameters $\theta_{e}$ with $L_{\mathrm{B}}(\theta_{e})$ to obtain $\theta_{e}^{*}$ and $F_{e}$ . Then we can optimize Eqn. (10), where two weight-merging regularizers selectively merge $\theta_{i}$ with $\theta_{A,i}^{*}$ for the old tasks and $\theta_{e,i}^{*}$ for the new task. The forgetting factor $\beta$ is integrated into a hyperparameter $\lambda_{e} \propto \beta / (1 - \beta)$ to control the penalty that promotes active forgetting. Therefore, derived from active forgetting of the original posterior in Eqn. (6), we obtain an algorithm that dynamically expands parameters to learn a new task and then selectively converges the expanded parameters to the main network. Intriguingly, this algorithm is formally consistent with the underlying mechanism of biological active forgetting (the neuroscience evidence is detailed in Appendix A), which also expands additional functional connections for a new experience (synaptic expansion) and then prunes them to the amount before learning (synaptic convergence). + +As the proposed active forgetting is integrated into the third term, our method can be used in a plug-and-play way to improve continual learning (detailed in Appendix E, F). Here we use Laplace approximation to approximate the intractable posteriors, which can be other strategies of approximate inference [20] in further work. Note that $\theta_{e}^{*}$ and $F_{e}$ are not stored in continual learning, and the architecture of the main network is fixed. Thus, AFEC does not cause additional storage cost compared with regular weight regularization approaches such as [12, 35, 11, 2]. Further, it is straightforward to extend our method to continual learning of more than two tasks. We discuss it in Appendix B.4 with a pseudocode. + +Now we conceptually analyze how AFEC mitigates potential negative transfer in continual learning (see Fig. 2). When learning task $B$ on the basis of task $A$ , regular weight regularization approaches [12, 35], selectively penalize changes of the old + +parameters learned for task $A$ , which will severely interfere with the learning of task $B$ if they conflict with each other. In contrast, AFEC learns a set of expanded parameters only for task $B$ to avoid potential negative transfer from task $A$ . Then, the main network parameters selectively merge with both the old parameters and the expanded parameters, depending on their contributions to the overall representations of task $A$ and task $B$ . + +![](images/1e14ab7a32abdfc2cffeab019c0b31a1732bd36fdbbd30d34b2c729d62f0e753.jpg) + +![](images/63644865e8998451cbe085e13103c9a6e62f2b02d9cbec357cf4212f6c30580f.jpg) +Figure 2: Conceptual comparison of EWC and AFEC (ours). $①$ Synaptic Expansion: Learn the expanded parameters $\theta_{e}$ with $L_{B}(\theta_{e})$ to obtain $\theta_{e}^{*}$ and $F_{e}$ . $②$ Synaptic Convergence: Learn the main network parameters $\theta$ with Eqn. (10) for selective weight-merging. + +# 4 Experiment + +In this section, we evaluate AFEC on a variety of continual learning benchmarks, including: CIFAR-10 regression tasks, which is a toy experiment to validate our idea about negative transfer in continual learning; visual classification tasks, where the forward knowledge transfer might be either positive or negative; and Atari reinforcement tasks, where the forward knowledge transfer is severely negative. All the experiments are averaged by 5 runs with different random seeds and task orders. + +# 4.1 CIFAR-10 Regression Tasks + +First, we propose CIFAR-10 regression tasks to explicitly show how negative transfer affects continual learning, and how AFEC effectively addresses this challenging issue. CIFAR-10 dataset [13] contains 50,000 training samples and 10,000 testing samples of 10-class colored images of size $32 \times 32$ . The regression task is to evenly map the ten classes around the origin of the two-dimensional coordinates and train the neural network to predict the angle of the origin to each class (see Fig. 3). We change the relative position of the ten classes to construct different regres + +sion tasks with mutual negative transfer, in which remembering the old knowledge will severely interfere with the learning of a new task. + +![](images/8f93a3e299dde99077dda9251df6fed90aae5b8374b62595a246e12df019aa7e.jpg) +Figure 3: CIFAR-10 regression tasks. Each circle represents the position of a class. Task $A$ and Task $B$ use different relative positions. "Transfer" applies the same relative position as Task $A$ , but rotates by several phases. + +![](images/de35b8f49211ba2b3966e1851ef75ba9e7c20fe607360c2487bcc4187e43f15a.jpg) + +![](images/baf9ebc6626f2005929a027c7eb2a3ef99542bf353cf1af416cc53457fb7e3fb.jpg) + +![](images/b2e953ae060b8bd2e63498e68c83c6bb59dfa5da4b83d86d517fc0ea2bf5fa71.jpg) +Figure 4: Continual learning of two CIFAR-10 regression tasks with a two-layer LeNet architecture. Larger strength of weight regularization can better remember the old task but limits the learning of the new task. AFEC can more effectively learn a new task while remembering the old task. + +![](images/c89eb263f86763942dae8b66827ef867396d220941ff5083afd8f981862a98b1.jpg) + +![](images/1b0ff0979e2a3a4c3e519f0a5524728348dc8fc9297364a018a0a0e587aaf6db.jpg) + +![](images/0d98e8add8f301032dae53ebcf222f3def7a865eddb926d1e1773c9ad7b58e9f.jpg) + +As shown in Fig. 4 for continual learning of two different regression tasks, regular weight regularization approaches, such as MAS [1] and EWC [12], can effectively remember the old tasks, but limits the learning of new tasks. In particular, larger strength of the weight regularization results in better performance of the + +Table 1: Continual learning of CIFAR-10 regression tasks with various architectures. We present the averaged accuracy $(\%)$ of five runs for two-task and ten-task, and five runs of five rotations for transfer experiment. + +
MethodsLeNet [15]VGG11 [30]VGG11BN [30]ResNet10 [7]
Two-TaskFine-tuning29.23 ±0.7246.37 ±0.1146.54 ±0.2960.67 ±1.52
EWC [12]39.91 ±1.4473.55 ±1.2682.00 ±0.3271.94 ±1.61
AFEC (ours)44.45 ±1.0377.76 ±0.0986.07 ±0.2475.67 ±1.19
Ten-TaskFine-tuning46.57 ±0.6818.03 ±0.0318.08 ±0.0454.97 ±1.33
EWC [12]49.95 ±1.8179.39 ±1.1285.98 ±0.0782.91 ±0.22
AFEC (ours)53.50 ±1.7082.50 ±0.4788.31 ±0.1185.33 ±0.31
TransferFine-tuning38.93 ±0.8080.37 ±0.4084.30 ±0.1085.69 ±0.93
EWC [12]35.87 ±0.8776.66 ±0.4482.25 ±0.1184.96 ±0.91
AFEC (ours)40.90 ±1.3583.81 ±0.4286.30 ±0.1787.80 ±0.66
+ +first task but worse performance of the second task. In contrast, AFEC improves the learning of new tasks on the basis of remembering the old tasks, so as to achieve better averaged accuracy. Note that EWC is equal to the ablation of active forgetting in AFEC, i.e., $\beta = 0$ , so the performance improvement of AFEC on EWC validates the effectiveness of our proposal. We further demonstrate the efficacy of AFEC on a variety of architectures and a larger amount of tasks (see Table I). + +In addition, we evaluate the ability of transfer learning after continual learning of two different regression tasks. We fix the feature extractor of the neural network and only fine-tune a linear classifier to predict a new task that is similar to the first task. Specifically, the similar task applies the same relative position as the first task, but rotates by $60^{\circ}$ , $120^{\circ}$ , $180^{\circ}$ , $240^{\circ}$ or $300^{\circ}$ . Therefore, if the neural network effectively remembers and transfers the relative position learned in the first task, it will be able to learn the similar task well. As shown in Table I, AFEC can more effectively learn the similar task, while EWC is even worse than sequentially fine-tuning without weight regularization. + +# 4.2 Visual Classification Tasks + +Dataset: We evaluate continual learning on a variety of benchmark datasets for visual classification, including CIFAR-100, CUB-200-2011 and ImageNet-100. CIFAR-100 [13] contains 100-class colored images of the size $32 \times 32$ , where each class includes 500 training samples and 100 testing samples. CUB-200-2011 [31] is a large-scale dataset including 200 classes and 11,788 colored images of birds, split as 30 images per class for training while the rest for testing. ImageNet-100 [9] is a subset of iILSVRC-2012 [23], consisting of randomly selected 100 classes of images and 1300 samples per class. We follow the regular preprocessing pipeline of CUB-200-2011 and ImageNet-100 as [10], which randomlyizes and crops the images to the size of $224 \times 224$ before experiment. + +Benchmark: We consider five representative benchmarks of visual classification tasks to evaluate continual learning in different aspects. The first three are on CIFAR-100, with forward knowledge transfer from more negative to more positive (detailed in Fig. 5), while the second two are on large-scale images. (1) CIFAR-100-SC [34]: CIFAR-100 can be split as 20 superclasses (SC) with 5 classes per superclass dependent on semantic similarity, where each superclass is a classification task. Since the superfamilies are semantically different, forward knowledge transfer in such a task sequence is + +Table 2: Averaged accuracy $(\%)$ of all the tasks learned so far in continual learning of visual classification tasks, averaged by 5 different random seeds (see Appendix C for error bar). *AFEC is our method described in Sec. 3.2, while w/ AFEC is the adaptation of our method to representative weight regularization methods (detailed in Appendix E). + +
MethodsCIFAR-100-SCCIFAR-100CIFAR-10/100CUB-200 w/ PTCUB-200 w/o PTImageNet-100
A10A20A10A20A2A2+20A5A10A5A10A5A10
Fine-tuning32.5828.4040.9233.5378.9637.8178.7578.1331.9139.8250.5644.80
P&C [26]53.4852.8870.1070.2186.7278.2981.4281.7433.8842.7976.4474.38
AGS-CL [10]55.1953.1971.2469.9986.2780.4282.3081.8432.6940.7351.4847.20
EWC [12]52.2551.7468.7269.1885.0777.7581.3780.9232.9042.2976.1273.82
*AFEC (ours)56.2855.2472.3672.2986.8781.2583.6582.0434.3643.0577.6475.46
MAS [1]52.7652.1867.6069.4184.9777.3979.9879.6731.6842.5675.4874.72
w/ AFEC (ours)55.2654.8969.5771.2086.2180.0182.7781.3134.0842.9375.6475.66
SI [35]52.2051.9768.7269.2185.0076.6980.1480.2133.0842.0373.5272.97
w/ AFEC (ours)55.2553.9069.3470.1385.7178.4983.0681.8834.0443.2075.7274.14
RWALK [2]50.5149.6266.0266.9085.5973.6480.8180.5832.5641.9473.2473.22
w/ AFEC (ours)52.6251.7668.5069.1286.1277.1683.2481.9533.3542.9574.6473.86
+ +relatively more negative. (2) CIFAR-100 [21]: The 100 classes in CIFAR-100 are randomly split as 20 classification tasks with 5 classes per task. (3) CIFAR-10/100 [10]: The 10-class CIFAR-10 are randomly split as 2 classification tasks with 5 classes per task, followed by 20 tasks with 5 classes per task randomly split from CIFAR-100. This benchmark is adapted from [10] to keep the number of classes per task the same as benchmark (1, 2), where the large amounts of training data in the first two CIFAR-10 tasks bring a relatively more positive transfer. (4) CUB-200 [10]: The 200 classes in CUB-200-2011 are randomly split as 10 classification tasks with 20 classes per task. (5) ImageNet-100 [21]: The 100 classes in ImageNet-100 are randomly split as 10 classification tasks with 10 classes per task. + +Architecture: We follow [10] to use a CNN architecture with 6 convolution layers and 2 fully connected layers for benchmark (1, 2, 3), and AlexNet [14] for benchmark (4, 5). Since continual learning needs to quickly learn a usable model from incrementally collected data, we mainly consider learning the network from scratch. Following [10], we also try AlexNet with ImageNet pretraining for CUB-200. + +Baseline: First, we consider a restrict yet realistic setting of continual learning without access to the old training data, and perform multi-head evaluation [2]. Since AFEC is a weight regularization approach, we mainly compare with representative approaches that follow a similar idea, such as EWC [12], MAS [1], SI [35] and RWALK [2]. We also compare with AGS-CL [10], the SOTA method that takes advantage of weight regularization and parameter isolation, and P&C [26], which learns an additional active column on the basis of EWC to improve forward knowledge transfer. We reproduce the results of all the baselines from the officially released code of [10], where we do an extensive hyperparameter search and report the best performance for fair comparison (detailed in Appendix C). Then, we relax the restriction of using old training data and plug AFEC in representative memory replay approaches, where we perform single-head evaluation [2] (detailed in Appendix F). + +Averaged Accuracy: In Table 2, we summarize the averaged accuracy of all the tasks learned so far during continual learning of visual classification tasks. AFEC achieves the best performance on all the continual learning benchmarks and is much better than EWC [12], i.e., the ablation of active forgetting in AFEC. In particular, AGS-CL [10] is the SOTA method on relatively small-scale images and on CUB-200 with ImageNet pretraining (CUB-200 w/ PT). While, AFEC achieves a better performance than AGS-CL on small-scale images from scratch and CUB-200 w/ PT, and substantially outperforms AGS-CL on the two benchmarks of large-scale images from scratch. Further, since regular weight regularization approaches are generally in a re-weighted weight decay form, AFEC can be easily adapted to such approaches (the adaptation is detailed in Appendix E) and effectively boost their performance on the benchmarks above. + +Knowledge Transfer: Next, we evaluate knowledge transfer in the three continual learning benchmarks developed on CIFAR-100 in Fig. 5. We first present the accuracy of learning each new task + +![](images/a3d3f474c5650d3e1a2e494625bd5c34ce9c33605812326f9d86143c1f4a71e0.jpg) + +![](images/44ab00ebdbbd828d7959d0490dd74f6853a0a83088a7419c20a1f05e4e4dbcbb.jpg) + +![](images/ad21c0c23f023dbfd0c618a466b3993e615e41cd7ee1424f938c74c0b00c97a7.jpg) +$\rightarrow$ AFEC + $\rightarrow$ EWC + $\rightarrow$ MAS + $\rightarrow$ SI + $\rightarrow$ RWALI + $\rightarrow$ AGS-C + $\rightarrow$ P&C + +![](images/3b16a3fc56689d4e5d64c83978f5d33f139a150f7fde175101a801f69e6468ff.jpg) + +![](images/580480963b8f826725432fc3e76c926f1d4eda933264774c5459c1b29a5da96c.jpg) + +![](images/01faeb2744451f2313cef4f85862a8ef284ca7ca522febd9111232af629092a9.jpg) +AFEC EWC MAS SI RWALK AGS-CL P&C + +![](images/1edf32d6208c677a3bb5626b334f31029a080d4e5eb56d699471cf40b7d4c0df.jpg) +Figure 5: Knowledge transfer in continual learning. (a) The accuracy of learning each new task in continual learning. (b) Forward Transfer (FWT), which is from more negative to more positive on CIFAR-100-SC, CIFAR-100 and CIFAR-10/100. (c) Backward Transfer (BWT). + +![](images/7de09cea5d76bed655225833b9586c6d8bf86557d12389f93ae6d40069f45bed.jpg) + +![](images/cfcba9d5738778c58762729d4b44ee4c58a12323a3abf1c77175ca2e8a06d97a.jpg) +AFEC EWC MAS SI RWALK AGS-CL P&C + +![](images/0bc15ed6985815d48a08cee1897838b846de847f5360496b06da555618f4d108.jpg) +Figure 6: Visualization of predictions of the latest task after continual learning on CIFAR-100-SC. We present the results on five different random seeds, which determine five different superclasses. + +in continual learning, where AFEC learns each new task much better than other baselines. Since continual learning of more tasks leads to less network resources for a new task, the overall trend of all the baselines is declining, indicating the necessity to improve forward knowledge transfer on the basis of overcoming catastrophic forgetting. Then we calculate forward transfer (FWT) [17], i.e., the averaged influence that learning the previous tasks has on a future task, and backward transfer (BWT) [17], i.e., the averaged influence that learning a new task has on the previous tasks (detailed in Appendix D). FWT is from more negative to more positive in CIFAR-100-SC, CIFAR-100 and CIFAR-10/100, while AFEC achieves the highest FWT among all the baselines. The BWT of AFEC is comparable as EWC, indicating that the proposed active forgetting does not cause additional catastrophic forgetting. Therefore, the performance improvement of AFEC in Table2 is achieved by effectively improving the learning of new tasks in continual learning. In particular, AFEC achieves a much larger improvement on the learning of new tasks than P&C, which attempted to improve forward transfer of EWC through learning an additional active column. Due to the progressive + +parameter isolation, although AGS-CL achieves the best BWT, its ability of learning each new task drops more rapidly than other baselines. Thus, it underperforms AFEC in Table 2. + +Visual Explanation: To explicitly show how AFEC improves continual learning, in Fig. 6 we use Grad-CAM [27] to visualize predictions of the latest task after continual learning on CIFAR-100-SC, where FWT is more negative as discussed above. The predictions of EWC overfit the background information since it attempts to best remember the old tasks with severe negative transfer, which limits the learning of new tasks. In contrast, the visual explanation of AFEC is much more reasonable than EWC, indicating the efficacy of active forgetting to address potential negative transfer and benefit the learning of new tasks. + +Plugging-in Memory Replay: We further implement AFEC in representative memory replay approaches in Appendix F, where we perform single-head evaluation [2]. On CIFAR-100 and ImageNet-100 datasets, we follow [9,6] that first learn 50 classes and then continually learn the other 50 classes by 5 phases (10 classes per phase) or 10 phases (5 classes per phase), using a small memory buffer of 20 images per class. AFEC substantially boosts the performance of representative memory replay approaches such as iCaRL [21], LUCIR [9] and PODNet [6]. + +# 4.3 Atari Reinforcement Tasks + +![](images/f89d644355406bd904fdffabd2bd8878e5cd9d2a666b216d6729e7e9f38260e2.jpg) +Figure 7: Continual learning of Atari reinforcement tasks. AFEC $^1$ is our method described in Sec. 3.2, while AFEC $^2$ is the adaptation of our method to MAS. + +![](images/aef6bd64091b1989897a7e01a0d3c2d153fa9db9840b05ff46a2a0a19a1a88ed.jpg) + +![](images/ed6f8d932698e983df2ff1aba79e381d03a6515c5a03f722bc9d451ffb1dd312.jpg) + +Next, we evaluate AFEC in continual learning of Atari reinforcement tasks (Atari games). We follow the implementation of [10] to sequentially learn eight randomly selected Atari games. Specifically, we applies a CNN architecture consisting of 3 convolution layers with 2 fully connected layers and identical PPO [25] for all the methods (detailed in Appendix G). The evaluation metric is the normalized accumulated reward: the evaluated rewards are normalized with the maximum reward of fine-tuning on each task, and accumulated. We present the results of three different orders of task sequence, averaged by five runs with different random initialization. + +For continual learning of Atari reinforcement tasks, forward knowledge transfer is severely negative, possibly because the optimal policies of each Atari games are highly different. We first measure the normalized rewards of learning each task with a randomly initialized network, which are 2.16, 1.44 and 1.68 on the three task sequences, + +respectively. That is to say, the initialization learned from the old tasks results in an averaged performance decline by $53.67\%$ , $30.66\%$ and $40.56\%$ , compared with random initialization. Then, we evaluate the maximum reward of learning each new task in Table 3 and the normalized accumulated reward of continual learning in Fig. 7 AFEC effectively improves the learning of new tasks and thus boosts the performance of EWC and MAS, particularly when learning more incremental tasks. AFEC also achieves a much better performance than the reproduced results of AGS-CL on its officially released code [10] (see Appendix G for an extensive analysis). + +Table 3: Averaged performance increase of learning each new task on Atari reinforcement tasks. + +
Sequence 1Sequence 2Sequence 3
\( AFEC^1 \) on EWC+35.28%+50.55%+28.00%
\( AFEC^2 \) on MAS+30.09%+61.12%+26.63%
+ +# 5 Conclusion + +In this work, we draw inspirations from the biological active forgetting and propose a novel approach to mitigate potential negative transfer in continual learning. Our method achieves the SOTA performance on a variety of continual learning benchmarks through effectively improving the learning of new tasks, and boosts representative continual learning strategies in a plug-and-play way. Intriguingly, derived from active forgetting of the past with Bayesian continual learning, we obtain the algorithm that is formally consistent with the synaptic expansion and synaptic convergence (detailed Appendix A), and is functionally consistent with the advantage of biological active forgetting in memory flexibility [5]. This connection provides a potential theoretical explanation of how the underlying mechanism of biological active forgetting achieves its function of forgetting the past and continually learning conflicting experiences. We will further explore it with artificial neural networks and biological neural networks in the future. + +# Limitation and Social Impact + +The potential limitations of our work include three aspects: First, we propose a method to mitigate potential negative transfer in continual learning, so the efficacy of our method might be influenced by the level of negative transfer in a task sequence. Second, following [12], we assume that all the incremental tasks are independent, which might limit the application of our method to other scenarios such as continual learning of smoothly-changed data distributions. Third, our method needs to learn an additional set of parameters, resulting in more computational cost. Since our work is a fundamental research in machine learning, the negative social impacts are not obvious at this stage. + +# Acknowledgements + +This work was supported by NSF of China Projects (Nos. 62061136001, 61620106010, U19B2034, U181146, 62076145), Beijing NSF Project (No. JQ19016), Tsinghua-Peking Center for Life Sciences, Beijing Academy of Artificial Intelligence (BAAI), Tsinghua-Huawei Joint Research Program, a grant from Tsinghua Institute for Guo Qiang, and the NVIDIA NVAIL Program with GPU/DGX Acceleration. + +# References + +[1] 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), pages 139-154, 2018. +[2] Arslan Chaudhry, Puneet K Dokania, Thalaiyasingam Ajanthan, and Philip HS Torr. Riemannian walk for incremental learning: Understanding forgetting and intransigence. In Proceedings of the European Conference on Computer Vision (ECCV), pages 532-547, 2018. +[3] Xinyang Chen, Sinan Wang, Bo Fu, Mingsheng Long, and Jianmin Wang. Catastrophic forgetting meets negative transfer: Batch spectral shrinkage for safe transfer learning. In Advances in Neural Information Processing Systems, pages 1908-1918, 2019. +[4] Natalia Díaz-Rodríguez, Vincenzo Lomonaco, David Filliat, and Davide Maltoni. Don't forget, there is more than forgetting: new metrics for continual learning. arXiv preprint arXiv:1810.13166, 2018. +[5] Tao Dong, Jing He, Shiqing Wang, Lianzhang Wang, Yuqi Cheng, and Yi Zhong. Inability to activate rac1-dependent forgetting contributes to behavioral inflexibility in mutants of multiple autism-risk genes. Proceedings of the National Academy of Sciences, 113(27):7644-7649, 2016. +[6] Arthur Douillard, Matthieu Cord, Charles Ollion, Thomas Robert, and Eduardo Valle. Podnet: Pooled outputs distillation for small-tasks incremental learning. In Proceedings of the European Conference on Computer Vision (ECCV), volume 12365, pages 86-102, 2020. +[7] 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, pages 770-778, 2016. +[8] Geoffrey E Hinton. Training products of experts by minimizing contrastive divergence. Neural Computation, 14(8):1771-1800, 2002. +[9] Saihui Hou, Xinyu Pan, Chen Change Loy, Zilei Wang, and Dahua Lin. Learning a unified classifier incrementally via rebalancing. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 831-839, 2019. +[10] Sangwon Jung, Hongjoon Ahn, Sungmin Cha, and Taesup Moon. Continual learning with node-importance based adaptive group sparse regularization. arXiv e-prints, pages arXiv-2003, 2020. +[11] Steven M Kay. Fundamentals of statistical signal processing. Prentice Hall PTR, 1993. +[12] James Kirkpatrick, Razvan Pascanu, Neil Rabinowitz, Joel Veness, Guillaume Desjardins, Andrei A Rusu, Kieran Milan, John Quan, Tiago Ramalho, Agnieszka Grabska-Barwinska, et al. Overcoming catastrophic forgetting in neural networks. Proceedings of the National Academy of Sciences, 114(13):3521-3526, 2017. +[13] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. Technical report, Citeseer, 2009. +[14] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems, volume 25, pages 1097-1105, 2012. +[15] Yann LeCun. The mnist database of handwritten digits. http://yann.lecun.com/exdb/mnist/, 1998. +[16] Yaoyao Liu, Bernt Schiele, and Qianru Sun. Meta-aggregating networks for class-incremental learning. arXiv preprint arXiv:2010.05063, 2020. +[17] David Lopez-Paz et al. Gradient episodic memory for continual learning. In Advances in Neural Information Processing Systems, pages 6467-6476, 2017. + +[18] Michael McCloskey and Neal J Cohen. Catastrophic interference in connectionist networks: The sequential learning problem. In Psychology of Learning and Motivation, volume 24, pages 109-165. Elsevier, 1989. +[19] Thomas Minka. Power ep. Technical report, Microsoft Research, Cambridge, 2004. +[20] Cuong V Nguyen, Yingzhen Li, Thang D Bui, and Richard E Turner. Variational continual learning. arXiv preprint arXiv:1710.10628, 2017. +[21] 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, pages 2001-2010, 2017. +[22] Matthew Riemer, Ignacio Cases, Robert Ajemian, Miao Liu, Irina Rish, Yuhai Tu, and Gerald Tesauro. Learning to learn without forgetting by maximizing transfer and minimizing interference. arXiv preprint arXiv:1810.11910, 2018. +[23] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International Journal of Computer Vision, 115(3):211-252, 2015. +[24] Andrei A Rusu, Neil C Rabinowitz, Guillaume Desjardins, Hubert Soyer, James Kirkpatrick, Koray Kavukcuoglu, Razvan Pascanu, and Raia Hadsell. Progressive neural networks. arXiv preprint arXiv:1606.04671, 2016. +[25] John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017. +[26] Jonathan Schwarz, Wojciech Czarnecki, Jelena Luketina, Agnieszka Grabska-Barwinska, Yee Whye Teh, Razvan Pascanu, and Raia Hadsell. Progress & compress: A scalable framework for continual learning. In Proceedings of International Conference on Machine Learning, pages 4528-4537. PMLR, 2018. +[27] Ramprasaath R Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad-cam: Visual explanations from deep networks via gradient-based localization. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 618-626, 2017. +[28] Hanul Shin, Jung Kwon Lee, Jaehong Kim, and Jiwon Kim. Continual learning with deep generative replay. In Advances in Neural Information Processing Systems, pages 2990-2999, 2017. +[29] Yichun Shuai, Binyan Lu, Ying Hu, Lianzhang Wang, Kan Sun, and Yi Zhong. Forgetting is regulated through rac activity in drosophila. Cell, 140(4):579-589, 2010. +[30] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. +[31] Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The caltech-ucsd birds-200-2011 dataset. 2011. +[32] Shipeng Wang, Xiaorong Li, Jian Sun, and Zongben Xu. Training networks in null space of covariance for continual learning. arXiv preprint arXiv:2103.07113, 2021. +[33] Shipeng Yan, Jiangwei Xie, and Xuming He. Der: Dynamically expandable representation for class incremental learning. arXiv preprint arXiv:2103.16788, 2021. +[34] Jaehong Yoon, Saehoon Kim, Eunho Yang, and Sung Ju Hwang. Scalable and order-robust continual learning with additive parameter decomposition. arXiv preprint arXiv:1902.09432, 2019. +[35] Friedemann Zenke, Ben Poole, and Surya Ganguli. Continual learning through synaptic intelligence. In Proceedings of International Conference on Machine Learning, pages 3987-3995, 2017. +[36] Wen Zhang, Lingfei Deng, and Dongrui Wu. Overcoming negative transfer: A survey. arXiv preprint arXiv:2009.00909, 2020. + +# Checklist + +1. For all authors... + +(a) Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope? [Yes] See the abstract and introduction with the manuscript. +(b) Did you describe the limitations of your work? [Yes] See the paragraph after Conclusion. +(c) Did you discuss any potential negative societal impacts of your work? [Yes] See the paragraph after Conclusion. +(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] We carefully read the ethics review guidelines and ensured that our paper conforms to them. + +2. If you are including theoretical results... + +(a) Did you state the full set of assumptions of all theoretical results? [Yes] See Sec. 3. +(b) Did you include complete proofs of all theoretical results? [Yes] See Sec. 3, Appendix B and E. + +3. If you ran experiments... + +(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] Our code is included in supplementary materials. +(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Sec. 4 and Appendix C, F and G. +(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] See Sec. 4. +(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Appendix I. + +4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... + +(a) If your work uses existing assets, did you cite the creators? [Yes] See Sec. 4. +(b) Did you mention the license of the assets? [Yes] See Appendix H. +(c) Did you include any new assets either in the supplemental material or as a URL? [N/A] We do not include new assets. +(d) Did you discuss whether and how consent was obtained from people whose data you're using/curating? [N/A] We do not include new assets. +(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] + +5. If you used crowdsourcing or conducted research with human subjects... + +(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] We do not use crowdsourcing or conducted research with human subjects. +(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] We do not use crowdsourcing or conducted research with human subjects. +(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] We do not use crowdsourcing or conducted research with human subjects. \ No newline at end of file diff --git a/afecactiveforgettingofnegativetransferincontinuallearning/images.zip b/afecactiveforgettingofnegativetransferincontinuallearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..15587658311eaa0245aee0a1a399f775f5d23aec --- /dev/null +++ b/afecactiveforgettingofnegativetransferincontinuallearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5641f4d0c0307c651b4594b229dfd10ae155356fb709db83be5544f7402d6733 +size 657219 diff --git a/afecactiveforgettingofnegativetransferincontinuallearning/layout.json b/afecactiveforgettingofnegativetransferincontinuallearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..0d7e343f38e9afa2b3c1e78ac417dc49da04bb29 --- /dev/null +++ b/afecactiveforgettingofnegativetransferincontinuallearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:44cecac76008fc0245cd5a773111de5c2824580392a823940cbae80f44d4bc43 +size 441659 diff --git a/afirstorderprimaldualmethodwithadaptivitytolocalsmoothness/509997d0-15b3-49de-ab62-314dca005a8c_content_list.json b/afirstorderprimaldualmethodwithadaptivitytolocalsmoothness/509997d0-15b3-49de-ab62-314dca005a8c_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..7b5cc9e2ad1a4ca88a9e66d515f3eeb2e4fbc9f8 --- /dev/null +++ b/afirstorderprimaldualmethodwithadaptivitytolocalsmoothness/509997d0-15b3-49de-ab62-314dca005a8c_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9935039a5a4022fbbb7bf0b69581b1a0aee91c25aae99c24c773790efcf76ef1 +size 79187 diff --git a/afirstorderprimaldualmethodwithadaptivitytolocalsmoothness/509997d0-15b3-49de-ab62-314dca005a8c_model.json b/afirstorderprimaldualmethodwithadaptivitytolocalsmoothness/509997d0-15b3-49de-ab62-314dca005a8c_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e5dbd2eb5e2efa3e3687bd479e41237944b57ba2 --- /dev/null +++ b/afirstorderprimaldualmethodwithadaptivitytolocalsmoothness/509997d0-15b3-49de-ab62-314dca005a8c_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d4ea1069edab96b26e3e7e1ca8438a26fe1f6835475f4fa1b2c689752aa82f50 +size 92299 diff --git a/afirstorderprimaldualmethodwithadaptivitytolocalsmoothness/509997d0-15b3-49de-ab62-314dca005a8c_origin.pdf b/afirstorderprimaldualmethodwithadaptivitytolocalsmoothness/509997d0-15b3-49de-ab62-314dca005a8c_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c0136a16d7c86ab650699625815f6a89d513c487 --- /dev/null +++ b/afirstorderprimaldualmethodwithadaptivitytolocalsmoothness/509997d0-15b3-49de-ab62-314dca005a8c_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8dd044d104573570406f87c6f3b7bb4f73c13e7f2a6c1574b785c9ebaa20773 +size 654147 diff --git a/afirstorderprimaldualmethodwithadaptivitytolocalsmoothness/full.md b/afirstorderprimaldualmethodwithadaptivitytolocalsmoothness/full.md new file mode 100644 index 0000000000000000000000000000000000000000..729bbef074198a22911996f5742c768bb37f40c7 --- /dev/null +++ b/afirstorderprimaldualmethodwithadaptivitytolocalsmoothness/full.md @@ -0,0 +1,401 @@ +# A first-order primal-dual method with adaptivity to local smoothness + +Maria-Luiza Vladarean\* + +Yura Malitsky† + +Volkan Cevher* + +{maria-luiza.vladarean, volkan.cevher}@epfl.ch + +yurii.malitskyi@liu.se + +* LIONS, École Polytechnique Fédérale de Lausanne, Switzerland + +† Linköping University, Sweden + +# Abstract + +We consider the problem of finding a saddle point for the convex-concave objective $\min_x\max_yf(x) + \langle Ax,y\rangle -g^* (y)$ , where $f$ is a convex function with locally Lipschitz gradient and $g$ is convex and possibly non-smooth. We propose an adaptive version of the Condat-Vu algorithm, which alternates between primal gradient steps and dual proximal steps. The method achieves stepsize adaptivity through a simple rule involving $\| A\|$ and the norm of recently computed gradients of $f$ . Under standard assumptions, we prove an $\mathcal{O}(k^{-1})$ ergodic convergence rate. Furthermore, when $f$ is also locally strongly convex and $A$ has full row rank we show that our method converges with a linear rate. Numerical experiments are provided for illustrating the practical performance of the algorithm. + +# 1 Introduction + +In this paper we study a particular instance of the composite minimization problem + +$$ +\min _ {x \in \mathcal {X}} f (x) + g (A x), \tag {1} +$$ + +where $f$ and $g$ are convex, proper and lower-semicontinuous (l.s.c.), and $A$ is a linear operator. + +Problems of the form (1) have been studied in the literature under various assumptions on $f$ and $g$ . For the particular instances where $g \circ A$ is proximal-friendly and $f$ is $L$ -smooth, the objective is suitable for applying forward-backward splitting algorithms like the Proximal Gradient algorithm and its accelerated counterpart [Nesterov, 2013, Beck and Teboulle, 2009]. In general, however, the proximal operator of $g \circ A$ is not easily computable and in such cases a popular approach is to decouple $A$ and $g$ by reformulating problem (1) as a convex-concave saddle-point problem: + +$$ +\min _ {x \in \mathcal {X}} \max _ {y \in \mathcal {Y}} \langle A x, y \rangle + f (x) - g ^ {*} (y), \tag {2} +$$ + +where $g^{*}$ denotes the Fenchel conjugate of $g$ . Objective (2) is typically addressed by primal-dual splitting algorithms which, under strong duality, can recover the solution to the original problem (1). In the particular case when $f$ and $g$ are proximal-friendly and possibly non-smooth, a very popular method is the Primal-Dual Hybrid Gradient proposed in [Chambolle and Pock, 2011], which was further extended to handle an additional $L$ -smooth component with the Condat-Vu algorithm [Condat, 2013, Vu, 2013]. Convergence rates for the latter are studied in [Chambolle and Pock, 2016a]. + +Together, these classes of algorithms cover a broad range of problems in diverse fields such as signal processing, machine learning, inverse problems, telecommunications and many others. As a result, a great amount of research effort has gone into addressing practical concerns such as robustness + +to inexact oracles, acceleration and automation of stepsize selection. For a comprehensive list of examples and theoretical details we refer the reader to review papers [Combettes and Pesquet, 2011, Parikh and Boyd, 2014, Komodakis and Pesquet, 2015, Chambolle and Pock, 2016b]. In this work, we focus on the line of investigation studying stepsize regime automation for primal-dual algorithms targeting problem (2). + +In their basic form, primal-dual methods require as input stepsize parameters belonging to a designated interval of stability, which depends on problem specific constants like the global smoothness parameter $L$ and $\| A \|$ . Dependence on such constants is undesirable because they may be costly to compute and oftentimes one can only access upper-bound estimates, thus leading to overly-conservative stepsizes and slower convergence. Moreover, the need to know $L$ for setting the stepsizes prevents these methods from being applied to functions which are not globally smooth. + +Consequently, recent efforts have gone towards devising methods with adaptive step sizes [Goldstein et al., 2013, 2015, Malitsky and Pock, 2018, Pedregosa and Gidel, 2018]. These approaches resort to linesearch for finding good step sizes at every iteration, and exhibit improved practical performance. It thus appears that better convergence comes at the cost of an indeterminate number of extra steps spent in subprocedures aimed at finding appropriate step sizes. + +In this work, we study problem (2) under the assumption that $\nabla f$ is locally Lipschitz continuous and $g$ is proximal-friendly. To illustrate the motivation of our framework, we take a prototypical example in image processing: + +$$ +\min _ {x} \frac {1}{2} \| K x - b \| ^ {2} + \lambda \| D x \| _ {2, 1}, K \in \mathbb {R} ^ {m \times d}, D \in \mathbb {R} ^ {2 d \times d}, +$$ + +where $x$ is an image, $K$ is a problem-specific measurement operator, $b$ is the vector of (possibly noisy) observations and $D$ is the discrete gradient operator and the regularization term represents the isotropic TV norm. In order to apply any of the aforementioned primal-dual algorithms, one needs to first choose how to decouple the linear operators. There are three options: decoupling with respect to $K$ leaves us with having to compute the proximal operator of the TV norm for the primal step, which is an iterative procedure [Chambolle, 2004]. Decoupling $D$ implies performing gradient steps on $f$ , since in general its proximal operator is not efficient. Finally, decoupling with respect to both implies increasing the dimensionality of the dual variable to $m + 2d$ , which is problematic for large $d$ and $m$ . The sensible choice is the second one (i.e., decoupling $D$ ), and the question we seek to answer with this work is: + +Does there exist a method for solving (2) that adapts to the local problem geometry without resorting to linesearch? + +Our contribution is to propose a first-order primal-dual scheme that answers this question in the affirmative and is accompanied by theoretical convergence guarantees. Using standard analysis techniques we show an ergodic convergence of $\mathcal{O}(k^{-1})$ when $\nabla f$ is locally Lipschitz and $g$ is proximal-friendly, and a linear convergence rate for the case when $f$ is in addition locally strongly convex and $A$ has full row rank. We provide numerical experiments for sparse logistic regression and image inpainting, as well as use our method as a heuristic for TV-regularized nonconvex phase retrieval. + +The rest of the paper is structured as follows: Section 2 provides details about related work; Section 3 introduces notation, along with technical preliminaries and assumptions to be used in our analysis; Section 4 reports the main theoretical results alongside partial proofs; finally, partial numerical results are provided in Section 5 with the rest being deferred to the appendix due to lack of space. + +# 2 Related Work + +Adaptive Gradient Descent (GD) methods. Arguably the most widespread of optimization methods, GD presents similar shortcomings for setting the stepsize as those described in the previous section. In particular, much research effort has gone in devising variants of the algorithm that remove the need to estimate the global smoothness constant $L$ . In a recent work, Malitsky and Mishchenko [2020] propose an extremely simple and effective alternative for setting the stepsize $\tau_{k}$ adaptively at every iteration, as follows: + +$$ +\tau_ {k} = \min \left\{\tau_ {k - 1} \sqrt {1 + \frac {\tau_ {k - 1}}{\tau_ {k - 2}}}, \frac {\| x _ {k} - x _ {k - 1} \|}{2 \| \nabla f (x _ {k}) - \nabla f (x _ {k - 1}) \|} \right\}. \tag {3} +$$ + +Adaptivity essentially comes 'for free' in (3), as it involves solely quantities which have already been computed. Moreover, the method requires only the weaker assumption of local smoothness, thus extending the reach of provably-convergent GD to a wider class of differentiable functions while maintaining the standard $\mathcal{O}(k^{-1})$ convergence rate. + +In this work we show that the above technique can be extended to the analysis of primal-dual methods, where it gives rise to an algorithm whose stepsizes adapt to the local geometry of the objective's (locally) smooth component $f$ . + +Adaptive monotone variational inequality (VI) methods. Malitsky [2020] proposes an algorithm for solving monotone VIs with a stepsize that adapts to local smoothness similarly to (3). This method solves the very general formulation of finding $u^{*}$ such that $\langle F(u^{*}), u - u^{*} \rangle + h(u) - h(u^{*}) \geq 0$ , $\forall u$ for a given monotone operator $F$ which is locally Lipschitz continuous. Our template (2) can be recovered from theirs by setting $u = (x, y)$ , with + +$$ +F (u) = F (x, y) = \left[ \begin{array}{c} \nabla f (x) + A ^ {T} y \\ - A x \end{array} \right], +$$ + +and $h(u) = g^{*}(y)$ . The advantages of this approach are the relaxed requirement of local Lipschitz continuity for $F$ and the fact that knowledge of $\| A\|$ is not required. However, since the VI framework is very general and does not take advantage of the problem structure (e.g. the fact that $\langle Ax,y\rangle$ is a bilinear term), the method comes with worse convergence bounds than algorithms specifically designed to solve (2). In addition, the algorithm requires as input an upper bound on the step sizes, despite them being set in accordance to the estimated local smoothness. + +First order primal dual algorithms and adaptive versions. A popular method for solving (2) when $f$ is $L$ -smooth is the Condat-Vu algorithm (CVA) [Condat, 2013, Vu, 2013]. The method's convergence is subject to a global stepsize validity condition given by $\left(\frac{1}{\tau} - L\right)\frac{1}{\sigma} \geq \|A\|^2$ , where $\tau$ and $\sigma$ are the primal and dual step sizes, respectively. + +Another approach to solving problem (2) is via the Primal-Dual Fixed-Point algorithm based on the Proximity Operator $(\mathrm{PDFP}^2\mathrm{O})$ or the Proximal Alternating Predictor-Corrector (PAPC) methods [Loris and Verhoeven, 2011, Chen et al., 2013, Drori et al., 2015]. This approach comes with less restrictive stepsize conditions than CVA owing to a different iteration style, but which nevertheless depend on the global smoothness constant $L$ and $\parallel A\parallel$ and have to be carefully chosen. + +In order to alleviate the burden of choosing the stepsize parameters in CVA, Malitsky and Pock [2018] propose a linesearch procedure involving only dual variable updates and which, for certain problems such as regularized least squares, does not require any additional matrix-vector multiplications. A characteristic of this algorithm is that it maintains a constant ratio between primal and dual step sizes through a hyperparameter $\beta$ — a setup which we also use in this work. + +# 3 Preliminaries + +Consider problem (2) and let $\mathcal{X},\mathcal{Y}$ be finite dimensional real vector spaces equipped with the standard inner product $\langle \cdot ,\cdot \rangle$ and the associated Euclidean norm $\| \cdot \| = \sqrt{\langle\cdot,\cdot\rangle}$ . We denote by $g^{*}$ the Fenchel conjugate of $g$ in (1) defined as $g^{*}(y) = \sup_{x}\{\langle x,y\rangle -g(x)\}$ . In order to not overload the * notation, we use $A^T$ to denote the adjoint operator of $A$ . + +One can easily see that (2) is a primal-dual formulation of the following primal and dual optimization problems, of which the former is the same as (1): + +$$ +\min _ {x \in \mathcal {X}} f (x) + g (A x), \qquad \max _ {y \in \mathcal {Y}} - (f ^ {*} (- A ^ {T} y) + g ^ {*} (y)). +$$ + +A saddle-point $(x^{*},y^{*})\in \mathcal{X}\times \mathcal{V}$ of problem (2) satisfies the following optimality conditions: + +$$ +- A ^ {T} y ^ {*} = \nabla f \left(x ^ {*}\right), \quad A x ^ {*} \in \partial g ^ {*} \left(y ^ {*}\right). \tag {4} +$$ + +For $(x', y') \in \mathcal{X} \times \mathcal{Y}$ we define the following quantities: + +$$ +P _ {x ^ {\prime}, y ^ {\prime}} (x) := f (x) - f \left(x ^ {\prime}\right) + \langle x - x ^ {\prime}, A ^ {T} y ^ {\prime} \rangle , +$$ + +$$ +D _ {x ^ {\prime}, y ^ {\prime}} (y) := g ^ {*} (y) - g ^ {*} (y ^ {\prime}) - \langle A x ^ {\prime}, y - y ^ {\prime} \rangle , +$$ + +$$ +\mathcal {G} _ {x ^ {\prime}, y ^ {\prime}} (x, y) := P _ {x ^ {\prime}, y ^ {\prime}} (x) + D _ {x ^ {\prime}, y ^ {\prime}} (y). +$$ + +These functions are convex for fixed $(x', y')$ and whenever $(x', y') = (x^*, y^*)$ , it holds that $P_{x^*, y^*}(x) \geq 0$ , $D_{x^*, y^*}(x) \geq 0$ and $\mathcal{G}_{x^*, y^*}(x, y) \geq 0$ , with the latter quantity representing the primal-dual gap. We also define the gap restricted to a bounded subset $B_1 \times B_2 \subset \mathcal{X} \times \mathcal{Y}$ as: + +$$ +\mathcal {G} _ {B _ {1} \times B _ {2}} (x, y) := \sup _ {(x ^ {\prime}, y ^ {\prime}) \in B _ {1} \times B _ {2}} P _ {x ^ {\prime}, y ^ {\prime}} (x) + D _ {x ^ {\prime}, y ^ {\prime}} (y), +$$ + +and note that it is non-negative whenever $B_{1} \times B_{2}$ contains a saddle-point. + +Given a function $f: \mathcal{X} \to \mathbb{R}$ and $L > 0$ , we say that $f$ is $L$ -smooth if its gradient $\nabla f$ is Lipschitz continuous: $\| \nabla f(x) - \nabla f(y) \| \leq L \| x - y \|, \forall x, y$ . Furthermore, $f$ is locally smooth if $\nabla f$ is Lipschitz continuous on any compact subset $\mathcal{C}$ : $\forall \mathcal{C} \subset \mathcal{X}$ , $\exists L_{\mathcal{C}} > 0$ such that $\| \nabla f(x) - \nabla f(y) \| \leq L_{\mathcal{C}} \| x - y \|, \forall x, y \in \mathcal{C}$ . + +We also say that $f$ is $\mu$ -strongly convex if $f(y) \geq f(x) + \langle \nabla f(x), y - x \rangle + \frac{\mu}{2} \| x - y \|^2, \forall x, y$ . Similarly, $f$ is locally strongly convex if it is strongly convex on any compact subset $\mathcal{C}$ : $\forall \mathcal{C} \subset \mathcal{X}$ , $\exists \mu_{\mathcal{C}} > 0$ such that $f(y) \geq f(x) + \langle \nabla f(x), y - x \rangle + \frac{\mu_{\mathcal{C}}}{2} \| x - y \|^2, \forall x, y \in \mathcal{C}$ . + +We define the proximal operator of a convex function $g: \mathcal{X} \to \mathbb{R} \cup \{\infty\}$ as $\operatorname{prox}_g(x) = \arg \min_z \left\{ g(z) + \frac{1}{2} \| x - z \|^2 \right\}$ , and say that $g$ is 'proximal-friendly' if $\operatorname{prox}_g(x)$ has a closed form solution or can be efficiently computed to high accuracy. + +Finally, the following two blanket assumptions will hold throughout the paper: + +Assumption 3.1. Function $f$ is convex and locally smooth, while $g$ is convex, l.s.c., and proximal-friendly. + +Assumption 3.2. A saddle-point exists for problem (2) and thus strong duality holds. + +We note that Assumption 3.2 is standard in the literature (see e.g., [Chambolle and Pock, 2011]). Assumption 3.1, on the other hand, is weaker than the usual global $L$ -smoothness premise and thus enlarges the category of admissible functions $f$ with instances such as $x \mapsto \exp(x)$ . To illustrate, consider the aforementioned function defined on the reals: the global smoothness assumption clearly does not hold, however for any fixed interval $[a, b] \subset \mathbb{R}$ the smoothness constant can be chosen as $\exp(b)$ . + +For showing linear convergence of our method, we will add the following assumption: + +Assumption 3.3. Function $f$ is locally strongly convex and operator $A$ has full row-rank. + +# 4 Algorithm and convergence + +The primal-dual method proposed for solving problem (2) under assumptions 3.1 and 3.2, is provided in Algorithm 1 under the abbreviation APDA, which we use from here onwards. APDA follows the same structure as the basic CVA [Chambolle and Pock, 2016a] for the given assumptions. Notice that if we restrict Assumption 3.1 to $L$ -smooth functions $f$ , we can in fact recover CVA by setting $\theta_{k} = \theta = 1$ and $\tau_{k} = \tau$ , $\sigma_{k} = \sigma$ fixed such that $\left(\frac{1}{\tau} - L\right)\frac{1}{\sigma} \geq \|A\|^2$ . + +# Algorithm 1 Adaptive Primal Dual Algorithm (APDA) + +Input: $x_0 \in \mathcal{X}, y_0 \in \mathcal{Y}, \tau_{\mathrm{init}} > 0, \tau_0 = \infty, \theta_0 = 1, \beta > 0, c \in (0,1)$ + +$$ +x _ {1} = x _ {0} - \tau_ {\text {i n i t}} \left(\nabla f (x _ {0}) + A ^ {T} y _ {0}\right) +$$ + +for $k = 1,2,\ldots$ do + +Set $\tau_{k} = \min \left\{\frac{1}{2\sqrt{L_{k}^{2} + (\beta / (1 - c))\|A\|^{2}}},\tau_{k - 1}\sqrt{1 + \theta_{k - 1}}\right\}$ $\sigma_{k} = \beta \tau_{k},\theta_{k} = \frac{\tau_{k}}{\tau_{k - 1}}$ + +$$ +\tilde {x} _ {k} = x _ {k} + \theta_ {k} (x _ {k} - x _ {k - 1}) +$$ + +$$ +y _ {k + 1} = \operatorname {p r o x} _ {\sigma_ {k} g ^ {*}} \left(y _ {k} + \sigma_ {k} A \tilde {x} _ {k}\right) +$$ + +$$ +x _ {k + 1} = x _ {k} - \tau_ {k} (\nabla f (x _ {k}) + A ^ {T} y _ {k + 1}) +$$ + +end for + +# 4.1 High level ideas + +We can rephrase the global stepsize condition of CVA by introducing a free parameter $\beta > 0$ which represents the ratio between the fixed dual and primal stepsizes: $\beta = \frac{\sigma}{\tau}$ . With this change of variables, the stepsize validity condition becomes $\tau \in \left(0, \frac{2}{L + \sqrt{L^2 + 4\beta \|A\|^2}}\right)$ . + +Our algorithm disposes of CVA's global condition and relies instead on a very similar but local criterion given by $\tau_{k}\in \left(0,\frac{1}{L_{k} + \sqrt{L_{k}^{2} + 2\beta\|A\|^{2}}}\right)$ , where $L_{k}\coloneqq \frac{\|\nabla f(x_{k}) - \nabla f(x_{k - 1})\|}{\|x_{k} - x_{k - 1}\|}$ provides an estimate of the local smoothness constant and $\beta = \frac{\sigma_k}{\tau_k}$ . In particular, this requirement is satisfied by the first part of the expression defining $\tau_{k}$ in APDA: + +$$ +\tau_ {k} = \min \left\{\frac {1}{2 \sqrt {L _ {k} ^ {2} + (\beta / (1 - c)) \| A \| ^ {2}}}, \tau_ {k - 1} \sqrt {1 + \theta_ {k - 1}} \right\} \tag {5} +$$ + +where $c \in (0,1)$ . Intuitively, this rule demands that $\tau_{k}$ does not overstep a constant related to the local curvature, thus allowing for larger step sizes in flatter regions and correspondingly smaller ones otherwise. + +By itself, the first term of (5) does not ensure convergence, since overly-aggressive and possibly destabilizing step sizes might occur in near-linear regions. This issue is addressed by the second part of the expression (5) which, informally, prevents the stepsize from increasing 'too fast' in consecutive iterations. Specifically, the increase factor is at most $\sqrt{1 + \theta_{k - 1}}$ , where $\theta_{k} = \frac{\tau_{k - 1}}{\tau_{k - 2}}$ . + +Under these two local stepsize conditions we are able to show APDA's convergence using the weaker assumption of local smoothness of $f$ , thus conveniently removing the need of estimating a global smoothness constant $L$ . + +Remark 4.1. While $\tau_{k}$ does not adapt to $\parallel A\parallel$ , for many practical problems this fact is not a big hindrance. Function $f$ typically represents the data fidelity term, whose smoothness constant $L$ (should it exist) can far exceed $\parallel A\parallel -$ the linear operator enforcing structured regularization on $x$ A specific example are TV-regularized imaging problems, where $A$ is the discrete gradient operator whose norm is bounded by $\sqrt{8}$ [Chambolle, 2004], while the data fidelity term may involve a very large number of measurements and a larger norm, consequently. + +Remark 4.2. APDA takes an additional primal step prior to the for-loop, which is controlled by $\tau_{init}$ given as input. This is needed for estimating $L_{1}$ in the first iteration. In practice we set $\tau_{init} = 1e - 9$ , a sufficiently small value to ensure that $x_{1}$ does not depart too far from $x_{0}$ and yield a good estimate of $L_{1}$ . Furthermore, the setting of $\tau_0 = \infty$ simply ensures that in the first step, $\tau_{1} = \frac{1}{2\sqrt{L_{1}^{2} + (\beta / (1 - c))\|A\|^{2}}}$ and has no impact on further steps. Finally, in our experiments we set $c = 1e - 15$ – this is a parameter introduced for theoretical purposes as explained in the following section. + +# 4.2 Analysis - the base case + +In short, the main steps of our analysis are: first, we establish the inequality that characterizes the dynamics of APDA given in Lemma 4.1 below. Based on it, we are able to prove the boundedness of sequences $\{x_{k}\}$ and $\{y_{k}\}$ in Theorem 4.1. In turn, sequence boundedness alongside the local smoothness property of $f$ allows us to conclude that there exists a constant $L > 0$ such that $f$ is $L$ -smooth on the compact set $\overline{\operatorname{Conv}}(\{x^{*}, x_{0}, x_{1}, \ldots\}) - \operatorname{conv}(f(x_{k}, y_{k}))$ (see [2]). Finally, we leverage this information to show that $(x_{k}, y_{k})$ converges to a saddle point of (2) and derive the associated ergodic convergence rates presented in Theorem 4.1. + +Lemma 4.1. Consider APDA along with Assumptions 3.1 and 3.2 and $(x,y)\in \mathcal{X}\times \mathcal{Y}$ . Then, for all $k$ and $\eta_{k}\in \left(\frac{\beta\tau_{k}\|A\|}{1 - c},\frac{1 - 2\tau_{k}L_{k}}{2\tau_{k}\|A\|}\right)$ , + +$$ +\begin{array}{l} \left\| x _ {k + 1} - x \right\| ^ {2} + \frac {1}{\beta} \left\| y _ {k + 1} - y \right\| ^ {2} + \left(1 - \eta_ {k} \tau_ {k} \left\| A \right\| - \tau_ {k} L _ {k}\right) \left\| x _ {k + 1} - x _ {k} \right\| ^ {2} \\ + \frac {\eta_ {k} - \tau_ {k} \beta \| A \|}{\beta \eta_ {k}} \| y _ {k + 1} - y _ {k} \| ^ {2} + 2 \tau_ {k} (1 + \theta_ {k}) P _ {x, y} (x _ {k}) + 2 \tau_ {k} D _ {x, y} (y _ {k + 1}) \\ \end{array} +$$ + +$$ +\leq \left\| x _ {k} - x \right\| ^ {2} + \frac {1}{\beta} \left\| y _ {k} - y \right\| ^ {2} + \tau_ {k} L _ {k} \left\| x _ {k} - x _ {k - 1} \right\| ^ {2} + 2 \tau_ {k} \theta_ {k} P _ {x, y} (x _ {k - 1}). +$$ + +Moreover, it holds that: + +1) $\tau_k L_k < \frac{1}{2} < 1 - \eta_k \tau_k \| A \| - \tau_k L_k$ , +2) $\frac{1}{\beta} - \frac{\tau_k \| A \|}{\eta_k} > \frac{c}{\beta} > 0$ . + +Proof sketch. The full proof is deferred to the appendix. We use algebraic manipulations, APDA's update rules, the Cauchy-Schwarz and Young inequalities and properties of the prox operator to get the recurrence: + +$$ +\begin{array}{l} \left\| x _ {k + 1} - x \right\| ^ {2} + \frac {1}{\beta} \left\| y _ {k + 1} - y \right\| ^ {2} + \left(1 - \tau_ {k} \left\| A \left\| \eta_ {k} - \tau_ {k} L _ {k}\right) \right\| x _ {k + 1} - x _ {k} \right\| ^ {2} \\ + \left(\frac {1}{\beta} - \frac {\tau_ {k} \| A \|}{\eta_ {k}}\right) \| y _ {k + 1} - y _ {k} \| ^ {2} + 2 \tau_ {k} \left(1 + \theta_ {k}\right) P _ {x, y} \left(x _ {k}\right) + 2 \tau_ {k} D _ {x, y} \left(y _ {k + 1}\right) \\ \leq \left\| x _ {k} - x \right\| ^ {2} + \frac {1}{\beta} \left\| y _ {k} - y \right\| ^ {2} + \tau_ {k} L _ {k} \left\| x _ {k} - x _ {k - 1} \right\| ^ {2} + 2 \tau_ {k} \theta_ {k} P _ {x, y} \left(x _ {k - 1}\right), \tag {6} \\ \end{array} +$$ + +where $\eta_{k} > 0$ is a free iteration-dependent constant involved in Young's inequality. + +In order to obtain anything worthwhile we would like to set $\eta_{k}$ such that, when unrolling (6) over the iterations, the terms containing $\| x_{k + 1} - x_k\|^2$ and $\| y_{k + 1} - y_k\|^2$ accumulate on the LHS with positive coefficients. More precisely, we ask that: + +$$ +\left\{ \begin{array}{l} \frac {1}{\beta} - \frac {\tau_ {k} \| A \|}{\eta_ {k}} > \frac {c}{\beta}, \\ 1 - \tau_ {k} \| A \| \eta_ {k} - \tau_ {k} L _ {k} > \frac {1}{2}, \end{array} \right. \tag {7} +$$ + +where $c \in (0,1)$ . We note that the RHS of the first inequality could have been chosen as 0, however, we made it strictly positive due to technical reasons related to controlling the sequence $\| y_{k + 1} - y_k\|^2$ . In practice, we choose $c$ to be as small as possible. + +A similar remark holds for the second inequality, where it would have been sufficient to set its RHS to $\tau_{k + 1}L_{k + 1}$ . Since this would considerably complicate the analysis, we make the observation that $\tau_k L_k < \frac{1}{2}, \forall k$ and use this simpler uniform upper-bound instead. + +The inequalities (7) are equivalent to asking that $\eta_{k} \in \left(\frac{\tau_{k}\beta\|A\|}{1 - c}, \frac{1 - 2\tau_{k}L_{k}}{2\tau_{k}\|A\|}\right)$ and what is left to show is that this is a valid interval i.e., that the left endpoint is strictly smaller than its right counterpart. This condition amounts to solving a quadratic inequality in $\tau_{k}$ , whose solutions lie in the interval $\left(0, \frac{1}{L_k + \sqrt{L_k^2 + 2(\beta / (1 - c))\|A\|^2}}\right)$ . The proof is concluded by showing that our choice of $\tau_{k}$ indeed satisfies this constraint. + +We are now ready to state the main convergence result in Theorem 4.1 below, whose full proof is given in the appendix. + +Theorem 4.1. Consider APDA along with Assumptions 3.1 and 3.2, and let $(x^{*},y^{*})\in \mathcal{X}\times \mathcal{Y}$ be a saddle point of problem (2). Then, for all $k$ + +1) Boundedness. The sequence $\{(x_k, y_k)\}$ is bounded. Specifically, for all $k$ , + +$$ +\left\| x _ {k} - x ^ {*} \right\| ^ {2} + \left\| y _ {k} - y ^ {*} \right\| ^ {2} \leq M, +$$ + +where $M\coloneqq \left\| x_1 - x^*\right\|^2 +\frac{1}{\beta}\left\| y_1 - y^*\right\|^2 +\frac{1}{2}\left\| x_1 - x_0\right\|^2 < \infty$ + +2) Convergence to a saddle point. The sequence $\{(x_k, y_k)\}$ converges to a saddle point of (2). + +3) Ergodic convergence. Let $S_{k} \coloneqq \sum_{i=1}^{k} \tau_{i}$ , $X_{k} \coloneqq \frac{1}{S_{k}} \left( \tau_{k} (1 + \theta_{k}) x_{k} + \right.$ + +$\sum_{i=1}^{k-1} (\tau_i(1 + \theta_i) - \tau_{i+1} \theta_{i+1}) x_i$ and $Y_k := \frac{1}{S_k} \sum_{i=1}^k \tau_i y_{i+1}$ . Then, for any bounded $B_1 \times B_2 \in \mathcal{X} \times \mathcal{Y}$ and for all $k$ , + +$$ +\mathcal {G} _ {B _ {1} \times B _ {2}} (X _ {k}, Y _ {k}) \leq \frac {M (B _ {1} , B _ {2}) \sqrt {L ^ {2} + (\beta / (1 - c)) \| A \| ^ {2}}}{k}, +$$ + +where $L$ is the Lipschitz constant of $\nabla f$ over the compact set $\overline{\text{Conv}}(\{x^*, x_0, x_1, \ldots\})$ and $M(B_1, B_2) = \sup_{(x,y) \in B_1 \times B_2} \| x_1 - x \|^2 + \frac{1}{\beta} \| y_1 - x \|^2 + \frac{1}{2} \| x_1 - x_0 \|^2$ . + +The boundedness result of Theorem 4.1 point 1) implies that the closed set $\mathcal{C} = \overline{\operatorname{Conv}(\{x^*, x_0, x_1, \ldots\})}$ is also bounded and hence compact. The local smoothness assumption on $f$ then ensures that there exists $L > 0$ such that $f$ is $L$ -smooth over $\mathcal{C}$ . Note that such an $L$ exists for any $x_0, y_0$ since the boundedness result itself holds for any initial conditions (though the value of such $L$ cannot be generally known, as it is path-dependent). Using this fact, we can show a uniform lower-bound on the primal stepsize: $\tau_k \geq \frac{1}{2} \left(L^2 + \left(\beta / (1 - c)\right) \|A\|^2\right)^{-1/2} > 0$ , $\forall k$ , which is instrumental in deriving the subsequent convergence results, as well as Theorem 4.2. We emphasize that the appearance of constant $L$ in the provided rates is a consequence of iterate boundedness, whose proof does not require its knowledge. Finally, we note that our rate is comparable to that of CVA in terms of constants. + +# 4.3 Analysis under the additional Assumption 3.3 + +We now study APDA under the additional assumption of locally strongly convex $f$ and full row rank $A$ . Before proving the result of Theorem 4.2, a few remarks are in order. First, the boundedness result of Theorem 4.1 point 1) also holds for constant $c = 0$ , since this constant was required only for proving convergence to a saddle point in point 2) of the theorem. Second, taking a smaller stepsize than the originally defined $\tau_{k}$ will not change the validity of Lemma 4.1 or the boundedness result of Theorem 4.1, as it remains within the required interval mentioned in section 4.1. + +Consequently, for studying APDA under the additional Assumption 3.3 we can simplify the stepsize expression by taking $c = 0$ , because now we are able to show iterate convergence directly by using the strong convexity and full row-rank assumptions. Specifically, we consider the stepsize: + +$$ +\tau_ {k} = \min \left\{\frac {1}{2 \sqrt {4 L _ {k} ^ {2} + \beta \| A \| ^ {2}}}, \tau_ {k - 1} \sqrt {1 + \theta_ {k - 1} / 2} \right\}, \tag {8} +$$ + +which is smaller than the one originally considered and, due to the aforementioned remarks it ensures that APDA produces a bounded sequence. It follows that, under the local smoothness and local strong convexity assumptions, there exist constants $L$ and $\mu$ such that $f$ is $L$ -smooth and $\mu$ -strongly convex over $\operatorname{Conv}(\{x^*, x_0, x_1, \ldots\})$ . + +The existence of these constants along with $A$ being full row rank, in turn, allows us to derive a strengthened version of the inequality in Lemma 4.1 for $(x,y) = (x^{*},y^{*})$ : + +$$ +\begin{array}{l} \left\| x _ {k + 1} - x ^ {*} \right\| ^ {2} + \left(\frac {1}{\beta} + q _ {1}\right) \left\| y _ {k + 1} - y ^ {*} \right\| ^ {2} + \left(\frac {1}{2} + q _ {2}\right) \left\| x _ {k} - x _ {k + 1} \right\| ^ {2} + q _ {3} \left\| y _ {k + 1} - y _ {k} \right\| ^ {2} \\ + 2 \tau_ {k} (1 + \theta_ {k}) P _ {x ^ {*}, y ^ {*}} (x _ {k}) + 2 \tau_ {k} D _ {x ^ {*}, y ^ {*}} (y _ {k + 1}) \\ \leq \left(1 - q _ {4}\right) \| x _ {k} - x ^ {*} \| ^ {2} + \frac {1}{\beta} \| y _ {k} - y ^ {*} \| ^ {2} + \left(\frac {1}{2} - q _ {5}\right) \| x _ {k} - x _ {k - 1} \| ^ {2} + 2 \tau_ {k} \theta_ {k} P _ {x ^ {*}, y ^ {*}} (x _ {k - 1}), \\ \end{array} +$$ + +where $q_{1}, q_{2}, q_{3}, q_{4}, q_{5} > 0$ are constants given in the appendix. This new inequality represents in fact a contraction, which guarantees the linear convergence rate stated in Theorem 4.2. + +Theorem 4.2. Consider APDA along with Assumptions 3.1, 3.2 and 3.3. Let $(x^{*},y^{*})\in \mathcal{X}\times \mathcal{Y}$ be a saddle point of problem (2). Furthermore, let $\tau_{k}$ be defined by (8) and let $s\coloneqq \sqrt{4L^2 + \beta\|A\|^2}$ and $t\coloneqq \sqrt{4\mu^2 + \beta\|A\|^2}$ , where $\mu ,L$ are the strong convexity and smoothness constants of $f$ over the compact set $\overline{\operatorname{Conv}} (\{x^{*},x_{0},x_{1},\ldots \})$ . + +Then, for all $k$ : + +$$ +\left\| x _ {k} - x ^ {*} \right\| ^ {2} + \frac {1}{\beta} \left\| y _ {k} - y ^ {*} \right\| ^ {2} \leq \left(1 - \min \{p, q, r \}\right) ^ {k} M, +$$ + +where the rate constants are given by: + +$$ +p = \frac {1}{2}, \quad q = \frac {\mu}{4 s}, \quad r = \frac {\beta \sigma_ {\mathrm {m i n}} ^ {2} (A) \mu}{\beta \sigma_ {\mathrm {m i n}} ^ {2} (A) \mu + 8 s ^ {2} t + 4 L ^ {2} s}, +$$ + +and $M = \| x_2 - x^* \|^2 + \left( \frac{1}{\beta} + T \right) \| y_2 - y^* \|^2 + \frac{1}{2} \| x_2 - x_1 \|^2 + 2\tau_1 P_{x^*,y^*}(x_1), T = \frac{\sigma_{\min}^2(A)\mu}{8s^2t + 4L^2s}$ , with $\sigma_{\min}(A)$ representing the smallest singular value of $A$ . + +A few remarks are in order: first, as a sanity check, we observe that when $A = 0$ we recover the contraction factor of [Malitsky and Mishchenko, 2020] which is equal to $q$ . + +Second, we make some notes on how our rate compares with existing ones. To our knowledge, there are no explicit results regarding the linear convergence of CVA under assumptions similar to ours (linear rates are usually shown for the 3-component objective without assumptions on $A$ — see e.g., [Chambolle and Pock, 2016a]). However, in the case of $L$ -smooth and $\mu$ -strongly-convex $f$ and full row-rank $A$ , Chen et al. [2013] show the linear convergence of $\mathrm{PDFP}^2\mathrm{O}$ with rate: + +$$ +\| x _ {k} - x ^ {*} \| ^ {2} \leq \left(\| x _ {1} - x _ {0} \| ^ {2} + \frac {1}{\sigma_ {\max (A)}} \| y _ {1} - y _ {0} \| ^ {2}\right) \left(1 - \min \left\{\frac {\sigma_ {\min (A)} ^ {2}}{\sigma_ {\max (A)} ^ {2}}, \frac {\mu}{L} \right\}\right) ^ {k - 1}, +$$ + +The rate presented in Theorem 4.2 has a comparatively worse contraction factor. The reason is that our iteration is set up in the style of CVA, where we essentially have a single stepsize to compute using the rephrasing from Section 4.1. Therefore, $\tau_{k}$ needs to obey the problem structure with respect to both $L$ and $\| A\|$ , resulting in the 'mixed' term appearing in the denominator. + +Keeping the above in mind, the interested reader may find in the appendix that constants $q$ and $r$ come from a product between $\tau_{k}$ and other condition number-related quantities, which is tightly linked to the structure of the main inequality used in the paper. This makes the nice separation of condition numbers achieved in $\mathrm{PDFP}^2\mathrm{O}$ 's rate not possible in our case and, it seems, the analysis necessary to achieve this kind of adaptivity comes at the cost of worse constants (the same remark holds for [Malitsky and Mishchenko, 2020]). + +$\mathrm{PDFP}^2\mathrm{O}$ , on the other hand, achieves a clean bound by having a different iteration style than CVA, as well as a fundamentally different kind of analysis where the iteration is expressed in fixed-point form to show convergence. In this context the stability conditions on the step sizes are also relaxed — specifically, $0 < \lambda \leq 1 / \sigma_{\max}^2 (A)$ and $0 < \gamma < 2L$ in [Chen et al., 2013]. A drawback of this approach, however, is that the algorithm has no rate guarantees when $f$ is only smooth and not strongly convex and only asymptotic convergence is shown. Also, $\mathrm{PDFP}^2\mathrm{O}$ requires 3 matrix-vector multiplications per iteration whereas we only require 2. + +# 5 Experiments + +We now present some numerical experiments conducted for APDA1. Additional problems and results are included the appendix. The experiments were implemented in Python 3.9 and executed on a MacBook Pro with 32 GB RAM and a 2,9 GHz 6-Core Intel Core i9 processor. + +The baseline we compare against in this section as well as the appendix is CVA, for which we use Algorithm 1 in [Chambolle and Pock, 2016a] (using $g \equiv 0$ ). In the particular case of sparse logistic regression we also compare against FISTA [Beck and Teboulle, 2009]. For obtaining $x^{*}$ we ran one of the algorithms for a large number of iterations. + +# 5.1 Sparse binary logistic regression + +![](images/0d35d0bd38b9d308bd1659e7446e538888b450052e6c89867e6efd78c76862c1.jpg) + +![](images/9d082a44c647420272aed04c3574ac16d74ab85323b55296795eb519527a890e.jpg) +(a) + +![](images/e60d7565f7f3f322f97e045fac1acfdb14e5b5f3525a6a2ae9c4307c787edcde.jpg) + +![](images/528eae1dc59ba93366005aae7d1a6408cb2d37a37616c56d7445aa007cab20a4.jpg) + +![](images/d894cbb956df03c8d926762c416019b4dab3ed1308aa56fc61b03c7eb53784de.jpg) +(b) + +![](images/152a44009760666a050a6982174bff04df56719904c6ec0bd02dcd3a87fe7b91.jpg) + +![](images/c9e4061d1df78477386879a56eced88b8c7b45ca25de2ac0182d2063e52c1692.jpg) + +![](images/4c7e6515bd6460be766bf6a1b82b620b5683eb596a7dd2c125b1b0f6c44df89b.jpg) +(c) + +![](images/444cc2249d2b4f98192b933b73aefe209dd1ddb51a7af66516271e65a904e065.jpg) + +![](images/939a4a85546e0fc624f72260becab90a5bd21caf92cc48c38cf3aa5ec9187a08.jpg) +Figure 1: The first column shows algorithm convergence. The second column shows a comparison of primal step sizes between APDA and CVA. The third column shows a comparison of dual step sizes between APDA and CVA. Each subfigure represents a different dataset: (a) ijCNN; (b) mushrooms; (c) a9a; (d) covtype. + +![](images/fb4a2d16143a53c93d4ac05aaaa4a3682434d7486498eecdab424a3658e1fc45.jpg) +(d) + +![](images/e37dae54c919602f1b1f141294340213b22174cf89aeafb08fdfb62bc9cb2a56.jpg) + +We consider the problem of sparse binary Logistic Regression on 4 LIBSVM datasets [Chang and Lin, 2011] and show that adaptivity provides faster convergence in 3 of these cases. The objective we + +consider is: + +$$ +\min _ {x \in \mathbb {R} ^ {d}} F (x) := \underbrace {\sum_ {i = 1} ^ {m} \log \left(1 + \exp \left(- b _ {i} \langle q _ {i} , x \rangle\right)\right)} _ {f} + \underbrace {\lambda \| x \| _ {1}} _ {g}, \tag {9} +$$ + +where $(q_i, b_i) \in \mathbb{R}^d \times \{-1, 1\}$ and $\lambda$ is the regularization parameter. APDA and CVA can be applied to this problem by setting $A = I$ in formulation (2). Primal-dual algorithms are not the typical choice for solving (9), which is usually addressed by methods such as Proximal Gradient or FISTA [Beck and Teboulle, 2009]. However, we note that the computational costs of APDA and FISTA are comparable since the matrix-vector multiplication cost of the former is removed due to a $A = I$ . + +We choose $\lambda = 0.005\| Q^T b\|_\infty$ , where $Q^{T} = [q_{1}^{T},\dots q_{m}^{T}]^{T}$ . For APDA we perform a parameter sweep over $\beta \in [1e - 3,1e6]$ for each dataset and settle for: $\beta = 2.68e3$ for ijCNN; $\beta = 5.18e4$ for a9a; $\beta = 3.16e1$ for mushrooms; $\beta = 3.73e - 1$ for covtype. + +For CVA we sweep $p \in [1\mathsf{e} - 3,1\mathsf{e}6]$ and set $\tau = \frac{1}{\|A\| / p + L}$ and $\sigma = \frac{1}{p\|\mathbf{A}\|}$ by construction, these stepsizes satisfy the validity condition and are as large as possible since the condition is satisfied with equality. We do an additional tuning procedure where we choose constants $\tau \in [1\mathsf{e} - 10,1\mathsf{e}2]$ and $\xi \in [1\mathsf{e} - 5,1\mathsf{e}2]$ and set $\sigma = \tau \xi$ , which are subject to verifying the stepsize validity condition of CVA. Finally we select the best stepsizes across the two tuning phases to be (truncated to 3 decimals): $\tau = 9.869\mathsf{e} - 4$ , $\sigma = 1.125\mathsf{e}1$ for i j cnn; $\tau = 2.655\mathsf{e} - 4$ , $\sigma = 7.896\mathsf{e}1$ for a9a; $\tau = 9.936\mathsf{e} - 4$ , $\sigma = 5.878\mathsf{e}0$ for mushrooms; $\tau = 7.728\mathsf{e} - 06$ , $\sigma = 1\mathsf{e} - 06$ for covtype. + +Note that the Hessian of $f$ is given by $\nabla^2 f(x) = Q^T D(x)Q$ , where $D(x)$ is a diagonal matrix such that $D_{i,i}(x) = \sigma_i(x)(1 - \sigma_i(x))$ , where $\sigma_i(x) = \frac{1}{1 + \exp(-b_i\langle q_i,x\rangle)} \in (0,1)$ . Clearly, over any compact set in $\mathcal{C} \subset \mathcal{X}$ there exist $D_{\mathrm{min}} := \min_{i,x \in \mathcal{C}} D_{i,i}(x) \in (0,1)$ such that $D_{\mathrm{min}} Q^T Q \preceq Q^T D(x)Q$ . As a result, a sufficient condition for local strong convexity is that the minimum eigenvalue of $Q^T Q$ be greater than 0. + +The convergence results along with stepsize comparison plots are presented in Figure 1. For dataset i j cnn we run APDA with the modified $\tau_{k}$ used in Theorem 4.2, since $\lambda_{\mathrm{min}}(Q^T Q) = 75.13$ and $A$ has full rank. In the latter case, the legend identifier is APDA-strcnv. For the remaining datasets we use only the basic setting for $\tau_{k}$ , as $\lambda_{\mathrm{min}}(Q^T Q) \leq 1 \mathrm{e} - 13$ . + +While APDA outperforms FISTA and CVA on ijCNN, a9a and mushrooms, it shows a relatively poor performance on covtype. We hypothesize that this is related to the condition number of $Q^T Q$ , which is almost three orders of magnitude larger in the latter case: 9.2e22 versus 5.3e1, 2e20 and 2e17 for ijCNN, mushrooms and a9a, respectively. A similar behavior is seen in Figure 1.(c) of [Malitsky and Mishchenko, 2020]. + +Finally, the adaptive property of APDA's stepsizes is visible in the stepsize comparison plots where they are shown to oscillate within at least one order of magnitude throughout the optimization process. + +# 6 Limitations of APDA + +The experiments presented in this paper (Section 5 and Appendix A) have the common trait of not imposing hard constraints on the primal variables. As a consequence, we are able to take plain gradient steps in the primal domain. However, for instances such as Poisson linear inverse problems [Bertero et al., 2009], the iterates $x_{k}$ need to reside in $\mathbb{R}_+^n$ because the primal objective contains log functions. APDA cannot handle such cases, as any constraints imposed on the primal variables will only be satisfied asymptotically. We consider such scenarios as a future research direction. + +# Acknowledgements + +The first author is grateful to Ya-Ping Hsieh for his feedback on the manuscript and for helpful research discussions throughout the development of this work. The authors also sincerely thank the anonymous reviewers for their time and their thoughtful, constructive feedback which helped improve and clarify this manuscript. + +This project has received funding from the European Research Council (ERC) under the European Union's Horizon 2020 research and innovation programme (grant agreement no. 725594 - time-data), the Wallenberg Al, Autonomous Systems and Software Program (WASP) funded by the Knut and Alice Wallenberg Foundation, with the project number 305286. The work was also sponsored by the Department of the Navy, Office of Naval Research (ONR) under a grant number N62909-17-1-2111; by the Army Research Office and was accomplished under Grant Number W911NF-19-1-0404; by the Hasler Foundation Program: Cyber Human Systems (project number 16066). This work was also supported by the Swiss National Science Foundation (SNSF) under grant number 200021_178865/1. + +# References + +Amir Beck and Marc Teboulle. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM journal on imaging sciences, 2(1):183-202, 2009. +Mario Bertero, Patrizia Boccacci, Gabriele Desiderà, and Giuseppe Vicidomini. Image deblurring with poisson data: from cells to galaxies. Inverse Problems, 25(12):123006, 2009. +Antonin Chambolle. An algorithm for total variation minimization and applications. Journal of Mathematical imaging and vision, 20(1):89-97, 2004. +Antonin Chambolle and Thomas Pock. A first-order primal-dual algorithm for convex problems with applications to imaging. Journal of mathematical imaging and vision, 40(1):120-145, 2011. +Antonin Chambolle and Thomas Pock. On the ergodic convergence rates of a first-order primal-dual algorithm. Mathematical Programming, 159(1):253-287, 2016a. +Antonin Chambolle and Thomas Pock. An introduction to continuous optimization for imaging. Acta Numerica, 25:161-319, 2016b. +Chih-Chung Chang and Chih-Jen Lin. LIBSVM: A library for support vector machines. ACM Transactions on Intelligent Systems and Technology, 2:27:1-27:27, 2011. Software available at http://www.csie.ntu.edu.tw/~cjlin/libsvm. +Peijun Chen, Jianguo Huang, and Xiaoqun Zhang. A primal-dual fixed point algorithm for convex separable minimization with applications to image restoration. Inverse Problems, 29(2):025011, 2013. +Patrick L Combettes and Jean-Christophe Pesquet. Proximal splitting methods in signal processing. In Fixed-point algorithms for inverse problems in science and engineering, pages 185-212. Springer, 2011. +Laurent Condat. A primal-dual splitting method for convex optimization involving lipschitzian, proximable and linear composite terms. Journal of optimization theory and applications, 158(2): 460-479, 2013. +Yoel Drori, Shoham Sabach, and Marc Teboulle. A simple algorithm for a class of nonsmooth convex-concave saddle-point problems. Operations Research Letters, 43(2):209-214, 2015. +Tom Goldstein, Min Li, Xiaoming Yuan, Ernie Esser, and Richard Baraniuk. Adaptive primal-dual hybrid gradient methods for saddle-point problems. arXiv preprint arXiv:1305.0546, 2013. +Tom Goldstein, Min Li, and Xiaoming Yuan. Adaptive primal-dual splitting methods for statistical learning and image processing. In Advances in Neural Information Processing Systems, pages 2089-2097, 2015. + +Nikos Komodakis and Jean-Christophe Pesquet. Playing with duality: An overview of recent primal? dual approaches for solving large-scale optimization problems. IEEE Signal Processing Magazine, 32(6):31-54, 2015. +Ignace Loris and Caroline Verhoeven. On a generalization of the iterative soft-thresholding algorithm for the case of non-separable penalty. Inverse Problems, 27(12):125007, 2011. +Yura Malitsky. Golden ratio algorithms for variational inequalities. Mathematical Programming, 184 (1):383-410, 2020. +Yura Malitsky and Konstantin Mishchenko. Adaptive gradient descent without descent. In International Conference on Machine Learning, pages 6702-6712. PMLR, 2020. +Yura Malitsky and Thomas Pock. A first-order primal-dual algorithm with linesearch. SIAM Journal on Optimization, 28(1):411-432, 2018. +Yu Nesterov. Gradient methods for minimizing composite functions. Mathematical Programming, 140(1):125-161, 2013. +Neal Parikh and Stephen Boyd. Proximal algorithms. Foundations and Trends in optimization, 1(3): 127-239, 2014. +Fabian Pedregosa and Gauthier Gidel. Adaptive three operator splitting. In International Conference on Machine Learning, pages 4085-4094. PMLR, 2018. +Bang Cong Vū. A splitting algorithm for dual monotone inclusions involving cocoercive operators. Advances in Computational Mathematics, 38(3):667-681, 2013. \ No newline at end of file diff --git a/afirstorderprimaldualmethodwithadaptivitytolocalsmoothness/images.zip b/afirstorderprimaldualmethodwithadaptivitytolocalsmoothness/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..2e64073bc5c7ed5f4bc8f5afbbefa78792a138f9 --- /dev/null +++ b/afirstorderprimaldualmethodwithadaptivitytolocalsmoothness/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:235751cfce1433d8d1f8a8bdf9dab6f921e86d4ad87448d65d13dcd9328e6b4a +size 391519 diff --git a/afirstorderprimaldualmethodwithadaptivitytolocalsmoothness/layout.json b/afirstorderprimaldualmethodwithadaptivitytolocalsmoothness/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..e112f7fbcb9f6112efd6c10bb92bfc7bd82e4343 --- /dev/null +++ b/afirstorderprimaldualmethodwithadaptivitytolocalsmoothness/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cfe11cfe59f316974f281dabd2d079c6ceebe54984814985bfe5e85295022416 +size 553466 diff --git a/aflowbasedlatentstategenerativemodelofneuralpopulationresponsestonaturalimages/287f8787-761e-4c39-88b7-7d94f8234974_content_list.json b/aflowbasedlatentstategenerativemodelofneuralpopulationresponsestonaturalimages/287f8787-761e-4c39-88b7-7d94f8234974_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..b31ca29162543346f150f213f993d39fbc8bb073 --- /dev/null +++ b/aflowbasedlatentstategenerativemodelofneuralpopulationresponsestonaturalimages/287f8787-761e-4c39-88b7-7d94f8234974_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c5afc1c0d5e8bf73fc1d30b3faeb40e9f7d9eaddfe057e7a1c3add8a8567659 +size 88147 diff --git a/aflowbasedlatentstategenerativemodelofneuralpopulationresponsestonaturalimages/287f8787-761e-4c39-88b7-7d94f8234974_model.json b/aflowbasedlatentstategenerativemodelofneuralpopulationresponsestonaturalimages/287f8787-761e-4c39-88b7-7d94f8234974_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a319a9f65de65f071af0fa4f4c94db495570d0be --- /dev/null +++ b/aflowbasedlatentstategenerativemodelofneuralpopulationresponsestonaturalimages/287f8787-761e-4c39-88b7-7d94f8234974_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a80578715ff074cad297082327da04d33a1f39cfeaf59d10d4ffea3579c0d4dc +size 104955 diff --git a/aflowbasedlatentstategenerativemodelofneuralpopulationresponsestonaturalimages/287f8787-761e-4c39-88b7-7d94f8234974_origin.pdf b/aflowbasedlatentstategenerativemodelofneuralpopulationresponsestonaturalimages/287f8787-761e-4c39-88b7-7d94f8234974_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..78158a1e3b6fa4dbbf9506a7e335fc8a1cd0cd15 --- /dev/null +++ b/aflowbasedlatentstategenerativemodelofneuralpopulationresponsestonaturalimages/287f8787-761e-4c39-88b7-7d94f8234974_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:411eb152609326a292eb30e5cfd38163f58821b685a99e15c6acbcef1baaf03f +size 2608370 diff --git a/aflowbasedlatentstategenerativemodelofneuralpopulationresponsestonaturalimages/full.md b/aflowbasedlatentstategenerativemodelofneuralpopulationresponsestonaturalimages/full.md new file mode 100644 index 0000000000000000000000000000000000000000..9efcbe009bf39951167d8a57ce449df8437e0b78 --- /dev/null +++ b/aflowbasedlatentstategenerativemodelofneuralpopulationresponsestonaturalimages/full.md @@ -0,0 +1,304 @@ +# A flow-based latent state generative model of neural population responses to natural images + +Mohammad Bashiri, $^{1,*}$ Edgar Y. Walker, $^{1,*}$ Konstantin-Klemens Lurz, $^{1}$ + +Akshay Kumar Jagadish, $^{1,2}$ , Taliah Muhammad, $^{3-4}$ Zhiwei Ding, $^{3-4}$ Zhuokun Ding, $^{3-4}$ + +Andreas S. Tolias, $^{3-4}$ Fabian H. Sinz $^{5,1,\dagger}$ + +$^{1}$ Institute for Bioinformatics and Medical Informatics, University of Tübingen, Germany + +2 Max Planck Institute for Biological Cybernetics, Tübingen, Germany + +$^{3}$ Department for Neuroscience, Baylor College of Medicine, Houston, TX, USA + +4 Center for Neuroscience and Artificial Intelligence, Baylor College of Medicine, Houston, TX, USA + +$^{5}$ Department of Computer Science, University Göttingen, Germany + +*equal contribution, †sinz@cs.uni-goettingen.de + +# Abstract + +We present a joint deep neural system identification model for two major sources of neural variability: stimulus-driven and stimulus-conditioned fluctuations. To this end, we combine (1) state-of-the-art deep networks for stimulus-driven activity and (2) a flexible, normalizing flow-based generative model to capture the stimulus-conditioned variability including noise correlations. This allows us to train the model end-to-end without the need for sophisticated probabilistic approximations associated with many latent state models for stimulus-conditioned fluctuations. We train the model on the responses of thousands of neurons from multiple areas of the mouse visual cortex to natural images. We show that our model outperforms previous state-of-the-art models in predicting the distribution of neural population responses to novel stimuli, including shared stimulus-conditioned variability. Furthermore, it successfully learns known latent factors of the population responses that are related to behavioral variables such as pupil dilation, and other factors that vary systematically with brain area or retinotopic location. Overall, our model accurately accounts for two critical sources of neural variability while avoiding several complexities associated with many existing latent state models. It thus provides a useful tool for uncovering the interplay between different factors that contribute to variability in neural activity. + +# 1 Introduction + +Characterizing the activity of sensory neurons is a major goal of neural system identification. While neural responses in the visual cortex vary with visual stimuli, they also exhibit variability to the repeated presentations of identical stimuli [1-4]. This stimulus-conditioned variability has significant and sophisticated correlations among neurons commonly referred to as noise correlations [4-6] and exhibits dependency on various factors such as the stimulus [7-9], the behavioral task [10, 11], attention [12-14], and the general brain state [15, 16]. Understanding the nature of this correlated variability and its functional implication in the processing of sensory stimuli requires models that account for both stimulus-driven and shared stimulus-conditioned variability. The goal is thus to model the stimulus-conditioned response distribution $p(\mathbf{r}|\mathbf{x})$ of population activity $\mathbf{r} \in \mathbb{R}^n$ over $n$ neurons responding to an arbitrary sensory stimulus $\mathbf{x}$ . However, models that account for stimulus-driven and stimulus-conditioned correlated variability have been developed largely independently. + +In the recent decade, we have seen significant progress in modeling stimulus-driven activity, largely driven by the use of deep neural networks (DNNs) [17-22]. Typically, the expected response of the neurons conditioned on the stimulus is captured as a function of the stimulus via a deep network $\mathbf{f}_{\theta}(\mathbf{x}) = \mathbb{E}[\mathbf{r}|\mathbf{x}]$ with learnable parameters $\theta$ . These models can therefore predict how population responses depend on an arbitrary stimulus, and could even be used to derive stimuli that would yield desirable responses [23, 24]. Typically, these networks are trained using Poisson-loss, assuming that the population activity $\mathbf{r}$ is distributed around the stimulus-conditioned mean $\mathbf{f}_{\theta}(\mathbf{x})$ with an independent Poisson distribution. Therefore, existing state-of-the-art networks commonly ignore stimulus-conditioned correlations among neural responses, and impose strong assumptions about the form of the marginal distribution (i.e. Poisson) for each neuron. As sensory populations are known to exhibit noise correlations and deviate from Poisson distributions [4, 25, 26], this conditional independence assumption might limit the ability of these models to accurately capture $p(\mathbf{r}|\mathbf{x})$ . + +On the other hand, many of the existing models for stimulus-conditioned variability capture the variations in the population activity by specifically modeling the responses to repeated presentations of an identical stimulus. Many of these approaches employ statistical techniques such as maximum-entropy or copula distributions to reduce the number of parameters needed to fit the target distribution [27-29]. A popular approach has been to describe the stimulus-conditioned variability in terms of a typically lower-dimensional shared latent state $\mathbf{z}$ : $p(\mathbf{r}|\mathbf{x}) = \int p(\mathbf{r}|\mathbf{x},\mathbf{z})p(\mathbf{z}|\mathbf{x})\mathrm{d}\mathbf{z}$ [16, 25, 26, 30-35]. Among these are hierarchical generative models that can capture more sophisticated relationships between the stimulus and noise correlations, as well as deviations from Poisson, such as over-dispersion [25, 26, 32, 34, 35]. While these approaches present powerful methods to capture stimulus-conditioned variability, they often fit $p(\mathbf{r}|\mathbf{x})$ separately for each unique stimulus and require responses to repeated presentations of the stimulus [16, 25, 26, 29, 35]. This limits their ability to yield predictions to a novel stimulus without requiring some stimulus-specific parameters to be learned. Furthermore, the increased complexity of the distribution usually requires a substantially more involved probabilistic machinery to make latent state inference and parameter fitting feasible. Consequently, most latent state models for neural data either ignore stimulus-driven variability altogether [30, 31, 34], or employ a very simple model of stimulus-driven variations [16, 25, 26, 32]. + +Here, we propose a new model that closes the gap between these two approaches by combining DNN-based models of stimulus-driven activity with a latent state model that accounts for shared stimulus-conditioned variability. While DNNs can be trained effectively via gradient-based optimization, the challenge is to avoid the complex probabilistic machinery associated with existing latent state models, particularly those that require stimulus-specific parameters to be learned over repeated presentations of identical stimuli. To this end, we combine normalizing flows [36-41] with Gaussian Factor Analysis (FA) models [42], where the stimulus-dependence occurs through a DNN that learns to shift the mean of the FA distribution based on the stimulus. FA models make use of multivariate Gaussian distributions with a particular low-rank structure of the covariance matrix. While the use of FA in capturing shared variability greatly simplifies inference and learning, it is not directly applicable to neural responses because neural responses are not Gaussian-distributed, particularly for low firing rates. To circumvent this problem, variance-stabilizing transformations, such as the square-root function, have been used in the past to make the responses more Gaussian-distributed [16, 30]. However, there may be other transformations that capture the response distribution more accurately. Furthermore, since the transformation for one neuron may not be applicable to other neurons, ideally it would be learned for each neuron separately. To achieve this flexibility, we allow our model to learn neuron-specific transformations with a marginal normalizing flow. + +Normalizing flow models are density estimators that use a series of diffeomorphisms to transform the source density underlying the data into a simple distribution—typically an isotropic Gaussian of the same dimension. These transformations are usually chosen to have efficient-to-compute log-determinants, and typically act on the entire variable vector to capture any statistical dependencies between the dimensions. Here, we replace the isotropic Gaussian with an FA model to capture dependencies among dimensions and only use diffeomorphisms that act on each dimension separately, i.e. apply flow-based transformations on the marginals only. While this choice places certain restrictions on the complex dependencies between neurons that may be captured (refer to section 4 Discussion for details), it has two important advantages: (1) The generative model is easy to train while combining state-of-the-art deep networks with flexible latent state models, and (2) the use of marginal flows allows for an easy mechanism to compute conditional distributions of one neuron given responses of other neurons that would not be easy to obtain with non-marginal flow models. + +![](images/5f68cfe496f3eb965e6b0788fcb9a2cc9a09774f6845668cd2d5ef76d1b2111a.jpg) +Figure 1: Flow-based Factor Analysis model. a: Schematic of the flow-based model relating all relevant variables in the study. b: Schematic of the sub-network used by the image-computable model to map cortical positions into receptive field positions. Refer to section 2 Methods for the details. + +In summary, we make the following contributions. We (1) combine state-of-the-art DNN-based models with flow-based latent state models to jointly account for stimulus-driven and shared stimulus-conditioned variability in neural population activity. Our model can predict the distribution of neural responses to unseen stimuli, without the need for repeated presentations to learn stimulus-conditioned variability. We (2) apply our method on the activity of thousands of neurons in response to natural images, recorded via two-photon Calcium imaging from multiple areas of the mouse visual cortex. We demonstrate that our model outperforms current state-of-the-art methods in capturing the distribution of responses. Finally, we (3) show that our model infers latent state structures with meaningful relations to behavioral variables such as pupil dilation as well as other functional and anatomical properties of visual sensory neurons. + +# 2 Methods + +# 2.1 Models + +Flow-based Factor Analysis model (FlowFA) For a given stimulus $\mathbf{x}$ and population response $\mathbf{r} \in \mathbb{R}^n$ , where $n$ is the number of neurons, we define our normalizing flow-based Factor Analysis (FlowFA) model of the stimulus-conditioned population activity $p(\mathbf{r}|\mathbf{x})$ as + +$$ +p (\mathbf {r} | \mathbf {x}, \theta , \phi) = \mathcal {N} \left(T _ {\phi} (\mathbf {r}); \mathbf {f} _ {\theta} (\mathbf {x}), \mathbf {C C} ^ {\top} + \Psi\right) \cdot | \det \nabla_ {\mathbf {r}} T _ {\phi} (\mathbf {r}) |. \tag {1} +$$ + +FlowFA has two major parts: (1) A flow model $T_{\phi}$ with learnable parameters $\phi$ that transforms the population responses $\mathbf{r}$ such that the transformed responses $\mathbf{v} = T_{\phi}(\mathbf{r})$ are well modelled by a (2) Gaussian Factor Analysis (FA) model $\mathcal{N}(\mathbf{v}; \mathbf{f}_{\theta}(\mathbf{x}), \mathbf{C}\mathbf{C}^{\top} + \Psi)$ (Fig. 1a). Here, $\mathcal{N}(\mathbf{v}; \mu, \Sigma)$ denotes a Gaussian distribution over $\mathbf{v}$ with mean $\mu$ and covariance $\Sigma$ . According to the FA model, the random variable $\mathbf{v}$ is generated via $\mathbf{v} = \mathbf{f}_{\theta}(\mathbf{x}) + \mathbf{C}\mathbf{z} + \varepsilon$ where $\mathbf{z} \in \mathbb{R}^{k}$ is a low-dimensional latent state with $k \ll n$ and an isotropic Gaussian prior $\mathbf{z} \sim \mathcal{N}(0, I_k)$ whose samples map to $\mathbf{v}$ via the factor loading matrix $\mathbf{C} \in \mathbb{R}^{n \times k}$ . The effect of the stimulus $\mathbf{x}$ on the responses is captured by the mean of the FA distribution that depends on the stimulus, modeled as a deep network $\mathbf{f}_{\theta}(\mathbf{x}) \in \mathbb{R}^{n}$ with learnable parameters $\theta$ (Fig. 1a,b). We further include neuron-specific, independent noise $\varepsilon \sim \mathcal{N}(0, \Psi)$ where $\Psi \in \mathbb{R}^{n \times n}$ is a diagonal covariance matrix. + +Since the flow model is a trainable change of variables, it introduces the absolute determinant $|\operatorname{det}\nabla_{\mathbf{r}}T_{\phi}(\mathbf{r})|$ of the Jacobian $\nabla$ of $T_{\phi}$ with respect to $\mathbf{r}$ into Eq. (1). The transform itself is a diffeomorphism, i.e., an invertible differentiable mapping $T_{\phi}:\mathbb{R}^n\mapsto \mathbb{R}^n$ allowing us to evaluate the exact likelihood of each data point and easily draw samples from the model. Therefore, the model serves as a fully generative model from which samples of the stimulus-conditioned population responses can easily be generated for an arbitrary stimulus. + +In the model formulation presented here, we choose $T_{\phi}$ to act on each single dimension separately, i.e. $T_{\phi}(\mathbf{r}) = [T_{\phi_1}(r_1),\dots,T_{\phi_n}(r_n)]^\top$ . This choice results in a diagonal Jacobian which not only substantially simplifies the form of the determinant to $\operatorname*{det}\nabla_{\mathbf{r}}T_{\phi}(\mathbf{r}) = \prod_{i = 1}^{n}\frac{\partial T_{\phi_i}}{\partial r_i}$ , but also allows us to easily compute conditionals and marginals (see appendix A for the details). This would not generally be possible for diffeomorphisms with a non-diagonal Jacobian. + +Zero-Inflated Flow-based Factor Analysis model (ZIFFA) For two-photon Calcium imaging, a significant portion of inferred neural activity is zero, resulting in a sharp peak at zero in the response distribution (i.e. zero-inflated distribution) [43]. This zero-inflation is potentially a problem for the FlowFA model since the model would attempt to generate the peak at zero by mapping a large proportion of the Gaussian probability mass onto the "zero" responses, resulting in a poor fit to the response distribution. To avoid this, we extend FlowFA by modeling the zero responses with a separate peak (similar to Wei et al. [43]) and applying the FlowFA model to capture only the positive responses. We refer to this model as Zero-Inflated Flow-based Factor Analysis (ZIFFA). More specifically, ZIFFA is a mixture model that models neural responses below and above a threshold value $\rho$ with two separate, non-overlapping distributions. To capture the peak at zero, the responses below the threshold (i.e. "zero" responses) are modeled by a uniform distribution, while FlowFA is used to capture responses above the threshold: + +$$ +p (\mathbf {r} | \mathbf {x}) = \left(\prod_ {\{i: r _ {i} \leq \rho \}} \frac {1 - q _ {i} (\mathbf {x})}{\rho}\right) \cdot \left(\prod_ {\{i: r _ {i} > \rho \}} q _ {i} (\mathbf {x})\right) \cdot \mathcal {N} \left(T _ {\phi} \left(\mathbf {r} _ {+}\right); f _ {\theta , +} (\mathbf {x}), \mathbf {C} _ {+} \mathbf {C} _ {+} ^ {\top} + \Psi_ {+}\right) \cdot | \nabla T _ {\phi} \left(\mathbf {r} _ {+}\right) |, \tag {2} +$$ + +where $q_{i}(\mathbf{x})$ is the probability of the response being above the threshold $\rho$ modeled, jointly with the mean of the FA, as a function of the stimulus via a DNN $\mathbf{f}_{\theta}$ with learnable parameters $\theta$ . $\mathbf{r}_{+}$ and $f_{\theta, +}(\mathbf{x})$ are the sub-vectors, and $\mathbf{C}_{+}$ and $\Psi_{+}$ are the sub-matrices corresponding to responses above the threshold, and $\theta$ , $\mathbf{C}$ , $\Psi$ are the same as defined in Eq. (1). Refer to appendix B for the derivation. + +Control models We compare the FA-based models against two control models used for neural system identification that assume independence among neurons with specific forms of marginal distributions inspired by existing work: (1) Poisson [18, 22] and (2) Zero-inflated Gamma (ZIG) [43]. To capture continuous neural responses measured with Calcium imaging, we relax the discrete Poisson distribution into a continuous distribution by assuming $r = \hat{r} + \epsilon$ where $\hat{r} \sim \mathrm{Poisson}(\lambda)$ and $\epsilon \sim \mathrm{Uniform}[0,1)$ . This yields the likelihood function + +$$ +p _ {\text {p o i s s}} (\mathbf {r} | \mathbf {x}) = \prod_ {i} ^ {n} \frac {\lambda_ {i} (\mathbf {x}) ^ {\left\lfloor r _ {i} \right\rfloor} e ^ {- \lambda_ {i} (\mathbf {x})}}{\left\lfloor r _ {i} \right\rfloor !}, \tag {3} +$$ + +where $\lambda (\mathbf{x}) = \mathbf{f}_{\theta}(\mathbf{x})$ is the predicted firing rate of the neurons to input image $\mathbf{x}$ modeled as a DNN $\mathbf{f}_{\theta}$ with learnable parameters $\theta$ . The ZIG distribution is a mixture of a uniform and a gamma distribution separated at the value $\rho$ with no overlap [43]: + +$$ +p _ {\mathrm {Z I G}} (\mathbf {r} | \mathbf {x}) = \prod_ {i} ^ {n} \left(\frac {1 - q _ {i} (\mathbf {x})}{\rho} + \frac {q _ {i} (\mathbf {x}) r _ {i} ^ {\kappa_ {i} - 1}}{\Gamma (\kappa_ {i}) \nu_ {i} (\mathbf {x}) ^ {\kappa_ {i}}} \exp \left(- \frac {r _ {i}}{\nu_ {i} (\mathbf {x})}\right)\right), \tag {4} +$$ + +where $\nu_{i}(\mathbf{x})$ is the scale parameter of the gamma distribution, and $q_{i}(\mathbf{x})$ is same as in Eq. (2). To formulate ZIG as an image-computable model, $\nu_{i}(\mathbf{x})$ and $q_{i}(\mathbf{x})$ are jointly modeled using a DNN $\mathbf{f}_{\theta}$ with learnable parameters $\theta$ . Similar to Wei et al. [43], we let the shape parameter $\kappa_{i}$ be neuron-specific, but independent of the input. Importantly, we used the same value for $\rho$ in both ZIG and ZIFFA models. + +Note that when the covariance matrix of the FA-based models is diagonal (i.e. 0-dimensional latent state), these models assume independence among neurons and their performance is directly comparable to the control models. + +# 2.2 Model components + +Deep convolutional neural network $\mathbf{f}_{\theta}$ We capture the stimulus-driven changes in the neuronal response distribution using a deep convolutional neural network $\mathbf{f}_{\theta}(\mathbf{x})$ with the same architecture as used by Lurz et al. [22]. Briefly, the network consists of two parts: (1) A shared four-layer core network, where each layer consists of a standard or depth-separable [44] convolution operation resulting in 64 feature channels, followed by batch normalization and ELU nonlinearity, and (2) a neuron-specific readout mechanism (referred to as "Gaussian readout") that learns the position of the neuron's receptive field (RF) and computes a weighted sum of the features at this position along the channel dimension (Fig. 1a). In contrast to Lurz et al. [22] where the RF positions $\delta$ in image space were obtained by applying a shared affine transformation on the experimentally measured cortical positions $\Delta$ of the neurons, here we allow this mapping to take on a non-linear form to allow flips + +in the representation of the visual field as a function of cortical position (Fig. 1b). This is crucial to model cortex-to-visual space mappings for multiple brain areas, as the retinotopy of some areas are mirrored with respect to each other. During training, we apply L1 regularization to the readout feature weights and L2 regularization on the Laplace-filtered weights of the first convolution layer. + +Normalizing flow $T_{\phi}$ We construct the marginal flow model $T_{\phi} = \text{affine} \circ \exp \circ \text{affine} \circ \text{ELU} \circ \text{affine} \circ \text{ELU} \circ \text{affine} \circ \log \circ \text{affine}$ from a set of monotonic functions {affine, ELU, log, exp}, of which only the affine transformation has learnable parameters. We restricted all the affine transformation layers to have positive scale, and additionally restricted the first affine layer to have a positive offset. For each neuron indexed by $i$ , we learn a separate marginal transformation $T_{\phi_i}$ . We compare the flow transformation against two common fixed transformations: square-root [16, 30] and Anscombe [45]. These two transformations can be expressed by the general form $u = \exp(a \log(y + b) + c)$ which is a series of affine, log, affine, and exp transformations, with $a = 0.5$ , $b = 0$ , and $c = 0$ for square-root, and $a = 0.5$ , $b = \frac{3}{8}$ , and $c = \log(2)$ for Anscombe. We specifically chose the components of $T_{\phi}$ such that these common fixed transformations exist as special cases, ensuring that the flow transformations are strictly more flexible than any choice of fixed transformations commonly found in the literature. For ZIFFA, we adjusted the formulation of the marginal flow $T_{\phi}$ such that the predicted neuronal responses remain above $\rho$ , the boundary between the uniform and the FlowFA components of the mixture model, by replacing the first affine transformation in $T_{\phi}$ with a layer that only shifts by $-\rho$ . + +# 2.3 Neural and behavioral data + +We recorded the response of neurons in mouse visual cortices (layer L2/3) to gray-scale natural images using a wide-field two-photon microscope [46] (see appendix C for details). In this study, we used two scans from two mice spanning three visual areas: primary visual cortex (V1) and lateromedial area (LM) in scan 1; V1 and posteromedial area (PM) in scan 2. A total of 2,867 V1 neurons and 907 LM neurons were recorded in scan 1; 5,029 V1 neurons and 3,343 PM neurons were recorded in scan 2. Among these, we used 1,000 V1 and 907 LM neurons from scan 1, and 1,000 V1 and 1,000 PM neurons from scan 2. For both scans, neurons were randomly selected if the area contained more than 1,000 neurons. We also recorded behavioral variables such as pupil dilation, simultaneously. The natural image stimuli were sampled from ImageNet [47], cropped to fit a monitor with 16:9 aspect ratio, and presented to the mice at a resolution of 0.53 ppd (pixels per degree of visual angle). A total of 6,000 images were shown in each scan, of which 1,000 images consist of 100 unique images each repeated 10 times to allow for an estimate of the neural response variability. We used the repeated images for testing, and split the remaining images into 4,500 training and 500 validation images. + +# 2.4 Model fitting and evaluation + +Fitting We trained all models end-to-end via gradient-based optimization to maximize the log-likelihood obtained from Eqs. (1), (2), (3) or (4) for the corresponding model, optimizing over all learnable parameters. To ensure that $\Psi$ , the diagonal covariance matrix, stays positive-valued, we re-parameterized $\Psi = e^{\nu}$ and optimized $\nu$ instead. To find the best image-computable DNN models, we used Bayesian optimization [48] to find hyper-parameters that maximized the final log-likelihood of the trained model. Hyper-parameters include the learning rate and regularization coefficient on the readout weights. The log-likelihood used for scheduling learning rate, early stopping, and finding hyper-parameters was computed on the validation set. Additional details about training can be found in appendix D. The code can be found at https://github.com/sinzlab/bashiri-et-al-2021. + +Evaluation We compared the FA-based models (ZIFFA, FlowFA, and FA with fixed transformations) to the control models based on likelihood and leave-neuron-out prediction correlation on the test set. For the former, we computed the likelihood of the responses in bits per neuron per image under each model, based on Eqs. (1), (2), (3), and (4), accordingly. For the correlation measure, we computed the Pearson correlation between the predicted and the measured responses of each neuron on the test set. For the FA-based models that may capture the statistical dependency (i.e. covariance) between neurons, we predicted the response of a given neuron conditioned on the responses of all other neurons recorded simultaneously on the trial. More specifically, given an image $\mathbf{x}$ and the response of all other neurons $\mathbf{r}_{\backslash i}$ , we estimated the response of a neuron $r_i$ to the image by computing the posterior mean of the neuron's response $\mathbb{E}[r_i|\mathbf{x},\mathbf{r}_{\backslash i}]$ . We refer to this measure as conditional correlation (see appendix E for details). + +![](images/603128a344e128526d28e15642ce1a874ac7d00db4c4194f47fbf9526469d64d.jpg) +a + +![](images/9a8ea09aac77a939c1b67a18fe061a37d362251fc6b304b33fd771a8d6098190.jpg) + +![](images/a36ef946b810fdbe7993a94e23e6f8b0d506b15703245f2937782f0f631b1044.jpg) + +![](images/76979aad4f724d4a0d7d6f0821d53b321073fe6b0672fbdbe46839cbe2684cd3.jpg) + +![](images/a6447ed0fd2ad9dd2a44ea07e43e6ccba98a72a4d8fd11d64ecd825664babf8c.jpg) + +![](images/99a1132c32232117adff95670d37454ff0ab233bfe1fb73a4bfc4e4406b14086.jpg) + +![](images/eb71e502d840a33ef2194ae6948daa7f07644a5f3a974a1bfd5efe1eecb91668.jpg) +Figure 2: FlowFA model recovers the underlying transformation. a: Simulated responses for 2 neurons under various transformations. Across all transformations, transformed responses were sampled from Gaussian distributions with differing means (indicated by the color of the samples) but identical covariance. The covariance between the two neurons is shown in black text. b: Transformations learned by the flow model are shown in black, overlaid on the ground-truth transformations. c: Performance of models with fixed or learned (flow) transformations (rows) trained on responses simulated with a variety of transformations (columns). Cases where the simulating and trained transformations are the same are indicated by black outlines. Performance is measured as the KL divergence between the modeled and ground-truth distributions, where 0 would correspond to a perfect fit. + +# 3 Results + +# 3.1 Model performance + +FlowFA model faithfully recovers invertible transformations on synthetic data We first used synthetic data to illustrate that our FlowFA model with a learnable transformation can adequately learn and recover a wide variety of transformations resulting in different response distributions. To this end, we sampled 5,000 data points for 100 neurons from models with different ground-truth transformations (see appendix F for details on data generation). The invertible transformations (Example 1-10) had the general form $\exp (a\log (y + b) + c)$ with differing values of $a,b$ ,and $c$ Fig.2b).We trained FA-based models with either a fixed (FixedFA) or a learnable flow-based (FlowFA) transformation. As expected, the models with a fixed transformation performed well if the data was generated with a similar transformation, but the performance suffered when the transformations differed (Fig. 2c, first three rows). In contrast, the FlowFA model was able to flexibly learn every underlying transformation (Fig. 2b) and effectively captured all distributions across all simulations (Fig. 2c, last row). + +Flow-based models capture cortical response distribution well. After demonstrating that the flow-based model can effectively fit a wide range of distributions, we used it to capture distributions of the mouse visual cortex population responses to natural images, recorded in two different two-photon scans from two mice (scan 1 and scan 2, refer to section 2.3 for details). We trained the FA-based models (ZIFFA, FlowFA, and FixedFA) for different values of latent dimensions $k \in \{0,1,2,3,10\}$ . We measured the model performance by computing the log-likelihood as well as the conditional correlations (see section 2.4). + +![](images/b87d9ad1c5edde80185dd05c3dd08e6569769b8249894f182a82ce460beaa9c9.jpg) + +![](images/823b39e037a063dfa7d2513b5801aa6a63de3dedd3ef237adccfc24211ca0d25.jpg) + +![](images/414685bd17563183d1f523f0837a7f588597746b0591dddada4c03e499a1ea7c.jpg) + +![](images/caeca4eb58bc258854b267fabeeb57303577013bea9ad24230242edbc1b7ef4a.jpg) +Figure 3: Comparison of models trained on the mouse visual cortical population responses to natural images. a: log-likelihood computed for models trained on scan 1 (left panel) and scan 2 (right panel). Values for both individual (lighter shade) and average (darker shade) performance of a model trained under various random seeds are shown. Gray block provides a zoomed-in view of the ZIFFA, FlowFA, and Zero-Inflated-Gamma (ZIG) models. b: Neuron-specific transformations learned by the flow-based models (ZIFFA in green, average across neurons in light green; FlowFA in pink, average across neurons in light pink) shown in comparison to fixed transformations. c: Conditional correlation. Format is similar to a. + +![](images/f9c0a4abe7ebdc7f2e2bccb8d20fd8de813599b0d839e3982200e692d0ea1582.jpg) + +![](images/6f0fb73da349555aba4fbd0bae63906dbaa7bf0e66b2b63a98b676c2e564afa4.jpg) + +The ZIFFA model outperformed all other models across all numbers of latent dimensions $k$ in terms of log-likelihood (Fig. 3a). Furthermore, with increasing latent dimensions, the conditional correlation of the ZIFFA model improved significantly beyond the control models (Fig. 3c). Interestingly, we observed that the ZIFFA model exhibited slightly lower correlation performance compared to models with fixed transformations, reflecting that fitting models on likelihood does not necessarily yield optimal correlation. Importantly, the flow-based models outperformed all FixedFA models in terms of likelihood, which is corroborated by the fact that the learned transformation markedly differs from all fixed transformations and from one neuron to the other (Fig. 3b). Overall, the results suggest that the ZIFFA model is able to capture the (marginal) neural response distributions more accurately than other models (Fig. S2) while at the same time it learns and takes advantage of the statistical dependencies between neurons. + +# 3.2 Uncovering biological insights from the trained model + +Here, we explore the utility of our model in uncovering potential biological insights. All analyses were performed on the trained ZIFFA model with 3 latent dimensions. + +Model-based visual area identification Several visual areas in mice show retinotopies that are "flipped" with respect to each other [49]. Intuitively, this means that if a point moves along the cortical surface, as it crosses the boundary between two "mirrored" areas, its counterpart in visual space would reverse its movement direction. As described in section 2.2, our model is equipped with a component network that predicts the RF location $\delta$ of each neuron in visual space as a function of its cortical location $\Delta$ (Fig. 1b). This network can be used to infer distinct visual cortical areas by detecting where the retinotopy "flips" with respect to the cortical position. To detect this flip we looked at the sign of the determinant of the Jacobian of the RF positions with respect to cortical positions $\operatorname*{det}\frac{\partial\delta}{\partial\Delta}$ . The sign can detect changes in the direction because (1) the sign of a determinant flips if one of the column or row vectors of the Jacobian matrix flips and (2) the determinant is invariant under rotation. When we compare distinct areas identified via the model to the experimentally identified areas, we find a very good match (Fig. 4a, left vs. right panels). To assess the quality of the learned + +![](images/6ca67ef33580cc5d102a523ffd477e52eb9b38636cb22214a51143133b6cfcba.jpg) +a + +![](images/636894c2665f9151c8abb6c2187b7bf92036cf9fcb3822dae0aab37a982c1312.jpg) + +![](images/4785b0058e603fba59a4fc0d69a6dadba0ac85417b2bec4f5dad4883c1cdf694.jpg) + +![](images/0977e16988d271628954bd025ab6a377afbd2795aa7e50bcf48b35d624b36419.jpg) + +![](images/705c5e673887e02798d49be0bfce00d10febd9109fdc71cd88ff5439248da855.jpg) +Scan 2 + +![](images/8b5ad48dfa6008197eaf5c0084a7d98245601e72af07255bb4b70413de96db49.jpg) + +![](images/722f100e752ac913464b0339c26434753070cdcab0d1807e8eaa977660e435a0.jpg) +b + +![](images/5e941cedf6ccbf125799034faafc537aab44304f0958afcc13edde5c7a8896ca.jpg) + +![](images/e8016532d79e2bc786e7e21a3245d389ceec56a650de5e1e4417cf0c6d0ba410.jpg) + +![](images/24c829f222e2aaebc7e101340dd2a21c0e30117a82f385c6857396b133829f34.jpg) + +![](images/565bec2d2048530a68ddd4ceacf73f857fbb49599c3f31ae7518dc51877f1641.jpg) + +![](images/fe96ebb8b0c6a0344a75a5bf31cf0959a1cfffd4116f4e0313fad6fe92b501f9.jpg) + +![](images/5065fdd15c1d4ec698128aa8b7d407a65067c6c271398ca17f18eabbe3a8ea7e.jpg) +C + +![](images/2178fbdbbd18dddbe273089a821b34a5c98f949dad064808f4ea4aa1fd6970f1.jpg) + +![](images/e0d7360a4df7d71dffd332ad7ed8ed822ec6fff82fe7606a3734da8b4a2dd957.jpg) + +![](images/04d6f92348e724edf1ee2cee9276d8ad16eff1901b9c2bfc14db99e0d57715dc.jpg) + +![](images/43b6fbff292e893f36c9ba6834542266741b64984b23c824fef6fa8ebd6a2a7d.jpg) + +![](images/b5230a1c67f0b3d9789460f1358138ff168d31c0a3eb14504916774ac959c19a.jpg) + +![](images/65a7033312b3ad7b57aea8ce6fcf5d7582a5ffc7e2e7271744895faca52f68ee.jpg) +d + +![](images/f713126902f477962ef30cf14f7527cd54f3a6c42962c7c5306fde7335bf0706.jpg) + +![](images/8e24c289ca532206c22c77972318151c286367d5c5be986eb1b384c8b55127aa.jpg) + +![](images/3eb30aa096aa0f567278b178b97ae6b611137e8b78b029437f8aa1ce0ee2a8cc.jpg) + +![](images/b635b2364bdbd0b2ee67819b6b77a221be29e96201fe091f349be7d16340c6fa.jpg) + +![](images/3f6e07c14b3d8ba9a188b65a912d227d7c42fbdf4cec0370dd1ef8b3b47c07ef.jpg) + +![](images/4239fd23e895011a6d9e063e24e63cf7803613fda46de1d5952d699a87973a0e.jpg) +Figure 4: Analysis of the ZIFFA model with 3-dimensional latent state $(k = 3)$ . a: Model-based area identification from responses of visual sensory neurons to natural images. Left panel (Cortex positions): cortical position of the recorded neurons color-coded by experimentally identified areas (green: V1; blue: LM; orange: PM). Middle panel (RF positions): learned receptive field position for each neuron as a function of cortical positions color-coded by experimentally identified areas. Right panel (Model-based area identification): visual areas identified via the model by computing the determinant of the relative changes in RF position with respect to changes in cortical position; blue color shows negative determinant (i.e. mirrored visual field representation) and red color shows positive determinant (i.e. non-mirrored visual field representation). b-c: Distribution of the latent-to-neuron weights across cortical positions (b) and receptive field positions (c). d: Pupil dilation (black) and the inferred latent states (red) across trials from the test set. $R^2$ values are computed between the inferred latent state and the pupil dilation. + +![](images/86ef875d2a885aff04c2dbab4859f64087d8349a94915cbcfdc022974f7814f7.jpg) + +mapping, we quantified how well our model can identify distinct visual brain areas via the sign of the determinant. Across models initialized and trained with different random seeds, the sign correctly classifies distinct brain areas with an accuracy of $84\% \pm 3.4\%$ (SEM) and $75\% \pm 7.7\%$ (SEM). Because the experimental methods to determine area assignment that we use as ground truth can be quite coarse, the actual accuracy could even be higher. This suggests that our model could in principle + +allow neuroscientists to identify distinct visual areas from responses to natural images alone, without the need for an extra experiment for area identification. + +Inferred latent states and their functional and anatomical implications We next explored the latent states and how they relate to anatomy or behavior. For any particular trial, the FA-based models allow us to infer the most probable latent state $\mathbf{z}$ (MAP estimate), where the effect of each latent dimension on the neural population is captured by the factor loading matrix $\mathbf{C}$ . However, as formulated in Eq. (1) and (2), interpreting the inferred latent states $\mathbf{z}$ can be difficult because the latent dimensions can be arbitrarily permuted and rotated (with corresponding changes in $\mathbf{C}$ ) without affecting the fit of the model. To facilitate interpretability of the inferred latent states, we follow a similar procedure used by Yu et al. [30] to extract orthonormalized latent states which are uniquely ordered by the amount of response variability each latent dimension accounts for (see appendix G for detailed explanation). + +The orthonormalized latent states inferred from the ZIFFA model showed strong correlations with behavioral variables such as pupil dilation (Fig. 4d), as expected from previous works that use pupil dilation as a proxy for arousal and attention [50-54]. Interestingly, pupil dilation correlated most strongly with the second latent dimension in both scans with $R^2$ values of 0.53 ( $p < 0.001$ , two-tailed test for significance of correlation [55]) and 0.63 ( $p < 0.001$ ) for scan 1 and scan 2, respectively, comparable to values previously reported [56]. To our surprise, this observation was consistent across models initialized and trained with different random seeds (Fig. S4b). To further quantify how well the latent states can jointly predict the pupil dilation, we regressed the pupil dilation against the latent states (Fig. S4a). The resulting $R^2$ values were 0.56 ( $p < 0.001$ ) and 0.76 ( $p < 0.001$ ) for scan 1 and scan 2, respectively. The high correlation between the latent states and the known surrogates of global brain state such as pupil dilation suggests that the latent model is able to learn meaningful dependencies and common factors in neural population. + +Next, we explored whether the effect of the orthonormalized latent states on the neurons is related to their cortical or RF positions. To this end, we plotted the sign and magnitude of the weight mapping from the latent state to each neuron on the cortical position (Fig. 4b) or the RF positions of the neurons (Fig. 4c). We observed that the effect of some latent dimensions varies systematically across brain areas where the latent dimension has generally opposite effect on different areas (Fig. 4b: dimension 2 for both scans). In addition, some latent dimensions seemed to vary as a function of RF positions/retinotopy where a differential effect of the latent dimension is observed for both areas (Fig. 4c: dimension 3 for both scans). Interestingly, the first dimension which accounts for most of the shared variability in neural responses (refer to section G for more details) seemed to have a global effect that does not vary across different visual areas. These observations illustrate that our model can be a useful tool for uncovering the functional and structural implications of the behavioral or internal processes associated with the inferred latent states. + +While the result of the analyses we present here are promising, we would like to point out that all analyses are preliminary, and conclusive biological interpretations would require additional rigorous experiments and analyses. + +# 4 Discussion + +Getting the best of both worlds Two major components of the variability in the activity of cortical neurons are the variability due to stimulus and the variability due to unobserved or internal processes, such as behavioral tasks or general brain states, that affect population of neurons in similar ways giving rise to correlated variability among neurons. Here, we presented a model that combines state-of-the-art DNN-based models to predict stimulus-driven changes in neural activity with a simple, yet flexible, flow-based factor analysis model to account for correlated neural activity. This formulation allows us to evaluate the exact likelihood of neural responses, easily sample stimulus-conditioned responses, and efficiently compute conditional and marginal distributions of subsets of neurons. By fitting this model to the activity of thousands of neurons from multiple areas of mouse visual cortex in response to natural images, we obtained state-of-the-art performance in capturing neural response distribution while additionally yielding latent states that exhibit meaningful relations to anatomy and functional properties of visual sensory neurons. + +Modeling zero-inflated response distribution Flow models use diffeomorphisms to map one distribution into another. However, diffeomorphisms cannot transform a single peak at 0—typically + +observed in neural responses recorded via Calcium imaging—into a smooth distribution such as Gaussian used in our model. The ZIFFA model avoids this problem by only transforming the positive part of the response with a diffeomorphism while explicitly capturing the peak at 0 via a uniform distribution as found in ZIG. Importantly, ZIFFA preserves all properties of the FlowFA model, while capturing the marginal distributions more accurately (Fig. S2), achieving a higher likelihood (Fig. 3), and learning more consistent and less step-like transformations (Fig. S3). + +Dependency of noise correlation on the stimulus The presented flow-based models learn a nonlinear transformation between a simple distribution (Gaussian FA) and the neural response distribution. While the learned covariance structure on the "transformed" neural responses captured by the FA model does not vary with the stimulus and the stimulus is only used to shift the mean of the FA model, this is not true for samples from the FA model transformed back into "neural response space" because the nonlinear flow transformation can introduce changes in the covariance as the mean varies (Fig. 2a). This mean-dependent change in the covariance potentially allows the model to capture changes in the covariance structure based on stimulus through the nonlinear transformation. A possible extension of our model is an explicit dependence of the FA's covariance matrix on the stimulus, which would allow the model to capture more complex dependencies between the stimulus and covariance structure. + +Comparison to related methods Our approach in capturing stimulus-conditioned variability is related to many existing approaches, or can be seen as a generalization thereof, while being computationally easier to handle at the same time. Recently, Keeley et al. [35] captured the trial-by-trial fluctuations by modeling the stimulus-specific and trial-specific latents via Factor Analysis (FA) models much like in our model. Importantly, while we capture the dependence of the stimulus-specific latents on the stimulus explicitly via a trained DNN, they inferred it from repeated presentations of the stimulus. Furthermore, the final Poisson distribution used to map from the latents to the distribution of neurons can be captured in our model via the flow-based transformation (e.g. inverse Anscombe) that maps Gaussian-distributed latents into a continuous approximation of a Poisson distribution. Moreover, the use of FA in combination with the marginal flow makes our approach related to copula-based distribution approximation and related approaches [28, 29, 57]. However, by explicitly limiting the stimulus dependence to occur via the shift in the mean of the FA model along with flow-based transformation of responses, we avoid the reliance on the repeated presentations of the stimuli [29] or highly constrained forms of the marginal distribution [28]. + +Limitations and future extensions As discussed above, our flow-based approach generalizes several existing methods to capture stimulus-conditioned variability of neural responses while being computationally more tractable. This allows us to train our models end-to-end directly on the likelihood via common gradient-based optimization algorithms. Within this general framework, we presented a specific case where we learned neuron-specific stimulus-independent transformations, mapping responses into a FA model whose mean varies with the stimulus. As noted earlier, for each stimulus, this approach closely parallels Gaussian copula and thus shares much of the same limitations. Also, the fact that stimulus-dependent changes in the covariance structure only occur through the learned transformation implies that the model can only capture changes in the covariance structure that varies with the mean (a limitation shared with many of the existing models). That being said, we believe that our general approach of flow-based modeling of neural response distributions allows for several generalizations that would overcome these limitations. Examples include an explicit dependence of the FA's covariance matrix on the stimulus, as well as the usage of richer, potentially stimulus-dependent, learnable transformations. + +Broader impact Accurate models of neural variability such as the one presented here can lead to deeper scientific insights and understanding of how brains perceive and compute with sensory information, and can eventually also provide insights into how neurological and psychological disorders may disturb these functions. In particular, a more accurate model that relates internal brain states, stimulus-driven responses, and anatomical features such as retinotopy or memberships to certain brain areas might provide deeper insights into the computational principles of cortex. Naturally, our model requires data from animal experiments to be trained. However, we used existing datasets with very general protocols that can be used in several analyses to make efficient scientific use of data from animal experiments. Furthermore, models such as the one presented here do help to reduce the amount of animal experiments as faithful models allow us to explore the functional principles of neural populations in silico. + +# Acknowledgments and Disclosure of Funding + +We thank all reviewers for their constructive and thoughtful feedback. Furthermore, we thank Alexander Ecker, Konstantin Willeke, Arne Nix, Christoph-Benjamin Blessing, and Emmanouil Froudarakis for comments and discussions. MB is supported by the International Max Planck Research School for Intelligent Systems. KKL is funded by the German Federal Ministry of Education and Research through the Tübingen AI Center (FKZ: 01IS18039A). FHS is supported by the Carl-Zeiss-Stiftung and acknowledges the support of the DFG Cluster of Excellence "Machine Learning - New Perspectives for Science", EXC 2064/1, project number 390727645. This work was supported by an AWS Machine Learning research award to FHS. Also supported by the Intelligence Advanced Research Projects Activity (IARPA) via Department of Interior/Interior Business Center (DoI/IBC) contract number D16PC00003. The U.S. Government is authorized to reproduce and distribute reprints for Governmental purposes notwithstanding any copyright annotation thereon. Disclaimer: The views and conclusions contained herein are those of the authors and should not be interpreted as necessarily representing the official policies or endorsements, either expressed or implied, of IARPA, DoI/IBC, or the U.S. Government. + +# References + +[1] A F Dean. The variability of discharge of simple cells in the cat striate cortex. Exp. Brain Res., 44(4):437-440, 1981. +[2] D J Tolhurst, J A Movshon, and A F Dean. The statistical reliability of signals in single neurons in cat and monkey visual cortex. Vision Res., 23(8):775-785, 1983. +[3] George J Tomko and Donald R Crapper. Neuronal variability: non-stationary responses to identical visual stimuli. *Brain research*, 79(3):405-418, 1974. +[4] Michael N Shadlen and William T Newsome. The variable discharge of cortical neurons: implications for connectivity, computation, and information coding. Journal of neuroscience, 18(10):3870-3896, 1998. +[5] David J Tolhurst, J Anthony Movshon, and Andrew F Dean. The statistical reliability of signals in single neurons in cat and monkey visual cortex. Vision research, 23(8):775-785, 1983. +[6] Marlene R Cohen and Adam Kohn. Measuring and interpreting neuronal correlations. Nature neuroscience, 14(7):811, 2011. +[7] Krešimir Josić, Eric Shea-Brown, Brent Doiron, and Jaime de la Rocha. Stimulus-dependent correlations and population codes. Neural computation, 21(10):2774-2804, 2009. +[8] Adrián Ponce-Alvarez, Alexander Thiele, Thomas D Albright, Gene R Stoner, and Gustavo Deco. Stimulus-dependent variability and noise correlations in cortical mt neurons. Proceedings of the National Academy of Sciences, 110(32):13162-13167, 2013. +[9] Mihály Bányai, Andreea Lazar, Liane Klein, Johanna Klon-Lipok, Marcell Stippinger, Wolf Singer, and Gergő Orbán. Stimulus complexity shapes response correlations in primary visual cortex. Proceedings of the National Academy of Sciences, 116(7):2723-2732, 2019. +[10] Marlene R Cohen and William T Newsome. Context-dependent changes in functional circuitry in visual area mt. Neuron, 60(1):162-173, 2008. +[11] Ralf M Haefner, Pietro Berkes, and József Fiser. Perceptual decision-making as probabilistic inference by neural sampling. Neuron, 90(3):649-660, 2016. +[12] Marlene R Cohen and John HR Maunsell. Attention improves performance primarily by reducing interneuronal correlations. Nature neuroscience, 12(12):1594, 2009. +[13] Jude F Mitchell, Kristy A Sundberg, and John H Reynolds. Spatial attention decorrelates intrinsic activity fluctuations in macaque area v4. Neuron, 63(6):879-888, 2009. +[14] Farran Briggs, George R Mangun, and W Martin Usrey. Attention enhances synaptic efficacy and the signal-to-noise ratio in neural circuits. Nature, 499(7459):476-480, 2013. + +[15] Christopher M Niell and Michael P Stryker. Modulation of visual responses by behavioral state in mouse visual cortex. Neuron, 65(4):472-479, 2010. +[16] Alexander S Ecker, Philipp Berens, R James Cotton, Manivannan Subramaniyan, George H Denfield, Cathryn R Cadwell, Stelios M Smirnakis, Matthias Bethge, and Andreas S Tolias. State dependence of noise correlations in macaque primary visual cortex. Neuron, 82(1): 235-248, 2014. +[17] David A Klindt, Alexander S Ecker, Thomas Euler, and Matthias Bethge. Neural system identification for large populations separating "what" and "where". Adv. Neural Inf. Process. Syst., November 2017. +[18] Eleanor Batty, Josh Merel, Nora Brackbill, Alexander Heitman, Alexander Sher, Alan Litke, E J Chichilnisky, and Liam Paninski. Multilayer recurrent network models of primate retinal ganglion cell responses. November 2016. +[19] Lane T McIntosh, Niru Maheswaranathan, Aran Nayebi, Surya Ganguli, and Stephen A Baccus. Deep learning models of the retinal response to natural scenes. In Advances in neural information processing systems, volume 29, pages 1369-1377, February 2016. +[20] Fabian Sinz, Alexander S Ecker, Paul Fahey, Edgar Walker, Erick Cobos, Emmanouil Froudarakis, Dimitri Yatsenko, Zachary Pitkow, Jacob Reimer, and Andreas Tolias. Stimulus domain transfer in recurrent models for large scale cortical population prediction on video. In Advances in Neural Information Processing Systems 31, pages 7199-7210, 2018. +[21] Santiago A Cadena, George H Denfield, Edgar Y Walker, Leon A Gatys, Andreas S Tolias, Matthias Bethge, and Alexander S Ecker. Deep convolutional models improve predictions of macaque v1 responses to natural images. PLoS computational biology, 15(4):e1006897, 2019. +[22] Konstantin-Klemens Lurz, Mohammad Bashiri, Konstantin Friedrich Willeke, Akshay Kumar Jagadish, Eric Wang, Edgar Y Walker, Santiago Cadena, Taliah Muhammad, Eric Cobos, Andreas Tolias, et al. Generalization in data-driven models of primary visual cortex. bioRxiv, 2020. +[23] Edgar Y Walker, Fabian H Sinz, Erick Cobos, Taliah Muhammad, Emmanouil Froudarakis, Paul G Fahey, Alexander S Ecker, Jacob Reimer, Xaq Pitkow, and Andreas S Tolias. Inception loops discover what excites neurons most using deep predictive models. Nature neuroscience, 22(12):2060-2065, 2019. +[24] Pouya Bashivan, Kohitij Kar, and James J DiCarlo. Neural population control via deep image synthesis. Science, 364(6439):eaav9436, May 2019. +[25] Adam S Charles, Mijung Park, J Patrick Weller, Gregory D Horwitz, and Jonathan W Pillow. Dethroning the fano factor: a flexible, model-based approach to partitioning neural variability. Neural computation, 30(4):1012-1045, 2018. +[26] Robbe LT Goris, J Anthony Movshon, and Eero P Simoncelli. Partitioning neuronal variability. Nature neuroscience, 17(6):858-865, 2014. +[27] Cian O'Donnell, J Tiago Gonçalves, Nick Whiteley, Carlos Portera-Cailliau, and Terrence J Sejnowski. The population tracking model: A simple, scalable statistical model for neural population data. Neural Comput., 29(1):50-93, January 2017. +[28] Pietro Berkes, Frank Wood, and Jonathan Pillow. Characterizing neural dependencies with copula models. https://pillowlab.princeton.edu/pubs/Berkes09_Copulas_NIPS.pdf. Accessed: 2021-5-22. +[29] Oleksandr Sorochynsky, Stéphane Deny, Olivier Marre, and Ulisse Ferrari. Predicting synchronous firing of large neural populations from sequential recordings. PLoS Comput. Biol., 17 (1):e1008501, January 2021. +[30] Byron M Yu, John P Cunningham, Gopal Santhanam, Stephen I Ryu, Krishna V Shenoy, and Maneesh Sahani. Gaussian-process factor analysis for low-dimensional single-trial analysis of neural population activity. J. Neurophysiol., 102(1):614-635, July 2009. + +[31] Jakob H Macke, Lars Buesing, John P Cunningham, Byron M Yu, Krishna V Shenoy, and Maneesh Sahani. Empirical models of spiking in neural populations. In J Shawe-Taylor, R S Zemel, P L Bartlett, F Pereira, and K Q Weinberger, editors, Advances in Neural Information Processing Systems 24, pages 1350-1358. Curran Associates, Inc., 2011. +[32] Evan W Archer, Urs Koster, Jonathan W Pillow, and Jakob H Macke. Low-dimensional models of neural population activity in sensory cortical circuits. In Advances in Neural Information Processing Systems 27: 28th Conference on Neural Information Processing Systems (NIPS 2014), pages 343-351, 2015. +[33] Yuan Zhao and Il Memming Park. Variational latent gaussian process for recovering Single-Trial dynamics from population spike trains. Neural Comput., 29(5):1293-1316, May 2017. +[34] Anqi Wu, Nicholas A Roy, Stephen Keeley, and Jonathan W Pillow. Gaussian process based nonlinear latent structure discovery in multivariate spike train data. Adv. Neural Inf. Process. Syst., 30:3496-3505, December 2017. +[35] Stephen L Keeley, Mikio C Aoi, Yiyi Yu, Spencer L Smith, and Jonathan W Pillow. Identifying signal and noise structure in neural population activity with gaussian process factor models. July 2020. +[36] E G Tabak. A family of non-parametric density estimation algorithms. https://www.math.nyu.edu/\~tabak/publications/Tabak-Turner.pdf, 2000. Accessed: 2021-5-25. +[37] Esteban G Tabak and Eric Vanden-Eijnden. Density estimation by dual ascent of the log-likelihood. CMS Books Math./Ouvrages Math. SMC, 8(1):217-233, March 2010. +[38] Oren Rippel and Ryan Prescott Adams. High-Dimensional probability estimation with deep density models. February 2013. +[39] J P Agnelli, M Cadeiras, E G Tabak, C V Turner, and E Vanden-Eijnden. Clustering and classification through normalizing flows in feature space. Multiscale Model. Simul., 8(5): 1784-1802, January 2010. +[40] L Dinh, J Sohl-Dickstein, and S Bengio. Density estimation using real NVP. Technical report, 2017. +[41] Danilo Jimenez Rezende and Shakir Mohamed. Variational inference with normalizing flows. 1505.05770, 2015. +[42] Sam Roweis and Zoubin Ghahramani. A unifying review of linear gaussian models. Neural Comput., 11(2):305-345, 1999. +[43] Xue-Xin Wei, Ding Zhou, Andres Grosmark, Zaki Ajabi, Fraser Sparks, Pengcheng Zhou, Mark Brandon, Attila Losonczy, and Liam Paninski. A zero-inflated gamma model for deconvolved calcium imaging traces. June 2020. +[44] François Chollet. Xception: Deep learning with depthwise separable convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1251-1258, 2017. +[45] Shaul K Bar-Lev and Peter Enis. On the classical choice of variance stabilizing transformations and an application for a poisson variate. Biometrika, 75(4):803-804, 1988. +[46] Nicholas James Sofroniew, Daniel Flickinger, Jonathan King, and Karel Svoboda. A large field of view two-photon mesoscope with subcellular resolution for in vivo imaging. *Elife*, 5:e14472, 2016. +[47] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, Alexander C. Berg, and Li Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision (IJCV), 115(3):211-252, 2015. doi: 10.1007/s11263-015-0816-y. +[48] Facebook. Adaptive experimentation platform, 2019. URL https://ax.dev/. + +[49] Marina E Garrett, Ian Nauhaus, James H Marshall, and Edward M Callaway. Topography and areal organization of mouse visual cortex. Journal of Neuroscience, 34(37):12587-12600, 2014. +[50] Jacob Reimer, Emmanouil Froudarakis, Cathryn R R Cadwell, Dimitri Yatsenko, George H H Denfield, and Andreas S S Tolias. Pupil fluctuations track fast switching of cortical states during quiet wakefulness. Neuron, 84(2):355-362, 2014. +[51] Martin Vinck, Renata Batista-Brito, Ulf Knoblich, and Jessica A Cardin. Arousal and locomotion make distinct contributions to cortical activity patterns and visual encoding. *Neuron*, 86(3): 740-754, May 2015. +[52] Matthew J McGinley, Martin Vinck, Jacob Reimer, Renata Batista-Brito, Edward Zagha, Cathryn R Cadwell, Andreas S Tolias, Jessica A Cardin, and David A McCormick. Waking state: Rapid variations modulate neural and behavioral responses. Neuron, 87(6):1143-1161, September 2015. +[53] Jacob Reimer, Matthew J McGinley, Yang Liu, Charles Rodenkirch, Qi Wang, David A McCormick, and Andreas S Tolias. Pupil fluctuations track rapid changes in adrenergic and cholinergic activity in cortex. Nat. Commun., 7:13289, November 2016. +[54] Siddhartha Joshi, Yin Li, Rishi M. Kalwani, and Joshua I. Gold. Relationships between Pupil Diameter and Neuronal Activity in the Locus Coeruleus, Colliculi, and Cingulate Cortex. Neuron, 89(1):221-234, 2016. ISSN 0896-6273. doi: 10.1016/j.neuron.2015.11.028. +[55] Student. Probable error of a correlation coefficient. Biometrika, pages 302-310, 1908. +[56] Carsen Stringer, Marius Pachitariu, Nicholas Steinmetz, Charu Bai Reddy, Matteo Carandini, and Kenneth D Harris. Spontaneous behaviors drive multidimensional, brainwide activity. Science, 364(6437), 2019. +[57] Jakob H Macke, Philipp Berens, Alexander S Ecker, Andreas S Tolias, and Matthias Bethge. Generating spike trains with specified correlation coefficients. Neural Comput., 21(2):397-423, February 2009. +[58] Emmanouil Froudarakis, Uri Cohen, Maria Diamantaki, Edgar Y Walker, Jacob Reimer, Philipp Berens, Haim Sompolinsky, and Andreas S Tolias. Object manifold geometry across the mouse cortical visual hierarchy. August 2020. +[59] Eftychios A Pnevmatikakis, Daniel Soudry, Yuanjun Gao, Timothy A Machado, Josh Merel, David Pfau, Thomas Reardon, Yu Mu, Clay Lacefield, Weijian Yang, et al. Simultaneous denoising, deconvolution, and demixing of calcium imaging data. Neuron, 89(2):285-299, 2016. +[60] D P Kingma and J Ba. Adam: A method for stochastic optimization. International Conference on Learning Representations, pages 1-13, 2014. +[61] Lutz Prechelt. Early stopping — but when? In Grégoire Montavon, Geneviève B Orr, and Klaus-Robert Müller, editors, Neural Networks: Tricks of the Trade: Second Edition, pages 53–67. Springer Berlin Heidelberg, Berlin, Heidelberg, 2012. +[62] 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, high-performance deep learning library. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems 32, pages 8024-8035. Curran Associates, Inc., 2019. URL http://papers.neurips.cc/paper/9015-pytorch-an-imperative-style-high-performance-deep-learning-library.pdf. +[63] Charles R. Harris, K. Jarrod Millman, Stefan J. van der Walt, Ralf Gommers, Pauli Virtanen, David Cournapeau, Eric Wieser, Julian Taylor, Sebastian Berg, Nathaniel J. Smith, + +Robert Kern, Matti Picus, Stephan Hoyer, Marten H. van Kerkwijk, Matthew Brett, Allan Haldane, Jaime Fernández del Río, Mark Wiebe, PEARU Peterson, Pierre Gérard-Marchant, Kevin Sheppard, Tyler Reddy, Warren Weckesser, Hameer Abbasi, Christoph Gohlke, and Travis E. Oliphant. Array programming with NumPy. Nature, 585(7825):357-362, September 2020. doi: 10.1038/s41586-020-2649-2. URL https://doi.org/10.1038/s41586-020-2649-2. \ No newline at end of file diff --git a/aflowbasedlatentstategenerativemodelofneuralpopulationresponsestonaturalimages/images.zip b/aflowbasedlatentstategenerativemodelofneuralpopulationresponsestonaturalimages/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..706d8d3916f267ef37e17ba422637807d9b8ac7f --- /dev/null +++ b/aflowbasedlatentstategenerativemodelofneuralpopulationresponsestonaturalimages/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f20baa72602b4cfad65f778df859ddb267a8fe4e2a2efcf6d0a0451b6322c5b +size 494558 diff --git a/aflowbasedlatentstategenerativemodelofneuralpopulationresponsestonaturalimages/layout.json b/aflowbasedlatentstategenerativemodelofneuralpopulationresponsestonaturalimages/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..dce790c6a3820ee089a7842f23bba3232926cd24 --- /dev/null +++ b/aflowbasedlatentstategenerativemodelofneuralpopulationresponsestonaturalimages/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:94e966180a5a11384bd384d3e1664cd1db28c32f5ad3cf8c1f0c92d79e4b77f4 +size 448757 diff --git a/aframeworktolearnwithinterpretation/a6883a9a-f6b5-4da0-9daa-b34877de66c5_content_list.json b/aframeworktolearnwithinterpretation/a6883a9a-f6b5-4da0-9daa-b34877de66c5_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..4a9216d51d5371476aeee516b1275cb861aef28c --- /dev/null +++ b/aframeworktolearnwithinterpretation/a6883a9a-f6b5-4da0-9daa-b34877de66c5_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ecab63864989068cb5311b43ef1cdf7881d6358c1d7e00127ba2f9f743037ad6 +size 79387 diff --git a/aframeworktolearnwithinterpretation/a6883a9a-f6b5-4da0-9daa-b34877de66c5_model.json b/aframeworktolearnwithinterpretation/a6883a9a-f6b5-4da0-9daa-b34877de66c5_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d14e941bd3800b578f35193cc68a1fd45986df2f --- /dev/null +++ b/aframeworktolearnwithinterpretation/a6883a9a-f6b5-4da0-9daa-b34877de66c5_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3bbe3557cb672b759cd4cc707f853aa85d98f6de56e88cce6aba980a702ff5b7 +size 100735 diff --git a/aframeworktolearnwithinterpretation/a6883a9a-f6b5-4da0-9daa-b34877de66c5_origin.pdf b/aframeworktolearnwithinterpretation/a6883a9a-f6b5-4da0-9daa-b34877de66c5_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..715609aa23eab390a4f349d91f39ce14162c8442 --- /dev/null +++ b/aframeworktolearnwithinterpretation/a6883a9a-f6b5-4da0-9daa-b34877de66c5_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:70bea6be7a34694bee106827cb7dfd5d5e6725a2c4ebbd8d3929fbff2a86d519 +size 1967983 diff --git a/aframeworktolearnwithinterpretation/full.md b/aframeworktolearnwithinterpretation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..706e4135e7bd3bca924cd76cb9c27aab51fd4b2b --- /dev/null +++ b/aframeworktolearnwithinterpretation/full.md @@ -0,0 +1,297 @@ +# A Framework to Learn with Interpretation + +Jayneel Parekh $^{1}$ , Pavlo Mozharovskyi $^{1}$ , Florence d'Alché-Buc $^{1}$ + +1 LTCI, Télecom Paris, + +Institut Polytechnique de Paris, France + +{jayneel.parekh,pavlo.mozharovskyi,florence.dalche} $@$ telecom-paris.fr + +# Abstract + +To tackle interpretability in deep learning, we present a novel framework to jointly learn a predictive model and its associated interpretation model. The interpreter provides both local and global interpretability about the predictive model in terms of human-understandable high level attribute functions, with minimal loss of accuracy. This is achieved by a dedicated architecture and well chosen regularization penalties. We seek for a small-size dictionary of high level attribute functions that take as inputs the outputs of selected hidden layers and whose outputs feed a linear classifier. We impose strong conciseness on the activation of attributes with an entropy-based criterion while enforcing fidelity to both inputs and outputs of the predictive model. A detailed pipeline to visualize the learnt features is also developed. Moreover, besides generating interpretable models by design, our approach can be specialized to provide post-hoc interpretations for a pre-trained neural network. We validate our approach against several state-of-the-art methods on multiple datasets and show its efficacy on both kinds of tasks. + +# 1 Introduction + +Interpretability in machine learning systems [16, 37, 42] has recently attracted a large amount of attention. This is due to the increasing adoption of these tools in every area of automated decision-making, including critical domains such as law [25], healthcare [48] or defence. Besides robustness, fairness and safety, it is considered as an essential component to ensure trustworthiness in predictive models that exhibit a growing complexity. Explainability and interpretability are often used as synonyms in the literature, referring to the ability to provide human-understandable insights on the decision process. Throughout this paper, we opt for interpretability as in [15] and leave the term explainability for the ability to provide logical explanations or causal reasoning, both requiring more sophisticated frameworks [17, 19, 44]. To address the long-standing challenge of interpreting models such as deep neural networks [43, 10, 9], two main approaches have been developed in literature: post-hoc approaches and "by design methods". + +Post-hoc approaches [7, 41, 38, 45] generally analyze a pre-trained system locally and attempt to interpret its decisions. "Interpretable by design" [3, 1] methods aim at integrating the interpretability objective into the learning process. They generally modify the structure of predictor function itself or add to the loss function regularizing penalties to enforce interpretability. Both approaches offer different types of advantages and drawbacks. Post-hoc approaches guarantee not affecting the performance of the pre-trained system but are however criticized for computational costs, robustness and faithfulness of interpretations [54, 28, 5]. Interpretable systems by-design on the other hand, although preferred for interpretability, face the challenge of not losing out on performance. + +Here, we adopt another angle to learning interpretable models. As a starting point, we consider that prediction (computing $\hat{y}$ the model's output for a given input) and interpretation (giving a human-understandable description of properties of the input that lead to $\hat{y}$ ) are two distinct but strongly related tasks. On one hand, they do not involve the same criteria for the assessment of their + +quality and might not be implemented using the same hypothesis space. On the other hand, we wish that an interpretable model relies on the components of a predictive model to remain faithful to it. These remarks yield to a novel generic task in machine learning called Supervised Learning with Interpretation (SLI). SLI is the problem of jointly learning a pair of dedicated models, a predictive model and an interpreter model, to provide both interpretability and prediction accuracy. In this work, we present FLINT (Framework to Learn With INTERpretation) as a solution to SLI when the model to interpret is a deep neural network classifier. The interpreter in FLINT implements the idea that a prediction to be understandable by a human should be linearly decomposed in terms of attribute functions that encode high-level concepts as other approaches [4, 18]. However, it enjoys two original key features. First the high-level attribute functions leverage the outputs of chosen hidden layers of the neural network. Second, together with expansion coefficients they are jointly learnt with the neural network to enable local and global interpretations. By local interpretation, we mean a subset of attribute functions whose simultaneous activation leads to the model's prediction, while by global interpretation, we refer to the description of each class in terms of a subset of attribute functions whose activation leads to the class prediction. Learning the pair of models involves the minimization of dedicated losses and penalty terms. In particular, local and global interpretability are enforced by imposing a limited number of attribute functions as well as conciseness and diversity among the activation of these attributes for a given input. Additionally we show that FLINT can be specialized to post-hoc interpretability if a pre-trained deep neural network is available. + +# Key contributions: + +- We present FLINT devoted to Supervised Learning with Interpretation with an original interpreter network architecture based on some hidden layers of the network. The role of the interpreter is to provide local and global interpretability that we express using a novel notion of relevance of concepts. +- We propose a novel entropy and sparsity based criterion for promoting conciseness and diversity in the learnt attribute functions and develop a simple pipeline to visualize the encoded concepts based on previously proposed tools. +- We present extensive experiments on 4 image classification datasets, MNIST, FashionMNIST, CIFAR10, QuickDraw, with a comparison with state-of-the-art approaches and a subjective evaluation study. +- Eventually, a specialization of FLINT to post-hoc interpretability is presented while corresponding numerical results are deferred to supplements. + +# 2 Related Works + +We emphasize here more on the methods relying upon a dictionary of high level attributes/concepts, a key feature of our framework. A synthetic view of this review is presented in the supplements to effectively view the connections and differences w.r.t wider literature regarding interpretability. + +Post-hoc interpretations. Most works in literature focus on producing a *posteriori* interpretations for pre-trained models via input attribution. They often consider the model as a black-box [41, 38, 8, 31, 14] or in the case of deep neural networks, work with gradients to generate saliency maps for a given input [46, 47, 45, 40]. Very few post-hoc approaches rely on high level concepts or other means of interpretations [22]. Methods utilizing high level concepts come under the subclass of concept activation vector (CAV)-based approaches. TCAV [27] proposed to utilize human-annotated examples to represent concepts in terms of activations of a pre-trained neural network. The sensitivity of prediction to these concepts is estimated to offer an explanation. ACE [18] attempts to automate the human-annotation process by super-pixel segmentation and clustering these segments based on their perceptual similarity where each cluster represents a concept. ConceptSHAP [51] introduces the idea of "completeness" in ACE's framework. The CAV-based approaches already strongly differ from us in context of problem as they only consider post-hoc interpretations. TCAV generates candidate concepts using human supervision and not from the network itself. While ACE automates concept discovery, the concepts are less dynamic as by design they are associated to a single class and rely on being represented via spatially connected regions. Moreover, since ACE depends on using a CNN as perceptual similarity metric for image segments (regardless of aspect ratio, scale), it is limited in applicability (experimentally supported in supplement Sec. S.3). + +Interpretable neural networks by design. Most works from this class learn a single model by either modifying the architecture [3], the loss functions [55, 13], or both [6, 36, 4, 12]. Methods like FRESH [24] and INVASE [53] perform selection over raw input tokens/features. The selected input features then are used by the final prediction model. GAME [35] shapes the learning problem as a co-operative game between predictor and interpreter. However, it learns a separate local interpreter for each sample rather than a single model. The above methods do not utilize high-level concepts for interpretation and offer local interpretations, with the exception of neural additive models [2], which are currently only suitable for tabular data. + +Self Explaining Neural Networks (SENN) [4] presented a generalized linear model wherein coefficients are also modelled as a function of input. The linear structure is to emphasize interpretability. SENN imposes a gradient-based penalty to learn coefficients stably and other constraints to learn human understandable features. Unlike SENN, to avoid trade-off between accuracy and interpretability in FLINT, we allow the predictor to be an unrestrained neural network and jointly learn the interpreter. Interpretations are generated at a local and global level using a novel notion of relevance of attributes. Moreover, FLINT can be specialized for generating post-hoc interpretations of pre-trained networks. + +Known dictionary of concepts. Some recent works have focused on different ways of utilizing a known dictionary of concepts for interpretability [26], by transforming the latent space to align with the concepts [13] or by adding user intervention as an additional feature to improve interactivity [29]. It should be noted that these methods are not comparable to FLINT or other interpretable networks by design as they assume availability of a ground truth dictionary of concepts for training. + +# 3 Learning a classifier and its interpreter with FLINT + +We introduce a novel generic task called Supervised Learning with Interpretation (SLI). Denoting $\mathcal{X}$ the input space, and $\mathcal{Y}$ the output space, we assume that the training set $\mathcal{S} = \{(x_i,y_i)_{i=1}^N\}$ is composed of $n$ independent realizations of a pair of random variables $(X,Y)$ defined over $\mathcal{X} \times \mathcal{Y}$ . SLI refers to the idea that the interpretation task differs from the prediction task and must be taken over by a dedicated model that depends on the predictive model to be interpreted. Let us call $\mathcal{F}$ the space of predictive models from $\mathcal{X}$ to $\mathcal{Y}$ . For a given model $f \in \mathcal{F}$ , we denote $\mathcal{G}_f$ the family of models $g_f: \mathcal{X} \to \mathcal{Y}$ , that depend on $f$ and are devoted to its interpretation. For sake of simplicity, an interpreter $g_f \in \mathcal{G}_f$ is denoted $g$ , omitting the dependency on $f$ . With these assumptions, the empirical loss of supervised learning is revisited to include explicitly an interpretability objective besides the prediction loss yielding to the following definition. + +Supervised Learning with Interpretation (SLI): + +$$ +\textbf {P r o b l e m 1 :} \arg \min _ {f \in \mathcal {F}, g \in \mathcal {G} _ {f}} \mathcal {L} _ {p r e d} (f, \mathcal {S}) + \mathcal {L} _ {i n t} (f, g, \mathcal {S}), +$$ + +where $\mathcal{L}_{pred}(f, S)$ denotes a loss term related to prediction error and $\mathcal{L}_{int}(f, g, S)$ measures the ability of $g$ to provide interpretations of predictions by $f$ . + +The goal of this paper is to address Supervised Learning with Interpretation when the hypothesis space $\mathcal{F}$ is instantiated to deep neural networks and the task at hand is multi-class classification. We present a novel and general framework, called Framework to Learn with INTERpretation (FLINT) that relies on (i) a specific architecture for the interpreter model which leverages some hidden layers of the neural network network to be interpreted, (ii) notions of local and global interpretation and (iii) corresponding penalties in the loss function. + +# 3.1 Design of FLINT + +All along the paper, we take $\mathcal{X} = \mathbb{R}^d$ and $\mathcal{Y} = \{y\in \{0,1\} ^C,\sum_{j = 1}^{C}y^j = 1\}$ , the set of $C$ one-hot encoding vectors of dimension $C$ . We set $\mathcal{F}$ to the class of deep neural networks with $l$ hidden layers of respective dimension $d_1,\ldots ,d_l$ . Each element $f:\mathcal{X}\rightarrow \mathcal{Y}$ of $\mathcal{F}$ satisfies: $f = f_{l + 1}\circ f_l\circ \dots \circ f_1$ where $f_{k}:\mathbb{R}^{d_{k - 1}}\to \mathbb{R}^{d_{k}}$ , $d_0 = d,d_{l + 1} = C$ , $k = 1,\ldots ,l + 1$ is the function implemented by layer $k$ . A network $f$ in $\mathcal{F}$ is completely identified by its generic parameter $\theta_f$ . As for the interpreter model $g\in \mathcal{G}_f$ , we propose the following original architecture which exploits the outputs of chosen hidden layers of $f$ . Denote $\mathcal{I} = \{i_1,i_2,\dots,i_T\} \subset \{1,\dots ,l\}$ the set of indices specifying the intermediate layers of network $f$ to be accessed and chosen for the representation of input. We define $D = \sum_{t = 1}^{T}d_{i_t}$ . Typically these layers are selected from the latter layers of the network $f$ . The + +![](images/950985e395d4cdd4f7164e70025fa65ccb1854fb39d4a504415bf0110712f89c.jpg) +Figure 1: (Left) General view of FLINT. (Right) Instantiation of FLINT on a deep architecture. + +![](images/4cfc6c0ae672cd5b5bb8e106a411bf47cad9493d08b4df28b42b770bec2473b0.jpg) + +concatenated vector of all intermediate outputs for an input sample $x$ is denoted as $f_{\mathcal{I}}(x) \in \mathbb{R}^D$ . Given $f$ a network to be interpreted and a positive integer $J \in \mathbb{N}^*$ , an interpreter network $g$ computes the composition of a dictionary of attribute functions $\Phi: \mathcal{X} \to \mathbb{R}^J$ and an interpretable function $h: \mathbb{R}^J \to \mathcal{Y}$ . + +$$ +\forall x \in \mathcal {X}, g (x) = h \circ \Phi (x), \tag {1} +$$ + +In this work, we take: $h(\Phi(x)) \coloneqq \text{softmax}(W^T \Phi(x))$ but other models like decision trees could be eligible. The attribute dictionary is composed of functions $\phi_j : \mathcal{X} \to \mathbb{R}^+$ , $j = 1, \ldots, J$ whose non-negative images $\phi_j(x)$ can be interpreted as the activation of some high level attribute, i.e., a "concept" over $\mathcal{X}$ . A key originality of the model lies in the fact that the attribute functions $\phi_j$ (referred to as attribute for simplicity) leverage the outputs of hidden layers of $f$ specified by $\mathcal{I}$ : + +$$ +\forall j \in \{1, \dots , J \}, \phi_ {j} (x) = \psi_ {j} \circ f _ {\mathcal {I}} (x) \tag {2} +$$ + +where each $\psi_j: \mathbb{R}^D \to \mathbb{R}^+$ operates on the accessed hidden layers. Here, the set of functions $\psi_j, j = 1, \ldots, J$ is defined to form a shallow network $\Psi$ (around 3 layers) whose output is $\Psi(f_{\mathcal{I}}(x)) = \Phi(x)$ (example architecture in Fig. 1). Interestingly, $\phi_j$ are defined over $\mathcal{X}$ and as a consequence can be interpreted in the input space which is the most meaningful for the user (see Sec. 4). For sake of simplicity, we denote $\Theta_g = (\theta_\Psi, \theta_h)$ the specific parameters of this model, while the parameters devoted to the computation of $f_{\mathcal{I}}(x)$ are shared with $f$ . + +# 3.2 Interpretation in FLINT + +The interpreter being defined, we need to specify its expected role and corresponding interpretability objective. In FLINT, interpretation is seen as an additional task besides prediction. We are interested by two kinds of interpretation, one at the global level that helps to understand which attribute functions are useful to predict a class and the other at the local level, that indicates which attribute functions are involved in prediction of a specific sample. As a preamble, note that, to interpret a local prediction $f(x)$ , we require that the interpreter output $g(x)$ matches $f(x)$ . When the two models disagree, we provide a way to analyze the conflictual data and possibly raise an issue about the confidence on the prediction $f(x)$ (see Supplementary Sec. S.2). To define local and global interpretation, we rely on the notion of relevance of an attribute. + +Given an interpreter with parameter $\Theta_g = (\theta_\Psi, \theta_h)$ and some input $x$ , the relevance score of an attribute $\phi_j$ is defined regarding the prediction $g(x) = f(x) = \hat{y}$ . Denoting $\hat{y} \in \mathcal{Y}$ the index of the predicted class and $w_{j,\hat{y}} \in W$ the coefficient associated to this class, the contribution of attribute $\phi_j$ to unnormalized score of class $\hat{y}$ is $\alpha_{j,\hat{y},x} = \phi_j(x).w_{j,\hat{y}}$ . The relevance score is computed by normalizing contribution $\alpha$ as $r_{j,x} = \frac{\alpha_{j,\hat{y},x}}{\max_i |\alpha_i,\hat{y},x|}$ . An attribute $\phi_j$ is considered as relevant for a local prediction if it is both activated and effectively used in the linear (logistic) model. The notion of relevance of an attribute for a sample is extended to its "overall" importance in the prediction of any class $c$ . This can be done by simply averaging relevance scores from local interpretations over a random subset or whole of the training set $S$ , where predicted class is $c$ . Thus, we have: $r_{j,c} = \frac{1}{|\mathcal{S}_c|} \sum_{x \in S_c} r_{j,x}, \mathcal{S}_c = \{x \in S | \hat{y} = c\}$ . Now, we can introduce the notions of local and global interpretations that the interpreter will provide. + +Definition 1 (Global and Local Interpretation) For a prediction network $f$ , the global interpretation $G(g, f)$ provided by an interpreter $g$ , is the set of class-attribute pairs $(c, \phi_j)$ such that their global relevance $r_{j,c}$ is greater than some threshold $1 / \tau, \tau > 1$ . A local interpretation for a sample $x$ provided by an interpreter $g$ of $f$ denoted $L(x, g, f)$ is the set of attribute functions $\phi_j$ with local relevance score $r_{j,x}$ greater than some threshold $1 / \tau, \tau > 1$ . + +It is important to note that these definitions do not prejudice the quality of local and global interpretations. Next, we convert desirable properties of the interpreter into specific loss functions. + +# 3.3 Learning by imposing interpretability properties + +Although converting desirable interpretability properties into losses is shared by several by-design approaches [11, 38], there is no consensus on these properties. We propose below a minimal set of penalties which are suitable for the proposed architecture and sufficient to provide relevant interpretations. + +Fidelity to Output. The output of the interpreter $g(x)$ should be "close" to $f(x)$ for any $x$ . This can be imposed through a cross-entropy loss: + +$$ +\mathcal {L} _ {o f} (f, g, \mathcal {S}) = - \sum_ {x \in \mathcal {S}} h (\Psi (f _ {\mathcal {I}} (x))) ^ {T} \log (f (x)) +$$ + +Conciseness and Diversity of Interpretations. For any given sample $x$ , we wish to get a small number of attributes in its associated local interpretation. This property of conciseness should make the interpretation easier to understand due to fewer attributes to be analyzed and promote the "high-level" character in the encoded concepts. However, to encourage better use of available attributes we also expect activation of multiple attributes across many randomly selected samples. We refer to this property as diversity. This is also important to avoid the case of attribute functions being learnt as class exclusive (for eg. reshuffled version of class logits). To enforce these conditions we utilize notion of entropy defined for real vectors proposed by Jain et al [23] to solve problem of efficient image search. For a real-valued vector $v$ , the entropy is defined as $\mathcal{E}(v) = -\sum_{i} p_{i} \log(p_{i})$ , $p_{i} = \exp(v_{i}) / (\sum_{i} \exp(v_{i}))$ . + +Conciseness is promoted by minimizing $\mathcal{E}(\Psi(f_{\mathcal{I}}(x)))$ and diversity is promoted by maximizing entropy of average $\Psi(f_{\mathcal{I}}(x))$ over a mini-batch. Note that this can be seen as encouraging the interpreter to find a sparse and diverse coding of $f_{\mathcal{I}}(x)$ using the function $\Psi$ . Since entropy-based losses have inherent normalization, they do not constrain the magnitude of the attribute activation. This often leads to poor optimization. Thus, we also minimize the $\ell_1$ norm $\| \Psi(f_{\mathcal{I}}(x)) \|_1$ (with hyperparameter $\eta$ ) to avoid it. Note that $\ell_1$ -regularization is a common tool to encourage sparsity and thus conciseness, however we show in the experiments that entropy provides a more effective way. + +$$ +\mathcal {L} _ {c d} (f, g, \mathcal {S}) = - \mathcal {E} (\bar {\Phi} _ {\mathcal {S}}) + \sum_ {x \in \mathcal {S}} \mathcal {E} (\Psi (f _ {\mathcal {I}} (x))) + \sum_ {x \in \mathcal {S}} \eta \| \Psi (f _ {\mathcal {I}} (x)) \| _ {1} \quad \text {w i t h} \quad \bar {\Phi} _ {\mathcal {S}} = \frac {1}{| \mathcal {S} |} \sum_ {x \in \mathcal {S}} \Psi (f _ {\mathcal {I}} (x)) +$$ + +Fidelity to Input. To encourage encoding high-level patterns related to input in $\Phi (x)$ , we use a decoder network $d:\mathbb{R}^J\to \mathcal{X}$ that takes as input the dictionary of attributes $\Psi (f_{\mathcal{I}}(x))$ and reconstructs $x$ . A similar penalty has previously been applied by [4]. + +$$ +\mathcal {L} _ {i f} (f, g, d, \mathcal {S}) = \sum_ {x \in \mathcal {S}} (d (\Psi (f _ {\mathcal {I}} (x))) - x) ^ {2} +$$ + +Note that one can modify $\mathcal{L}_{if}$ with other reconstruction losses as well (such as $\ell_1$ -reconstruction). + +Given the proposed loss terms, the loss for interpretability writes as follows: + +$$ +\mathcal {L} _ {i n t} (f, g, d, \mathcal {S}) = \beta \mathcal {L} _ {o f} (f, g, \mathcal {S}) + \gamma \mathcal {L} _ {i f} (f, g, d, \mathcal {S}) + \delta \mathcal {L} _ {c d} (f, g, \mathcal {S}) +$$ + +where $\beta, \gamma, \delta$ are non-negative hyperparameters. The total loss to be minimized $\mathcal{L} = \mathcal{L}_{pred} + \mathcal{L}_{int}$ , where the prediction loss, $\mathcal{L}_{pred}$ , is the well-known cross-entropy loss. + +Let us denote $\Theta = (\theta_{f},\theta_{d},\theta_{\Psi},\theta_{h})$ the parameters of these networks. Learning the models $f,\Psi ,h$ and $d$ boils down to learning $\Theta$ . In practice, introducing all the losses at once often leads to very poor optimization. Thus, we follow the procedure described in Alg. 1. We train the networks with $\mathcal{L}_{pred},\mathcal{L}_{if}$ for the first two epochs and gain a reasonable level of accuracy. From the third epoch we introduce $\mathcal{L}_{of}$ and from the fourth epoch we introduce $\mathcal{L}_{cd}$ loss. + +# 4 Understanding encoded concepts in FLINT + +Once the predictor and interpreter are jointly learnt, interpretation can be given at the global and local levels as in Def. 1. A key component to grasp the interpretations is to understand the concept + +# Algorithm 1 Learning algorithm for FLINT + +1: Input: $S$ & parameters $\Theta = (\theta_f, \theta_d, \theta_\Psi, \theta_h)$ & hyperparameters: $\beta_0, \gamma_0, \delta_0, \eta_0$ & number of batches $B$ & number of training epochs $N_{epoch}$ . +2: Random initialization of parameter $\Theta_0$ +3: $\Theta_1\gets$ Train $(S,\Theta_0,\beta = 0,\gamma_0,\delta = 0,\eta = 0,B,2)$ { $\%$ Trains 2 epochs with $\mathcal{L}_{pred},\mathcal{L}_{if}\}$ +4: $\Theta_{2}\gets$ Train $(S,\Theta_{1},\beta = \beta_{0},\gamma_{0},\delta = 0,\eta = 0,B,1)$ { $\%$ Trains 1 epoch with $\mathcal{L}_{pred},\mathcal{L}_{if},\mathcal{L}_{of}\}$ +5: $\hat{\Theta}\gets$ Train $(S,\Theta_{2},\beta_{0},\gamma_{0},\delta_{0},\eta_{0},B,N_{epoch} - 3)$ { $\%$ Trains with all losses} +6: Output: $\hat{\Theta} = (\theta_f, \theta_d, \theta_\Psi, \theta_h)$ + +encoded by each individual attribute function $\phi_j$ , previously defined in Eq. 2. In this work, we focus on image classification and propose to represent an encoded concept as a set of visual patterns in the input space which highly activate $\phi_j$ . We present a pipeline to generate visualizations for global and local interpretation by adapting various previously proposed tools [4, 39]. + +# Algorithm 2 Visualization of global interpretation + +1: Input: (class, attribute): $(c, \phi_j)$ & subset size: $l$ & training set: $S_n$ & AM+PI params: $(\lambda_{\phi}, \lambda_{tv}, \lambda_{bo})$ +2: $\mathcal{S}_c = \{x|(x,c)\in \mathcal{S}_n\}$ +3: $\mathbf{MAS}(c,\phi_j,l)\gets \arg \max_{\mathcal{M}\subset \mathcal{S}_c,|\mathcal{M}| = l}\sum_{x_i\in \mathcal{M}}\phi_j(x)$ +4: FOR $x_{k} \in \mathrm{MAS}(c, \phi_{j}, l)$ +5: $x_{vis}^{k}\gets \mathrm{AM + PI}(x_{k},\lambda_{\phi},\lambda_{tv},\lambda_{bo})$ +6:ENDFOR +7: Output: $\{x_{vis}^{1},\ldots ,x_{vis}^{l}\}$ , MAS(c, $\phi_j,l$ + +Visualization of global interpretation. Given any class-attribute pair $(c, \phi_j)$ in the global interpretation $G(g, f)$ , we first select a small subset of training samples from class $c$ that maximally activate $\phi_j$ . This set of samples is referred to as maximum activating samples and denoted $\mathrm{MAS}(c, \phi_j, l)$ where $l$ is the size of the subset (chosen as 3 in the experiments). Although, MAS reveal some information about the encoded concept, it might not be apparent what aspect of these samples causes activation of $\phi_j$ . We thus propose further analyzing each element in MAS through tools that enhance the detected concept. This results in a much better understanding. The primary tool we employ is a modified version of activation maximization [39], which we refer to as activation maximization with partial initialization (AM+PI). + +Given a maximum activating sample $x' \in \mathrm{MAS}(c, \phi_j, l)$ , the key idea behind AM+PI is to synthesize appropriate input via optimization, that maximally activates $\phi_j$ . We thus optimize a common activation maximization objective [39]: $\arg \max_x \lambda_\phi \phi_j(x) - \lambda_{tv} \mathrm{TV}(x) - \lambda_{bo} \mathrm{Bo}(x)$ , where $\mathrm{TV}(.)$ , $\mathrm{Bo}(.)$ are regularization terms. However, we initialize the procedure by low-intensity version of sample $x'$ . This makes the optimization easier with the detected concept weakly present in the input. This also allows the optimization to "fill" the input to enhance the encoded concept. As an output, we obtain a map adapted to $x'$ , that strongly activates $\phi_j$ . Complete details of the AM+PI procedure are given in supplementary (Sec. S.2). Visualization of a class-attribute pair is summarized in Alg. 2. Alternative useful tools are discussed in the supplementary (Sec. S.2). + +Local analysis. Given any test sample $x_0$ , one can determine its local interpretation $L(x_0, f, g)$ , the set of relevant attribute functions accordingly to Def. 1. To visualize a relevant attribute $\phi_j \in L(x_0, f, g)$ , we can repeat the AM+PI procedure with initialization using low-intensity version of $x_0$ to enhance concept detected by $\phi_j$ in $x_0$ . Note that the understanding built about any attribute function $\phi_j$ via global analysis, although not essential, can still be helpful to understand the generated AM+PI maps during local analysis, as these maps are generally similar. + +# 5 Numerical Experiments for FLINT + +Datasets and Networks. We consider 4 datasets for experiments, MNIST [34], FashionMNIST [50], CIFAR-10 [30], and a subset of QuickDraw dataset [20]. Additional results on CIFAR100 [30] (large number of classes) and Caltech-UCSD Birds-200-2011 [49] (large-scale images and large number of + +
Accuracy (in %)Fidelity (in %)
BASE- fSENNPrototypeDNNFLINT- fFLINT- gLIMEVIBIFLINT- g
MNIST98.9±0.198.4±0.199.298.9±0.298.3±0.295.6±0.496.6±0.798.7±0.1
FashionMNIST90.4±0.184.2±0.390.090.5±0.286.8±0.467.3±1.388.4±0.391.5±0.1
CIFAR1084.7±0.377.8±0.7-84.5±0.284.0±0.431.5±0.965.5±0.393.2±0.2
QuickDraw85.3±0.285.5±0.4-85.7±0.385.4±0.176.3±0.178.6±0.490.8±0.4
+ +Table 1: Results for accuracy (in %) and fidelity to FLINT- $f$ on different datasets. BASE- $f$ is system trained with just accuracy loss. FLINT- $f$ ,FLINT- $g$ denote the predictor and interpreter trained in our framework. Mean and standard deviation of 4 runs for each system are reported + +classes) are covered in supplementary (Sec. S.2.2). Our experiments include 2 kinds of architectures for predictor $f$ : (i) LeNet-based [33] network for MNIST, FashionMNIST, and (ii) ResNet18-based [21] network for QuickDraw, CIFAR. We select one intermediate layer for LeNet based network and two for ResNet based networks, from the last few convolutional layers as they are expected to capture higher-level features. We set the number of attributes $J = 25$ for MNIST, FashionMNIST, $J = 24$ QuickDraw and $J = 36$ for CIFAR. Further details about the QuickDraw subset, precise architecture, ablation studies about choice of hyperparameters (hidden layers, size of attribute dictionary, loss scheduling) and optimization details are available in supplementary (Sec. S.2). + +# 5.1 Quantitative evaluation of FLINT + +We evaluate and compare our model with other state-of-the-art systems regarding accuracy and interpretability. The evaluation metrics for interpretability [15] are defined to measure the effectiveness of the losses proposed in Sec. 3.3. Our primary method for comparison, wherever applicable, is SENN, as it is an interpretable network by design with same units for interpretation as FLINT. Other baselines include PrototypeDNN [36] for predictive performance, LIME [41] and VIBI [8] for fidelity of interpretations. Implementation of our method is available on Github1. Details for implementation of baselines are in supplementary (Sec. S.2). + +Predictive performance of FLINT. There are two goals to validate related to predictor trained with FLINT (denoted FLINT- $f$ ), (i) Jointly training $f$ with $g$ and backpropagating loss term $\mathcal{L}_{int}$ does not negatively impact performance, and (ii) The achieved performance is comparable with other similar interpretable by-design models. For the former we compare the accuracy of FLINT- $f$ with same predictor architecture trained just with $\mathcal{L}_{pred}$ (denoted by BASE- $f$ ). For the latter goal we compare accuracy of FLINT- $f$ with accuracy of SENN and another interpretable network by design PrototypeDNN [36] that does not use input attribution for interpretations. Note that PrototypeDNN requires non-trivial changes to the model for running on more complex datasets, CIFAR10 and QuickDraw. To avoid any unfair comparison we skip these results. The accuracies are reported in Tab. 1. They indicate that training $f$ within FLINT does not result in any significant accuracy loss on any dataset. Also, FLINT is competitive with other interpretable by-design models. + +Fidelity of Interpreter. The fraction of samples where prediction of a model and its interpreter agree, i.e. predict the same class, is referred to as fidelity. It is a commonly used metric to measure how well an interpreter approximates a model [8, 32]. Note that, typically, for interpretable by design models, fidelity cannot be measured as they only consider a single model. However, to validate that the interpreter trained with FLINT (denoted as FLINT- $g$ ) achieves a reasonable level of agreement with FLINT- $f$ , we benchmark its fidelity against a state-of-the-art black-box explainer VIBI [8] and a traditional method LIME [41]. The results for this are provided in Tab. 1 (last three columns). FLINT- $g$ consistently achieves higher fidelity. Even though it is not a fair comparison as other systems are black-box explainers and FLINT- $g$ accesses intermediate layers, they clearly show that FLINT- $g$ demonstrates high fidelity to FLINT- $f$ . + +Conciseness of interpretations. We evaluate conciseness by measuring the average number of important attributes in generated interpretations. For a given sample $x$ , it can be computed as number of attributes $\phi_j$ with $r_{j,x}$ greater than a threshold $1 / \tau, \tau > 1$ , i.e. $\mathrm{CNS}_{g,x} = |\{j:|r_{j,x}| > 1 / \tau\}|$ . For different thresholds $1 / \tau$ , we compute the mean of $\mathrm{CNS}_{g,x}$ over test data to estimate conciseness of $g$ , $\mathrm{CNS}_g$ . Lower conciseness indicates need to analyze a lower number of attributes on an + +![](images/0e61811ea8fa4936c0b3a7c46f72b6a83d2dfb4f9d16e675e7528ba23296c9c9.jpg) +(a) + +![](images/050fe3c7da5df12f3a25e00a7963a48b0b58dc2af7f22579c58275a69804eeaf.jpg) +(b) +Figure 2: (a) Conciseness comparison of FLINT and SENN. (b) Effect of entropy losses on conciseness of ResNet for QuickDraw for various $\ell_1$ -regularization levels. (c) Global class-attribute relevances $r_{j,c}$ for QuickDraw (Left) and CIFAR10 (Right). 24 class-attribute pairs for QuickDraw and 32 pairs for CIFAR10 have relevance $r_{j,c} > 0.2$ . + +![](images/25f43e144342c9e5fbb337fef94ab5811621e3bb4eee5be76bae9c7111f468c7.jpg) + +![](images/ba6d9ce9c789458ade421be98e35d29d3748c8e3deee21af31f258860a61cf1e.jpg) +(c) + +![](images/2aeb5dea90ba31086cea60ce5f7978dd47b457f7749bd5aab10f8a5d1af56433.jpg) +Figure 3: Example class-attribute pair analysis on all datasets, with global relevance $r_{j,c} > 0.2$ . Each row contains 3 MAS with corresponding AM+PI outputs + +![](images/562321021fe3f9c69e996c1759607c215470364776d6651f69922be5f64093c1.jpg) + +![](images/9e6984611d65ea9479335f577d9bfa7553eeb9359ba9dd736686ba8573374cf4.jpg) + +![](images/c845de2457aa2e36c046e74e4ccc50a9d2dc4386668d3b8a74e0dfc0f138baf4.jpg) +Figure 4: (Left) Local interpretations for test samples. Top 3 attributes with corresponding AM+PI output are shown. True labels for inputs are: Pullover, Airplane, Apple, Dog. (Right) Examples of attribute functions detecting same part across various test samples. For each sample, their relevance is greater than 0.8. True labels of samples indicated above them. + +average. SENN is the only other system for which this curve can be computed. We thus compare the conciseness of SENN with FLINT on all four datasets. Fig. 2a depicts the same. It can be easily observed that FLINT produces lot more concise interpretations compared to SENN. Moreover, SENN even ends up with majority of concepts being considered relevant for lower thresholds (higher $\tau$ ). + +Entropy vs $\ell_1$ regularization. We validate the effectiveness of entropy losses by computing conciseness curve at various levels of $\ell_1$ regularization strength, with and without entropy, for ResNet with QuickDraw. This is reported in Fig. 2b. The figure confirms that using the entropy-based loss is more effective in inducing conciseness of explanations compared to using just $\ell_1$ -regularization, with the difference being close to use of 1 attribute less when entropy losses are employed. + +Importance of attributes. Additional experiments evaluating meaningfulness of attributes by shuffling them and observing the effect (for FLINT and SENN) are given in supplementary (Sec. S.2). + +# 5.2 Qualitative analysis + +Global interpretation. Fig. 2c depicts the generated global relevances $r_{j,c}$ for all class-attribute pairs on QuickDraw and CIFAR. Each class-attribute pair with 'high' relevance needs to be analyzed as part of global analysis. Some example class-attribute pairs, with high relevance, are visualized in Fig. 3. For each pair we select MAS of size 3 and also show their AM+PI outputs. As mentioned before, simply analyzing MAS reveals useful information about the encoded concept. For instance, based on MAS, $\phi_{15}, \phi_{19}$ on MNIST, relevant for class 'One', clearly seem to activate for vertical and diagonal strokes respectively. However, AM+PI outputs give deeper insights about the concept by revealing more clearly what parts of input activate an attribute function. For eg., while MAS indicate that $\phi_5$ on FashionMNIST activates for heels (one type of 'Sandal'), $\phi_2$ on CIFAR10 activates for white dogs, it is not clear what part the attribute focuses on. AM+PI outputs indicate that $\phi_2$ focuses on the area around eyes and nose (the most enhanced regions), $\phi_5$ primarily detects a thin diagonal stroke of the heel surrounded by empty space. AM+PI outputs generally become even more important for attributes relevant for multiple classes. One such example is the function $\phi_5$ on QuickDraw, relevant for both 'Dog' and 'Lion'. It activates for very similar set of strokes for all samples, as indicated by AM+PI maps. For 'Dog' this corresponds to ears and mouth and for 'Lion' it corresponds to the mane. Other such attribute functions in the figure include $\phi_{24}$ on FashionMNIST, relevant for 'Pullover', 'Coat' and 'Shirt' which detects long sleeves and $\phi_{29}$ on CIFAR10, relevant for 'Trucks', 'Cars' and primarily detects wheels and parts of upper body. Further visualizations including those of other relevant classes for $\phi_{24}, \phi_{29}$ and global relevances are available in supplementary (Sec. S.2). + +Local interpretation. Fig. 4 (left) displays the local interpretation visualizations for test samples. $f$ and $g$ both predict the true class in all the cases. We show the top 3 relevant attributes to the prediction with their relevances and their corresponding AM+PI outputs. Based on the AM+PI outputs it can be observed that the attribute functions generally activate for patterns corresponding to the same concept as inferred during global analysis. This can be easily seen for attribute functions present in both Fig. 3, 4 (left). This is further illustrated by Fig. 4 (right) where we illustrate AM+PI outputs for two attributes from Fig. 3. These functions are relevant for more than one class and detect the same concept across various test samples, namely long sleeves for $\phi_{24}$ and primarily wheels for $\phi_{29}$ . + +# 5.3 Subjective evaluation + +We conducted a survey based subjective evaluation with QuickDraw dataset for FLINT with 20 respondents. We selected 10 attributes, covering 17 class-attribute pairs from the QuickDraw dataset. For each attribute we present the respondent with our visualizations (3 MAS and AM+PI outputs) for each of its relevant classes along with a textual description. We ask them if the description meaningfully associates to patterns in the AM+PI outputs. They indicate level of agreement with choices: Strongly Agree (SA), Agree (A), Disagree (D), Strongly Disagree (SD), Don't Know (DK). Descriptions were manually generated by our understanding of encoded concept for each attribute. $40\%$ incorrect descriptions were carefully included to ensure informed responses. These were forcefully related to the classes shown to make them harder to identify. Results - for correct descriptions: $77.5\% - \mathrm{SA} / \mathrm{A}$ , $10.0\% - \mathrm{DK}$ , $12.5\% - \mathrm{D} / \mathrm{SD}$ . For incorrect descriptions: $83.7\% - \mathrm{D} / \mathrm{SD}$ , $7.5\% - \mathrm{DK}$ , $8.8\% - \mathrm{SA} / \mathrm{A}$ . These results clearly indicate that concepts encoded in FLINT's learnt attributes are understandable to humans. Survey details are given in supplementary (Sec. S.2). + +# 6 Specialization of FLINT to post-hoc interpretability + +While interpretability by design is the primary goal of FLINT, it can be specialized to provide a post-hoc interpretation when a classifier $\hat{f}$ is already available. The Post-hoc interpretation learning (see for instance [41]) comes as a special case of SLI and is defined as follows. Given a classifier $\hat{f} \in \mathcal{F}$ and a training set $S$ , the goal is to build an interpreter of $\hat{f}$ by solving: + +$$ +\textbf{Problem 2:} \arg \min_{g\in \mathcal{G}_{\hat{f}}}\mathcal{L}_{int}(\hat{f},g,\mathcal{S}). +$$ + +With FLINT, we have $g(x) = h \circ \Phi(x)$ and $\Phi(x) = \Psi \circ \hat{f}_{\mathcal{I}}(x)$ for a given set of accessible hidden layers $\mathcal{I}$ and a attribute dictionary size $J$ . Learning can be performed by specializing Alg. 1 with slight modification of replacing $\Theta$ as $\Theta = (\theta_{\Psi}, \theta_h, \theta_d)$ while $\theta_{\hat{f}}$ is fixed and eliminating $\mathcal{L}_{pred}$ from training loss $\mathcal{L}$ . + +Experimental results for post-hoc FLINT: We validate this ability of our framework by interpreting fixed models trained only for accuracy, i.e., BASE- $f$ models from section 5.1. Even after not tuning the internal layers of $f$ , the system is still able to generate high-fidelity and meaningful interpretations. Fidelity comparisons against VIBI, class-attribute pair visualizations and experimental details are available in supplementary (Sec. S.3). + +# 7 Discussion and Perspectives + +FLINT is a novel framework for learning a predictor network and its interpreter network with dedicated losses. It provides local and global interpretations in terms of high-level learnt attributes/concepts by relying on (some) hidden layers of the prediction network. This however leaves some under-explored questions about faithfulness of interpretations to the predictor. Defining faithfulness of an interpretation regarding a decision process [4] has not yet reached a consensus particularly in the case of post-hoc interpretability or when the two models, predictor and interpreter, differ [52]. Even though generating interpretations based on hidden layers of predictor ensures high level of faithfulness of the interpreter to the predictor, a complete faithfulness cannot be guaranteed since predictor and interpreter differ in their last part. However if ensuring faithfulness by design is regarded as the primary objective, nothing stops the use of interpreter FLINT- $g$ as the final decision-making network. In this case, there is only one network and the so-called prediction network has only played the useful role of providing relevant hidden layers. + +Retaining only the interpreter model additionally provides a compression of the predictor and can be relevant when frugality is at stake. Further works will investigate this direction and the enforcement of additional constraints on attribute functions to encourage invariance under various transformations. Eventually FLINT can be extended to other tasks or modalities other than images in particular by adapting the design of attributes and the pipeline to understand them. + +# Acknowledgments and Disclosure of Funding + +This work has been funded by the research chair Data Science & Artificial Intelligence for Digitalized Industry and Services of Telecom Paris. This work also benefited from the support of French National Research Agency (ANR) under reference ANR-20-CE23-0028 (LIMPID project). The authors would like to thank Sanjeel Parekh for fruitful discussions and anonymous reviewers for their valuable comments and suggestions. + +# References + +[1] Tameem Adel, Zoubin Ghahramani, and Adrian Weller. Discovering interpretable representations for both deep generative and discriminative models. In International Conference on Machine Learning, pages 50-59. PMLR, 2018. +[2] Rishabh Agarwal, Nicholas Frosst, Xuezhou Zhang, Rich Caruana, and Geoffrey Hinton. Neural additive models: Interpretable machine learning with neural nets. arXiv preprint arXiv:2004.13912, 2020. +[3] Maruan Al-Shedivat, Avinava Dubey, and Eric Xing. Contextual explanation networks. arXiv preprint arXiv:1705.10301, 2017. +[4] David Alvarez-Melis and Tommi Jaakkola. Towards robust interpretability with self-explaining neural networks. In Advances in Neural Information Processing Systems (NeurIPS), pages 7775-7784, 2018. +[5] David Alvarez-Melis and Tommi S Jaakkola. On the robustness of interpretability methods. arXiv preprint arXiv:1806.08049, 2018. +[6] Plamen Angelov and Eduardo Soares. Towards explainable deep neural networks (xdnn). Neural Networks, 130:185-194, 2020. +[7] David Baehrens, Timon Schroeter, Stefan Harmeling, Motoaki Kawanabe, Katja Hansen, and Klaus-Robert Müller. How to explain individual classification decisions. J. Mach. Learn. Res., 11:1803-1831, August 2010. ISSN 1532-4435. + +[8] Seojin Bang, Pengtao Xie, Wei Wu, and Eric Xing. Explaining a black-box using deep variational information bottleneck approach. arXiv preprint arXiv:1902.06918, 2019. +[9] Alejandro Barredo Arrieta, Natalia Díaz-Rodríguez, Javier Del Ser, Adrien Bennetot, Siham Tabik, Alberto Barbado, Salvador Garcia, Sergio Gil-Lopez, Daniel Molina, Richard Benjamins, Raja Chatila, and Francisco Herrera. Explainable artificial intelligence (xai): Concepts, taxonomies, opportunities and challenges toward responsible ai. Information Fusion, 58:82 - 115, 2020. +[10] Valérie Beaudouin, Isabelle Bloch, David Bounie, Stéphan Clémenton, Florence d'Alché-Buc, James Eagan, Winston Maxwell, Pavlo Mozharovskyi, and Jayneel Parekh. Flexible and context-specific AI explainability: A multidisciplinary approach. CoRR, abs/2003.07703, 2020. +[11] Diogo V. Carvalho, Eduardo M. Pereira, and Jaime S. Cardoso. Machine learning interpretability: A survey on methods and metrics. *Electronics*, 8(8), 2019. +[12] Chaofan Chen, Oscar Li, Daniel Tao, Alina Barnett, Cynthia Rudin, and Jonathan K Su. This looks like that: deep learning for interpretable image recognition. In Advances in Neural Information Processing Systems (NeurIPS), pages 8928-8939, 2019. +[13] Zhi Chen, Yijie Bei, and Cynthia Rudin. Concept whitening for interpretable image recognition. Nature Machine Intelligence, 2(12):772-782, 2020. +[14] Jonathan Crabbe, Yao Zhang, William Zame, and Mihaela van der Schaar. Learning outside the black-box: The pursuit of interpretable models. In Advances in Neural Information Processing Systems, pages 17838-17849, 2020. +[15] Finale Doshi-Velez and Been Kim. Towards a rigorous science of interpretable machine learning. arXiv preprint arXiv:1702.08608, 2017. +[16] Finale Doshi-Velez and Been Kim. Interpretable machine learning. In Proceedings of the Thirty-fourth International Conference on Machine Learning, 2017. +[17] D. Dubois and H. Prade. Possibilistic logic—an overview. Computational logic, 9, 2014. +[18] Amirata Ghorbani, James Wexler, James Y Zou, and Been Kim. Towards automatic concept-based explanations. In Advances in Neural Information Processing Systems (NeurIPS), pages 9277-9286, 2019. +[19] Riccardo Guidotti, Anna Monreale, Fosca Giannotti, Dino Pedreschi, Salvatore Ruggieri, and Franco Turini. Factual and counterfactual explanations for black box decision making. IEEE Intelligent Systems, 2019. +[20] David Ha and Douglas Eck. A neural representation of sketch drawings. In International Conference on Learning Representations, 2018. +[21] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks. In European conference on computer vision, pages 630-645. Springer, 2016. +[22] Lisa Anne Hendricks, Zeynep Akata, Marcus Rohrbach, Jeff Donahue, Bernt Schiele, and Trevor Darrell. Generating visual explanations. In European Conference on Computer Vision, pages 3-19. Springer, 2016. +[23] Himalaya Jain, Joaquin Zepeda, Patrick Pérez, and Rémi Gribonval. Subic: A supervised, structured binary code for image search. In Proceedings of the IEEE International Conference on Computer Vision, pages 833-842, 2017. +[24] Sarthak Jain, Sarah Wiegrefe, Yuval Pinter, and Byron C Wallace. Learning to faithfully rationalize by construction. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 4459-4473, 2020. +[25] Berk Ustun Jyaming Zeng and Cynthia Rudin. Interpretable classification models for recidivism prediction. Journal of the Royal Statistical Society, Series A, Statistics in Society, 180, part 3: 689-722, 2017. + +[26] Dmitry Kazhdan, Botty Dimanov, Mateja Jamnik, Pietro Liò, and Adrian Weller. Now you see me (cme): Concept-based model extraction. arXiv preprint arXiv:2010.13233, 2020. +[27] 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). arXiv preprint arXiv:1711.11279, 2017. +[28] Pieter-Jan Kindermans, Sara Hooker, Julius Adebayo, Maximilian Alber, Kristof T Schütt, Sven Dähne, Dumitru Erhan, and Been Kim. The (un) reliability of saliency methods. In Explainable AI: Interpreting, Explaining and Visualizing Deep Learning, pages 267-280. Springer, 2019. +[29] 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, pages 5338-5348. PMLR, 2020. +[30] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. +[31] Himabindu Lakkaraju, Ece Kamar, Rich Caruana, and Jure Leskovec. Faithful and customizable explanations of black box models. In Proceedings of the 2019 AAAI/ACM Conference on AI, Ethics, and Society, pages 131-138, 2019. +[32] Himabindu Lakkaraju, Nino Arsov, and Osbert Bastani. Robust and stable black box explanations. In International Conference on Machine Learning, pages 5628-5638. PMLR, 2020. +[33] Yann LeCun. Lenet-5, convolutional neural networks. URL: http://yann.lecun.com/exdb/lenet, 2015. +[34] Yann LeCun, Léon Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324, 1998. +[35] Guang-He Lee, Wengong Jin, David Alvarez-Melis, and Tommi S Jaakkola. Functional transparency for structured data: a game-theoretic approach. arXiv preprint arXiv:1902.09737, 2019. +[36] Oscar Li, Hao Liu, Chaofan Chen, and Cynthia Rudin. Deep learning for case-based reasoning through prototypes: A neural network that explains its predictions. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018. +[37] Zachary C. Lipton. The mythos of model interpretability. Commun. ACM, 61(10):36-43, 2018. +[38] Scott M Lundberg and Su-In Lee. A unified approach to interpreting model predictions. In Advances in Neural Information Processing Systems, pages 4765-4774, 2017. +[39] Aravindh Mahendran and Andrea Vedaldi. Visualizing deep convolutional neural networks using natural pre-images. International Journal of Computer Vision, 120(3):233-255, 2016. +[40] Grégoire Montavon, Wojciech Samek, and Klaus-Robert Müller. Methods for interpreting and understanding deep neural networks. Digital Signal Processing, 73:1-15, 2018. +[41] Marco Tulio Ribeiro, Sameer Singh, and Carlos Guestrin. Why should i trust you?: Explaining the predictions of any classifier. In Proceedings of the 22nd ACM SIGKDD international conference on knowledge discovery and data mining, pages 1135-1144. ACM, 2016. +[42] Cynthia Rudin, Chaofan Chen, Zhi Chen, Haiyang Huang, Lesia Semenova, and Chudi Zhong. Interpretable machine learning: Fundamental principles and 10 grand challenges. CoRR, abs/2103.11251, 2021. +[43] Wojciech Samek, Grégoire Montavon, Andrea Vedaldi, Lars Kai Hansen, and Klaus-Robert Müller, editors. Explainable AI: Interpreting, Explaining and Visualizing Deep Learning, volume 11700 of Lecture Notes in Computer Science. Springer, 2019. +[44] Sascha Saralajew, Lars Holdijk, Maike Rees, Ebubekir Asan, and Thomas Villmann. Classification-by-components: Probabilistic modeling of reasoning over a set of components. In Advances in Neural Information Processing Systems (NeurIPS), pages 2788-2799, 2019. + +[45] Ramprasaath R Selvaraju, Michael Cogswell, Abhishek Das, Ramakrishna Vedantam, Devi Parikh, and Dhruv Batra. Grad-cam: Visual explanations from deep networks via gradient-based localization. In Proceedings of the IEEE International Conference on Computer Vision, pages 618-626, 2017. +[46] Karen Simonyan, Andrea Vedaldi, and Andrew Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps. arXiv preprint arXiv:1312.6034, 2013. +[47] Daniel Smilkov, Nikhil Thorat, Been Kim, Fernanda Viégas, and Martin Wattenberg. Smoothgrad: removing noise by adding noise. arXiv preprint arXiv:1706.03825, 2017. +[48] Gregor Stiglic, Primoz Kocbek, Nino Fijacko, Marinka Zitnik, Katrien Verbert, and Leona Cilar. Interpretability of machine learning-based prediction models in healthcare. Wiley Interdiscip. Rev. Data Min. Knowl. Discov., 10(5), 2020. +[49] Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The caltech-ucsd birds-200-2011 dataset. 2011. +[50] Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747, 2017. +[51] Chih-Kuan Yeh, Been Kim, Sercan O Arik, Chun-Liang Li, Pradeep Ravikumar, and Tomas Pfister. On concept-based explanations in deep neural networks. arXiv preprint arXiv:1910.07969, 2019. +[52] Fan Yin, Zhouxing Shi, Cho-Jui Hsieh, and Kai-Wei Chang. On the faithfulness measurements for model interpretations. arXiv preprint arXiv:2104.08782, 2021. +[53] Jinsung Yoon, James Jordan, and Mihaela van der Schaar. Invasive: Instance-wise variable selection using neural networks. In International Conference on Learning Representations, 2018. +[54] Jason Yosinski, Jeff Clune, Anh Nguyen, Thomas Fuchs, and Hod Lipson. Understanding neural networks through deep visualization. arXiv preprint arXiv:1506.06579, 2015. +[55] 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, pages 8827-8836, 2018. \ No newline at end of file diff --git a/aframeworktolearnwithinterpretation/images.zip b/aframeworktolearnwithinterpretation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..5bc0f13bc5c68709c7cbb30c8e28f682b82739a5 --- /dev/null +++ b/aframeworktolearnwithinterpretation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d8a3149564b296749324a257c5b2605e41b83dd6ef5dd8e8e7a9b9bc560332c7 +size 281856 diff --git a/aframeworktolearnwithinterpretation/layout.json b/aframeworktolearnwithinterpretation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..2f4e84a4acc60d6ebb114988bafe57dcd1e82333 --- /dev/null +++ b/aframeworktolearnwithinterpretation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c0ec14b617a822c1a2e5111400db6415d1775f03e9fa2dd1257f6792df4434f +size 539337 diff --git a/agangofadversarialbandits/1604671f-84fb-49fd-b681-248846723ba2_content_list.json b/agangofadversarialbandits/1604671f-84fb-49fd-b681-248846723ba2_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..bd6a23e7b229c48b9c38844377994e967bce330a --- /dev/null +++ b/agangofadversarialbandits/1604671f-84fb-49fd-b681-248846723ba2_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cf55198b100f238fad35c2219043d5830566a371195638dbcb10d1197bd7dd96 +size 95564 diff --git a/agangofadversarialbandits/1604671f-84fb-49fd-b681-248846723ba2_model.json b/agangofadversarialbandits/1604671f-84fb-49fd-b681-248846723ba2_model.json new file mode 100644 index 0000000000000000000000000000000000000000..ee058f83c005bce580958816cb07b09d2053f536 --- /dev/null +++ b/agangofadversarialbandits/1604671f-84fb-49fd-b681-248846723ba2_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a7a1c1ea99bfe746161163b8afb3d308b5c9a159f7b4b1a38a87a32ce51237f +size 130832 diff --git a/agangofadversarialbandits/1604671f-84fb-49fd-b681-248846723ba2_origin.pdf b/agangofadversarialbandits/1604671f-84fb-49fd-b681-248846723ba2_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..009748475660fdc2d65ef3e3d87cfa6298106b7b --- /dev/null +++ b/agangofadversarialbandits/1604671f-84fb-49fd-b681-248846723ba2_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7523c409901894643ffb37e2bee37eb4d69cf4cc8c75cafb33eb004f2b321ce9 +size 444173 diff --git a/agangofadversarialbandits/full.md b/agangofadversarialbandits/full.md new file mode 100644 index 0000000000000000000000000000000000000000..d75988194c56ffac02d02f5a1d3af0fc8a7b6967 --- /dev/null +++ b/agangofadversarialbandits/full.md @@ -0,0 +1,457 @@ +# A Gang of Adversarial Bandits + +Mark Herbster*, Stephen Pasteris* + +Department of Computer Science + +University College London + +London WC1E 6BT + +{m.herbster,s.pasteris}@cs.ucl.ac.uk + +Fabio Vitale + +University of Lille + +59653 Villeneuve d'Ascq CEDEX + +France + +fabio.vitale2@univ-lille.fr + +Massimiliano Pontil + +CSML, Istituto Italiano di Tecnologia and + +Department of Computer Science + +University College London + +massimiliano.pontil@iit.it + +# Abstract + +We consider running multiple instances of multi-armed bandit (MAB) problems in parallel. A main motivation for this study is online recommendation systems, in which each of $N$ users is associated with a MAB problem and the goal is to exploit users' similarity in order to learn users' preferences to $K$ items more efficiently. We consider the adversarial MAB setting, whereby an adversary is free to choose which user and which loss to present to the learner during the learning process. Users are in a social network and the learner is aided by a-priori knowledge of the strengths of the social links between all pairs of users. It is assumed that if the social link between two users is strong then they tend to share the same action. The regret is measured relative to an arbitrary function which maps users to actions. The smoothness of the function is captured by a resistance-based dispersion measure $\Psi$ . We present two learning algorithms, GABA-I and GABA-II which exploit the network structure to bias towards functions of low $\Psi$ values. We show that GABA-I has an expected regret bound of $\mathcal{O}(\sqrt{\ln(NK / \Psi)\Psi KT})$ and per-trial time complexity of $\mathcal{O}(K\ln (N))$ , whilst GABA-II has a weaker $\mathcal{O}(\sqrt{\ln(N / \Psi)\ln(NK / \Psi)\Psi KT})$ regret, but a better $\mathcal{O}(\ln (K)\ln (N))$ per-trial time complexity. We highlight improvements of both algorithms over running independent standard MABs across users. + +# 1 Introduction + +During the last decade multi-armed bandits (MAB) have received a great deal of attention in machine learning and related fields, due to their wide practical and theoretical importance. The central problem is to design a decision strategy whereby a learner explores sequentially the environment in order to find the best item (arm) within a prescribed set. At each step in the exploration the learner chooses an arm, after which feedback (typically a loss or reward corresponding to the selected arm) is observed from the environment. Then the next decision is made by the learner based on past interactions, and the process repeats. The goal is to design efficient exploration strategies which incur a small cumulative loss in comparison to the cumulative loss that would have been obtained by always + +selecting the best arm in hindsight. Applications of MAB are numerous, including recommender systems [1], clinical trials [2], and adaptive routing [3], among others. + +In this paper we study the problem in which the learner is facing several MAB problems that are related according to a prescribed interaction graph. A main motivation behind this problem is online recommendation systems, whereby each of several users is associated with a MAB problem (task), where the arms correspond to a finite set of products, and the graph represents a social network among users. The goal is to exploit users' similarity in order to improve the efficiency of learning users' preferences via online exploration of products. In the standard full information setting, a lot of work has been done showing that techniques from multitask learning are effective in reducing the amount of data needed to learn each of the individual tasks, both in the statistical and adversarial settings, see [4, 5, 6, 7, 8, 9, 10, 11] and references therein. Graphs have been used to model task relationships, with different tasks' parameters encouraged to be close according to the graph topology. In contrast, multitask learning in the bandit setting is much less explored. + +The algorithms that we present exploit the network homophily principle [12] which formulates that users that are connected in the network have similar preferences, that is, they tend to share preferred recommendations. We will show that our algorithms exploit graph structure and enjoy potentially much smaller regret bounds than the cumulative regret of standard MAB run independently on each user. Since the original graph may be dense, we exploit a randomized sparsification technique to develop fast prediction algorithms. Our approach builds upon previous work on online learning over graphs [13, 14] to generate a perfect full oriented binary tree, whose leaves are in one-to-one correspondence with the nodes of the original graph. This construction approximately preserves the relevant graph properties in expectation, and provides the starting point for designing our efficient algorithms. A further ingredient in our algorithm is provided by the method of specialists [15, 16]. Our learning strategies combine the above ingredients to devise efficient online algorithms under partial feedback. + +Contributions. We introduce two Gang of Adversarial BAndit algorithms, GABA-I and GABA-II that learn jointly MAB models for $N$ users over $K$ possible actions. Both algorithms are designed to exploit network structure while being (extremely) computationally efficient. We derive expected (over the algorithms' randomizations) regret bounds. The bounds scale with the dispersion measure $\Psi \in [1,N]$ of the best actions over the graph. For GABA-I the bound is of order of $\mathcal{O}(\sqrt{\ln(NK / \Psi)\Psi KT})$ , where $T$ is the number of trials, and has a per-trial time complexity of $\mathcal{O}(K\ln (N))$ . On the other hand GABA-II has a weaker expected regret bound of $\mathcal{O}(\sqrt{\ln(N / \Psi)}\ln (NK / \Psi)\Psi KT)$ but is faster, having a per-trial time complexity of $\mathcal{O}(\ln (K)\ln (N))$ . Thus the GABA-I algorithm improves on algorithms that treat each user independently, as in the best case the regret improves from $\mathcal{O}(\sqrt{N})$ to $\mathcal{O}(\sqrt{\ln N})$ and in the worst case the regret degrades by at most a constant factor. GABA-II has slightly weaker regret bounds; however, it is more computationally efficient. + +Outline of Main Results. The social network graph $\mathcal{G}$ is determined by a set of undirected links between users $\{\omega_{u,v}\}_{u < v}^{N}$ where $\omega_{u,v} \in [0,\infty)$ indicates the magnitude of the link between user $u$ and $v$ . For all $t \in [T]$ we have a user $u_t \in [N]$ and a loss vector $\ell_t \in [0,1]^K$ which are selected by Nature before learning begins and are unknown to Learner; i.e., Nature is a deterministic oblivious adversary (see e.g., [17, Section 5.1]). Learning then proceeds in trials $t = 1,2,\dots,T$ . On trial $t$ : + +1. Nature reveals user $u_{t} \in [N]$ to Learner, +2. Learner selects action $a_{t} \in [K]$ , +3. Nature reveals loss $\ell_{t,a_t} \in [0,1]$ to Learner. + +Before reflecting on the $N$ -user case we review the well-known results for the single user $(N = 1)$ . The seminal EXP3 algorithm [18] obtains the following (uniform) regret bound2, + +$$ +\mathbb {E} \left[ \sum_ {t \in [ T ]} \ell_ {t, a _ {t}} \right] - \min _ {a \in [ K ]} \sum_ {t \in [ T ]} \ell_ {t, a} \in \mathcal {O} \left(\sqrt {K \ln (K) T}\right), \tag {1} +$$ + +where the expectation is with respect to the internal randomization of the EXP3 algorithm. In the $N$ -user setting, by running a copy of EXP3 independently for each user, we may obtain a uniform regret bound of (see e.g., [20]) + +$$ +\mathbb {E} \left[ \sum_ {t \in [ T ]} \ell_ {t, a _ {t}} \right] - \min _ {y: [ N ] \rightarrow [ K ]} \sum_ {t \in [ T ]} \ell_ {t, y \left(u _ {t}\right)} \in \mathcal {O} \left(\sqrt {K \ln (K) N T}\right), \tag {2} +$$ + +i.e., for each user $u$ the best action is $y(u)$ and we now pay an additional constant factor of $\sqrt{N}$ in our regret. In this work we exploit the social network structure to prove a non-uniform regret bound for the GABA-I algorithm (see Corollary 4) of + +$$ +R (y) := \mathbb {E} \left[ \sum_ {t \in [ T ]} \ell_ {t, a _ {t}} \right] - \sum_ {t \in [ T ]} \ell_ {t, y \left(u _ {t}\right)} \in \mathcal {O} \left(\sqrt {K \ln \left(\frac {K N}{\Psi (y)}\right) \Psi (y) T}\right), \tag {3} +$$ + +for any mapping of users to actions $y: [N] \to [K]$ . The non-uniform regret now depends on $\Psi(y) \in [1, N]$ (see (5)) which measures dispersion of users' 'best' actions across the network. Thus, by taking network structure into account, we may upper bound the scaling in the regret with respect to the number of users by $\mathcal{O}(\sqrt{\ln(\frac{eN}{\Psi(y)})\Psi(y)})$ . When the best action across the network is nearly uniform then the dispersion $\Psi(y) \in \mathcal{O}(1)$ , in contrast when the dispersion is maximal then $\Psi(y) = N$ thus in the best case the regret with respect to the number of users improves from $\mathcal{O}(\sqrt{N})$ to $\mathcal{O}(\sqrt{\ln N})$ and in the worst case the regret only increases by a constant factor. The first algorithm GABA-I obtains the regret (3) while requiring $\mathcal{O}(K \ln N)$ time to predict and update. The second algorithm GABA-II's regret (see Corollary 5) is larger by a $\mathcal{O}(\sqrt{\ln N / \Psi(y)})$ factor but now prediction is at an even faster $\mathcal{O}(\ln(K) \ln(N))$ time per trial, that is, prediction time improves exponentially with respect to the cardinality of the action set $[K]$ . Thus both algorithms support very large user networks and the second algorithm allows efficient prediction with very large action sets. + +Related Work. We mention here some of the key papers that are more closely related to ours and refer the reader to the technical appendices for an expanded literature review. There has been much work in the heterogenous multi-user setting for linear-stochastic bandits. Out of these works, those closest to us are when the users are in a known social network and it is assumed that neighbouring users respond to context vectors in a similar way [21, 22, 23, 24, 25, 26] but as far as we are aware no works on this model have so far been done in the adversarial setting. Other works on this topic include those in which it is assumed that there is an unknown clustering of the users, where users in the same cluster are homogenous [27, 28, 29, 30, 31, 32, 33, 34, 35]; as well as other models [36, 37, 38, 39, 40, 41, 42, 43]. There are also works on networked, homogenous multi-user bandit models with limited communication between users [44, 45, 46, 47, 48, 49, 50]. Related to the multi-user setting are works on transfer learning and meta-learning with linear-stochastic bandits [51, 52]. Whilst our work assumes a known network structure over the users, there is a wide literature on bandit problems in which the actions are structured in a network and it is assumed that neighbouring actions give similar losses [53, 54, 55, 56, 57, 58, 59, 60], as well as other networked-action models [61, 62, 63]. In addition to the seminal paper on adversarial bandits [18], our work utilises ideas from several different papers [13, 14, 15, 16, 64, 65]. + +Notation. Given a set $X$ we define $2^{X}$ to be its power-set, that is: the set of all subsets of $X$ . For any positive integer $m$ , we define $[m] := \{1, 2, \ldots, m\}$ . For any predicate $\mathrm{PRED}$ , $\mathbb{[PRED]} := 1$ if $\mathrm{PRED}$ is true and equals 0 otherwise. Given vectors $\pmb{x}, \pmb{x}' \in \mathbb{R}^K$ we define $\pmb{x} \cdot \pmb{x}'$ to be their inner product (i.e., equal to $\sum_{i \in [K]} x_i x_{i'}$ ) and we define $\pmb{x} \odot \pmb{x}'$ to be their component-wise product (i.e., $(x \odot x')_i := x_i x_i'$ for all $i \in [K]$ ). We define '1' to be the $K$ -dimensional vector in which each component is equal to 1. Given a full oriented binary tree $\mathcal{B}$ we denote the set of its vertices also by $\mathcal{B}$ . Given a non-leaf vertex $n \in \mathcal{B}$ let $\triangleleft(n)$ and $\triangleright(n)$ be its left child and right child respectively. Given a non-root vertex $n \in \mathcal{B}$ let $\uparrow(n)$ be its parent. Given a vertex $n \in \mathcal{B}$ let $\uparrow(n)$ and $\Downarrow(n)$ be its set of ancestors and leaf-descendants (i.e. descendants which are leaves) respectively. Given a vertex $n \in \mathcal{B}$ we define $\triangleleft(n)$ and $\triangleright(n)$ as the left-most and right-most descendants (which are leaves) of $n$ respectively. Finally, we denote the user graph by $\mathcal{G}$ , which is an undirected connected graph with edge weights $\{\omega_{u,v} : 1 \leq u < v \leq N\}$ . For convenience we assume $N$ is a power of two. + +# 2 Modeling a Social Network as a Resistive Network + +In this section we introduce the tools necessary to formalize our complexity measures, as well as the ones to implement our algorithms. + +# 2.1 Conceptual Tools + +To minimize the incurred loss, Learner can exploit the similarity between any pair of users defined by the weights $\omega_{u,v}$ of user graph edges for all $u, v \in [N]$ . The function $y: [N] \to [K]$ is completely unknown to Learner, and can be viewed as labeling each user with its best/favorite action. Within this context, our homophilic bias can be stated as follows: users strongly connected w.r.t. the link weights $\omega$ , tend to be associated with the same label. + +The complexity measure used for this problem is the robustified resistance weighted cutsize $\Psi(y)$ , which we now define formally. Within the graph-based learning context, the cutsize is defined as the number of edges connecting users with different labels, i.e., $\sum_{u < v} [\omega_{u,v} \neq 0] [y(u) \neq y(v)]$ , and the weighted cutsize is defined as the sum of the edge weights $\omega_{u,v}$ over all pairs of users $u$ and $v$ having different labels, i.e., $\sum_{u < v} \omega_{u,v} [y(u) \neq y(v)]$ [14]. The effective resistance between two given nodes $u$ and $v$ of a graph is a commonly used measure that expresses the degree of the connection strength between $u$ and $v$ (see, e.g., [66]). More precisely, viewing the graph as an electrical circuit, where each edge weight $\omega_{u,v}$ corresponds to a $\frac{1}{\omega_{u,v}}$ resistor, the effective resistance between $u$ and $v$ is the power required to hold between them a unit voltage difference for a unit time. Informally, the more there are paths between two nodes $u$ and $v$ that are short, edge-disjoint and formed by edges with large weights, the lower is $r(u,v)$ because the amount of flow between the two considered nodes is larger. A formal definition of effective resistance $r(u,v)$ between users $u$ and $v$ is + +$$ +r (u, v) := \frac {1}{\min _ {\boldsymbol {x} \in \mathbb {R} ^ {N}} \{\sum_ {i < j} ^ {N} \omega_ {i , j} (x _ {i} - x _ {j}) ^ {2} : x _ {u} - x _ {v} = 1 \}}. +$$ + +Interestingly enough, for all $u, v \in [N]$ , $r(u, v)$ is exactly equal to the probability that the edge $\{u, v\}$ is included in a uniformly generated random spanning tree of the given user graph $\mathcal{G}$ (see, e.g., [66]). + +The resistance weighted cutsize $\Phi(y)$ [67] is the weighted sum of the effective resistances $r(u, v)$ between any two nodes $u$ and $v$ with different labels. i.e., + +$$ +\Phi (y) := \sum_ {u < v} ^ {N} \omega_ {u, v} r (u, v) [ [ y (u) \neq y (v) ] ] \tag {4} +$$ + +and then its robustification is defined as + +$$ +\Psi (y) := 1 + \min _ {z: [ N ] \rightarrow [ K ]} \left(\Phi (z) + \sum_ {u \in [ N ]} \llbracket z (u) \neq y (u) \rrbracket\right). \tag {5} +$$ + +The first quantity (4) can be viewed as a dispersion measure based on the above mentioned homophilic tendency. It has several advantages compared to the weighted cutsize in measuring the degree of homophily violation [67]. The most significant property is that it is locally density-dependent because the contribution to $\Phi(y)$ of each edge $(u, v)$ such that $y(u) \neq y(v)$ is inversely proportional to how strongly $u$ and $v$ are connected in their user graph local area. Indeed, because of the effective resistance, the potential contribution to $\Phi(y)$ of the edges in dense areas is smaller than the ones of the edges in sparse areas. In fact if the graph is well-clustered i.e., it can be partitioned into dense clusters (many intra-cluster edges) and fewer inter-cluster edges and the labeling $y$ respects these clusters then in many cases $\Phi(y) \ll N$ . As an archetypical instance consider the following proposition where the clusters are represented by cliques. + +Proposition 1. Consider an unweighted graph $\mathcal{G}$ partitioned into $G$ clusters and a labeling function $y(\cdot)$ , where each cluster is an $n$ -clique and, if $u, v$ are vertices in the cluster, then $y(u) = y(v)$ . For any pair of such clusters $C, C' \subset \mathcal{G}$ , suppose that there are $\frac{n-1}{G}$ edges connecting the nodes of $C$ with the nodes of $C'$ . Then we have $\Phi(y) \in \mathcal{O}(G)$ . + +# CONSTRUCTBST-C (User graph: $\mathcal{G}$ ) + +1. Sample a uniform random spanning tree $\mathcal{T}$ from the user graph. +2. Perform a depth-first visit of $\mathcal{T}$ to provide an order of the users. Without loss of generality assume that, for all $u\in [N]$ , we have that user $u$ is the $u$ -th vertex visited. +3. Construct a perfect full oriented binary tree $\mathcal{C}$ of depth $h := \log_2(N)$ whose $u$ -th leftmost leaf of its graphical representation is user $u$ .a + +Figure 1: Binary Support Tree Construction Algorithm + +Thus in this archetypal case our regret bounds now scale strongly with the number of clusters of users $G$ (see (3)) rather than with the number of users $N$ (comparing to the baseline (2)). + +The second quantity (5) is an extension of $\Phi(y)$ to deal with adversarial label perturbation, viz., capturing the regularity of all labelings $y$ such that $\Phi(y)$ can be dramatically reduced by simply changing the labels of a relatively small number of users. To give an insight into the advantages of $\Psi(y)$ w.r.t. $\Phi(y)$ regarding its noise-tolerance property, consider an input star graph with all edge weights equal to 1 and where all vertex labels are equal except for the one of the central node $u$ . It is natural to consider this labeling regular w.r.t. our bias, because it is sufficient to change only $y(u)$ to obtain a cutsize equal to 0. This is precisely the labeling property that is captured by $\Psi(y)$ , which is equal to the minimum, over all labelings $z$ , of the sum of $\Phi(z)$ and the number of vertices for which $y$ and $z$ differ (plus 1). In this case we have therefore $\Psi(y) = 1 + \Phi(y^{*}) + 1 = 2$ , where $y^{*}$ is the labeling obtained by changing $y(u)$ to make it equal to all other labels, so that $\Phi(y^{*}) = 0$ , whereas $\Phi(y) = N - 1$ . + +# 2.2 An Embedding to Enable Fast Computation + +A uniformly generated random spanning tree (RST) is defined as a spanning tree selected with a probability proportional to the product of the weights of all its edges (see, e.g., [66]). It represents a fundamental tool in several mathematical fields, e.g., combinatorial geometry, algebraic graph theory, stationary Markov chains [68], and can be viewed as a way to summarize the topological information of the input network. When the input graph is weighted as in our case, it can be generated in time almost linear in the number of edges [69, 70]. + +In a preliminary phase, our algorithms operate as follows (see Fig. 1). A RST $\mathcal{T}$ of the input social network is drawn (step 1). Thus, an order of the $N$ users is determined through a depth-first visit of $\mathcal{T}$ (step 2). From here on we assume, without loss of generality, that user $u\in [N]$ is the $u$ -th vertex visited. This step is necessary to make the algorithms noise-tolerant, and is strictly related to the improvement of the complexity measure $\Psi (y)$ over $\Phi (y)$ . Finally, a full perfect binary tree, called the Binary Support Tree (BST), and having the users, ordered from left to right, as leaves (step 3) is constructed. The BST forms the geometry that underlies the data-structures of our algorithms. + +We conclude this section by showing a result which will be useful in the analysis of our algorithms, and stems directly only from the user order determined by the depth-first visit of $\mathcal{T}$ . If we consider the line graph $\mathcal{L}$ connecting the users $u$ with $u + 1$ for all $u \in [N - 1]$ , we have that, as stated in the following theorem, the cutsize of $\mathcal{L}$ is at most twice the robustified resistance weighted cutsize of the input user graph. This result can be viewed as the multi-class extension of part 2 of Theorem 6 in [67]. + +Lemma 2 ([67, Theorem 6]). For any given input user graph, we have + +$$ +\mathbb {E} \left[ \sum_ {u \in [ N - 1 ]} \llbracket y (u) \neq y (u + 1) \rrbracket \right] \leq 2 \Psi (y), +$$ + +where the expectation is over the draw of the uniform random spanning tree $\mathcal{T}$ . + +SPECIALISTEXP (Learning rate $\eta > 0$ ; Distribution $w_1: \mathbb{S} \to [0,1]$ s.t. $\sum_{s \in \mathbb{S}} w_1(s) = 1$ .) + +For $t = 1,\dots ,T$ do + +1. $\forall a\in [K],\quad p_{t,a}\gets \sum_{s\in \mathbb{S}:s(u_t) = a}w_t(s);$ +2. Predict $a_{t}$ by drawing from $[K]$ with probability $\mathbb{P}[a_t = a] \coloneqq p_{t,a} / \| \pmb{p}_t\| _1$ ; +3. Receive $\ell_{t,a_t}$ +4. $\lambda_{t}\gets \exp (-\eta \ell_{t,a_{t}}\| \pmb{p}_{t}\|_{1} / p_{t,a_{t}})$ . $z_{t}\gets \| \pmb{p}_{t}\|_{1} / (\| \pmb{p}_{t}\|_{1} - (1 - \lambda_{t})p_{t,a_{t}});$ +5. $\forall s\in \mathbb{S}$ $w_{t + 1}(s)\gets \left\{ \begin{array}{ll}w_t(s) & s(u_t) = \square \\ w_t(s)z_t & s(u_t)\neq a_t\\ w_t(s)z_t\lambda_t & s(u_t) = a_t \end{array} \right.$ + +Figure 2: SPECIALISTEXP Algorithm + +# 3 Predicting with Specialists + +We build on the prediction with expert advice framework [71, 72, 73, 74], specifically that with bandit feedback: pioneered by the Exp4 algorithm [18]. This type of online algorithm maintains a distribution over a set of predictors ("experts"). After the predictors predict they incur a loss and the distribution is updated accordingly. Although, except in special cases, this procedure does not have a natural Bayesian interpretation, probabilistic methods still may be transferred into the expert advice framework. In particular we will exploit an analogue of message-passing as used in graphical models [75] to predict very efficiently over exponentially-sized sets of predictors. Broadly speaking we would like build a graphical model that is isomorphic to the user graph $\mathcal{G}$ . However it is well-known that exact prediction with graphical models that contain cycles is NP-hard [76]. Thus a benefit of the embedding to a BST (see Section 2.2) is that it enables fast and exact computation as the graph is now cycle-free and Lemma 2 ensures that the embedding only modestly increases our regret bounds. Surprisingly, we improve in terms of computation over standard message passing techniques, i.e., if we embedded to a "line" graph we would require $\mathcal{O}(KN)$ time to predict [75] per trial or using the method of [77] $\mathcal{O}(K^3\log N)$ time. However, we will require only $\mathcal{O}(K\log N)$ and $\mathcal{O}(\log K\log N)$ for the GABA-I and GABA-II algorithms respectively (see Figures 3 and 4). To accomplish this technically we adapt the method of specialists [15, 16]. + +A specialist is a prediction function $s: [N] \to \{1, 2, \dots, K, \square\}$ from a context space to an extended output space with abstentions. For us the context space is just the set of users $[N]$ ; and the extended output space is $\{1, 2, \dots, K, \square\}$ where $[K]$ corresponds to predicted actions, but '□' indicates that the specialist abstains from predicting an action. Thus a specialist specializes its prediction to part of the context space. We denote the set of all specialists as $\mathbb{S} := \{1, \dots, K, \square\}^{[N]}$ . As a single specialist only predicts over part of the context space, we need a set of specialists $S \subseteq \mathbb{S}$ if we wish to define a function that predicts an action for every context. A specialist set $S \subseteq \mathbb{S}$ is well-formed if for each $u \in [N]$ there exists a unique specialist $s \in S$ such that $s(u) \in [K]$ . For such a user $u$ and specialist $s$ we then define $S^{\dagger}(u) := s(u)$ so that $S^{\dagger}$ is a function from $[N]$ into $[K]$ . Finally a specialist model is defined by giving a distribution $w_{1}: \mathbb{S} \to [0,1]$ s.t. $\sum_{s \in \mathbb{S}} w_{1}(s) = 1$ . To predict with specialists we adapt [15] to the EXP3/4 [18] setting giving the SPECIALISTEXP algorithm (see Figure 2). We then bound the regret by combining the analysis of [15, 18] into the following theorem. + +Theorem 3. The expected regret of SPECIALISTEXP with initial specialist distribution $w_{1}:\mathbb{S}\rightarrow [0,1]$ and learning rate $\eta >0$ is bounded above by + +$$ +\mathbb {E} \left[ \sum_ {t \in [ T ]} \ell_ {t, a _ {t}} - \ell_ {t, S ^ {\dagger} (u _ {t})} \right] \leq \frac {1}{\eta} \sum_ {s \in \mathcal {S}} \ln \left(\frac {1}{w _ {1} (s) | \mathcal {S} |}\right) + \frac {\eta K T}{2} \tag {6} +$$ + +for all well-formed specialist sets $\mathcal{S} \subseteq \mathbb{S}$ . + +In the following we give the two distributions that define the two specialist models corresponding to GABA-I and GABA-II in (7) and (9), and in the supplementary material we detail how these distributions lead to the regret bounds in Corollaries 4 and 5. + +We now give the distribution $w_{1}(\cdot)$ over $\mathbb{S}$ that defines the GABA-I model. The model has a single parameter $\phi \in (0, 1)$ and we give the following helper functions to define the distribution, + +$$ +\operatorname {v a l i d} 1 (s) := \llbracket \forall u, v \in [ N ]: s (u) = s (v) \text {o r} s (u) = \square \text {o r} s (v) = \square \rrbracket +$$ + +$$ +\operatorname {c u t} (s) := \sum_ {u \in [ N - 1 ]} \llbracket s (u) \neq s (u + 1) \rrbracket +$$ + +$$ +\operatorname {s t a r t f a c t o r} (s) := \frac {K - 1}{K} [ [ s (1) \neq \square ] ] + \frac {1}{K} [ [ s (1) = \square ] ]. +$$ + +The function $\text{valid1}(\cdot)$ determines the support of $w_{1}(\cdot)$ which are the specialists that predict a unique action or abstain, hence the cardinality of the support of $w_{1}(\cdot)$ is $K \times (2^{N} - 1) + 1$ . The remaining two functions quantitatively determine probability mass of a specialist as: + +$$ +w _ {1} (s) := \operatorname {v a l i d} 1 (s) \times \frac {1}{K} \times \operatorname {s t a r t f a c t o r} (s) \times (1 - \phi) ^ {N - 1 - \operatorname {c u t} (s)} \phi^ {\operatorname {c u t} (s)} \quad (\forall s \in \mathbb {S}). \tag {7} +$$ + +We note that this specialist selection is similar to that of the Markov circadian specialists in [16] except that the nodes of the Markov chain are now users instead of trials. + +Corollary 4. The expected regret of SPECIALISTEXP with distribution $w_{1}(\cdot)$ as defined by (7) with parameter $\phi = 4\Psi(y)/(K(N-1))$ , learning rate $\eta = \sqrt{\frac{10\Psi(y)\ln(KN / \Psi(y))}{KT}}$ and with $\Psi(y) \leq (N-1)/4$ is bounded above by: + +$$ +\mathbb {E} \left[ \sum_ {t \in [ T ]} \ell_ {t, a _ {t}} - \ell_ {t, y \left(u _ {t}\right)} \right] \in \mathcal {O} \left(\sqrt {K \ln \left(\frac {K N}{\Psi (y)}\right) \Psi (y) T}\right) \tag {8} +$$ + +for any mapping of users to actions $y:[N]\to [K]$ + +We now give the distribution $w_{1}(\cdot)$ over $\mathbb{S}$ that defines the GABA-II model. Whereas for GABA-I the cardinality of the support was exponential in $N$ , for GABA-II the cardinality is just $K(2N - 1)$ . The supported specialists in GABA-II predict a unique action over a contiguous $l, \dots, r$ and abstain everywhere else, thus they are of the form: + +$$ +s _ {a} ^ {l, r} (u) := \left\{ \begin{array}{l l} a & u \in \{l, \ldots , r \} \\ \square & u \not \in \{l, \ldots , r \} \end{array} \right., +$$ + +but not all contiguous segments are supported. The segments supported are those that correspond to the set of all leaf-descendants of a node in the BST (see Section 2.2). As an example if $N = 4$ the supported $(l, r)$ segments are $\{(1, 1), (2, 2), (3, 3), (4, 4), (1, 2), (3, 4), (1, 4)\}$ . Expressing this algebraically leads to a relatively complex "validity" function + +[ \text{valid2}(s) := \llbracket \exists a \in [K]; l, r \in [N]; i, j \in [\log_2 N] : 1 + r - l = 2^i \text{ and } l = 2^i (j - 1) + 1 \text{ and } s = s_a^{l,r} \rrbracket, ] and then the distribution is defined as, + +$$ +w _ {1} (s) := \operatorname {v a l i d} 2 (s) \times \frac {1}{K (2 N - 1)} \quad (\forall s \in \mathbb {S}). \tag {9} +$$ + +We note that this selection of specialists is a simple multi-action extension of those defined in [65]. + +Corollary 5. The expected regret of SPECIALISTEXP with distribution $w_{1}(\cdot)$ as defined by (9) with learning rate $\eta = \sqrt{\frac{8\Psi(y)\log_{2}(eN / \Psi(y))\ln(3KN / 2\Psi(y))}{KT}}$ and with $\Psi (y)\leq N / 2$ is bounded above by: + +$$ +\mathbb {E} \left[ \sum_ {t \in [ T ]} \ell_ {t, a _ {t}} - \ell_ {t, y \left(u _ {t}\right)} \right] \in \mathcal {O} \left(\sqrt {K \ln \left(\frac {N}{\Psi (y)}\right) \ln \left(\frac {K N}{\Psi (y)}\right) \Psi (y) T}\right) \tag {10} +$$ + +for any mapping of users to actions $y:[N]\to [K]$ + +# 4 The GABA Algorithms + +We now introduce the GABA algorithms. Both algorithms are based on the BST $\mathcal{C}$ (see Section 2.2). + +# 4.1 GABA-I + +Since we have an exponential number of non-zero weight specialists in GABA-I a direct implementation of SPECIALISTEXP would take per-trial time and space exponential in $N$ . We now describe how GABA-I implements SPECIALISTEXP, bringing the per-trial time down to $\mathcal{O}(K\ln (N))$ and the space down to $\mathcal{O}(KN)$ . The implementation works by, for each action independently, performing online belief propagation [64] over the tree $\mathcal{C}$ . We note that each of these $K$ online belief propagations is over two states $\{0,1\}$ and hence takes a per-trial time of only $\mathcal{O}(\ln (N))$ . We now detail this procedure: + +GABA-I maintains a vector valued function $\alpha_{t}:\mathcal{C}\times \{0,1\} \times \{0,1\} \to \mathbb{R}^{K}$ which, for all $i,j\in \{0,1\}$ and $t\in [T]$ , has the following properties: + +$$ +\forall u \in [ N ] \backslash \left\{u _ {t} \right\}, \quad \alpha_ {t + 1} (u, i, j) = \alpha_ {t} (u, i, j) \tag {11} +$$ + +and for all internal vertices $n$ of $\mathcal{C}$ we have: + +$$ +\boldsymbol {\alpha} _ {t} (n, i, j) = \sum_ {k \in \{0, 1 \}} \boldsymbol {\alpha} _ {t} (\triangleleft (n), i, k) \odot \boldsymbol {\alpha} _ {t} (\triangleright (n), k, j) \tag {12} +$$ + +On trial $t$ GABA-I computes $\pmb{p}_t$ by sending vector valued messages down the path in $\mathcal{C}$ from the root to $u_{t}$ . Specifically, we construct the left and right message functions $\beta_t^{\Leftarrow},\beta_t^{\Rightarrow}:\uparrow (u_t)\times \{0,1\} \to \mathbb{R}^K$ as follows. Each (non-root, proper) ancestor $n$ of $u_{t}$ receives, for $i\in \{0,1\}$ , $K$ dimensional vector messages $\beta_t^{\Leftarrow}(\uparrow (n),i)$ and $\beta_t^{\Rightarrow}(\uparrow (n),i)$ from its parent and then constructs its own messages $\beta_t^{\leftarrow}(n,i)$ from $\beta_t^{\leftarrow}(\uparrow (n),j)$ and $\alpha_{t}(\triangleleft (\uparrow (n)),j,i)$ and messages $\beta_t^{\Rightarrow}(n,i)$ from $\beta_t^{\Rightarrow}(\uparrow (n),j)$ and $\alpha_{t}(\triangleright (\uparrow (n)),i,j)$ , for all $i,j\in \{0,1\}$ . It then sends these messages to its child that is next on the path to $u_{t}$ . Once $u_{t}$ has received the messages from its parent it combines them with $\alpha_{t}(u_{t},1,i)$ (for $i\in \{0,1\}$ ) to create $\pmb{p}_t$ . + +On the receipt of $\ell_{t,a_t}$ we update the function $\alpha_{t}$ to $\alpha_{t + 1}$ noting that by (11) and (12) we need only modify the values $\alpha_{t}(n,i,j)$ when $n$ is an ancestor of $u_{t}$ . + +# 4.2 GABA-II + +For GABA-II we have $\mathcal{O}(K\ln (N))$ non-zero weight specialists that don't abstain on any given trial so a direct implementation of SPECIALISTEXP would take a per-trial time of $\mathcal{O}(K\ln (N))$ . We now show how GABA-II implements SPECIALISTEXP, which takes the per-trial time down to $\mathcal{O}(\ln (K)\ln (N))$ whilst maintaining the space complexity of $\mathcal{O}(KN)$ . + +We first note that SPECIALISTEXP maintains a weight for each specialist. For any vertex $n$ of $\mathcal{C}$ and any action $a$ , the weight, on trial $t$ , of the specialist that predicts $a$ whenever $u_{t}$ is its descendant and abstains otherwise, is kept, by GABA-II in the following factored form: + +$$ +\frac {\mu_ {t} (n) \theta_ {t} (n , a)}{K (2 N - 1)} \tag {13} +$$ + +where $\mu_{t + 1}(n)\coloneqq \mu_t(n)$ whenever $n\notin \upharpoonright (u_t)$ , and $\theta_{t + 1}(n,a)\coloneqq \theta_t(n,a)$ whenever $n\notin \upharpoonright (u_t)$ or $a\neq a_{t}$ . + +In addition to the tree $\mathcal{C}$ , GABA-II also works with an oriented full binary tree $\mathcal{B}$ whose leaves are the actions (in this overview we assume that the cardinality of the action set is an integer power of two, although this is not required by GABA-II). For any vertex $n$ of $\mathcal{C}$ the function $\theta_t(n,\cdot)$ is extended onto all internal vertices of $\mathcal{B}$ by the following inductive relationship: + +$$ +\theta_ {t} (n, m) := \theta_ {t} (n, \triangleleft (m)) + \theta_ {t} (n, \triangleright (m)) \tag {14} +$$ + +To sample the action $a_{t}$ GABA-II first samples an ancestor $\delta_t$ of $u_{t}$ with probability $\mathbb{P}\left[\delta_t = n\right] \propto \mu_t(n)\theta_t(n,r)$ where $r$ is the root of $\mathcal{B}$ . GABA-II then uses the function $\hat{\theta}_t(\delta_t,\cdot)$ to sample action $a_{t}$ with probability $\mathbb{P}[a_t = a\mid \delta_t = n] = \theta_t(n,a) / \theta_t(n,r)$ in $\mathcal{O}(\ln (K))$ time. The law of total probability and (13) can then be used to show that $\mathbb{P}[a_t = a] \propto p_{t,a}$ where $p_{t,a}$ is as defined in SPECIALISTEXP. + +On the receipt of $\ell_{t,a_t}$ we update the functions $\mu_t$ and $\theta_t$ to $\mu_{t+1}$ and $\theta_{t+1}$ noting that by the equalities between these functions and (14) we need only modify the values $\mu_t(n)$ and $\theta_t(n,m)$ when $n$ is an ancestor of $u_t$ and $m$ is an ancestor of $a_t$ . + +GABA-I (Learning rate: $\eta > 0$ ; Model parameter: $\phi \in (0,1)$ ) + +0. Construct binary support tree $\mathcal{C}$ via CONSTRUCTBST- $\mathcal{C}$ algorithm (see Figure 1). + +1. $\forall$ leaf $n\in \mathcal{C},\forall i,j\in \{0,1\}$ , $\pmb{\alpha}_{1}(n,i,j)\gets [[i\neq j]]\phi \mathbf{1} + [[i = j]](1 - \phi)\mathbf{1};$ +2. For $d = 1,2,\ldots ,h - 1,\forall n\in \mathcal{C}$ at depth $h - d,\forall i,j\in \{0,1\}$ , do + +$$ +\alpha_ {1} (n, i, j) \leftarrow \sum_ {k \in \{0, 1 \}} \alpha_ {1} (\triangleleft (n), i, k) \odot \alpha_ {1} (\triangleright (n), k, j); +$$ + +For $t = 1,2\dots T$ ,do + +3. $\forall d\in [h]\cup \{0\}$ $\nu_{t,d}\gets$ ancestor of $u_{t}$ at depth $d$ in $\mathcal{C}$ +4. $\forall i\in \{0,1\}$ $\beta_{t}^{\leftarrow}(\nu_{t,0},i)\gets (1 + [[i = 0]](K - 2))\mathbf{1} / K;\forall i\in \{0,1\}$ $\beta_t^\Rightarrow (\nu_{t,0},i)\gets \mathbf{1};$ + +5. For $d = 1,2,\dots,h$ , do + +(a) if $\nu_{t,d} = \triangleleft (\nu_{t,d - 1})$ then $\forall i\in \{0,1\}$ + +$$ +\begin{array}{l} i. \beta_ {t} ^ {\leftarrow} \left(\nu_ {t, d}, i\right) \leftarrow \beta_ {t} ^ {\leftarrow} \left(\nu_ {t, d - 1}, i\right); \\ \quad \text {i i .} \quad \boldsymbol {\beta} _ {t} ^ {\Rightarrow} (\nu_ {t, d}, i) \leftarrow \sum_ {j \in \{0, 1 \}} \boldsymbol {\alpha} _ {t} (\triangleright (\nu_ {t, d - 1}), i, j) \odot \boldsymbol {\beta} _ {t} ^ {\Rightarrow} (\nu_ {t, d - 1}, j); \\ \end{array} +$$ + +(b) if $\nu_{t,d} = \triangleright (\nu_{t,d - 1})$ then $\forall i\in \{0,1\}$ + +$$ +\begin{array}{l} i. \beta_ {t} ^ {\Rightarrow} (\nu_ {t, d}, i) \leftarrow \beta_ {t} ^ {\Rightarrow} (\nu_ {t, d - 1}, i); \\ \quad \text {i i .} \quad \boldsymbol {\beta} _ {t} ^ {\Leftarrow} (\nu_ {t, d}, i) \leftarrow \sum_ {j \in \{0, 1 \}} \boldsymbol {\beta} _ {t} ^ {\Leftarrow} (\nu_ {t, d - 1}, j) \odot \alpha_ {t} (\triangleleft (\nu_ {t, d - 1}), j, i); \\ \end{array} +$$ + +6. $\bar{\pmb{p}}_t\gets (1 / K)\sum_{i\in \{0,1\}}\pmb {\beta}_t^{\Leftarrow}(\nu_{t,h},1)\odot \pmb {\alpha}_t(\nu_{t,h},1,i)\odot \pmb {\beta}_t^{\Rightarrow}(\nu_{t,h},i);$ +7. Predict $a_{t}\in [K]$ with probability $\mathbb{P}[a_t = a] = \bar{p}_{t,a} / \| \bar{p}_t\| _1$ +8. Receive $\ell_{t,a_t}$ +9. $\forall a\in [K],c_{t,a}\gets \exp (-\eta [[a = a_t]]\ell_{t,a_t}||\bar{\boldsymbol{p}}_t||_1 / \bar{p}_{t,a});\pmb {\pi}^t\gets (\| \bar{\boldsymbol{p}}_t||_1\boldsymbol {c}_t) / (\bar{\boldsymbol{p}}_t\cdot \boldsymbol {c}_t);$ +10. $\forall i\in \{0,1\}$ $\pmb{\alpha}_{t + 1}(\nu_{t,h},1,i)\gets \pmb{\pi}^t\odot \pmb{\alpha}_t(\nu_{t,h},1,i);$ +11. $\forall i\in \{0,1\}$ , $\pmb{\alpha}_{t + 1}(\nu_{t,h},0,i)\gets \pmb{\alpha}_t(\nu_{t,h},0,i);$ +12. $\forall n\in \mathcal{C}\setminus \{\nu_{t,d}\mid d\in [h]\cup \{0\} \} ,\forall i,j\in \{0,1\} ,\quad \pmb{\alpha}_{t + 1}(n,i,j)\gets \pmb{\alpha}_t(n,i,j);$ +13. For $d = 1,2,\ldots ,h - 1$ do $\forall i,j\in \{0,1\}$ + +$$ +\boldsymbol {\alpha} _ {t + 1} \left(\nu_ {t, (h - d)}, i, j\right) \leftarrow \sum_ {k \in \{0, 1 \}} \boldsymbol {\alpha} _ {t + 1} \left(\triangleleft \left(\nu_ {t, (h - d)}\right), i, k\right) \odot \boldsymbol {\alpha} _ {t + 1} \left(\triangleright \left(\nu_ {t, (h - d)}\right), k, j\right); +$$ + +Figure 3: GABA-I Algorithm + +GABA-II (Learning rate: $\eta >0$ ) + +0. Construct binary support tree $\mathcal{C}$ via CONSTRUCTBST- $\mathcal{C}$ algorithm (see Figure 1). + +1. Construct a full perfect oriented binary tree $\mathcal{B}$ with height $g\coloneqq \lceil \log_2(K)\rceil$ , whose first $K$ leaves represent the actions $[K]$ ; Set $r$ to be the root of $\mathcal{B}$ +2. $\forall$ vertex $n\in \mathcal{C}$ + +(a) $\mu_1(n)\gets 1;\quad \forall \mathrm{leaf}m\in \mathcal{B},\quad \mathrm{if}m\in [K]$ then $\theta_{1}(n,m)\gets 1$ ; else $\theta_{1}(n,m)\gets 0$ +(b) $\forall d\in \{1,2,\ldots ,g\} ,\forall m\in \mathcal{B}$ at depth $g - d$ , $\theta_{1}(n,m)\coloneqq \theta_{1}(n,\triangleleft (m)) + \theta_{1}(n,\triangleright (m));$ + +For $t = 1,2\ldots T$ ,do + +3. Draw $\delta_t$ from $\uparrow (u_t)$ with prob. $\mathbb{P}[\delta_t = n] \propto \mu_t(n)\theta_t(n,r)$ ; $\zeta_{t,0} \gets r$ ; +4. For $d = 0,\dots ,g - 1$ : draw $\zeta_{t,d + 1}$ from $\{\triangleleft (\zeta_{t,d}),\triangleright (\zeta_{t,d})\}$ with prob. $\mathbb{P}[\zeta_{t,d + 1} = m]\propto \theta_t(\delta_t,m)$ +5. Predict $a_{t} \gets \zeta_{t, g}$ ; +6. Receive $\ell_{t,a_t}$ +7. $\psi_t \gets \sum_{n \in \Uparrow(u_t)} \mu_t(n) \theta(n, r)$ ; $\varrho_t \gets \sum_{n \in \Uparrow(u_t)} \mu_t(n) \theta(n, a_t)$ ; $\bar{\lambda}_t \gets \exp(-\eta \ell_{t,a_t} \psi_t / \varrho_t)$ ; +8. $\forall n\in \uparrow (u_t)$ + +(a) $\mu_{t + 1}(n)\gets \mu_t(n)\psi_t / (\psi_t - (1 - \bar{\lambda}_t)\varrho_t);\quad \theta_{t + 1}(n,a_t)\gets \bar{\lambda}_t\theta_t(n,a_t);$ +(b) $\forall m\in \mathcal{B}\setminus \uparrow (a_t),\quad \theta_{t + 1}(n,m)\coloneqq \theta_t(n,m);$ +(c) For $d = 1,2,\ldots g$ $\theta_{t + 1}(n,\zeta_{t,(g - d)})\gets \theta_{t + 1}(n,\triangleleft (\zeta_{t,(g - d)})) + \theta_{t + 1}(n,\triangleright (\zeta_{t,(g - d)}));$ + +9. $\forall n\in \mathcal{C}\setminus \uparrow (u_t)$ , $\mu_{t + 1}(n)\coloneqq \mu_t(n);\quad \forall m\in \mathcal{B},\theta_{t + 1}(n,m)\coloneqq \theta_t(n,m);$ + +Figure 4: GABA-II Algorithm + +# 4.3 Parameter Tuning + +A limitation of the GABA-I regret bound is that it is dependent on knowing the optimal values of the parameters $\phi$ and $\eta$ , and for GABA-II on the parameter $\eta$ . In the following, we will 1) sketch how to autotune $\phi$ at little cost and 2) autotune $\eta$ , however at essentially the cost of moving $\Psi(y)$ outside of the square root. + +We first sketch how to automatically tune the parameter $\phi$ that appears in GABA-I. Assume, without loss of generality, that $N$ is an integer power of 2. The idea of our tuning method is that since $\phi$ is unknown we will "mix" over possible values of $\phi \in [0,1]$ . In fact, at little cost in regret it is sufficient to just mix over the exponentially increasing values of $\phi = 2 / N, 4 / N, 8 / N, \dots, N / N$ . Thus each specialist is split into $\log_2 N$ specialists, so that the new distribution over specialists is + +$$ +w _ {1} (s _ {\phi}) := \frac {1}{\log_ {2} N} \times \mathrm {v a l i d} 1 (s) \times \frac {1}{K} \times \mathrm {s t a r t f a c t o r} (s) \times (1 - \phi) ^ {N - 1 - \mathrm {c u t} (s)} \phi^ {\mathrm {c u t} (s)}, +$$ + +where $\sum_{s\in \mathbb{S},\phi \in \{2 / N,4 / N,\ldots ,1\}}w_1(s_\phi) = 1$ . Implementing this efficiently is similar to the implementation of GABA-I, except that we now have $\log_2N$ copies of the BST $\mathcal{C}_{\phi}$ , each initialized with a different value of $\phi$ . On each trial the computed values from the $\log_2N$ copies of the BST $\mathcal{C}_{\phi}$ are summed to find the prediction vector. After receipt of the loss, all copies of the BST are updated as in GABA-I. The regret bound of this autotuning with respect to $\phi$ is equal, up to an $\mathcal{O}(\sqrt{\log(\log(N))})$ factor, to that of GABA-I with the optimal $\phi$ , but comes at the cost of an additional $\mathcal{O}(\log (N))$ factor in the computation time. + +Now that we have shown how to automatically tune $\phi$ in GABA-I we are left with the learning rate $\eta$ in both algorithms. We first note that, with any $\eta$ , the regret of both algorithms is $\Upsilon/\eta + \eta KT/2$ , where $\Upsilon$ is the robustified resistance weighted cutsize $\Psi(y)$ multiplied by logarithmic terms (one in GABA-I and two in GABA-II). By setting $\eta = \sqrt{2/KT}$ we get a regret of $(\Upsilon + 1)\sqrt{KT/2}$ . In addition, if $T$ is unknown then a doubling trick can be performed with this result to get a regret bound of $\mathcal{O}(\Upsilon \sqrt{KT})$ with no parameters needed. We compare this to the regret bound of $\mathcal{O}(\sqrt{\Upsilon KT})$ that comes from the optimal tuning of $\eta$ . It remains an open problem to bring $\Upsilon$ inside the square-root. + +Even with the above knowledge-free tuning of $\eta$ , our methods improve over the baseline comparator of running an independent EXP3 algorithm for each of the $N$ users in many natural scenarios. Recall that in this case the induced regret is then $\widetilde{\mathcal{O}}(\sqrt{NKT})$ (see (2)). Consider a very large social network where the bandit problem is to show 1-of- $K$ advertisements (for simplicity assume $K \in \mathcal{O}(1)$ ) at the nodes (users). Now consider the case that each user is served at most one advert, i.e., there is at most a single trial for any given user. Since $N \geq T$ the bound of the baseline is now the vacuous regret $\Theta(T)$ . We can intuitively see that this analysis is correct since the baseline algorithm is now just picking a single "uniformly at random" advertisement from $[K]$ for each user independently. However, observe that when $\Psi(y) \in \tilde{o}(\sqrt{T})$ we get $\widetilde{\mathcal{O}}(\Psi(y)\sqrt{T}) \subseteq \tilde{o}(T)$ , which is non-vacuous. Intuitively, GABA-I/II may achieve this result since algorithmically they are exploiting the network structure. + +# 5 Conclusion + +We considered a contextual, non-stochastic bandit problem in which the finite set of contexts (a.k.a users) form a social network and the inductive bias is that if the social link between two users is strong then actions that perform well for one of these users are likely to perform well for the other. We gave two highly efficient algorithms for this problem, both with good regret bounds. Since this work is theoretical in nature we cannot foresee any potential negative societal impacts. + +In the future it may be interesting to investigate extensions of our algorithms to the stochastic setting, as well as continuous bandit settings. Finally, it would be valuable to study potential applications of our algorithms, with large scale recommender systems being a natural candidate. On the theory side our bounds are based on an exponential potential function. Improved adversarial regret bounds were proven for an alternate potential function in [19] and it is an open question if our techniques can be extended to that potential. + +Acknowledgements. Mark Herbster was supported by the U.S. Army Research Laboratory and the U.K. Ministry of Defence under Agreement Number W911NF-16-3-0001. Stephen Pasteris and Massimiliano Pontil were supported in part by EPSRC Grant N. EP/P009069/1 and SAP SE. + +# References + +[1] Lihong Li, Wei Chu, John Langford, and Robert E. Schapire. A contextual-bandit approach to personalized news article recommendation. In Proceedings of the 19th International Conference on World Wide Web, WWW '10, pages 661-670, New York, NY, USA, 2010. Association for Computing Machinery. +[2] Sofia S Villar Villar, Jack Bowden, and James Wason. Multi-armed Bandit Models for the Optimal Design of Clinical Trials: Benefits and Challenges. Statistical Science, 30(2):199 - 215, 2015. +[3] Baruch Awerbuch and Robert Kleinberg. Online linear optimization and adaptive routing. Journal of Computer and System Sciences, 74(1):97-114, 2008. +[4] Rie Kubota Ando and Tong Zhang. A framework for learning predictive structures from multiple tasks and unlabeled data. J. Mach. Learn. Res., 6:1817-1853, December 2005. +[5] Andreas Maurer and Massimiliano Pontil. Excess risk bounds for multitask learning with trace norm regularization. In Conference on Learning Theory, pages 55-76, 2013. +[6] Maria-Florina Balcan, Mikhail Khodak, and Ameet Talwalkar. Provable guarantees for gradient-based meta-learning. In International Conference on Machine Learning, pages 424–433, 2019. +[7] Giovanni Cavallanti, Nicolò Cesa-Bianchi, and Claudio Gentile. Linear algorithms for online multitask classification. J. Mach. Learn. Res., 11:2901-2934, December 2010. +[8] Pierre Alquier, The Tien Mai, and Massimiliano Pontil. Regret Bounds for Lifelong Learning. In Aarti Singh and Jerry Zhu, editors, Proceedings of the 20th International Conference on rtificial Intelligence and Statistics, volume 54 of Proceedings of Machine Learning Research, pages 261-269, Fort Lauderdale, FL, USA, 20-22 Apr 2017. PMLR. +[9] Giulia Denevi, Carlo Ciliberto, Dimitris Stamos, and Massimiliano Pontil. Incremental learning-to-learn with statistical guarantees. arXiv preprint arXiv:1803.08089, 2018. +[10] Giulia Denevi, Carlo Ciliberto, Riccardo Grazzi, and Massimiliano Pontil. Learning-to-learn stochastic gradient descent with biased regularization. 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 1566–1575, Long Beach, California, USA, 09–15 Jun 2019. PMLR. +[11] Anastasia Pentina and Ruth Urner. Lifelong learning with weighted majority votes. In D. D. Lee, M. Sugiyama, U. V. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems 29, pages 3612-3620. Curran Associates, Inc., 2016. +[12] Miller McPherson, Lynn Smith-Lovin, and James M Cook. Birds of a feather: Homophily in social networks. Annual Review of Sociology, 27(1):415-444, 2001. +[13] M. Herbster, G. Lever, and M. Pontil. Online prediction on large diameter graphs. In NIPS, 2008. +[14] Nicolò Cesà-Bianchi, C. Gentile, Fabio Vitale, and Giovanni Zappella. Random spanning trees and the prediction of weighted graphs. In ICML, 2010. +[15] Y. Freund, R. Schapire, Y. Singer, and Manfred K. Warmuth. Using and combining predictors that specialize. In STOC '97, 1997. +[16] Wouter M. Koolen, Dmitry Adamskiy, and Manfred K. Warmuth. Putting bayes to sleep. In NIPS, 2012. +[17] Aleksandrs Slivkins. Introduction to multi-armed bandits. Foundations and Trends in Machine Learning, 12(1-2):1-286, 2019. +[18] Peter Auer, Nicolò Cesa-Bianchi, Yoav Freund, and Robert E. Schapire. The nonstochastic multiarmed bandit problem. SIAM J. Comput., 32(1):48-77, January 2003. + +[19] Jean-Yves Audibert and Sébastien Bubeck. Regret bounds and minimax policies under partial monitoring. Journal of Machine Learning Research, 11(94):2785-2836, 2010. +[20] Sébastien Bubeck and Nicolo Cesa-Bianchi. Regret analysis of stochastic and nonstochastic multi-armed bandit problems. Foundations and Trends in Machine Learning, 5(1):1–122, 2012. +[21] N. Cesa-Bianchi, C. Gentile, and Giovanni Zappella. A gang of bandits. In NIPS, 2013. +[22] Kaige Yang, X. Dong, and L. Toni. Laplacian-regularized graph bandits: Algorithms and theoretical analysis. In AISTATS, 2020. +[23] Sharan Vaswani, M. Schmidt, and L. Lakshmanan. Horde of bandits using gaussian markov random fields. In AISTATS, 2017. +[24] Qingyun Wu, Huazheng Wang, Quanquan Gu, and Hongning Wang. Contextual bandits in a collaborative environment. Proceedings of the 39th International ACM SIGIR conference on Research and Development in Information Retrieval, 2016. +[25] Xin Wang, S. Hoi, Chenghao Liu, and M. Ester. Interactive social recommendation. Proceedings of the 2017 ACM on Conference on Information and Knowledge Management, 2017. +[26] Huazheng Wang, Qingyun Wu, and Hongning Wang. Factorization bandits for interactive recommendation. In AAAI, 2017. +[27] C. Gentile, S. Li, and Giovanni Zappella. Online clustering of bandits. In ICML, 2014. +[28] S. Li, C. Gentile, and Alexandros Karatzoglou. Graph clustering bandits for recommendation. ArXiv, abs/1605.00596, 2016. +[29] C. Gentile, S. Li, Purushottam Kar, Alexandros Karatzoglou, Giovanni Zappella, and Evans Etrue. On context-dependent clustering of bandits. In ICML, 2017. +[30] S. Li, C. Gentile, Alexandros Karatzoglou, and Giovanni Zappella. Data-dependent clustering in exploration-exploitation algorithms. ArXiv, abs/1502.03473, 2015. +[31] S. Li and Purushottam Kar. Context-aware bandits. ArXiv, abs/1510.03164, 2015. +[32] S. Li, C. Gentile, Alexandros Karatzoglou, and Giovanni Zappella. Online context-dependent clustering in recommendations based on exploration-exploitation algorithms. ArXiv, abs/1608.03544, 2016. +[33] S. Li, Alexandros Karatzoglou, and C. Gentile. Collaborative filtering bandits. Proceedings of the 39th International ACM SIGIR conference on Research and Development in Information Retrieval, 2016. +[34] Kaige Yang and L. Toni. Graph-based recommendation system. 2018 IEEE Global Conference on Signal and Information Processing (GlobalSIP), pages 798-802, 2018. +[35] Trong T. Nguyen and H. W. Lauw. Dynamic clustering of contextual multi-armed bandits. Proceedings of the 23rd ACM International Conference on Conference on Information and Knowledge Management, 2014. +[36] Zongguo Wang, Chicheng Zhang, M. Singh, L. Riek, and K. Chaudhuri. Multitask bandit learning through heterogeneous feedback aggregation. In AISTATS, 2021. +[37] Zongguo Wang, M. Singh, Chicheng Zhang, L. Riek, and K. Chaudhuri. Stochastic multi-player bandit learning from player-dependent feedback. 2020. +[38] Hassan Saber, Pierre Ménard, and Odalric-Ambrym Maillard. Optimal strategies for graph-structured bandits. ArXiv, abs/2007.03224, 2020. +[39] Sabina Tomkins, Peng Liao, P. Klasnja, and S. Murphy. Intelligentpooling: Practical thompson sampling for mhealth. ArXiv, abs/2008.01571, 2020. +[40] Silviu Maniu, Stratis Ioannidis, and B. Cautis. Bandits under the influence. 2020 IEEE International Conference on Data Mining (ICDM), pages 1172-1177, 2020. + +[41] L. Yang, Bo Liu, L. Lin, Feng Xia, Kai Chen, and Qiang Yang. Exploring clustering of bandits for online recommendation system. Fourteenth ACM Conference on Recommender Systems, 2020. +[42] Huazheng Wang, Qingyun Wu, and Hongning Wang. Learning hidden features for contextual bandits. Proceedings of the 25th ACM International on Conference on Information and Knowledge Management, 2016. +[43] Swapna Buccapatnam, A. Eryilmaz, and N. Shroff. Multi-armed bandits in the presence of side observations in social networks. 52nd IEEE Conference on Decision and Control, pages 7309–7314, 2013. +[44] S. Kar, H. Poor, and S. Cui. Bandit problems in networks: Asymptotically efficient distributed allocation rules. IEEE Conference on Decision and Control and European Control Conference, pages 1771-1778, 2011. +[45] Balázs Szörenyi, R. Busa-Fekete, I. Hegedüs, Robert Ormandi, M. Jelasity, and B. Kégl. Gossip-based distributed stochastic bandit algorithms. In ICML, 2013. +[46] N. Korda, Balázs Szörenyi, and S. Li. Distributed clustering of linear bandits in peer networks. ArXiv, abs/1604.07706, 2016. +[47] Abishek Sankararaman, A. Ganesh, and S. Shakkottai. Social learning in multi agent multi armed bandits. Proceedings of the ACM on Measurement and Analysis of Computing Systems, 3:1 - 35, 2019. +[48] L. E. Celis and F. Salehi. Lean from thy neighbor: Stochastic and adversarial bandits in a network. ArXiv, abs/1704.04470, 2017. +[49] Yogev Bar-On and Y. Mansour. Individual regret in cooperative nonstochastic multi-armed bandits. In NeurIPS, 2019. +[50] N. Cesa-Bianchi, C. Gentile, Y. Mansour, and Alberto Minora. Delay and cooperation in nonstochastic bandits. ArXiv, abs/1602.04741, 2016. +[51] Bo Liu, Y. Wei, Y. Zhang, Z. Yan, and Qiang Yang. Transferable contextual bandit for cross-domain recommendation. In AAAI, 2018. +[52] L. Cella, A. Lazaric, and M. Pontil. Meta-learning with stochastic linear bandits. ArXiv, abs/2005.08531, 2020. +[53] Michal Valko, R. Munos, B. Kveton, and Tomás Kocák. Spectral bandits for smooth graph functions. In ICML, 2014. +[54] M. K. Hanawal, Venkatesh Saligrama, Michal Valko, and R. Munos. Cheap bandits. ArXiv, abs/1506.04782, 2015. +[55] A. Deshmukh, U. Dogan, and C. Scott. Multi-task learning for contextual bandits. In NIPS, 2017. +[56] Michal Valko. Bandits on graphs and structures. Diss., École normale supérieure de Cachan-ENS Cachanz, 2016. +[57] M. K. Hanawal and Venkatesh Saligrama. Efficient detection and localization on graph structured data. 2015 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 5590-5594, 2015. +[58] M. K. Hanawal and Venkatesh Saligrama. Cost effective algorithms for spectral bandits. 2015 53rd Annual Allerton Conference on Communication, Control, and Computing (Allerton), pages 1323-1329, 2015. +[59] Sylvain Lamprier, Thibault Gisselbrecht, and P. Gallinari. Variational thompson sampling for relational recurrent bandits. In ECML/PKDD, 2017. + +[60] Aadirupa Saha, Shreyas Sheshadri, and C. Bhattacharyya. Be greedy: How chromatic number meets regret minimization in graph bandits. In UAI, 2019. +[61] N. Alon, N. Cesa-Bianchi, C. Gentile, Shie Mannor, Y. Mansour, and O. Shamir. Nonstochastic multi-armed bandits with graph-structured feedback. SIAM J. Comput., 46:1785–1826, 2017. +[62] N. Alon, N. Cesa-Bianchi, O. Dekel, and T. Koren. Online learning with feedback graphs: Beyond bandits. In $COLT$ , 2015. +[63] Meng Fang and D. Tao. Networked bandits with disjoint linear payoffs. Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining, 2014. +[64] M. Herbster, Stephen Pasteris, and Fabio Vitale. Online sum-product computation over trees. In NIPS, 2012. +[65] M. Herbster and J. Robinson. Online prediction of switching graph labelings with cluster specialists. In NeurIPS, 2019. +[66] Lyons, Russell, and Yuval Peres. Probability on trees and networks. Cambridge University Press, 2017. +[67] Nicolò Cesa-Bianchi, Claudio Gentile, Fabio Vitale, and Giovanni Zappella. Random spanning trees and the prediction of weighted graphs. Journal of Machine Learning Research, 14(2):1251-1284, 2013. +[68] R. Pemantle. Uniform random spanning trees. arXiv: Probability, 2004. +[69] Aaron Schild. An almost-linear time algorithm for uniform random spanning tree generation. Proceedings of the 50th Annual ACM SIGACT Symposium on Theory of Computing, 2018. +[70] D. Durfee, Rasmus Kyng, J. Peebles, A. Rao, and Sushant Sachdeva. Sampling random spanning trees faster than matrix multiplication. Proceedings of the 49th Annual ACM SIGACT Symposium on Theory of Computing, 2017. +[71] Volodimir G. Vovk. Aggregating strategies. Proc. of Computational Learning Theory, 1990. +[72] David Haussler, Jyrki Kivinen, and Manfred K Warmuth. Sequential prediction of individual sequences under general loss functions. IEEE Transactions on Information Theory, 44(5):1906-1925, 1998. +[73] Nick Littlestone and Manfred K. Warmuth. The weighted majority algorithm. Information and computation, 108(2):212-261, 1994. +[74] Yoav Freund and Robert E Schapire. A decision-theoretic generalization of on-line learning and an application to boosting. Journal of computer and system sciences, 55(1):119-139, 1997. +[75] David Barber. Bayesian Reasoning and Machine Learning. Cambridge University Press, 2012. +[76] Leslie Ann Goldberg and Mark Jerrum. The complexity of ferromagnetic ising with local fields. Combinatorics, Probability & Computing, 16(1):43-61, 2007. +[77] Arthur L. Delcher, Adam J. Grove, Simon Kasif, and Judea Pearl. Logarithmic-time updates and queries in probabilistic networks. CoRR, abs/1408.1479, 2014. +[78] Guy Bresler, D. Shah, and L. F. Voloch. Collaborative filtering with low regret. Proceedings of the 2016 ACM SIGMETRICS International Conference on Measurement and Modeling of Computer Science, 2016. +[79] Guy Bresler, D. Shah, and L. F. Voloch. Regret guarantees for item-item collaborative filtering. arXiv: Learning, 2015. +[80] Nicolò Cesa-Bianchi and G. Lsugosi. Combinatorial bandits. J. Comput. Syst. Sci., 78:1404-1422, 2009. +[81] Alon Cohen, Tamir Hazan, and T. Koren. Tight bounds for bandit combinatorial optimization. In $COLT$ , 2017. + +[82] S. Ito, Daisuke Hatano, Hanna Sumita, Kei Takemura, Takuro Fukunaga, Naonori Kakimura, and K. Kawarabayashi. Improved regret bounds for bandit combinatorial optimization. In NeurIPS, 2019. +[83] Kareem Amin, M. Kearns, and U. Syed. Graphical models for bandit problems. In UAI, 2011. +[84] Aleksandrs Slivkins. Contextual bandits with similarity information. J. Mach. Learn. Res., 15:2533-2568, 2011. +[85] Qingyun Wu, N. Iyer, and Hongning Wang. Learning contextual bandits in a non-stationary environment. The 41st International ACM SIGIR Conference on Research and Development in Information Retrieval, 2018. +[86] Qingyun Wu, Huazheng Wang, Yanen Li, and Hongning Wang. Dynamic ensemble of contextual bandits to satisfy users' changing interests. The World Wide Web Conference, 2019. +[87] Xiao Xu, Fang Dong, Yanghua Li, Shao jian He, and X. Li. Contextual-bandit based personalized recommendation with time-varying user interests. ArXiv, abs/2003.00359, 2020. +[88] Chuanhao Li, Qingyun Wu, and Hongning Wang. Unifying clustered and non-stationary bandits. In AISTATS, 2021. +[89] Mark Herbster, Stephen Pasteris, and Lisa Tse. Online multitask learning with long-term memory. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 17779-17791. Curran Associates, Inc., 2020. \ No newline at end of file diff --git a/agangofadversarialbandits/images.zip b/agangofadversarialbandits/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f848fecc0562b2b02427035eae5836fe5bdf1a67 --- /dev/null +++ b/agangofadversarialbandits/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:03a1acb8db3f666decff35a14f552c02d7d9c8c99a615ed827c195c4e97644c1 +size 199393 diff --git a/agangofadversarialbandits/layout.json b/agangofadversarialbandits/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..263f1e731cbceded5463ab3f5befdf799aca27df --- /dev/null +++ b/agangofadversarialbandits/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3c20b9cb4d784f4de69eb9e04ee04848f47bb0332a1fe6f10ca7611b2bb11abb +size 811297 diff --git a/agaussianprocessbayesianbernoullimixturemodelformultilabelactivelearning/cca2a514-5242-48b4-a693-44d6bb55a025_content_list.json b/agaussianprocessbayesianbernoullimixturemodelformultilabelactivelearning/cca2a514-5242-48b4-a693-44d6bb55a025_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..55d2a2aaae7ac32418a6e7fe50dfab6b196997f4 --- /dev/null +++ b/agaussianprocessbayesianbernoullimixturemodelformultilabelactivelearning/cca2a514-5242-48b4-a693-44d6bb55a025_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:07d46e6952c33192eb8089827dd7f6057b8551a4772f88588517b0e69949787d +size 86052 diff --git a/agaussianprocessbayesianbernoullimixturemodelformultilabelactivelearning/cca2a514-5242-48b4-a693-44d6bb55a025_model.json b/agaussianprocessbayesianbernoullimixturemodelformultilabelactivelearning/cca2a514-5242-48b4-a693-44d6bb55a025_model.json new file mode 100644 index 0000000000000000000000000000000000000000..eaceab3c58481efcc8843262183be01283863862 --- /dev/null +++ b/agaussianprocessbayesianbernoullimixturemodelformultilabelactivelearning/cca2a514-5242-48b4-a693-44d6bb55a025_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5df7f60bdc417511fdc39f499a2be3e3c7a6984509bd084686f736384a13f0c1 +size 106442 diff --git a/agaussianprocessbayesianbernoullimixturemodelformultilabelactivelearning/cca2a514-5242-48b4-a693-44d6bb55a025_origin.pdf b/agaussianprocessbayesianbernoullimixturemodelformultilabelactivelearning/cca2a514-5242-48b4-a693-44d6bb55a025_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..48a3ac74ebcd97fd9d6a8f559cc0a688c0264c1d --- /dev/null +++ b/agaussianprocessbayesianbernoullimixturemodelformultilabelactivelearning/cca2a514-5242-48b4-a693-44d6bb55a025_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e4354e30a84bb18c80e7bce7bb86ddcfcbcecb53e526f7558a23fed4428236ba +size 5556156 diff --git a/agaussianprocessbayesianbernoullimixturemodelformultilabelactivelearning/full.md b/agaussianprocessbayesianbernoullimixturemodelformultilabelactivelearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..5b8d79925715b8343a842a0cdf4aee5992d4e8dc --- /dev/null +++ b/agaussianprocessbayesianbernoullimixturemodelformultilabelactivelearning/full.md @@ -0,0 +1,370 @@ +# A Gaussian Process-Bayesian Bernoulli Mixture Model for Multi-Label Active Learning + +Weishi Shi* Dayou Yu* Qi Yu + +Golisano College of Computing and Information Sciences + +Rochester Institute of Technology + +{ws7586,dy2507,qi.yu}@rit.edu + +# Abstract + +Multi-label classification (MLC) allows complex dependencies among labels, making it more suitable to model many real-world problems. However, data annotation for training MLC models becomes much more labor-intensive due to the correlated (hence non-exclusive) labels and a potentially large and sparse label space. We propose to conduct multi-label active learning (ML-AL) through a novel integrated Gaussian Process-Bernoulli Mixture model $(\mathrm{GP - B}^2\mathrm{M})$ to accurately quantify a data sample's overall contribution to a correlated label space and choose the most informative samples for cost-effective annotation. In particular, the $\mathrm{B}^2\mathrm{M}$ encodes label correlations using a Bayesian Bernoulli mixture of label clusters, where each mixture component corresponds to a global pattern of label correlations. To tackle highly sparse labels under AL, the $\mathrm{B}^2\mathrm{M}$ is further integrated with a predictive GP to connect data features as an effective inductive bias and achieve a feature-component-label mapping. The GP predicts coefficients of mixture components that help to recover the final set of labels of a data sample. A novel auxiliary variable based variational inference algorithm is developed to tackle the non-conjugacy introduced along with the mapping process for efficient end-to-end posterior inference. The model also outputs a predictive distribution that provides both the label prediction and their correlations in the form of a label covariance matrix. A principled sampling function is designed accordingly to naturally capture both the feature uncertainty (through GP) and label covariance (through $\mathrm{B}^2\mathrm{M}$ ) for effective data sampling. Experiments on real-world multi-label datasets demonstrate the state-of-the-art AL performance of the proposed model. + +# 1 Introduction + +In multi-label classification (MLC), each data instance may be associated with more than one label. Such a rich representation of labels can encode more complex data-label distributions that arise in many real-world problems [1, 2, 3, 4]. As a simple yet powerful tool, binary relevance machines (BRMs) transform an MLC problem into multiple binary problems and train independent binary classifiers for each label [5]. Such a transformation gives BRMs the flexibility to leverage state-of-art binary classifiers (e.g., deep neural networks and SVMs). However, applying BRMs to a correlated and potentially large label space poses key challenges. First, many real-world multi-label datasets contain a large number of labels. Training one predictor per label incurs a prohibitive cost. Second, despite an overall large label space, each data instance is usually assigned limited labels. Many labels are relatively rare and their appearances depend not only on the features but also the occurrence of other labels. Predicting these "complex" labels directly using independent binary classifiers is fundamentally difficult due to the limited positive data instances and weaker direct dependency on the features. Correlations among labels provide important auxiliary information to enhance multi-label + +![](images/9c4ba8d5e29d8f9192ce015ce605102c699af6561bd1efc6b565d6c87d1ee7b5.jpg) +Figure 1: (a) Labels with geometric correlation (G1-G8); (b) Labels with cardinality (C1,C2), overlapping (O1-O4), and exclusive (and hierarchical) dependencies (E1-E4); (c) Definition of label correlation and learned mixture components. + +![](images/5b2a6abb61db4b5ece24df403706404a7a120228cdacf1e54d1e7cb6d35d675a.jpg) + +![](images/07e82a9f85a54585b4fa012646aedafd3245c3720b7f88b06fc89cd8e4f162b7.jpg) + +prediction [6, 7, 8]. However, these models heavily rely on the training data that exhibit these important label correlations. Considering the high cost in annotating a multi-label dataset, it is critical to choose the most informative data samples for cost-effective data annotation. + +In this paper, we propose a novel Gaussian Process-Bayesian Bernoulli Mixture (GP- $\mathbf{B}^2\mathbf{M}$ ) model to achieve cost-effective sampling for multi-label active learning (ML-AL). In ML-AL, since labels are not mutually exclusive as in the single label setting, all the labels should be considered collectively when designing an active sampling function so that a data sample's overall contribution to the entire label space can be accurately measured. However, since only limited training data instances are available for an ML-AL model, how to accurately model label correlations and hence quantify a data sample's overall informativeness using very sparse labels under AL poses a grand challenge. Existing efforts that explicitly model label correlations usually focus on limited types of correlations such as pairwise [3, 9], conditional [10, 11], or full correlation in a subset of labels [12, 13]. Consequently, those methods may miss some important label correlations. Label correlations can also be captured through a latent embedding [7, 8]. While these methods can scale to a large label space, they usually require a decent number of training labels to compute an accurate embedding, making them less suitable for ML-AL. Furthermore, the learned embedding has no semantic meanings, which cannot be used to interpret the discovered label dependencies $^{2}$ . + +The proposed $\mathrm{GP - B^2M}$ model addresses the limitations of existing methods to fundamentally advance ML-AL. In particular, the $\mathrm{B^{2}M}$ encodes label correlations using a Bayesian Bernoulli mixture of label clusters. Since labels are highly sparse in ML-AL, a predictive GP is further integrated to learn a distribution of mixture coefficients that connect data features with the label clusters. Thus, the label clusters can be regarded as a global pattern of label co-occurrences discovered from both the training labels and data features to address label sparsity. In this novel feature-component-label mapping, data features serve as an inductive bias to learn accurate mixture components of labels, where data samples with similar features should be mapped to similar mixture components, which in turn lead to a similar set of labels. Such an inductive bias allows the discovery of label relationships from limited labels with the support of feature relationships, which is essential for a sparse label space in ML-AL. + +Figure 1 shows three mixture components learned from synthetic data designed with complex label correlations, including geometric, cardinality, overlapping, and hierarchical (see Figure 1 (c) for definitions). For example, the hierarchical labels $(E1 - E4)$ show some interesting but quite complicated correlations that may exist in many real-world data. If $E1$ represents a common disease and $E2$ , $E3$ represent some less common ones that may co-occur with $E1$ ( $30\%$ of the time), then $E4$ corresponds to a rather rare disease that only co-occurs with $E3$ but not $E2$ . In Figure 1 (c), both components 1 and 2 show a high chance of $E4$ . It is also clear that while both $E1$ and $E3$ are very likely to appear in these components, the chance of seeing $E2$ is much lower, reflecting its exclusive relationship with $E3$ . Interestingly, while both components 1 and 2 cover $E4$ , they also show complementary information. In component 1, $E4$ mostly appears in the non-overlapping regions, which is indicated by smaller $O1$ and $O4$ ; whereas in component 2, it's more likely to + +occur in overlapping regions $O1$ and $O4$ . Finally, in component 3, it is less likely to observe $E4$ . Consequently, the chance to see $E2$ is significantly higher. + +The above example demonstrates that the learned mixture components accurately capture complex label correlations that are critical for active data sampling. They are also interpretable, which can help to unveil important relationships among labels. Our key contribution is threefold: (i) We propose a novel GP-Bayesian Bernoulli mixture model to discover meaningful label correlations from limited labels by encoding the inductive bias from data features as Bayesian priors to learn from both labels and features while ensuring consistency. (ii) We introduce a set of auxiliary latent variables to achieve a fully conjugate feature-component-label mapping in the Bayesian model to support efficient end-to-end posterior inference. The number of mixture components is also dynamically adjusted during Bayesian inference so that the model complexity is automatically calibrated according to the size of training data, which is critical for AL. (iii) The model outputs the predictive distribution that provides both the label prediction and their correlations in the form of a label covariance matrix. We design a novel active sampling function that integrates both feature uncertainty and label covariance to quantify a data sample's overall contribution to a correlated label space. Extensive experiments on both synthetic and real-world multi-label data and comparison with competitive models demonstrate that the proposed $\mathrm{GP - B}^2\mathrm{M}$ achieves the state-of-the-art active learning performance. + +# 2 Related Work + +Due to the wide adoption of BRMs for MLC, a number of AL models have been developed based upon BRMs. For example, the estimated reduction of a BRM loss function has been used as an uncertainty criterion for data sampling [14]. Uncertainty from individual SVMs in BRMs has also been integrated to compute a sampling score, where label correlation is used to reduce the complexity of the active query rather than improve active sampling [15]. Label inconsistency provides an alternative way to incorporate label correlation into BRMs [16] for data sampling. This has been further extended through label ranking [17]. As discussed earlier, AL models built upon BRMs do not systematically capture label correlations, which may lead to inaccurate uncertainty measures for ML-AL. + +A few existing models capture label correlations explicitly or through a latent embedding to support active multi-label sampling. For example, the approximate entropy of the predicted labels from a Bernoulli Mixtures model (CBM) is used for data sampling [18]. However, the quality of the uncertainty estimation relies on an external multi-class classifier used to predict the component coefficients. Both model selection and parameter tuning for the classifier make it difficult for AL. One fundamental limitation is that CBM was originally designed for MLC (instead of AL) by predicting a distinct set of label clusters for each data sample [6]. Thus, different from the proposed $\mathrm{GP - B^2M}$ model, no global label clusters are discovered to capture the label correlations, making it unsuitable for multi-label AL. Gao et.al propose a correlation aware active sampling method for transfer learning task [19]. However, the method uses a kernel function to measure the label similarity between two data instances which cannot work well for a large and sparse label space. Compressed sensing (CS) has been employed to learn a latent embedding of the label space to capture potential label correlations, which can then be used to design a sampling function. However, since the latent space is continuous, the labels are further assumed to be drawn from a Gaussian distribution to ensure conjugacy, which violates the binary nature of the labels [20]. Furthermore, CS requires an additional step to recover the predicted label from the latent code, which is less efficient for AL. Active sampling is also sensitive to the recovery process and the recovery quality is usually low at the beginning of AL due to the lack of training data [21]. + +The proposed $\mathrm{GP - B^2M}$ model systematically addresses the key limitations of existing methods through a well integrated Bayesian framework that supports a fully conjugate feature-component-label mapping and end-to-end posterior inference for cost-effective ML-AL. + +# 3 GP-B $^2$ M for Multi-Label Active Learning + +In this section, we first describe the proposed $\mathrm{GP - B^2M}$ model by introducing key latent variables along with their conditional dependencies. We then present a novel posterior inference process by augmenting the original model using a set of auxiliary variables to resolve the non-conjugate prior and likelihood. A principled sampling function is introduced in the end for cost-effective ML-AL. + +![](images/ca2116cc96970ab6a8a38408001ce7f731d1b7ac41c767e08ee070446269003c.jpg) +Figure 2: (a) The $\mathrm{GP - B^2M}$ framework for ML-AL; (b) Graphical model of $\mathrm{GP - B^2M}$ . + +![](images/b5416fe3f39da3cecfc4a747cea987b3261bea8be78c2a250b77ec727a5d3283.jpg) + +# 3.1 The Bayesian Bernoulli Mixture Model + +Let $\mathbf{X} = \{\mathbf{x}_1,\dots,\mathbf{x}_N\}$ denote a training set with $N$ data samples and $\mathbf{Y} = \{\mathbf{y}_1,\dots,\mathbf{y}_N\}$ denote the labels, where $\mathbf{y}_n\in \{0,1\}^L$ . The proposed GP-B $^2$ M model assumes there are $K$ mixture components, $\Theta = \{\theta_k\}_{k = 1}^K$ , shared by all the data samples and the label vector of each sample is generated from a mixture process. Mixture component $k$ is a result of $L$ Bernoulli experiments governed by two parameters $a_{kl}$ and $b_{kl}$ : $\theta_{k}\sim \prod_{l = 1}^{L}\mathrm{Beta}(a_{kl},b_{kl})$ , where $\theta_{kl}$ denotes the probability of assigning label $l$ to component $k$ . The indicator variable $z_{nk}$ denotes whether component $k$ is assigned to sample $\mathbf{x}_n$ , where $z_{nk}\sim \mathrm{Cat}(\pi_n)$ , $\pi_{nk} = h^{(k)}(\mathbf{f}_n)$ , $h^{(k)}$ is a mapping function that outputs the probability of assigning $\mathbf{x}_n$ to mixture component $k$ , and $\mathbf{f}_n = (f_n^{(1)},\dots,f_n^{(K)})^T$ are GP latent functions for sample $\mathbf{x}_n$ with $f_{n}^{(k)} = f^{(k)}(\mathbf{x}_{n})$ . The final label vector associated with $\mathbf{x}_n$ is drawn from the mixture distribution given by $p(\mathbf{y}_n|\Theta) = \sum_{k = 1}^{K}\pi_{nk}\pmb {\theta}_k$ . Figure 2(b) shows the graphical model of this generative process. + +The $\mathrm{GP - B^2M}$ model essentially adopts a two-phase learning process, where these two phases are seamlessly integrated (see Figure 2(a)). In phase I, it predicts the probabilistic assignment of the mixture components by learning a distribution of latent functions: $F = \{\mathbf{f}^{(k)}\}_{k = 1}^{K}$ , where $\mathbf{f}^{(k)} = (f_1^{(k)},\dots,f_N^{(k)})^T$ . In phase II, these predicted mixture assignments are used to refine the parameters of the beta distributions so that updated mixture components can best recover the true label vectors. One key innovation lies in using the latent indicator variables $Z = \{\mathbf{z}_n\}_{n = 1}^N$ to link the feature space with the label mixture components as a way to encode the feature related inductive bias. This is achieved through a mapping function $\mathbf{h}_n = (h_n^{(1)},\dots,h_n^{(K)})^T$ , with $h_n^{(k)} = h^{(k)}(\mathbf{f}_n)$ : + +$$ +p \left(z _ {n k} = 1 \mid \mathbf {f} _ {n}\right) = \pi_ {n k} = h _ {n} ^ {(k)}, h _ {n} ^ {(k)} \in [ 0, 1 ], \sum_ {k = 1} ^ {K} h _ {n} ^ {(k)} = 1, \quad p \left(\mathbf {f} ^ {(k)}\right) = \mathcal {N} \left(\mathbf {f} ^ {(k)} \mid \mathbf {m} _ {k}, \Sigma_ {k}\right) \tag {1} +$$ + +where $\Sigma_{k} = [\mathcal{K}(\mathbf{x}_{n},\mathbf{x}_{m})]$ is a covariance matrix and $\mathcal{K}(\cdot ,\cdot)$ is a kernel function, and we set $\mathbf{m}_k = \mathbf{0}$ with out losing generality. From the Bayesian perspective, this is equivalent to placing a Dirac delta prior over $\pi_{nk}:\pi_{nk}\sim \delta (\pi_{nk} - h_n^{(k)}))$ , where the inductive bias is encoded by the prior distribution. By introducing $h^{(k)}(\mathbf{f}_n)$ , we essentially convert a multi-label problem into a multi-class problem as $\pi_{n}$ encodes the probability of assigning $\mathbf{x}_n$ to each of the $K$ components. Specifically, given the learned mixture components $\pmb{\theta}_{k}$ 's, for a test data sample $\mathbf{x}_{*}$ , we predict the component assignments $\pi_{*}$ using the trained GP. The final labels are obtained as $p(\mathbf{y}_{*}|\Theta) = \sum_{k = 1}^{K}\pi_{*k}\pmb{\theta}_{k}$ + +Posterior inference of latent variables in the two phases are jointly performed by maximizing the log marginal likelihood of the observed multiple labels for all training samples: + +$$ +\ln p (\mathbf {Y} \mid \mathbf {X}) = \ln \int \int \sum_ {Z} \prod_ {n} \prod_ {l} \prod_ {k} p \left(\mathbf {f} ^ {(k)}\right) p \left(\theta_ {k l}\right) p \left(z _ {n k} \mid \mathbf {f} _ {n}\right) p \left(y _ {n l} \mid z _ {n k}, \theta_ {k l}\right) d F d \Theta \tag {2} +$$ + +Directly maximizing this likelihood is intractable due to the interplay of the latent variables. So we turn to optimizing the evidence lower bound (ELBO) of the log marginal: $\mathcal{L}(q) = \int q(\Theta, Z, F) \ln \frac{p(\mathbf{Y}, Z, F; \Theta | \mathbf{X})}{q(\Theta, Z, F)} \mathrm{d}\Theta \mathrm{d}Z \mathrm{d}F$ , where $q(\Theta, Z, F)$ is the variational distribution. However, a key challenge that prevents us from using the standard mean field variational inference (MF-VI) is the term $p(z_{nk} | \mathbf{f}_n)$ , defined by the mapping function $h_n^{(k)}$ in (1). As the most typical forms of $h_n^{(k)}$ (e.g., softmax) are non-conjugate with the prior distribution $p(\mathbf{f}^{(k)})$ , which is a Gaussian, the variational posterior $q(\mathbf{f}^{(k)})$ cannot be derived analytically. + +# 3.2 Auxiliary Variables based Variational Inference + +We propose to resolve the non-conjugate mapping function in the complete data likelihood by introducing a number of auxiliary latent variables such that the augmented complete data likelihood becomes conjugate. Auxiliary variables have been used in MCMC based inference, such as slice sampling [22] and Hamiltonian MCMC [23], with improved sampling efficiency. The basic idea of auxiliary variables based variational inference (AV-VI) is to apply the following transformation: $p(x) = \int_y p(x|y)p(y)\mathrm{d}y$ , where $p(x)$ is a target function that is difficult to compute (e.g., non-conjugate) during VI. If the conditional likelihood $p(x|y)$ is still non-conjugate, this process will continue until a conjugate conditional is achieved. + +A key identity that we leverage to achieve a conditional likelihood conjugate to a Gaussian prior $p(\mathbf{f}^{(k)})$ is to convert a logistic sigmoid function as a scale mixture of Gaussian's [24] where the mixture is defined by a Pólya-Gamma distribution $p(\omega) = \mathrm{PG}(\omega | b, 0)$ , + +$$ +\frac {\left(e ^ {f}\right) ^ {a}}{\left(1 + e ^ {f}\right) ^ {b}} = 2 ^ {- b} e ^ {\kappa f} \int_ {0} ^ {\infty} e ^ {\frac {- \omega f ^ {2}}{2}} p (\omega) d \omega \tag {3} +$$ + +where $b \geq 0, \kappa = a - \frac{b}{2}$ . However, a sigmoid function is only suitable for binary classification, making it infeasible for a mapping function that outputs the assignments for $K > 2$ components. Thus, we adopt the logistic-softmax function [25] as our mapping function: + +$$ +h _ {n} ^ {(k)} = p \left(z _ {n k} = 1 \mid \mathbf {f} _ {n}\right) = \frac {\sigma \left(f _ {n} ^ {(k)}\right)}{\sum_ {j = 1} ^ {K} \sigma \left(f _ {n} ^ {(j)}\right)} \tag {4} +$$ + +To handle the summation in (4), we introduce random variables $\lambda_{1:N}$ and use identity $\frac{1}{x} = \int_0^\infty e^{-\lambda x} \, \mathrm{d}\lambda$ so that + +$$ +p \left(z _ {n k} = 1 \mid \mathbf {f} _ {n}, \lambda_ {n}\right) = \sigma \left(f _ {n} ^ {(k)}\right) \prod_ {j = 1} ^ {K} e ^ {- \lambda_ {n} \sigma \left(f _ {n} ^ {(j)}\right)} \tag {5} +$$ + +where $p(\lambda_n) \propto \mathbb{1}_{(0,\infty)}, \forall n \in [1,N]$ . By leveraging the moment generation function of the Poisson distribution $\mathrm{Po}(\lambda)$ , we introduce random variables $\Upsilon = \{\pmb{v}_1, \dots, \pmb{v}_N\}$ , where $\pmb{v}_n = (v_{n1}, \dots, v_{nK})^T$ , to convert the exponential term in (5), which leads to + +$$ +p \left(z _ {n k} = 1 \mid \mathbf {f} _ {n}, \boldsymbol {v} _ {n}\right) = \sigma \left(f _ {n} ^ {(k)}\right) \prod_ {j = 1} ^ {K} \left(\sigma \left(- f _ {n} ^ {(j)}\right)\right) ^ {v _ {n j}} \tag {6} +$$ + +where $v_{nk} \sim \mathrm{Po}(v_{nk}|\lambda_n)$ . Finally, using (3) and introducing the Pólya-Gamma random variables $\Omega = \{\omega_1,\dots,\omega_N\}$ , where $\omega_{n} = (\omega_{n1},\dots,\omega_{nK})^{T}$ , leads to + +$$ +p \left(z _ {n k} = 1 \mid \mathbf {f} _ {n}, v _ {n k}, \omega_ {n k}\right) = \prod_ {k = 1} ^ {K} 2 ^ {- \left(z _ {n k} + v _ {n k}\right)} \exp \left\{\frac {\left(z _ {n k} - v _ {n k}\right) f _ {n} ^ {(k)}}{2} - \frac {\left(f _ {n} ^ {(k)}\right) ^ {2}}{2} \omega_ {n k} \right\} \tag {7} +$$ + +where $\omega_{nk} \sim \mathrm{PG}(\omega_{nk}|v_{nk},0)$ . Figure 3 shows the graphical model with the auxiliary variables ( $\mathbf{x}_n$ 's are omitted from the graph to keep the notation uncluttered). + +We proceed by defining a variational distribution with auxiliary variables: + +$$ +q (\Theta , Z, F, \boldsymbol {\lambda}, \Upsilon , \Omega) = q (\Theta) q (Z) q (F) q (\boldsymbol {\lambda}) q (\Upsilon , \Omega) \tag {8} +$$ + +The optimal variational distribution can be obtained by computing the moments of component variational distributions using some important properties of the main and auxiliary variables and iterating until convergence. The optimal variational distributions of the main latent variables are summarized in the following theorem. + +Theorem 1. With the auxiliary random variables and the transformed complete conditional likelihood given in (6), the optimal components of the variational distribution as specified by (8) are given by + +- Component assignments $\widehat{q}(Z) = \prod_{n} \prod_{k} \widehat{q}(z_{nk})$ : + +$$ +\widehat {q} \left(z _ {n k}\right) = \operatorname {C a t} \left(z _ {n k} \mid \widehat {\phi_ {n k}}\right); \quad \widehat {\phi_ {n k}} \propto \exp \left\{\sum_ {l = 1} ^ {L} \left[ y _ {n l} \left(\psi \left(\widehat {a _ {k l}}\right) - \psi \left(\widehat {a _ {k l}} + \widehat {b _ {k l}}\right)\right) \right] + \frac {\widehat {m _ {n k}}}{2} \right\} \tag {9} +$$ + +where $\psi (\cdot)$ is the digamma function and $\widehat{m_{nk}}$ is $n$ -th element of mean of $\widehat{q} (\mathbf{f}^{(k)})$ defined in $\widehat{q} (F)$ . + +![](images/40c9a1bb68378ca482ff8506539fd6277d67fd16383296d0587aa97da258e1ab.jpg) +Figure 3: Graphical model with auxiliary variables + +- Bernoulli mixture components $\widehat{q}(\Theta) = \prod_{k} \prod_{l} \widehat{q}(\theta_{kl})$ + +$$ +\widehat {q} \left(\theta_ {k l}\right) = B e t a \left(\theta_ {k l} \mid \widehat {a _ {k l}}, \widehat {b _ {k l}}\right); \quad \widehat {a _ {k l}} = a _ {k l} + \sum_ {n = 1} ^ {N} \widehat {\phi_ {n k}} y _ {n l}, \widehat {b _ {k l}} = b _ {k l} + \sum_ {n = 1} ^ {N} \widehat {\phi_ {n k}} (1 - y _ {n l}) \tag {10} +$$ + +- $GP$ latent functions $\widehat{q}(F) = \prod_k \widehat{q}(\mathbf{f}^{(k)})$ : + +$$ +\widehat {q} \left(\mathbf {f} ^ {(k)}\right) = \mathcal {N} \left(\mathbf {f} _ {k} \mid \widehat {\mathbf {m} _ {k}}, \widehat {\Sigma_ {k}}\right); \widehat {\mathbf {m} _ {k}} = \frac {1}{2} \widehat {\Sigma_ {k}} \left(\widehat {\phi_ {k}} - \mathbb {E} _ {\widehat {q} \left(\boldsymbol {v} _ {k}\right)} [ \boldsymbol {v} _ {k} ]\right), \widehat {\Sigma_ {k}} = \left(\Sigma_ {k} ^ {- 1} + d i a g \left(\mathbb {E} _ {\widehat {q} \left(\boldsymbol {\omega} _ {k}, \boldsymbol {v} _ {k}\right)} [ \boldsymbol {\omega} _ {k} ]\right)\right) ^ {- 1} \tag {11} +$$ + +where $\pmb{v}_k = (v_{1k},\dots,v_{Nk})^T$ $\pmb{\omega}_{k} = (\omega_{1k},\dots,\omega_{Nk})^{T}$ , and $\widehat{q} (\pmb {\omega}_k,\pmb {v}_k) = \widehat{q} (\pmb {\omega}_k|\pmb {v}_k)\widehat{q} (\pmb {v}_k)$ is the optimal variational distribution for these auxiliary variables. + +The specific forms of the auxiliary variational distributions $q(\pmb{\lambda})$ and $q(\Upsilon, \Omega)$ are provided in Appendix B as part of the detailed proof of the theorem. + +Model interpretation. The optimal variational distributions are fairly intuitive. Interpreting these distributions can reveal some key insights on how the proposed $\mathrm{GP - B^2M}$ model leverages the data features as an effective inductive bias to discover semantically coherent components from a sparse label space. First, from (9), the component assignment of data sample $(\mathbf{x}_n,\mathbf{y}_n)$ is determined by two terms: the first term indicates how all its labels $\mathbf{y}_n$ are correlated with the component and the second term reflects how likely to categorize the features $\mathbf{x}_n$ into the component. Second, from (10), since the component assignments are further utilized to compute the Bernoulli mixture components, the optimal components naturally aggregate both label and feature information to ensure semantic consistency as a result of using data features as the inductive bias. Last, from (11), the GP latent function value on a component increases with a positive component assignment and decreases with a 'negative' assignment, captured by the Poisson auxiliary variables $\pmb{v}_k$ . + +Time complexity. According to (11), posterior inference of $\mathrm{GP - B^2M}$ has the computational complexity of $O(N^{3}K)$ which is identical to training $K$ GPs. Since each component can be updated independently, we can parallelize the computation to further reduce the complexity to $O(N^{3})$ . We can further leverage sparse kernel machines (e.g., Sparse GP) to reduce the complexity if N is large. + +# 3.3 Multi-Label Active Sampling + +Being a Bayesian model, $\mathrm{GP - B^2M}$ outputs the predictive distribution that provides both the label prediction and a label covariance matrix. As the covariance matrix captures both the uncertainty of individual labels and correlation of each pair of labels, it provides essential information to design a principled measure to quantify a data sample's overall contribution to a correlated label space. + +For each testing sample $\mathbf{x}_{*}$ , the predictive mean can be computed using the variational distributions: + +$$ +\mathbb {E} \left[ \mathbf {y} _ {*} \mid \mathbf {x} _ {*} \right] \approx \sum_ {k} \mathbb {E} _ {p \left(\mathbf {f} _ {*} \mid \mathbf {X}, \mathbf {Y}, \mathbf {x} _ {*}\right)} \left[ \pi_ {*} k \right] \mathbb {E} _ {q (\Theta)} \left[ \boldsymbol {\theta} _ {k} \right] \tag {12} +$$ + +$$ +p (\mathbf {f} _ {*} | \mathbf {X}, \mathbf {Y}, \mathbf {x} _ {*}) \approx \int p (\mathbf {f} _ {*} | \mathbf {X}, F, \mathbf {x} _ {*}) q (F) \mathrm {d} F, \quad \mathbb {E} _ {q (\boldsymbol {\theta} _ {k})} [ \theta_ {k l} ] = \widehat {a _ {k l}} / (\widehat {a _ {k l}} + \widehat {b _ {k l}}) +$$ + +where $\pi_{*k} = p(z_{*k} = 1|\mathbf{f}_*)$ is defined as a logistic-softmax function given in (4). Theorem 1 shows that $q(F)$ , which approximates the true posterior $p(F|\mathbf{X},\mathbf{Y})$ , is a Gaussian. Hence, $p(\mathbf{f}_{*}|\mathbf{X},\mathbf{Y},\mathbf{x}_{*})$ is also a Gaussian. However, the logistic-softmax transformation makes predictive mean intractable + +![](images/e94f3ffcaec46dd6dade78a660f5bb9184ded3bd1c059a17236c953171fa5436.jpg) +(a) + +![](images/b61a9c71b6ca270535b0e89c2552f06bc28773bd3dd7f96af370e3437994e6b4.jpg) +(b) +Figure 4: (a) Distribution of $E4$ samples; (b) Prediction by BRMs; (c) Mixture component assignments by $\mathrm{B}^2\mathrm{M}$ ; (d) Prediction by $\mathrm{B}^2\mathrm{M}$ . + +![](images/a3e6c492e2b542e9f59f68d8b638624956cc0e3cffc038d107ce14c1570446f3.jpg) +(c) + +![](images/60e6fa55a7a40547b9e6e30dc437db1d153c1fb6c686c703aa86d7c19d275435.jpg) +(d) + +to compute. We propose to conduct Monte Carlo (MC) integration by drawing samples from $p(\mathbf{f}_*|\mathbf{X},\mathbf{Y},\mathbf{x}_*)$ , perform logistic-softmax transformation, and then average. + +The $\mathrm{GP - B^2M}$ model also allows us to compute the predicted label covariance, + +$$ +\operatorname {c o v} \left[ \mathbf {y} _ {*} \mid \mathbf {x} _ {*} \right] = \sum_ {k} \mathbb {E} \left[ \pi_ {* k} \right] \left\{\mathbb {E} \left[ \Lambda_ {k} \right] + \mathbb {E} \left[ \boldsymbol {\theta} _ {k} \right] \mathbb {E} \left[ \boldsymbol {\theta} _ {k} \right] ^ {T} \right\} - \mathbb {E} \left[ \mathbf {y} _ {*} \mid \mathbf {x} _ {*} \right] \mathbb {E} \left[ \mathbf {y} _ {*} \mid \mathbf {x} _ {*} \right] ^ {T} \tag {13} +$$ + +where $\Lambda_{k} = \mathrm{diag}\{\mathbb{E}[\theta_{kl}](1 - \mathbb{E}[\theta_{kl}])\}$ . The predicted label covariance captures both individual label uncertainty (diagonal entries of the matrix) and label correlations (off-diagonal entries), which is instrumental to quantify the total uncertainty of a test sample with respect to its predicted labels. Since directly computing the entropy of a mixture distribution is challenging, we instead choose to use the log determinant of covariance matrix: $\ln |\operatorname{cov}[\mathbf{y}_*|\mathbf{x}_*]\|$ , as a proxy for uncertainty evaluation. Intuitively, this is equivalent to approximating $p(\mathbf{y}_*|\mathbf{x}_*)$ using a multivariate Gaussian, whose entropy is the log determinant of its covariance matrix plus a constant. + +The label covariance is computed using a point estimate of $\pmb{\pi}_{*} = (\pi_{*1},\dots,\pi_{*K})^{T}$ (one $\pi_{*k}$ for each class) to quantify the total uncertainty on the label side. As a Bayesian model, the proposed GP- $\mathbf{B}^2\mathbf{M}$ allows us to quantify the variation of each $\pi_{k}$ using its predictive variance. Through MC integration as described above, we compute the predictive variance $\mathrm{Var}[\pi_{*k}]$ of sample $\mathbf{x}_{*}$ for each of the $K$ class. According to the property of the GP posterior, we can easily show that the model would assign a low variance to data samples near to the training data and a high variance to faraway samples. As a result, the predictive variance effectively captures the feature uncertainty that complements the label covariance. It allows the proposed sampling function to differentiate data samples based on their distinct contributions to model training and sample them accordingly. Our final sampling function is given by: $\hat{\mathbf{x}}_{*} = \arg \max_{\mathbf{x}_{*}}\ln |\mathrm{cov}[\mathbf{y}_{*}|\mathbf{x}_{*}]| + \eta \sum_{k}\mathrm{Var}[\pi_{*k}] / K$ , where $\eta$ is used to balance between label covariance and predictive variance of data features. It can be dynamically updated to give a higher weight in the early stage of AL to the feature variance term for better exploration of the data space and then shift the focus to the label covariance term for effective fine-tuning of decision boundaries with a correct shape obtained through effective exploration. + +# 4 Experiments + +We conduct extensive experiments on both synthetic and real-world multi-label data to demonstrate: (1) important properties of $\mathrm{GP - B^{2}M}$ to capture complex label correlations and how they contribute to predict complex labels, (2) state-of-the-art ML-AL performance by comparing with existing competitive models, (3) impact of key model parameters through an ablation study, and (4) effectiveness of active sampling by examining sampled data instances. + +# 4.1 Synthetic Data + +We design a synthetic dataset with 18 labels that exhibit 4 distinct types of dependencies as defined in Figure 1 (c). In the introduction, we show that three discovered mixture components precisely capture some rather complex label dependencies (e.g., hierarchical and exclusive) while being highly interpretable. For this dataset, the model discovers 10 components in total and we show some other components in Appendix D along with their interpretations. We further demonstrate how the discovered components contribute to the prediction of more complex and less frequent labels. We use $E4$ as an example, which is located deep in the hierarchy and appears much less than other labels. + +Figure 4 (a) shows the distribution of data samples whose labels contain $E4$ . It can be seen that these samples are distributed across the entire $E1$ region (roughly corresponds to the shaded area in purple). + +Note that, in addition to $E1$ , $E4$ also depends on the exclusive relationship: $E3$ AND NOT $E2$ ( $E2$ , $E3$ are not shown in the figure to keep the distribution of $E4$ clear). Figure 4 (b) shows the prediction result from BRMs, which has very high false positive and negative rates. The poor performance is also reflected by a low ROC-AUC (area under the receiver operating characteristic curve) score at 0.58 (slightly better than random guessing). It appears that BRMs only predict correctly samples in an area where $E4$ samples are relatively dense while missing most others. This is because BRMs try to directly learn the feature-label mapping (by training independent binary predictors), which is usually weak for complex and less frequent labels, like $E4$ . + +Different from BRMs, the proposed $\mathrm{GP - B^2M}$ learns mixture components that correctly capture the label correlations and the final labels can be recovered by combining the mixture components through their predicted coefficients. As discussed earlier, $E4$ has a high chance to appear in either + +Figure 5: AUC on different types of labels + +
LabelG1-G8C1,C2O1-O4E1-E4
BRMs0.790.680.720.58
GP-B2M0.830.700.860.82
+ +Component 1 or 2. Figure 4 (c) shows the predicted component assignments and the top component is highlighted. As can be seen, most $E4$ samples are assigned Component 1 or 2 as their top component. Also, samples assigned to Component 1 (shown in blue) are mostly distributed in the non-overlapping geometric regions and those assigned to Component 2 (shown in yellow) are mostly in overlapping regions. By leveraging these components, GP- $\mathbf{B}^2\mathbf{M}$ achieves much better prediction results as shown Figure 4 (d). Table 5 summarizes the AUC scores from BRMs and GP- $\mathbf{B}^2\mathbf{M}$ on different types of labels. While both models achieve similar performance on some common labels (e.g., G), GP- $\mathbf{B}^2\mathbf{M}$ significantly outperforms BRMs for more complex labels, where it is essential to capture important label correlations. + +# 4.2 Real Data + +Datasets and experiment settings. We choose five representative real-world multi-label datasets, including Delicious, Enron, BibTEX, Corel5K, and NUS-WIDE, from different application domains [26]. All datasets have a relatively large label space and high label sparsity $(2 - 6\%)$ . Table 2 in Appendix D summarizes key properties of the pre-processed datasets. We randomly shuffle each dataset and partition them into three parts: training, testing, and candidate pool. We keep a minimum of one positive instance per label in the initial training partition as required by BRMs based AL models. To make sure each label is well represented in each partition, we remove extremely rare labels with label frequency less than 20. Since the remaining labels are still highly imbalanced, we use the ROC-AUC score to evaluate the model performance. All the baseline models share the same copy of the initial training set to make a fair comparison. Active learning stops after each model selects 500 samples. + +Performance comparison. We include five competitive baselines for AL performance comparison: + +- MMC samples instances that introduce the greatest change of the expected loss. During label prediction, it uses logistic regression to predict the number of labels for a new instance [14]. +- Adaptive considers both the separation margin of an SVM and the label cardinality inconsistency and combines these two parts for data sampling [16]. +- AUDI uses a label ranking mechanism, where a dummy label is used to separate the positive and negative labels. Its sampling function is based on a modified cardinality inconsistency measure [27]. +- CVIRS combines the ranking on the magnitude of the difference margin in predictions and the label vector inconsistency for active sampling [17]. +- CS-GP conducts active sampling in a compressed label space using a multi-output GP [21]. + +Figure 6 reports the AUC scores of all the models. For each curve, we present the average result along with the error bar from 3 trials of randomly initialized AL experiments. The proposed $\mathbf{B}^2\mathbf{M}$ model achieves better AL performance consistently on all the datasets. For multiple datasets, $\mathrm{GP - B^{2}M}$ establishes a clear advantage in the early to middle stages of AL. While a few baselines eventually converge to a similar AUC score, they usually take more iterations (by consuming more labels) to reach a comparable performance as $\mathrm{GP - B^2M}$ . In addition, by comparing with random sampling with the proposed sampling function, we clearly demonstrate that the superior AL performance attributes to both the Bayesian mixture model and the effective active sampling. Note that the AUDI model runs much slower for BibTex and Corel5K when both the number of features and candidate pool size become very large so we omit the results. + +Analysis on label-wise improvement. To further justify why the proposed $\mathrm{GP - B^2M}$ outperforms the baselines, we offer a fine-grained analysis on the label-wise performance, which helps to achieve + +![](images/ca012973915d5ee99f74a7ef95a0ec4bd28cdddf87b74047f0b86f610ed3c2d7.jpg) +(a) + +![](images/52dcc0694cf593c25c7cb77ef7459b3887ecefade4016dd6585627064fe9aca7.jpg) + +![](images/cc2111850e229bfd007986b3aac048904cc6fdc35ca9dc25d21a9349f3f3ad2a.jpg) + +![](images/3ce2706f0da66aa8fcaf9d79eba4ed522dfc4b12ce42bf60e241759227c7f9d7.jpg) + +![](images/31b30db6fb6a5da1bba75ed2b2fa5512081ba96fb76957a7657039f96b3583ca.jpg) +(e) + +![](images/243871de4e6f228e12831314d1b7319144dd4cf436567b1291044fade1332e1c.jpg) +(f) + +![](images/bbc15dd9691c06d093e1781c75bc7f024f276629c4f002be4e1f3db7cae83163.jpg) +(g) + +![](images/d923a9657b88c7aa190a0cc3ac18815534f18a9c6e2fa8a06537d670f49a4fe1.jpg) +Figure 6: AL performance comparison (a)-(e); Ablation study on one example dataset (Enron): (f) shows the impact of $\eta$ and (g) shows the impact of effective components. +(a) +Figure 7: The label-wise average precision improvement over BRMs models. + +![](images/566ff80b36cb88782fa92cbb1587f7d16c136b86c62a027e6369e7f05b1af30a.jpg) +(b) + +a deeper insight on the performance gain. In fact, we reach a similar conclusion as the synthetic data experiments: while all models perform reasonably well on the most frequent labels, $\mathrm{GP - B^2M}$ clearly outperforms other baselines on less frequent labels, where considering the correlations with other labels can help to improve their predictions. Thus, in our fine-grained analysis, we first exclude the few most frequent labels and compute the Average Precision Improvement (API) of the $i$ -th label, + +$$ +A P I ^ {(i)} = \frac {A P _ {B ^ {2} M} ^ {(i)} - A P _ {B R M s} ^ {(i)}}{A P _ {B R M s} ^ {(i)}} \times 100 \% \tag{14} +$$ + +where $AP_{B^2 M}^{(i)}$ and $AP_{BRMs}^{(i)}$ denote the average precision of label $i$ provided by $\mathrm{GP - B^2M}$ and BRMs, respectively. Figure 7 demonstrates the label-wise API on the NUS-WIDE and Delicious datasets as two illustrative examples. We observe that $\mathrm{GP - B^2M}$ performs significantly better than BRMs on labels with a moderate or low frequency. This is because those labels usually do not have sufficient positive instances for BRMs to learn independently. Furthermore, they may have a complex correlation with other labels. $\mathrm{GP - B^2M}$ effectively leverages label correlations to make better predictions on these labels. This further confirms the overall good performance of $\mathrm{GP - B^2M}$ . + +Ablation study. We further investigate the impact of two tunable parameters of the model: (1) $\eta$ , which balances label covariance and feature uncertainty for data sampling and (2) $\rho$ , which controls the effective number of mixture components. Limited by space, we use the Enron dataset as an example and report other results in Appendix D. Figure 6 (f) compares the performance under different $\eta$ values. In early iterations, the label covariance guided sampling ( $\eta$ is small) slightly falls behind the feature uncertainty guided sampling ( $\eta$ is large) as the latter is more useful to explore + +![](images/eaac4402713e2179d3e07daf326a4dd48619d6e62888bf4ea0794edbda925ef2.jpg) + +![](images/bf3d01529d3cf6424d28a8e611923ac1cbbf22fdc0ddb52ae4946cc0a1250a88.jpg) +'landscape', + +![](images/dd34e6987c67da6cb687aa3171abaa238fc71047a8beb5f5568c396d81f06cd5.jpg) + +![](images/fbd4253418a88b4e4780cf70e877933d8c4eba977ad018a9b5b3b0eed933abb1.jpg) + +![](images/57b1996df908cded996c3cb760028b0802e82212c2c34561610f62bf895a56a5.jpg) +(a) ['clouds', ..., 'grass', 'plants', 'sky', 'valley'] +(e) ['architecture', 'b] clouds', 'plants', 'sky'] +Figure 8: (a)-(c) Training images; (d)-(f) Images with a large feature uncertainty; (g)-(h) Images with a high label variance. + +![](images/b0b159da09634b8a6fb0b0c7037e133d5985cad6fd8161fe739982a93b12b4bc.jpg) +(b) ['clouds', 'plants', 'sky'] +(f) ['farm', 'plants'] +'d', 'grass', + +![](images/b7ed2832258ee56e238257f2b4f4c1075f25c541a59f0b79504f0539513842f2.jpg) +(c) ['clouds', 'farm', 'lands' 'nature', 'plants', 'sky', 'sun +(g) ['clouds', 'farm', 'flowers', 'grass', 'plants', 'sky'] + +![](images/0d8e5f601ffdeb23402026d4b52ab3d7bfd71fa617110e93b09e01d1cf81ab60.jpg) +(d) ['house', 'plants', 'sky'] +'landscape', +(h) ['art, 'clouds', 'grass', 'nature', 'plants', 'sky', 'tree'] + +the feature space. Label covariance guided sampling gradually catches up and finally surpasses the feature uncertainty guided sampling. As shown next by the sampled instances, both criteria select informative instances that play complementary roles to improve the AL model. Figure 6 (g) shows how the AL performance is affected by the effective number of mixture components that is automatically determined by an upper bound $K$ and component strength ratio $\rho$ . For component $k$ , we compute its total 'effective posterior observations' [28] $g(\pmb{\theta}_k) = \sum_{l=1}^{L} \widehat{a_{kl}} + \widehat{b_{kl}}$ and define a threshold as $\bar{g} = (\rho / K) \sum g(\pmb{\theta}_k)$ . The effective components only include those with $g(\pmb{\theta}_k) \geq \bar{g}$ . When the size of the training set is still small (early stage in AL), fewer components (large $\rho$ ) yield better results than more components (small $\rho$ ) by avoiding over-fitting. When more training labels are acquired, a more flexible model can better explain the label correlations thus has better performance. + +Examples of actively sampled instances. To demonstrate the effectiveness of the proposed sampling function, we show images sampled by $\mathrm{GP - B^2M}$ from the NUS-WIDE dataset. To explain the distinct nature of these sampled images and how they contribute to the model training, we also show some representative images from the initial training pool for comparison. These correspond to images in Figure 8 (a)-(c) with common labels: 'plants' and 'sky'. First, for sampled images with a large feature uncertainty, while 'plants' and/or 'sky' are predicted for those images, they look very different from the training images. In particular, although the labels of the image in Figure 8 (e) contain both 'plants' and 'sky', there are no visible plants. For the image in Figure 8 (f), the label 'person' is not present even though a person is visible in the image. These types of samples are significantly dissimilar to the initial training set, thus considered valuable to explore the feature space for effective sampling. Images in Figure 8 (g)-(h) are samples based on a high label covariance. These images look similar to the training examples but their corresponding labels are somewhat different. Sampling these images can further improve the prediction of these labels and correlations there of, such as 'plants', 'grass', and 'nature'. As these images bring in additional labels, they may also help the model discover more possible correlations, such as that between 'plants' and 'flowers' or 'tree'. + +# 5 Conclusion + +We present a novel Gaussian Process-Bayesian Bernoulli Mixture (GP- $\mathbf{B}^2\mathbf{M}$ ) model for cost-effective multi-label active learning. GP- $\mathbf{B}^2\mathbf{M}$ extracts global patterns of label correlations by learning from both (limited) training labels and data features. The mixture components, which are accurately learned from end-to-end and fully conjugate posterior inference, are capable of encoding complex label correlations while being highly interpretable. A novel sampling function is designed by combining feature uncertainty and label covariance, both of which can be obtained from the predictive distribution of the GP- $\mathbf{B}^2\mathbf{M}$ model. Experiments conducted on both synthetic and real data justify the important properties of the model and its state-of-the-art AL performance. + +# Acknowledgements + +This research was supported in part by an NSF IIS award IIS-1814450 and an ONR award N00014-18-1-2875. The views and conclusions contained in this paper are those of the authors and should not be interpreted as representing any funding agency. We would also like to thank the anonymous reviewers for their constructive comments. + +# References + +[1] Hao Fei, Yue Zhang, Yafeng Ren, and Donghong Ji. Latent emotion memory for multi-label emotion classification. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 7692-7699, 2020. +[2] Dongkai Wang and Shiliang Zhang. Unsupervised person re-identification via multi-label classification. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10981-10990, 2020. +[3] Min-Ling Zhang and Zhi-Hua Zhou. Multilabel neural networks with applications to functional genomics and text categorization. IEEE transactions on Knowledge and Data Engineering, 18(10):1338-1351, 2006. +[4] Weizhi Liao, Yu Wang, Yanchao Yin, Xiaobing Zhang, and Pan Ma. Improved sequence generation model for multi-label classification via cnn and initialized fully connection. Neurocomputing, 382:188-195, 2020. +[5] Min-Ling Zhang, Yu-Kun Li, Xu-Ying Liu, and Xin Geng. Binary relevance for multi-label learning: an overview. Frontiers of Computer Science, 12(2):191-202, 2018. +[6] Cheng Li, Bingyu Wang, Virgil Pavlu, and Javed Aslam. Conditional bernoulli mixtures for multi-label classification. In International conference on machine learning, pages 2482-2491, 2016. +[7] Chih-Kuan Yeh, Wei-Chieh Wu, Wei-Jen Ko, and Yu-Chiang Frank Wang. Learning deep latent space for multi-label classification. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 31, 2017. +[8] Ya Wang, Dongliang He, Fu Li, Xiang Long, Zhichao Zhou, Jinwen Ma, and Shilei Wen. Multi-label classification with label graph superimposing. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34, pages 12265-12272, 2020. +[9] André Elisseeff and Jason Weston. A kernel method for multi-labelled classification. In Advances in neural information processing systems, pages 681-687, 2002. +[10] Nadia Ghamrawi and Andrew McCallum. Collective multi-label classification. In Proceedings of the 14th ACM international conference on Information and knowledge management, pages 195-200, 2005. +[11] Weiwei Cheng, Eyke Hüllermeier, and Krzysztof J Dembczynski. Bayes optimal multilabel classification via probabilistic classifier chains. In Proceedings of the 27th international conference on machine learning (ICML-10), pages 279–286, 2010. +[12] Jesse Read, Bernhard Pfahringer, and Geoff Holmes. Multi-label classification using ensembles of pruned sets. In 2008 eighth IEEE international conference on data mining, pages 995-1000. IEEE, 2008. +[13] Jesse Read, Bernhard Pfahringer, Geoff Holmes, and Eibe Frank. Classifier chains for multi-label classification. Machine learning, 85(3):333, 2011. +[14] Bishan Yang, Jian-Tao Sun, Tengjiao Wang, and Zheng Chen. Effective multi-label active learning for text classification. In Proceedings of the 15th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 917-926, 2009. + +[15] W. Shi, X. Liu, and Q. Yu. Correlation-aware multi-label active learning for web service tag recommendation. In 2017 IEEE International Conference on Web Services (ICWS), pages 229-236, 2017. +[16] Xin Li and Yuhong Guo. Active learning with multi-labelsvm classification. In $IjCAI$ , pages 1479-1485. Citeseer, 2013. +[17] Oscar Reyes, Carlos Morell, and Sebastián Ventura. Effective active learning strategy for multi-label learning. Neurocomputing, 273:494-508, 2018. +[18] Junyu Chen, Shiliang Sun, and Jing Zhao. Multi-label active learning with conditional bernoulli mixtures. In Pacific Rim International Conference on Artificial Intelligence, pages 954-967. Springer, 2018. +[19] Nengneng Gao, Sheng-Jun Huang, and Songcan Chen. Multi-label active learning by model guided distribution matching. Frontiers of Computer Science, 10(5):845-855, 2016. +[20] Deepak Vasisht, Andreas Damianou, Manik Varma, and Ashish Kapoor. Active learning for sparse bayesian multilabel classification. In Proceedings of the 20th ACM SIGKDD international conference on Knowledge discovery and data mining, pages 472-481, 2014. +[21] Weishi Shi and Qi Yu. Fast direct search in an optimally compressed continuous target space for efficient multi-label active learning. In International Conference on Machine Learning, pages 5769-5778, 2019. +[22] Radford M Neal. Slice sampling. Annals of statistics, pages 705-741, 2003. +[23] Radford M Neal et al. Mcmc using hamiltonian dynamics. Handbook of markov chain monte carlo, 2(11):2, 2011. +[24] Nicholas G Polson, James G Scott, and Jesse Windle. Bayesian inference for logistic models using polya-gamma latent variables. Journal of the American Statistical Association, 108(504):1339-1349, 2013. +[25] Théo Galy-Fajou, Florian Wenzel, Christian Donner, and Manfred Opper. Multi-class gaussian process classification made conjugate: Efficient inference via data augmentation. In Uncertainty in Artificial Intelligence, pages 755-765. PMLR, 2020. +[26] Grigorios Tsoumakas, Eleftherios Spyromitros-Xioufis, Jozef Vilcek, and Ioannis Vlahavas. *Mulan: A java library for multi-label learning.* The Journal of Machine Learning Research, 12:2411-2414, 2011. +[27] Sheng-Jun Huang and Zhi-Hua Zhou. Active query driven by uncertainty and diversity for incremental multi-label learning. In 2013 IEEE 13th International Conference on Data Mining, pages 1079-1084. IEEE, 2013. +[28] Christopher M Bishop. Pattern recognition and machine learning. Springer, 2006. + +# Checklist + +1. For all authors... + +(a) Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope? [Yes] +(b) Did you describe the limitations of your work? [Yes] For performance comparison, we tried to include all the representative baselines based on our best knowledge. However, certain baselines may be designed for a specific purpose. As a result, some baseline cannot run properly for the datasets used in our experiments to generate reasonable results. We have made this clear in the performance comparison section of our experiments. Another potential limitation is that all the labels collected are assumed to be accurate, like most other active learning models. Dealing with imperfect labels is an important direction that is out of the scope of this paper. +(c) Did you discuss any potential negative societal impacts of your work? [Yes] We provided references of real-world applications (e.g., bioinformatics and medicine) with positive societal impacts. One potential negative impact is that the active learning model could be leveraged by malicious attackers as a tool to manipulate the supervised learning model. Since the model will be trained using much less data, if certain data samples are compromised, the impact may be larger than a typically trained supervised learning model. +(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] + +2. If you are including theoretical results... + +(a) Did you state the full set of assumptions of all theoretical results? [Yes] +(b) Did you include complete proofs of all theoretical results? [Yes] + +3. If you ran experiments... + +(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] +(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] +(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] +(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] + +4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... + +(a) If your work uses existing assets, did you cite the creators? [N/A] +(b) Did you mention the license of the assets? [N/A] +(c) Did you include any new assets either in the supplemental material or as a URL? [N/A] +(d) Did you discuss whether and how consent was obtained from people whose data you're using/curating? [N/A] +(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] + +5. If you used crowdsourcing or conducted research with human subjects... + +(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] +(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] +(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] \ No newline at end of file diff --git a/agaussianprocessbayesianbernoullimixturemodelformultilabelactivelearning/images.zip b/agaussianprocessbayesianbernoullimixturemodelformultilabelactivelearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..727793d9b39db71ca8eca4faa4e44d8ea3acb0d2 --- /dev/null +++ b/agaussianprocessbayesianbernoullimixturemodelformultilabelactivelearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:de0c84a2253401152d544c910523cec59e954dd498a15a5a69c8f29d83fcfc96 +size 584200 diff --git a/agaussianprocessbayesianbernoullimixturemodelformultilabelactivelearning/layout.json b/agaussianprocessbayesianbernoullimixturemodelformultilabelactivelearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..81e2e807b7bf7233cddf5f09748b3d9f034c43a8 --- /dev/null +++ b/agaussianprocessbayesianbernoullimixturemodelformultilabelactivelearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a2abf0fb57e19ad04e1db54d2645d4973bbc5d6fa6e0485930167a19bed679ce +size 532267 diff --git a/agenerativenonparametricbayesianmodelforwholegenomes/7a94f690-e92f-443d-99db-33abbba95392_content_list.json b/agenerativenonparametricbayesianmodelforwholegenomes/7a94f690-e92f-443d-99db-33abbba95392_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..a311be31d14ad458c577e48b92e28aab2afce356 --- /dev/null +++ b/agenerativenonparametricbayesianmodelforwholegenomes/7a94f690-e92f-443d-99db-33abbba95392_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4b388fa6ec8106f5f92107d5ff1c6cb85bdcdd385c1c5e0c852a2570090ad6a3 +size 82327 diff --git a/agenerativenonparametricbayesianmodelforwholegenomes/7a94f690-e92f-443d-99db-33abbba95392_model.json b/agenerativenonparametricbayesianmodelforwholegenomes/7a94f690-e92f-443d-99db-33abbba95392_model.json new file mode 100644 index 0000000000000000000000000000000000000000..c17eae60f113e0758537d450f65f9cd8f261da72 --- /dev/null +++ b/agenerativenonparametricbayesianmodelforwholegenomes/7a94f690-e92f-443d-99db-33abbba95392_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28ebd3fc11c846e4e72ef76346516f7777db08c968dfb7bda9d0ce5851f4ce9c +size 104560 diff --git a/agenerativenonparametricbayesianmodelforwholegenomes/7a94f690-e92f-443d-99db-33abbba95392_origin.pdf b/agenerativenonparametricbayesianmodelforwholegenomes/7a94f690-e92f-443d-99db-33abbba95392_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..53d05baa964104e07bc2870b41abfcd6444cc4c2 --- /dev/null +++ b/agenerativenonparametricbayesianmodelforwholegenomes/7a94f690-e92f-443d-99db-33abbba95392_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f07d05f3beb88d54c75eebdaea2645659f923ce88ee09c2a64a008a18c59d9a5 +size 11679417 diff --git a/agenerativenonparametricbayesianmodelforwholegenomes/full.md b/agenerativenonparametricbayesianmodelforwholegenomes/full.md new file mode 100644 index 0000000000000000000000000000000000000000..df68474e7bbca2bc4480b153614e1bd09c5d6134 --- /dev/null +++ b/agenerativenonparametricbayesianmodelforwholegenomes/full.md @@ -0,0 +1,275 @@ +# A Generative Nonparametric Bayesian Model for Whole Genomes + +Alan N. Amin $^{1,2}$ , Eli N. Weinstein $^{2,3}$ and Debora S. Marks $^{2,4}$ + +1 Program in Systems, Synthetic and Quantitative Biology + +$^{2}$ Department of Systems Biology + +Harvard Medical School + +3 Program in Biophysics, Harvard University + +4 Broad Institute of Harvard and MIT + +alanamin@fas.harvard.edu, eweinstein@g.harvard.edu, debbie@hms.harvard.edu + +# Abstract + +Generative probabilistic modeling of biological sequences has widespread existing and potential use across biology and biomedicine, particularly given advances in high-throughput sequencing, synthesis and editing. However, we still lack methods with nucleotide resolution that are tractable at the scale of whole genomes and that can achieve high predictive accuracy in theory and practice. In this article we propose a new generative sequence model, the Bayesian embedded autoregressive (BEAR) model, which uses a parametric autoregressive model to specify a conjugate prior over a nonparametric Bayesian Markov model. We explore, theoretically and empirically, applications of BEAR models to a variety of statistical problems including density estimation, robust parameter estimation, goodness-of-fit tests, and two-sample tests. We prove rigorous asymptotic consistency results including nonparametric posterior concentration rates. We scale inference in BEAR models to datasets containing tens of billions of nucleotides. On genomic, transcriptomic, and metagenomic sequence data we show that BEAR models provide large increases in predictive performance as compared to parametric autoregressive models, among other results. BEAR models offer a flexible and scalable framework, with theoretical guarantees, for building and critiquing generative models at the whole genome scale. + +# 1 Introduction + +Measuring and making DNA is central to modern biology and biomedicine. Generative probabilistic modeling offers a framework for learning from sequencing data and forming experimentally testable predictions of unobserved or future sequences that can be synthesized in the laboratory [19, 31, 63]. Existing approaches to genome modeling typically preprocess the data to build a matrix of genetic variants such as single nucleotide polymorphisms [25, 57]. However, most modes of sequence variation are more complex. Structural variation occurs widely within individuals (e.g. in cancer), between individuals (e.g. in domesticated plant populations) and between species (e.g. in the human microbiome), and methods for detecting and classifying structural variants are heuristic and designed only for predefined types of sequence variation such as repeats [12, 44, 50, 69, 78]. Ideally, we would be able to directly model genome sequencing data and/or assembled genome sequences. However, building generative models that work with raw nucleotides, not matrices of alleles, raises the + +![](images/62dca3b46a9a9fd42f8c65c49f9b69a1c88d6185dbadd03673e8c85d92a91dd7.jpg) +Figure 1: Overview of the BEAR model. (A) BEAR models employ a Dirichlet prior on Markov transition probabilities that is centered at the prediction of an AR model. (B) De Bruijn graphs showing BEAR transitions with non-zero probability under an example data-generating distribution. As the lag $L$ increases, the model has higher resolution. + +![](images/0b65ab5b7b36af7d7a64ab8d0eeb2f4ece5f5a3cefcbb00205ee45948277bfb7.jpg) + +extreme statistical challenges of having enough flexibility to account for genomic complexity, interpretability to reach scientific conclusions, and scalability to train on billions of nucleotides. Given the relevance of genetic analysis to human health, models should also possess strong theoretical guarantees. + +Autoregressive (AR) models are a natural starting point for generative genome modeling, since they (1) have been successfully applied to biological sequences, as well as many other types of non-biological sequential data, (2) can be designed to have interpretable parameters, and (3) can be scaled to big datasets with very long sequences [66, 73]. However, since AR models are parametric models, they will in general suffer from misspecification; as we show empirically in Section 6 for genomic datasets misspecification can be a serious practical limitation not only for simple AR models but even for deep neural networks. + +As an alternative strategy for building generative probabilistic models at the genome scale, we propose in Section 2 the nonparametric "Bayesian embedded autoregressive" (BEAR) model. BEAR models are Bayesian Markov models, with a prior on the lag and conjugate Dirichlet priors on the transition probabilities. The hyperparameters of the Dirichlet prior are controlled by an "embedded" AR model with parameters $\theta$ and an overall concentration hyperparameter $h$ , both of which can be optimized via empirical Bayes. In Section 3 we show that BEAR models can capture arbitrary data-generating distributions, and establish asymptotic consistency guarantees and convergence rates for nonparametric density estimation. In Section 4 we show that the optimal $h$ provides a diagnostic for whether or not the embedded AR model is misspecified and if so by how much, alerting the practitioner when the parameter estimates $\theta$ are untrustworthy. Besides estimation problems, BEAR models can also be used to construct goodness-of-fit tests and two-sample tests, thanks to their analytic marginal likelihoods, and we prove consistency results for these tests in Section 5. Finally we apply BEAR models at large scale, to genomic datasets with tens of billions of nucleotides, including whole genome, whole transcriptome, and metagenomic sequencing data; we find that BEAR models can have greatly improved performance over AR models (Section 6). + +Crucial to our theoretical and empirical analysis is the statistical setting: we assume that the data $X_{1},\ldots ,X_{N}$ consists of finite but possibly variable length strings (with small alphabets) drawn i.i.d. from some underlying distribution $p^*$ , and study the behavior of estimators and tests as $N\to \infty$ . This setup differs from common theoretical analyses of sequence models outside of biology, which typically consider the limit as the length of an individual sequence goes to infinity [26]. In biology, however, we observe finite sequences recorded from many individual species, organisms, cells, molecules, etc. and want to generalize to unseen sequences, making $N\rightarrow \infty$ the appropriate large data limit. + +# 2 Bayesian embedded autoregressive models + +We first briefly review autoregressive (AR) models as applied to sequences of discrete characters. Let $f(\theta)$ denote an autoregressive function with parameter $\theta$ and let $L$ denote the lag of the autoregressive model; then the AR model generates data as + +$$ +X _ {i} \mid X _ {i - L: i - 1} \sim \text {C a t e g o r i c a l} \left(f _ {X _ {i - L: i - 1}} (\theta)\right), \tag {1} +$$ + +where $i$ indexes position in the sequence $X$ and $X_{i-L:i-1}$ consists of the previous $L$ letters in the sequence. Since sequence length as well as nucleotide or amino acid content is relevant to biological applications, we use a start symbol $\emptyset$ at the beginning and a stop symbol $\$$ at the end of each sequence; letters $X_i$ are sampled sequentially starting from the start symbol and continuing until a stop symbol is drawn. + +We propose the Bayesian embedded autoregressive (BEAR) model, a Bayesian Markov model that embeds an AR model into its prior. The BEAR model takes the form, + +$$ +L \sim \pi (l), \quad v _ {k} \sim \operatorname {D i r i c h l e t} \left(\frac {1}{h} f _ {k} (\theta)\right) \text {f o r a l l} k, \tag {2} +$$ + +$$ +X _ {i} \mid X _ {i - L: i - 1} \sim \text {C a t e g o r i c a l} \left(v _ {X _ {i - L: i - 1}}\right), +$$ + +where $\pi(l)$ is a prior on the lag with support up to infinity, $h > 0$ is a concentration hyperparameter, and $k$ is a length $L$ kmer. The BEAR model has three key properties (Fig. 1). First, the unrestricted transition parameter $v$ and lag $L$ allow the model to capture exact conditional distributions of $p^*$ to arbitrarily high order: $p^*(X_i|X_{i-1})$ at $L = 1$ , then $p^*(X_i|X_{i-2}, X_{i-1})$ at $L = 2$ , etc.. This property allows the BEAR model to be used for nonparametric density estimation (Section 3). Second, in the limit where $h \to 0$ , the BEAR model reduces to the embedded AR model (Eqn. 1). The optimal $h$ provides a measurement of the amount of misspecification in the AR model (Section 4). Third, the choice of the conjugate Dirichlet prior allows the conditional marginals $p((X_n)_{n=1}^N | L, h, \theta)$ to be computed analytically, and (since $L$ is one-dimensional) the total marginal likelihood $p((X_n)_{n=1}^N | h, \theta)$ to be estimated tractably. This allows BEAR models to be used for hypothesis testing (Section 5). + +There are a variety of ways of performing inference in BEAR models, but for most applications we will focus on empirical Bayes methods that optimize point estimates of $L$ , $h$ and $\theta$ . Let $\#(k,b)$ denote the number of times the length $L$ kmer $k$ is seen followed by the letter or stop symbol $b$ in the dataset $(X_n)_{n=1}^N$ . Using a high-performance kmer counter optimized for nucleotide data, KMC, we can compute the count matrix $\#(\cdot,\cdot)$ for all observed kmers $k$ in terabyte-scale datasets, even when the matrix does not fit in main memory (Section J.2) [39]. To optimize $h$ and $\theta$ , we take advantage of the fact that the log conditional marginal likelihood can be written as a sum over observed kmers, + +$$ +\log p \left(\left(X _ {n}\right) _ {n = 1} ^ {N} \mid L, h, \theta\right) = \sum_ {k: \# k > 0} \log \left[ \frac {\Gamma \left(\sum_ {b} \frac {1}{h} f _ {k b} (\theta)\right)}{\prod_ {b} \Gamma \left(\frac {1}{h} f _ {k b} (\theta)\right)} \frac {\prod_ {b} \Gamma \left(\frac {1}{h} f _ {k b} (\theta) + \# (k , b)\right)}{\Gamma \left(\sum_ {b} \frac {1}{h} f _ {k b} (\theta) + \# (k , b)\right)} \right]. \tag {3} +$$ + +This decomposition lets us construct unbiased stochastic estimates of the gradient with respect to $h$ and $\theta$ by subsampling rows of the count matrix (Section J.1). Empirical Bayes in the BEAR model therefore costs little extra time as compared to standard stochastic gradient-based optimization of the original AR model. Code is available at https://github.com/debbiemarkslab/BEAR. + +Toy example We next briefly illustrate the properties and advantages of the BEAR model in simulation. We generated samples from an AR model in which $f_{k}(\theta)$ depends on $k$ linearly as a function of both individual positions and pairwise interactions between positions, with the strength of the pairwise interaction weighted by a parameter $\beta^{*}$ (Section I.1). We first fit (using maximum likelihood) a linear AR model that lacks pairwise terms and is thus misspecified when $\beta^{*} > 0$ . Since the AR model is misspecified, it does not asymptotically approach the true data-generating distribution $p^{*}$ (Fig. 2A, gray). We next computed the posterior of a vanilla BEAR model without the embedded AR in its prior, instead using the Jeffreys prior $v_{k} \sim_{iid}$ Dirichlet(1/2, ..., 1/2). The vanilla BEAR model asymptotically approaches the true data generating distribution, since it is a nonparametric model; however, it underperforms the AR model in the low data regime (Fig. 2A, black). Finally, we fit a BEAR model with the misspecified linear AR model embedded, using our empirical Bayes procedure. The BEAR model performs just as well as its embedded AR model in the low data regime, just as well as the vanilla model in the high data regime, and better than both at intermediate values (Fig. 2A, blue and yellow). + +When the AR model is well-specified, the empirical Bayes estimates of the parameters $\theta$ under the BEAR model match the maximum likelihood estimates of $\theta$ under the AR model + +![](images/8b9bb6fba9a46cb8ddb75893574873bf9db0c7c8ed80deca3193f37bd86ba60c.jpg) +A. Density estimation +Figure 2: BEAR models detect and avoid misspecification without sacrificing small dataset performance. (A) Estimated KL divergence between simulated data-generating distribution $p^*$ and model posterior predictive distribution, as a function of dataset size $N$ . Five independent simulations were run; thin lines correspond to individual simulations, thick lines to the average across simulations. (B) The $h$ misspecification diagnostic as a function of dataset size, for varying $\beta^*$ . Dataset sizes at which $h$ is close to convergence for $\beta^* = 0.6$ (right) and $\beta^* = 1.0$ (left) are marked with vertical lines. + +![](images/db671dcd69e95beeb2a2b9edb8bb12a16235b41a32b4999773152c205db1e56c.jpg) + +![](images/549726ff1d2fc2160e5249cb3b5ed9d5ce87b7c098bae3f18bb455821deaf2af.jpg) +B. Diagnosing misspecification + +![](images/fc29a2c5c0b9d6fb6fb150d9cba446e0164b0a1ea96e777762f8f5a9cdde4301.jpg) + +nearly exactly (Fig. S7). When the AR model is misspecified, however, the BEAR model provides a warning: the empirical Bayes estimate of $h$ converges to a non-zero value, rather than zero (Fig. 2B). This warning emerges early: $h$ converges well before the vanilla model starts outperforming the misspecified AR model. + +Related Work The key idea behind BEAR models is to nonparametrically perturb a parametric model [48], following a similar strategy to the Polya tree method proposed by Berger and Guglielmi [6]. As in Berger and Guglielmi [6], we use Dirichlet priors centered at the parametric model's predictions, and construct tractable goodness-of-fit tests by exploiting Dirichlet-categorical conjugacy. BEAR models extend these ideas from one-dimensional continuous data to finite-length sequences of discrete characters. + +Markov and AR models have a long history and wide range of applications in biological sequence analysis [21, 51, 58]. Compression methods, in particular, often rely on accurate density estimation and use Markov or AR models to achieve it [17, 55, 56, 67]. We establish theoretical guarantees for density estimation with fully Bayesian Markov models (Section 3). AR models used for compression, like other AR models, can be embedded into BEAR models for improved statistical performance and to measure misspecification. + +BEAR models are closely linked to non-generative genome analysis methods. Assembly algorithms and variant callers often analyze paths in the de Bruijn graph of a sequence dataset; in the limit $h \to \infty$ , samples from the posterior predictive distribution of the BEAR model, conditional on $L$ , correspond to paths through the $L$ -mer de Bruijn graph of the data [11, 33]. Comparisons between genomes and other sequences are often made on the basis of kmer counts; our two-sample test provides a generative perspective on this idea [3, 16, 78]. + +BEAR models are also connected to ideas in natural language processing, where kmers are referred to as ngrams. Under the vanilla BEAR model, the mean of the posterior predictive distribution conditional on $L$ corresponds to an ngram additive smoothing model [9]. Comparisons between datasets using their ngram counts are also common in model evaluation metrics such as the BLEU score [53]. + +# 3 Density estimation + +The density estimation problem is that of estimating $p^*$ given data $(X_n)_{n=1}^N$ drawn i.i.d. from $p^*$ . Density estimation is particularly crucial for biological sequence analysis due to its connections to fitness estimation [31, 65]. State-of-the-art mutation effect prediction methods and clinical variant interpretation methods rely on density estimates of evolutionary sequence data [20, 60]. Density estimation with generative models is particularly useful for protein design, as samples from accurate density estimates are likely to be functional and + +can be synthesized in the laboratory [63, 66]. Despite all these applications, existing density estimation methods for biological sequences lack theoretical guarantees on their accuracy and are often limited in their scale, being restricted to relatively short sequences [79]. Here, we show that the posterior distribution of the BEAR model is consistent and will concentrate on $p^*$ as $N \to \infty$ , regardless of what $p^*$ actually is, so long as $p^*$ generates finite length sequences almost surely (a.s.). + +We first study the expressiveness of BEAR models. Let $\mathcal{M}_L$ be the set of Markov models $p_v$ with transition probabilities $v$ and lag $L$ that generate finite length strings a.s.. Note that $\mathcal{M}_1 \subset \mathcal{M}_2 \subset \ldots$ . Define the union $\mathcal{M} = \cup_{L=1}^{\infty} \mathcal{M}_L$ . We can compare $\mathcal{M}$ to the set of distributions over finite strings $S$ , of which $p^*$ is a member. In Section $\boxed{\mathbf{D}}$ we prove that, + +Summary of Propositions 1-4 Not all possible distributions over $S$ are in $\mathcal{M}$ . However, $\mathcal{M}$ is dense on the space of probability distributions over $S$ with the total variation metric. The implication of this result is that although BEAR models cannot exactly match arbitrary data-generating distributions, they can approximate $p^*$ arbitrarily well as $L$ increases. This makes asymptotic consistency possible. + +We now show that the posterior of the BEAR will in fact asymptotically concentrate on the true $p^*$ , i.e. it is consistent. For tractability, we assume in this section that the prior is fixed (we do not use empirical Bayes). The result relies on the tools for understanding convergence rates of posteriors developed in Ghosal et al. [23]. The most important assumption is that $p^*$ is subexponential, meaning that for some $t > 0$ , $E_{p^*} \exp(t|X|) < \infty$ where $|X|$ is the sequence length. Let $\Pi(\cdot|(X_n)_{n=1}^N)$ denote the posterior over sequence distributions. Let $B(p^*, \delta)$ denote a ball of radius $\delta$ centered at $p^*$ , using the Hellinger distance. + +Summary of Theorem 35 Given $M > 0$ large enough and $\epsilon \in (0,1)$ small enough, we have $\Pi(B(p^*, MN^{-\frac{1}{2}\epsilon}) | (X_n)^N_{n=1}) \to 1$ in probability. + +A proof is in Section H and simulations in Section I.2. This result states that the posterior distribution of the model converges to a delta function at the true distribution $p^*$ regardless of what $p^*$ is. It also provides a rate of convergence: in a parametric model, the uncertainty would shrink as $N^{-\frac{1}{2}}$ , but here the rate is slower, $N^{-\frac{1}{2}\epsilon}$ , a price paid for the nonparametric model's expressivity [23, 29, 35]. The proof includes a variety of new theoretical constructions and algorithms that are used to approximate subexponential sequence distributions. + +# 4 Robust parameter estimation + +To derive a biological understanding of mutational processes, evolutionary history, functional constraints, etc. from sequence data, researchers must estimate model parameters (not just density). However, parameter estimates cannot in general be trusted when models are misspecified [34]. To reach robust scientific conclusions, therefore, parameter estimates should ideally come with a warning about whether or not the model is misspecified and some measurement of the degree of misspecification. Here, we study in BEAR models the asymptotic behavior of empirical Bayes estimates of the AR parameter $\theta$ , as well as the hyperparameter $h$ , showing that $h$ diagnoses misspecification in the embedded AR model. + +Our analysis builds off the study of empirical Bayes consistency in Petrone et al. [54], which showed that empirical Bayes will, in general, maximize the prior probability of the true data-generating parameter value. Extending this theory to BEAR models is nontrivial, since in BEAR models the standard Laplace approximation to the marginal likelihood can fail. For theoretical tractability, as in many analyses of similar models, we fix $L$ at some arbitrary and large value [30]. Define $p^{*(L)} = \mathrm{argmin}_{p_v \in \mathcal{M}_L} \mathrm{KL}(p^* \| p_v)$ as the closest model in $\mathcal{M}_L$ to $p^*$ , and define $v^*$ such that $p_{v^*} = p^{*(L)}$ (note $p^{*(L)} \to p^*$ as $L \to \infty$ ). We say that the AR model is misspecified "at resolution $L$ " if $f$ cannot approximate $p^{*(L)}$ , i.e. if there does not exist some sequence of parameter values $\tilde{\theta}_N$ such that $p_{f(\tilde{\theta}_N)} \to p^{*(L)}$ as $N \to \infty$ ; otherwise, the AR model is well-specified at resolution $L$ . Now we can study empirical Bayes estimates of $h$ and $\theta$ , denoted $h_N$ and $\theta_N$ . + +Summary of Propositions 15-20 Let $(h_N)_{N=1}^{\infty}$ and $(\theta_N)_{N=1}^{\infty}$ be sequences maximizing the BEAR marginal likelihood $p((X_n)_{n=1}^N | L, h, \theta)$ for each $N$ . If the model is well-specified at resolution $L$ , then $h_N N^{1/4-\epsilon} \to 0$ for every $\epsilon > 0$ and $p_{f(\theta_N)} \to p^{*(L)}$ in distribution, with both sequences converging in probability. On the other hand, if the model is misspecified at + +resolution $L$ , then $h_N$ is eventually bounded below by some positive (non-zero) number a.s.. Proofs are in Section F and simulations in Section I.1. The implication of this result is that when the AR model is well-specified, $h_N$ converges to zero (at a rate that is a power of the dataset size) and $\theta_N$ converges to the parameter value $\theta^*$ at which the AR model matches the data (Corollary 16). On the other hand, when the AR model is misspecified, $h_N$ does not converge to zero; heuristically, we find instead that $h_N$ is approximately proportional to a divergence between $p^{*(L)}$ and the AR model, + +$$ +h _ {N} \propto \sum_ {k \in \operatorname {a c c} _ {L} (p ^ {*})} \left(\mathrm {K L} \left(f _ {k} \left(\theta_ {N}\right) \| v _ {k} ^ {*}\right) + \log (N) \sum_ {b \notin \operatorname {s u p p} _ {L} \left(p ^ {*}\right) | _ {k}} f _ {k, b} \left(\theta_ {N}\right)\right), \tag {4} +$$ + +where $\mathrm{acc}_L(p^*) = \{k\mid p^* (\# k > 0) > 0\}$ is the set of kmers with non-zero probability and $\mathrm{supp}_L(p^*)|_k = \{b\mid p^* (\# (k,b) > 0) > 0\}$ is the set of transitions from $k$ with non-zero probability. In summary: when fitting a BEAR model by empirical Bayes, you get, along with a parameter estimate $\theta_N$ , a value $h_N$ which tells you the amount (from zero to infinity) of misspecification in the AR model. If $h_N$ is close to zero, you can trust the estimate $\theta_N$ . + +# 5 Hypothesis testing + +Goodness-of-fit test A major outstanding challenge in biological sequence analysis is to build models based on natural sequence data that are accurate enough to generate novel functional sequences [45]. A crucial component of the problem is model evaluation: while relative model performance may be compared on the basis of likelihood, absolute performance - whether or not the model in fact provides an accurate description of the data - is usually addressed solely on the basis of limited numbers of summary statistics, such as average amino acid hydrophobicity or sequence length [63, 66]. Given a dataset $(X_{n})_{n = 1}^{N}\sim p^{*}$ i.i.d., a goodness-of-fit test asks whether or not the data distribution $p^*$ matches a model distribution $\tilde{p}$ . It takes into account all possible distributions $p^*$ including those that differ from $\tilde{p}$ in a manner that cannot be captured by finitely many summary statistics. We propose a goodness-of-fit test that compares the null hypothesis $\mathcal{H}_0:p^* = \tilde{p}$ to the alternative $\mathcal{H}_1:p^*\neq \tilde{p}$ using the Bayes factor $\mathrm{BF} = p((X_n)_{n = 1}^N |h,\theta) / \tilde{p} (X_{1:n})$ , where $p((X_n)_{n = 1}^N |h,\theta) = \sum_Lp((X_n)_{n = 1}^N |L,h,\theta)\pi (L)$ is the marginal likelihood under the BEAR model. Note that practically, the sum over $L$ is straightforward to approximate by truncation, and that the test can be computed in time linear in the amount of data. + +We now prove the consistency of the test. As in comparable theoretical analyses of tests based on Polya trees, for theoretical tractability we truncate the prior, setting $\pi(L) = 0$ for $L$ larger than some arbitrary $\tilde{L}$ but $\pi(L) > 0$ for $L \leq \tilde{L}$ [30]. We treat $\theta$ and $h > 0$ as fixed. Summary of Proposition [21] If $\tilde{p}$ is at least as close to $p^*$ as $p^{*(L)}$ is, as measured by $\mathrm{KL}(p^*|\cdot)$ , then $\mathrm{BF} \to 0$ in probability as $N \to \infty$ . On the other hand, if $p^{*(L)}$ is closer than $\tilde{p}$ , then $\mathrm{BF} \to \infty$ in probability. A proof is in Section [G.1] and simulations in Section [L.3] + +An important practical limitation on nonparametric hypothesis testing is low power: since so many alternative distributions must be considered, the null hypothesis can rarely be rejected. However, Proposition [21] holds for the Bayes factor $\mathrm{BF}(L,h,\theta) = p((X_n)^N | L,h,\theta) / \tilde{p} ((X_n)^N |_{n = 1})$ with any choice of $L$ , $h > 0$ , and $\theta$ . Thus in practice to increase power we can maximize the value of $\mathrm{BF}(L,h,\theta)$ as a function of $L$ , $h$ , and/or $\theta$ (note that this approach is heuristic, since we have not proven the consistency of the maximized Bayes factor). Berger and Guglielmi [6] provide extensive methodological guidance on using analogous tests constructed with Polya trees. Based on their recommendations, we suggest first choosing $\theta$ such that $p_{f(\theta)}$ is as close as possible to $\tilde{p}$ , then plotting the Bayes factor as a function of $h$ and/or $L$ to identify the maximum value and confirm that any conclusion is robust to changes in $h$ and/or $L$ . + +Another challenge in nonparametric hypothesis testing is that it can be difficult to understand how exactly a test reached its conclusion. To identify which sequences provided the most evidence for or against the null hypothesis, we suggest examining the BEAR Bayes factor for each individual sequence conditional on the rest of the dataset, in analogy to the witness function used in kernel-based tests [43, 70]. + +Table 1: Heldout perplexity. Whole genome sequencing data: YSD1: A Salmonella phage. A. th.: Arabidopsis thaliana, a plant (datasets represent different individuals). Single cell RNA sequencing data: PBMC: peripheral blood mononuclear cells, taken from a healthy donor. HL: Hodgkin's lymphoma tumor cells. GBM: glioblastoma tumor cells. Metagenomic sequencing data: HC: non-CD and non-UC controls. CD: Crohn's disease. UC: ulcerative colitis. Full assembled genomes: Bact.: Bacteria. Models Van.: Vanilla (Jeffreys prior). Lin.: Linear. CNN: convolutional neural network. Ref.: reference genome/transcriptome model. + +
DatasetAR Lin.AR CNNAR Ref.BEAR Van.BEAR Lin.BEAR CNNBEAR Ref.
YSD13.9533.8731.2661.1651.1441.1441.145
A.th.13.9563.9472.6861.5671.4321.4321.411
A.th.23.9533.9491.9821.6501.4631.4621.441
A.th.33.9983.9522.3401.8341.7281.7271.733
PBMC3.9913.9742.0971.4021.3721.3721.374
HL3.9593.9302.1411.4091.3781.3781.379
GBM4.1374.1372.3661.4421.4061.4061.406
HC3.9663.946-1.6521.4651.464-
CD3.9923.985-1.7601.5241.524-
UC3.9893.986-1.6441.4811.481-
Bact.3.8313.794-3.7743.7743.774-
+ +Two-sample test A two-sample test asks whether or not two datasets $(X_{n})_{n = 1}^{N}$ and $(X_{n}^{\prime})_{n = 1}^{N^{\prime}}$ are drawn from the same distribution. Efforts to compare different sequence datasets are widespread in biology: for instance, researchers often wish to determine whether two microbiome samples, taken under different conditions or at different timepoints, are the same up to sampling noise [44]. Two-sample tests can also be used to evaluate generative sequence models that lack tractable likelihoods (for which the goodness-of-fit test proposed above does not apply) such as energy-based models or implicit models like GANs and biophysical simulators [27, 42, 49]. Assume $(X_{n})_{n = 1}^{N}\sim p_{1}$ and $(X_{n}^{\prime})_{n = 1}^{N^{\prime}}\sim p_{2}$ i.i.d.. Our BEAR test compares the null hypothesis $\mathcal{H}_0:p_1 = p_2$ to the alternative $\mathcal{H}_1:p_1\neq p_2$ using the Bayes factor $\mathrm{BF} = p((X_n)_n = 1|h,\theta)p((X_n')_{n = 1}^{N'}|h,\theta) / p((X_n)_n = 1,(X_n')_{n = 1}^{N'}|h,\theta)$ . As in the goodness-of-fit case, the test can be computed approximately in time linear in the amount of data, and the same advice on increasing power and identifying important sequences holds here too. + +We next prove consistency, again truncating the prior at $\tilde{L}$ and fixing $h$ and $\theta$ . + +Summary of Proposition 22 If $p_1^{(\tilde{L})} = p_2^{(\tilde{L})}$ , then BF $\rightarrow$ 0 as $N \rightarrow \infty$ in probability. Otherwise, if $p_1^{(\tilde{L})} \neq p_2^{(\tilde{L})}$ , then BF $\rightarrow \infty$ in probability. A proof is in Section G.2 and simulations in Section I.3 + +# 6 Results + +Predicting sequences We sought to evaluate BEAR models as compared to AR models on the task of predicting real nucleotide (nt) sequences. We considered eleven datasets of four different types: whole genome sequencing read data, single cell RNA sequencing read data (including from patient tumors), metagenomic sequencing read data (including from patient fecal samples) and full bacterial genomes from across the tree of life (Section K). Datasets ranged in total size from $\sim 10^{7} - 10^{10}$ nt and in individual sequence length from $\sim 10^{2} - 10^{6}$ nt (Table S1). $25\%$ of data was randomly held out for testing, in the form of entire sequences (reads, genomes, etc., see Table S2); our goal was to evaluate BEAR models as density estimators, so we did not use masking (a common holdout strategy in natural language processing). We considered a linear AR model and a deep convolutional neural network (CNN) AR model with $>10\times$ more parameters, both of which are common models used across a range of applications; we also designed a biologically-structured AR model which makes predictions based on a reference genome and a Jukes-Cantor mutation model + +(Section L.1) 56, 67. We then embedded each AR model to create a corresponding BEAR model. The BEAR models improve over the AR models in nucleotide prediction according to both perplexity (Table 1) and accuracy (Table S3) in all datasets, even when the model lag $L$ is held fixed for comparison (Section L.3). + +In 10 out of 11 datasets, BEAR models increase nucleotide prediction accuracy from near chance values of $30 - 35\%$ (in the case of the linear and CNN models) to $78 - 95\%$ , bringing genome-scale models into the realm of potential practical use (Table S3). The training time for BEAR models is essentially identical to that of AR models, aside from the time required to build the transition count matrix, which need only be done once before training all models (Fig. S13). Remarkably, the optimal lag $L$ chosen by empirical Bayes is often quite short, less than 20 nt (Table S4). The improvements offered by BEAR models that use an embedded AR model over the vanilla BEAR model are modest for datasets of this size; however, sequencing experiments are often designed to collect enough data for downstream analyses. We found in an example that, if sequencing coverage was $3\times$ instead of $100\times$ , the improvement in prediction accuracy would have been greater than 10 percentage points instead of 0.1 (Section L.4; Fig. S14). + +Measuring misspecification When conventional deep neural network methods fail to provide strong predictive performance, popular wisdom often ascribes the failure to too much model flexibility or not enough training data, especially in scientific applications. Examining the $h$ misspecification diagnostic in the BEAR models described above, we see that this is not the case here (Table 2). The large values of $h$ suggest that where the CNN fails it is not because of too much flexibility but rather too little: the model is not flexible enough to encompass the true data distribution, so it suffers from misspecification. Meanwhile, the reference-based model has only two learned parameters, but is less misspecified than the CNN in all but one dataset. This too runs counter to popular wisdom in machine learning, which often assumes that when principled, low-flexibility scientific models outperform deep neural networks it is thanks to their low variance in the small data regime. + +Table 2: Diagnostic $h$ . Abbreviations as in Table I. + +
DatasetLin.CNNRef.
YSD15.5285.4614.183
A.th.12.7652.7562.990
A.th.22.6432.6332.326
A.th.33.9693.9641.598
PBMC4.1674.1453.762
HL4.0504.0383.581
GBM4.1724.1543.238
HC4.6684.651-
CD3.0963.094-
UC3.8433.835-
Bact.0.0100.003-
+ +Generating samples BEAR models are generative and can be used to sample new sequences. We sampled extrapolations from the end of a read sequence recorded in a plant (A. thaliana) whole genome sequencing experiment, and compared to an alternative non-probabilistic extrapolation method that is widely used in biology, local assembly (Fig. 3A; Section M). In this example the assembly algorithm SPAdes returns four possible assemblies, a relatively large number compared to other reads in the dataset (Fig. 3A stars) [5]. Samples from the BEAR model include these four possibilities, but also many more, some with higher probability. The distribution over possible nucleotide choices under the BEAR model is much wider than the number of assemblies would suggest: it has a perplexity of 1.4 per position (on average across samples) at the beginning of the extrapolation, and a perplexity of 2.7 at 50 nucleotides (Fig. 3B). These observations suggest that SPAdes, which does not provide a measurement of uncertainty, may not be capturing the full range of possible sequences. + +Visualizing data Methods for learning local representations or features of biological sequences can be powerful tools for visualization and semisupervised learning [7]. One approach to extracting such representations is to learn a generative model $q(X_{1},\ldots ,X_{L + 1})$ of kmers, for instance using a variational autoencoder. While such models are not autoregressive, the small size of the DNA alphabet makes it tractable to estimate the conditional $q(X_{L + 1}|X_{1:L})$ by Bayes' rule, and this conditional can then be embedded into a BEAR model. We applied this strategy to probabilistic PCA. We visualized in low dimensions the inferred latent representation for a model trained on a single cell RNA sequencing dataset (HL), and were able to assign annotations to clusters, including those containing unmapped reads (Fig. 3CD; Section N). The BEAR model however raises the warning that the model is misspecified ( $h = 4.836$ ), suggesting there may be richer latent structure yet to discover. + +![](images/09575884b6a692b80ba12b0ef351cc37adaed6179a91de5fe97a4bc9393a70b9.jpg) + +![](images/d488bb4e1a12bc497ed3f90dc93238b68a9ec33c574a87ac87a7a47512a188f1.jpg) + +![](images/445032f5c4b7e01eaa78861a4a852efb13fdea48b26efdc315f985de83381673.jpg) + +![](images/09c0bdaf6f4b51c590240f17ab097c8891a9b3dd06a340ede681023c46e0d7fd.jpg) +Figure 3: Generation, visualization and testing. (A) Sample extrapolations, colored to denote distinct paths through the $L$ -mer de Bruijn graph. (B) Distribution of the perplexity of the next Markov transition under the BEAR model, for each position of the sampled extrapolations, with the per position average shown in black (Section M). (C) Log probability of each read in the HL dataset under the BEAR model and a model built from the reference transcriptome. Reads are colored by whether or not they map to the reference. (D) Latent representations of the reads highlighted in C, visualized using tSNE, with clusters annotated as likely coming from mitochondria, the sequencing adapter, or transcripts of the gene JUND (Section N). (E) Goodness-of-fit test Bayes factor as a function of hyperparameter $h$ . (F) Two-sample test Bayes factor as a function of lag $L$ . Black line compares simulated data to simulated data; dashed lines compare subsampled real data to subsampled real data; solid lines compare real data to simulated data. (G) Log probability of each read under the real data BEAR model minus the log probability under the simulated data BEAR model (Section O). + +![](images/972c2fb1c0abd6695880b5d744ab654555af94d71025a0956d3b8ace9e352aaf.jpg) + +![](images/f59faab86d5aafb4cc4358df76ff26defcc41f44cd6fd0843e3c50a2e7eb8761.jpg) + +Testing hypotheses The question of when and how microbiomes change is widespread, but has in the past relied on summary statistics of sequencing datasets [44]. Schreiber et al. [64] studied changes in patient urine microbiomes before and after kidney transplant, and performed both unbiased metagenomic sequencing and diagnostic quantitative polymerase chain reaction (qPCR) for a specific virus associated with complications (JC polyomavirus). They found evidence of donor-to-recipient viral transmission in 5 cases out of 14. We applied the BEAR two-sample test to patients' metagenomic sequencing data before and after transplantation, using the vanilla Jeffreys prior and integrating over lags, in order to detect changes; the test rejects the null hypothesis in all 5 cases where there was transmission, and accepts the null hypothesis in all but one of the remaining 9 cases (Table S6; Section O.1). These results show, in a small example, that the two-sample test has sufficient power to detect microbiome changes in real data, and can be consistent with more specific tests. + +We next applied BEAR hypothesis tests to evaluate generative models. We evaluated the reference-based AR model described above using the BEAR goodness-of-fit test. The test identifies considerable evidence (log Bayes factor $>10^{8}$ ) for misspecification in each $A$ . thaliana whole genome sequencing dataset, and this conclusion is robust to a wide range of $h$ values (Fig. 3E; Section 0.2). Next, we evaluated a detailed simulation model (ART) that is intended to generate likely reads of a given reference genome 32. The model lacks tractable likelihoods, so we use the BEAR two-sample test. When integrating over all lags, the test accepts the null hypothesis, suggesting that the simulation model is accurate; if we examine the test results for individual lags $L$ to increase power, however, we can see some evidence of differences (Fig. 3F; Section 0.2). Note that as $L$ increases, there is a tradeoff: tests with larger lag can detect more subtle differences between the two distributions, but have less statistical power since they must consider a larger set of possible distributions. Thus the + +Bayes factor first increases and then decreases with lag, reaching a peak at intermediate values where there is the most evidence of difference. To understand in detail the source of the detected differences between the data and the simulation model, we examined the conditional Bayes factor for individual reads, discovering clusters of reads that are poorly explained by the simulation model (Fig. 3G). One group mapped to chloroplasts, an organelle with its own genome that is variable in copy number; reads mapping to centromeres, an area of the plant genome for which the reference genome is considered unreliable, were also poorly explained by the simulation model. In one dataset we found a cluster of outliers that did not map to A. thaliana at all, and instead mapped to a common soil bacteria, Bacillus cereus, presumably a contaminant in the experiment (Fig. 3G, left). These results illustrate how BEAR hypothesis tests can be used not only for testing but also for detailed model criticism. + +# 7 Discussion + +In this article we proposed the nonparametric BEAR model, studied its theoretical properties, and developed algorithms and implementations for terabyte-scale inference. BEAR models substantially outperform standard AR models on a variety of datasets, and come with extensive theoretical guarantees, including for density estimation, misspecification detection, and hypothesis testing. BEAR models are closely connected to non-probabilistic genome analysis methods, such as de Bruijn graph assembly, but provide an alternative that is uncertainty-aware. Note, however, that BEAR models do not explicitly account for paired-end read information, or other sources of long-distance information; this is an important area for future work. While there has been little previous empirical or theoretical work in the machine learning literature on generative models of full genomic, transcriptomic or metagenomic sequences, we hope BEAR models provide a useful starting point. + +# Acknowledgments and Disclosure of Funding + +We thank Jean Disset for a small scale version of the kmer counting code, Rob Patro for crucial advice on large scale kmer counting, and Winnie Wang for illustrations used in the theory section of the supplementary material. We also thank Chris Sander, Elizabeth Wood, Tessa Green and all the members of the Marks Lab for discussion and ideas. E.N.W. is supported by the Fannie and John Hertz Foundation. D.S.M. is supported by the Chan Zuckerberg Initiative. + +# References + +[1] 1001 Genomes Consortium. 1,135 genomes reveal the global pattern of polymorphism in Arabidopsis thaliana. Cell, 166(2):481-491, July 2016. +[2] M. Abadi, P. Barham, J. Chen, Z. Chen, A. Davis, J. Dean, M. Devin, S. Ghemawat, G. Irving, M. Isard, and Others. Tensorflow: A system for large-scale machine learning. In 12th USENIX symposium on operating systems design and implementation (OSDI 16), pages 265-283. usenix.org, 2016. +[3] E. B. Alsop and J. Raymond. Resolving Prokaryotic Taxonomy without rRNA: Longer Oligonucleotide Word Lengths Improve Genome and Metagenome Taxonomic Classification. PLoS ONE, 8(7), 2013. +[4] J. L. Ba, J. R. Kiros, and G. E. Hinton. Layer normalization. July 2016. +[5] A. Bankevich, S. Nurk, D. Antipov, A. A. Gurevich, M. Dvorkin, A. S. Kulikov, V. M. Lesin, S. I. Nikolenko, S. Pham, A. D. Prjibelski, A. V. Pyshkin, A. V. Sirotkin, N. Vyahhi, G. Tesler, M. A. Alekseyev, and P. A. Pevzner. SPAdes: a new genome assembly algorithm and its applications to single-cell sequencing. Journal of Computational Biology, 19(5):455-477, May 2012. +[6] J. O. Berger and A. Guglielmi. Bayesian and conditional frequentist testing of a parametric model versus nonparametric alternatives. Journal of the American Statistical Association, 96(453):174-184, 2001. + +[7] S. Biswas, G. Khimulya, E. C. Alley, K. M. Esvelt, and G. M. Church. Low-N protein engineering with data-efficient deep learning. Nature Methods, 18(4):389-396, 2021. +[8] G. M. Boratyn, C. Camacho, P. S. Cooper, G. Coulouris, A. Fong, N. Ma, T. L. Madden, W. T. Matten, S. D. McGinnis, Y. Merezhuk, Y. Raytselis, E. W. Sayers, T. Tao, J. Ye, and I. Zaretskaya. BLAST: a more efficient report with usability improvements. Nucleic Acids Research, 41(Web Server issue):W29-33, July 2013. +[9] S. F. Chen and J. Goodman. An empirical study of smoothing techniques for language modeling. Computer Speech and Language, 13(4):359-394, Oct. 1999. +[10] P. J. A. Cock, T. Antao, J. T. Chang, B. A. Chapman, C. J. Cox, A. Dalke, I. Friedberg, T. Hamelryck, F. Kauff, B. Wilczynski, and M. J. L. de Hoon. Biopython: freely available python tools for computational molecular biology and bioinformatics. Bioinformatics, 25(11):1422-1423, June 2009. +[11] P. E. C. Compeau, P. A. Pevzner, and G. Tesler. How to apply de Bruijn graphs to genome assembly. Nature Biotechnology, 29(11):987-991, Nov. 2011. +[12] I. Cortés-Ciriano, J. J.-K. Lee, R. Xi, D. Jain, Y. L. Jung, L. Yang, D. Gordenin, L. J. Klimczak, C.-Z. Zhang, D. S. Pellman, PCAWG Structural Variation Working Group, P. J. Park, and PCAWG Consortium. Comprehensive analysis of chromothripsis in 2,658 human cancers using whole-genome sequencing. Nature Genetics, 52(3):331-341, Mar. 2020. +[13] S. Darmanis, S. A. Sloan, D. Croote, M. Mignardi, S. Chernikova, P. Samghababi, Y. Zhang, N. Neff, M. Kowarsky, C. Caneda, G. Li, S. D. Chang, I. D. Connolly, Y. Li, B. A. Barres, M. H. Gephart, and S. R. Quake. Single-Cell RNA-Seq analysis of infiltrating neoplastic cells at the migrating front of human glioblastoma. Cell Reports, 21(5):1399–1410, Oct. 2017. +[14] A. P. Dawid. Posterior model probabilities. In P. S. Bandyopadhyay and M. R. Forster, editors, Philosophy of Statistics, volume 7, pages 607-630. North-Holland, Amsterdam, Jan. 2011. +[15] J. V. Dillon, I. Langmore, D. Tran, E. Brevdo, S. Vasudevan, D. Moore, B. Patton, A. Alemi, M. Hoffman, and R. A. Saurous. TensorFlow distributions. Nov. 2017. +[16] V. B. Dubinkina, D. S. Ischenko, V. I. Ulyantsev, A. V. Tyakht, and D. G. Alexeev. Assessment of k-mer spectrum applicability for metagenomic dissimilarity analysis. BMC Bioinformatics, 17:38, Jan. 2016. +[17] M. Duc Cao, T. I. Dix, L. Allison, and C. Mears. A simple statistical algorithm for biological sequence compression. In 2007 Data Compression Conference (DCC'07), pages 43-52, Mar. 2007. +[18] R. A. Dunstan, D. Pickard, S. Dougan, D. Goulding, C. Cormie, J. Hardy, F. Li, R. Grinner, K. Harcourt, L. Yu, J. Song, F. Schreiber, J. Choudhary, S. Clare, F. Coulibaly, R. A. Strugnell, G. Dougan, and T. Lithgow. The flagellotropic bacteriophage YSD1 targets salmonella typhi with a chi-like protein tail fibre. Molecular Microbiology, 112 (6):1831-1846, Dec. 2019. +[19] R. Durbin, S. Eddy, A. Krogh, and A. Mitchison. Biological Sequence Analysis. 1998. +[20] J. Frazer, P. Notin, M. Dias, A. Gomez, K. Brock, Y. Gal, and D. Marks. Large-scale clinical interpretation of genetic variants using evolutionary data and deep learning. Dec. 2020. +[21] C. Galiez, M. Siebert, F. Enault, J. Vincent, and J. Söding. WIsH: who is the host? predicting prokaryotic hosts from metagenomic phage contigs. Bioinformatics, 33(19): 3113-3114, Oct. 2017. +[22] S. Geman and C.-R. Hwang. Nonparametric maximum likelihood estimation by the method of sieves. The Annals of Statistics, 10(2):401-414, 1982. + +[23] S. Ghosal, J. K. Ghosh, and A. W. van der Vaart. Convergence rates of posterior distributions. The Annals of Statistics, 28(2):500-531, 2000. +[24] J. Ghosh and R. Ramamoorthi. Bayesian Nonparametrics. 2003. +[25] P. Gopalan, W. Hao, D. M. Blei, and J. D. Storey. Scaling probabilistic models of genetic variation to millions of humans. Nature Genetics, 48(12):1587-1590, Dec. 2016. +[26] R. M. Gray. Entropy and Information Theory. Springer Science & Business Media, Jan. 2011. +[27] A. Gretton, K. M. Borgwardt, M. J. Rasch, B. Scholkopf, and A. Smola. A kernel two-sample test. Journal of Machine Learning Research, 13:723-773, 2012. +[28] C. R. Harris, K. J. Millman, S. J. van der Walt, R. Gommers, P. Virtanen, D. Cournapeau, E. Wieser, J. Taylor, S. Berg, N. J. Smith, R. Kern, M. Picus, S. Hoyer, M. H. van Kerkwijk, M. Brett, A. Haldane, J. F. del Rio, M. Wiebe, P. Peterson, P. Gerard-Marchant, K. Sheppard, T. Reddy, W. Weckesser, H. Abbasi, C. Gohlke, and T. E. Oliphant. Array programming with NumPy. Nature, 585(7825):357-362, Sept. 2020. +[29] T. Henighan, J. Kaplan, M. Katz, M. Chen, C. Hesse, J. Jackson, H. Jun, T. B. Brown, P. Dhariwal, S. Gray, C. Hallacy, B. Mann, A. Radford, A. Ramesh, N. Ryder, D. M. Ziegler, J. Schulman, D. Amodei, and S. McCandlish. Scaling laws for autoregressive generative modeling. Oct. 2020. +[30] C. C. Holmes, F. Caron, J. E. Griffin, and D. A. Stephens. Two-sample bayesian nonparametric hypothesis testing. Bayesian Anal., 10(2):297-320, June 2015. +[31] T. A. Hopf, J. B. Ingraham, F. J. Poelwijk, C. P. I. Schärfe, M. Springer, C. Sander, and D. S. Marks. Mutation effects predicted from sequence co-variation. Nature Biotechnology, 35(2):128–135, Feb. 2017. +[32] W. Huang, L. Li, J. R. Myers, and G. T. Marth. ART: a next-generation sequencing read simulator. Bioinformatics, 28(4):593-594, Feb. 2012. +[33] Z. Iqbal, M. Caccamo, I. Turner, P. Flicek, and G. McVean. De novo assembly and genotyping of variants using colored de Bruijn graphs. Nature Genetics, 44(2):226-232, Jan. 2012. +[34] P. E. Jacob, L. M. Murray, C. C. Holmes, and C. P. Robert. Better together? statistical learning in models made of modules. Aug. 2017. +[35] J. Kaplan, S. McCandlish, T. Henighan, T. B. Brown, B. Chess, R. Child, S. Gray, A. Radford, J. Wu, and D. Amodei. Scaling laws for neural language models. Jan. 2020. +[36] D. Kim, J. M. Paggi, C. Park, C. Bennett, and S. L. Salzberg. Graph-based genome alignment and genotyping with HISAT2 and HISAT-genotype. Nature Biotechnology, 37(8):907-915, Aug. 2019. +[37] D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations, 2015. +[38] D. P. Kingma and M. Welling. Auto-encoding variational bayes. In International Conference on Learning Representations, 2014. +[39] M. Kokot, M. Dlugosz, and S. Deorowicz. KMC 3: counting and manipulating k-mer statistics. Bioinformatics, 33(17):2759–2761, Sept. 2017. +[40] W. Kool, H. van Hoof, and M. Welling. Stochastic beams and where to find them: The Gumbel-Top-k trick for sampling sequences without replacement. In International Conference on Machine Learning, pages 3499–3508. PMLR, 2019. +[41] A. Kucukelbir, D. Tran, R. Ranganath, A. Gelman, and D. M. Blei. Automatic differentiation variational inference. Journal of Machine Learning Research, 18(14): 1-45, Jan. 2017. + +[42] Y. Li, K. Swersky, and R. Zemel. Generative moment matching networks. In International Conference on Machine Learning, pages 1718-1727. PMLR, 2015. +[43] J. R. Lloyd and Z. Ghahramani. Statistical model criticism using kernel two sample tests. In Advances in Neural Information Processing Systems, pages 829-837, 2015. +[44] J. Lloyd-Price, A. Maharkar, G. Rahnavard, J. Crabtree, J. Orvis, A. B. Hall, A. Brady, H. H. Creasy, C. McCracken, M. G. Giglio, D. McDonald, E. A. Franzosa, R. Knight, O. White, and C. Huttenhower. Strains, functions and dynamics in the expanded human microbiome project. Nature, 550(7674):61-66, Oct. 2017. +[45] A. Madani, B. Krause, E. R. Greene, S. Subramanian, B. P. Mohr, J. M. Holton, J. L. Olmos, C. Xiong, Z. Z. Sun, R. Socher, J. S. Fraser, and N. Naik. Deep neural language modeling enables functional protein generation across families. 2021. +[46] G. Marçais and C. Kingsford. A fast, lock-free approach for efficient parallel counting of occurrences of k-mers. Bioinformatics, 27(6):764-770, Mar. 2011. +[47] J. W. Miller. Asymptotic normality, concentration, and coverage of generalized posteriors. Journal of Machine Learning Research, 22(168):1-53, 2021. +[48] J. W. Miller and D. B. Dunson. Robust bayesian inference via coarsening. Journal of the American Statistical Association, 114(527):1113-1125, 2019. +[49] S. Mohamed and B. Lakshminarayanan. Learning in implicit generative models. Oct. 2016. +[50] R. E. Mukamel, R. E. Handsaker, M. A. Sherman, A. R. Barton, Y. Zheng, S. A. McCarroll, and P.-R. Loh. Protein-coding repeat polymorphisms strongly shape diverse human phenotypes. Science, 373(6562):1499-1505, Sept. 2021. +[51] L. Narlikar, N. Mehta, S. Galande, and M. Arjunwadkar. One size does not fit all: on how Markov model order dictates performance of genomic sequence analyses. Nucleic Acids Research, 41(3):1416-1424, Feb. 2013. +[52] N. A. O'Leary, M. W. Wright, J. R. Brister, S. Ciufo, D. Haddad, R. McVeigh, B. Rajput, B. Robbertse, B. Smith-White, D. Ako-Adjei, A. Astashyn, A. Badretdin, Y. Bao, O. Blinkova, V. Brover, V. Chetvernin, J. Choi, E. Cox, O. Ermolaeva, C. M. Farrell, T. Goldfarb, T. Gupta, D. Haft, E. Hatcher, W. Hlavina, V. S. Joardar, V. K. Kodali, W. Li, D. Maglott, P. Masterson, K. M. McGarvey, M. R. Murphy, K. O'Neill, S. Pujar, S. H. Rangwala, D. Rausch, L. D. Riddick, C. Schoch, A. Shkeda, S. S. Storz, H. Sun, F. Thibaud-Nissen, I. Tolstoy, R. E. Tully, A. R. Vatsan, C. Wallin, D. Webb, W. Wu, M. J. Landrum, A. Kimchi, T. Tatusova, M. DiCuccio, P. Kitts, T. D. Murphy, and K. D. Pruitt. Reference sequence (RefSeq) database at NCBI: current status, taxonomic expansion, and functional annotation. Nucleic Acids Research, 44(D1):D733-45, Jan. 2016. +[53] K. Papineni, S. Roukos, T. Ward, and W.-J. Zhu. BLEU: a method for automatic evaluation of machine translation. In Annual Meeting of the Association for Computational Linguistics, pages 311-318, 2002. +[54] S. Petrone, J. Rousseau, and C. Scricciolo. Bayes and empirical Bayes: do they merge? Biometrika, 101(2):285-302, 2014. +[55] A. J. Pinho, P. J. S. G. Ferreira, A. J. R. Neves, and C. A. C. Bastos. On the representability of complete genomes by multiple competing finite-context (Markov) models. PLoS One, 6(6):e21588, June 2011. +[56] D. Pratas, M. Hosseini, and A. J. Pinho. Substitutional tolerant markov models for relative compression of DNA sequences. In International Conference on Practical Applications of Computational Biology & Bioinformatics (PACBB), pages 265-272, June 2017. + +[57] J. K. Pritchard, M. Stephens, and P. Donnelly. Inference of population structure using multilocus genotype data. Genetics, 155(2):945-959, June 2000. +[58] J. Ren, X. Bai, Y. Y. Lu, K. Tang, Y. Wang, G. Reinert, and F. Sun. Alignment-free sequence analysis and applications. Annual Review of Biomedical Data Science, 1: 93-114, July 2018. +[59] D. J. Rezende, S. Mohamed, and D. Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In International Conference on Machine Learning, 2014. +[60] A. J. Riesselman, J. B. Ingraham, and D. S. Marks. Deep generative models of genetic variation capture the effects of mutations. _Nat. Methods_, 15(10):816-822, Oct. 2018. +[61] J. Rousseau. On the frequentist properties of Bayesian nonparametric methods. Annual Review of Statistics and Its Application, 3:211-231, 2016. +[62] J. Rousseau and K. Mengersen. Asymptotic behaviour of the posterior distribution in overfitted mixture models. Journal of the Royal Statistical Society: Series B, 73(5): 689-710, Nov. 2011. +[63] W. P. Russ, M. Figliuzzi, C. Stocker, P. Barrat-Charlaix, M. Socolich, P. Kast, D. Hilvert, R. Monasson, S. Cocco, M. Weigt, and R. Ranganathan. An evolution-based model for designing chorismate mutase enzymes. Science, 369:440–445, 2020. +[64] P. W. Schreiber, V. Kufner, K. Hübel, S. Schmutz, O. Zagordi, A. Kaur, C. Bayard, M. Greiner, A. Zbinden, R. Capaul, J. Böni, H. H. Hirsch, T. F. Mueller, N. J. Mueller, A. Trkola, and M. Huber. Metagenomic virome sequencing in living donor and recipient kidney transplant pairs revealed JC polyomavirus transmission. Clinical Infectious Diseases, 69(6):987-994, Aug. 2019. +[65] G. Sella and A. E. Hirsh. The application of statistical physics to evolutionary biology. Proceedings of the National Academy of Sciences, 102(27):9541-9546, July 2005. +[66] J.-E. Shin, A. J. Riesselman, A. W. Kollasch, C. McMahon, E. Simon, C. Sander, A. Manglik, A. C. Kruse, and D. S. Marks. Protein design and variant prediction using autoregressive generative models. Nature Communications, 12(1):2403, Apr. 2021. +[67] M. Silva, D. Pratas, and A. J. Pinho. Efficient DNA sequence compression with neural networks. Gigascience, 9(11), Nov. 2020. +[68] J. T. Simpson, K. Wong, S. D. Jackman, J. E. Schein, S. J. M. Jones, and I. Birol. ABySS: a parallel assembler for short read sequence data. Genome Research, 19(6): 1117-1123, June 2009. +[69] P. J. Stephens, C. D. Greenman, B. Fu, F. Yang, G. R. Bignell, L. J. Mudie, E. D. Pleasance, K. W. Lau, D. Beare, L. A. Stebbings, S. McLaren, M.-L. Lin, D. J. McBride, I. Varela, S. Nik-Zainal, C. Leroy, M. Jia, A. Menzies, A. P. Butler, J. W. Teague, M. A. Quail, J. Burton, H. Swerdlow, N. P. Carter, L. A. Morsberger, C. Iacobuzio-Donahue, G. A. Follows, A. R. Green, A. M. Flanagan, M. R. Stratton, P. A. Futreal, and P. J. Campbell. Massive genomic rearrangement acquired in a single catastrophic event during cancer development. Cell, 144(1):27–40, Jan. 2011. +[70] D. J. Sutherland, H. Y. Tung, H. Strathmann, S. De, A. Ramdas, A. Smola, and A. Gretton. Generative models and model criticism via optimized maximum mean discrepancy. In International Conference on Learning Representations, 2017. +[71] M. E. Tipping and C. M. Bishop. Probabilistic principal component analysis. Journal of the Royal Statistical Society: Series B, 61(3):611-622, Aug. 1999. +[72] D. Tran, M. Hoffman, D. Moore, C. Suter, S. Vasudevan, A. Radul, M. Johnson, and R. A. Saurous. Simple, distributed, and accelerated probabilistic programming. In Neural Information Processing Systems, 2018. + +[73] A. van den Oord, S. Dieleman, H. Zen, K. Simonyan, O. Vinyals, A. Graves, N. Kalchbrenner, A. Senior, and K. Kavukcuoglu. WaveNet: A generative model for raw audio. Sept. 2016. +[74] L. van der Maaten and G. Hinton. Visualizing data using t-SNE. Journal of Machine Learning Research, 9:2579-2605, 2008. +[75] A. W. van der Vaart. Asymptotic Statistics. 1998. +[76] R. Vershynin. High-Dimensional Probability: An Introduction with Applications in Data Science. 2020. +[77] P. Virtanen, R. Gommers, T. E. Oliphant, M. Haberland, T. Reddy, D. Cournapeau, E. Burovski, P. Peterson, W. Weckesser, J. Bright, S. J. van der Walt, M. Brett, J. Wilson, K. J. Millman, N. Mayorov, A. R. J. Nelson, E. Jones, R. Kern, E. Larson, C. J. Carey, I. Polat, Y. Feng, E. W. Moore, J. VanderPlas, D. Laxalde, J. Perktold, R. Cirmrman, I. Henriksen, E. A. Quintero, C. R. Harris, A. M. Archibald, A. H. Ribeiro, F. Pedregosa, P. van Mulbregt, and SciPy 1.0 Contributors. SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python. Nature Methods, 17:261-272, 2020. +[78] Y. Voichek and D. Weigel. Identifying genetic variants underlying phenotypic variation in plants without complete genomes. Nature Genetics, 52(5):534-540, 2020. +[79] E. N. Weinstein and D. S. Marks. A structured observation distribution for generative biological sequence prediction and forecasting. In International Conference on Machine Learning, 139, pages 11068-11079. PMLR, 2021. \ No newline at end of file diff --git a/agenerativenonparametricbayesianmodelforwholegenomes/images.zip b/agenerativenonparametricbayesianmodelforwholegenomes/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..fff82623945ed40fd5fd6136b2153ce495dd7287 --- /dev/null +++ b/agenerativenonparametricbayesianmodelforwholegenomes/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:88fe6ff1c43eae5b180c254811adfd5a55040dc0f0c5db56f690cdbcd2ce7541 +size 339533 diff --git a/agenerativenonparametricbayesianmodelforwholegenomes/layout.json b/agenerativenonparametricbayesianmodelforwholegenomes/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..0cb244a40dbe4ace6801df9de1a97cfea01aa724 --- /dev/null +++ b/agenerativenonparametricbayesianmodelforwholegenomes/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0548d0aae6db46f3462225891f1f6abdddb223ab5c84f04b6e2bb6f79249c001 +size 520289 diff --git a/ageometricanalysisofneuralcollapsewithunconstrainedfeatures/eee896b0-849a-4b33-a6ba-228485122957_content_list.json b/ageometricanalysisofneuralcollapsewithunconstrainedfeatures/eee896b0-849a-4b33-a6ba-228485122957_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..13e8c3174e0e25d8e7a99a4c96c7b5dabf9119c8 --- /dev/null +++ b/ageometricanalysisofneuralcollapsewithunconstrainedfeatures/eee896b0-849a-4b33-a6ba-228485122957_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b3b07e17639a8df2f38c134039ceb4e799ea08609a5578eb41ea549ef12dc2c0 +size 101689 diff --git a/ageometricanalysisofneuralcollapsewithunconstrainedfeatures/eee896b0-849a-4b33-a6ba-228485122957_model.json b/ageometricanalysisofneuralcollapsewithunconstrainedfeatures/eee896b0-849a-4b33-a6ba-228485122957_model.json new file mode 100644 index 0000000000000000000000000000000000000000..0e3efb543e2f02d965f486207eb6ced7d4cf2acf --- /dev/null +++ b/ageometricanalysisofneuralcollapsewithunconstrainedfeatures/eee896b0-849a-4b33-a6ba-228485122957_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5834ddf0375613c4044e696cfc58e23d0690af2b65b714dee3959186f02068e6 +size 141543 diff --git a/ageometricanalysisofneuralcollapsewithunconstrainedfeatures/eee896b0-849a-4b33-a6ba-228485122957_origin.pdf b/ageometricanalysisofneuralcollapsewithunconstrainedfeatures/eee896b0-849a-4b33-a6ba-228485122957_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8c109369abb9f5b83232c1c35cb0dbade2744942 --- /dev/null +++ b/ageometricanalysisofneuralcollapsewithunconstrainedfeatures/eee896b0-849a-4b33-a6ba-228485122957_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd24074f47843fffcd8044d807b9f2930ba91a177b71eaea7c0a8819b3f03c64 +size 1698756 diff --git a/ageometricanalysisofneuralcollapsewithunconstrainedfeatures/full.md b/ageometricanalysisofneuralcollapsewithunconstrainedfeatures/full.md new file mode 100644 index 0000000000000000000000000000000000000000..495a532a71befe07fe15a8dcdc9ce1bb62d0671b --- /dev/null +++ b/ageometricanalysisofneuralcollapsewithunconstrainedfeatures/full.md @@ -0,0 +1,378 @@ +# A Geometric Analysis of Neural Collapse with Unconstrained Features + +Zhihui Zhu* + +University of Denver zhihui.zhu@du.edu + +Tianyu Ding + +Johns Hopkins University tding1@jhu.edu + +Jinxin Zhou + +University of Denver jinxin.zhou@du.edu + +Xiao Li + +University of Michigan xlxiao@umich.edu + +Chong You + +Google Research cyou@google.com + +Jeremias Sulam + +Johns Hopkins University jsulam1@jhu.edu + +Qing Qu + +University of Michigan qingqu@umich.edu + +# Abstract + +We provide the first global optimization landscape analysis of Neural Collapse—an intriguing empirical phenomenon that arises in the last-layer classifiers and features of neural networks during the terminal phase of training. As recently reported in [1], this phenomenon implies that (i) the class means and the last-layer classifiers all collapse to the vertices of a Simplex Equiangular Tight Frame (ETF) up to scaling, and (ii) cross-example within-class variability of last-layer activations collapses to zero. We study the problem based on a simplified unconstrained feature model, which isolates the topmost layers from the classifier of the neural network. In this context, we show that the classical cross-entropy loss with weight decay has a benign global landscape, in the sense that the only global minimizers are the Simplex ETFs while all other critical points are strict saddles whose Hessian exhibit negative curvature directions. Our analysis of the simplified model not only explains what kind of features are learned in the last layer, but also shows why they can be efficiently optimized, matching the empirical observations in practical deep network architectures. These findings provide important practical implications. As an example, our experiments demonstrate that one may set the feature dimension equal to the number of classes and fix the last-layer classifier to be a Simplex ETF for network training, which reduces memory cost by over $20\%$ on ResNet18 without sacrificing the generalization performance. The source code is available at https://github.com/tding1/Neural-Collapse. + +# 1 Introduction + +In the past decade, the revival of deep neural networks (DNN) has led to dramatic success in numerous applications ranging from computer vision, to natural language processing, to scientific discovery and beyond [2-5]. Nevertheless, the practice of deep networks has been shrouded with mystery as our theoretical understanding for the success of deep learning remains elusive. There are many intriguing phenomena, such as implicit algorithmic bias in training [6-10], and good generalization of highly-overparameterized networks [7, 11-15], that seem often contradictory to, or cannot be explained by, classical optimization and learning theory. + +![](images/a450fa0929443015d4379d172f9956c2bff24d101e2f92907109bf80668ed599.jpg) +Figure 1: Illustration of Neural Collapse. Here $\phi_{\theta}(\cdot)$ denotes the feature mapping of the network, i.e. the output of the penultimate layer; see (1) for the formal definition. + +![](images/9e8404403d5dd36fa4586b868cb25da29081901b54fa500cfb48ca240181b184.jpg) +Figure 2: Illustration of the unconstrained feature model, where the gray box is peeled off so that the representation $h$ is modeled by a simple decision variable for every training sample. + +Towards demystifying DNN, recent seminal work [1, 16] empirically discovered an intriguing phenomenon that persists across a range of canonical classification problems during the terminal phase of training. As illustrated in Figure 1, it has been widely observed that last-layer features and classifiers of a trained DNN exhibit simple but elegant mathematical structures: + +- Variability Collapse: cross-example within-class variability of last-layer features collapses to zero, as the individual features of each class themselves concentrate to their isolated class-means. +- Convergence to Simplex ETF: the class-means centered at their global mean are not only linearly separable, but are actually maximally distant and located on a sphere centered at the origin up to scaling (i.e., they form a Simplex Equiangular Tight Frame (ETF) – or Simplex ETF, which is formally defined in Definition C.1 in the Appendix). +- Convergence to Self-duality: the last-layer linear classifiers, living in the dual vector space to that of the class-means, are perfectly matched with their class-means. +- Simple Decision Rule: the last-layer classifier is behaviorally equivalent to a Nearest Class-Center decision rule. + +These results suggest that deep networks are learning maximally separable features between classes, and a max-margin classifier in the last layer upon these learned features, touching the ceiling in terms of the performance. This phenomenon is referred to as Neural Collapse (NC) [1], and it persists across a range of canonical classification problems, on different neural network architectures (e.g., VGG [17], ResNet [18], and DenseNet [19]) and on a variety of standard datasets (such as MNIST [20], CIFAR [21], and ImageNet [22]). + +Fully demystifying the $\mathcal{NC}$ phenomenon in theory can be very challenging. Perhaps the most difficult hurdle lies in the nonconvexity of the optimization problem for training neural networks, which, loosely speaking, stems from the nonlinear interaction across many different layers of neural networks. Towards this goal, a recent line of work [23-29] studied the properties of last-layer classifiers and features based on the assumption of the so-called unconstrained feature model [23] or layer-peeled model [26]. At a high level, the unconstrained feature model takes a top-down approach to the analysis of deep neural networks [23-26, 29-31], wherein the last-layer features are modeled as free optimization variables (hence we call them unconstrained features) along with the last-layer classifiers (see Figure 2 for an illustration); this is in contrast to the conventional bottom-up approach that studies the problem starting from the input [32-42]. The underlying reasoning is that modern deep networks are often highly overparameterized with the capacity of learning any representations [43-46], so that the last-layer features can approximate, or interpolate, any point in the feature space. In this way, the model simplifies the study of last-layer features, enabling us to analyze the interaction between them and the last-layer classifiers. + +Nonetheless, the simplified unconstrained feature model still leaves us a highly nonconvex training loss to be dealt with. Despite the nonconvexity, recent work [23-28] studied the global minimizers, proving that Simplex ETFs (i.e., $\mathcal{NC}$ ) are indeed global solutions to the nonconvex loss. In particular, the work [23, 47] studied the training problem with the least-squared loss, proving that the gradient flow converges to $\mathcal{NC}$ solutions with extra assumptions. Another line of work [24-27] considered the commonly used cross-entropy loss for classification, showing that the only global minimizers of the loss function are Simplex ETFs with different constraints on the weights and features.3 However, + +Table 1: Comparison of the setup and results under the unconstrained feature model with cross-entropy loss. + +
RegularizerBias termResults
ConstraintWeight decayGlobal minimizerLandscape
[24-27]
This paper
+ +these results still suffer from several limitations: $(i)$ due to the nonconvex nature, only characterizing optimality conditions is not enough to explain the empirical convergence of iterative algorithms to $\mathcal{NC}$ , such as stochastic gradient descent (SGD); $(ii)$ the problem formulations differ from those typically used in practice, which deploy norm regularization (i.e., weight decay) on the weights, rather than enforcing constraints, for the ease of optimization.4 + +Contributions of This Work. Inspired by these pioneering results [1, 23-26, 29], in this work we take a step further by characterizing the global optimization landscape of the network training loss based on the unconstrained feature model. Our contributions are summarized as follows. + +- Benign Global Landscape. For the unconstrained feature model, we provide the first result showing that a commonly used, regularized cross-entropy loss is a strict saddle function [49-51]. In other words, every critical point is either a global solution (corresponding to Simplex ETFs) or a strict saddle point with negative curvature, so that there is no spurious local minimizer on the optimization landscape. As summarized in Table 1, this is in contrast to previous work [23-26] that only characterizes global minimizers. +- Efficient, Algorithmic Independent, Global Optimization. The benign global landscape implies that any method that can escape strict saddle points (e.g. stochastic gradient descent) converges to a global solution [52] that exhibits $\mathcal{NC}$ . This result supports our empirical observation, as shown in Section 4.1, that practical overparameterized networks always converge to Simplex ETF solutions with a diverse choice of optimization algorithms. +- Cost Reduction for Practical Network Training. Moreover, the universality of $\mathcal{NC}$ implies that there is no need of training the last-layer classifiers since the weights can be simply fixed as a Simplex ETF throughout the training process. On the other hand, since $\mathcal{NC}$ happens whenever $d \geq K$ , this implies that we can choose the feature dimension $d$ comparable to the number of classes $K$ , reducing the feature dimension for further computational benefits. In Section 4.3, our experiments demonstrate that such a strategy achieves on par performance with classical training methods, leading to substantial cost reductions on both memory and computation. + +Our results shed new light on the question raised in the recent paper [53] on the role of the optimization strategy (e.g., stochastic gradient descent) for achieving $\mathcal{NC}$ in training practical deep networks. This question also relates to the recent highly influential work [7] on the implicit algorithmic bias. For multi-class classification problems with linearly separable data, this work [7] showed that linear predictors optimized by gradient descent converge to the max-margin classifiers even without adding any explicit regularization on the cross-entropy loss. Based on this result, a sequence of works [54-61] laid great emphasis on the notion of "inductive bias" of particular optimization algorithms as a reason for the surprising success in training deep learning models. In contrast, both our theoretical result on the global landscape for the unconstrained feature model and the empirical evidence on practical deep models demonstrate that $\mathcal{NC}$ in network training is facilitated not only by the choice of the optimization methods, but more importantly, by the choice of loss functions and the power of overparameterization in the network architecture. + +# 2 The Problem Setup + +A deep neural network is essentially a nonlinear mapping $\psi(\cdot): \mathbb{R}^D \mapsto \mathbb{R}^K$ , which can be modeled by a composition of simple maps: $\psi(\pmb{x}) = \psi^L \circ \dots \circ \psi^2 \circ \psi^1(\pmb{x})$ for $\pmb{x} \in \mathbb{R}^D$ , where $\psi^\ell(\cdot) (1 \leq \ell \leq L)$ are called "layers". Each layer is composed of an affine transform, represented by + +some weight matrix $W_{\ell}$ , and bias $b_{\ell}$ , followed by a simple nonlinear activation function $\sigma(\cdot)$ . More precisely, a vanilla $L$ -layer neural network can be written as + +$$ +\psi_ {\Theta} (\boldsymbol {x}) = \boldsymbol {W} _ {L} \underbrace {\sigma \left(\boldsymbol {W} _ {L - 1} \cdots \sigma \left(\boldsymbol {W} _ {1} \boldsymbol {x} + \boldsymbol {b} _ {1}\right) + \boldsymbol {b} _ {L - 1}\right)} _ {\phi_ {\boldsymbol {\theta}} (\boldsymbol {x})} + \boldsymbol {b} _ {L}. \tag {1} +$$ + +For convenience, we use $\Theta = \{W_k, b_k\}_{k=1}^L$ to denote all the network parameters, and use $\theta = \{W_k, b_k\}_{k=1}^{L-1}$ to denote the network parameters up to the last layer. The output of the penultimate layer, denoted by $\phi_\theta(x)$ , is usually referred to as the representation or feature of the input $x$ learned from the network. In this way, the function implemented by a neural network classifier can also be expressed as a linear classifier acting upon $\phi_\theta(x)$ . + +The goal of deep learning is to fit the parameters $\Theta$ so that the output of the model on an input samples $\pmb{x}$ approximates the corresponding output $\pmb{y}$ , i.e. so that $\psi_{\Theta}(\pmb{x}) \approx \pmb{y}$ , in expectation over a distribution of input-output pairs, $\mathcal{D}$ . This can be achieved by optimizing an appropriate loss function $\mathcal{L}(\psi_{\Theta}(\pmb{x}), \pmb{y})$ which quantifies this approximation. In this work, we focus on multi-class classification tasks (say, with $K$ classes), where the class label of a sample $\pmb{x}$ is given by a one-hot vector $\pmb{y} \in \mathbb{R}^{K}$ representing its membership to one of the $K$ classes. In this setting, cross-entropy is one of the most popular choices for the loss function. Naturally, the distribution $\mathcal{D}$ is unknown, but we have access to training samples that are drawn i.i.d. from $\mathcal{D}$ . In this way, one can minimize the empirical risk over these samples by optimizing the following problem + +$$ +\min _ {\boldsymbol {\Theta}} \sum_ {k = 1} ^ {K} \sum_ {i = 1} ^ {n _ {k}} \mathcal {L} _ {\mathrm {C E}} \left(\psi_ {\boldsymbol {\Theta}} \left(\boldsymbol {x} _ {k, i}\right), \boldsymbol {y} _ {k}\right) + \frac {\lambda}{2} \| \boldsymbol {\Theta} \| _ {F} ^ {2}, \tag {2} +$$ + +where $\pmb{y}_k\in \mathbb{R}^K$ is a one-hot vector with only the $k$ th entry equal to unity ( $1\leq k\leq K$ ), $\{n_k\}_{k = 1}^K$ are the numbers of training samples in each class, and $\lambda >0$ is the regularization parameter (or weight decay penalty), and $\mathcal{L}_{\mathrm{CE}}(\cdot ,\cdot)$ is the cross-entropy loss. As introduced in Section 1, recent work [1] showed that the features learned by minimizing the above objective showcase the $\mathcal{NC}$ phenomenon: their within-class variability vanishes, and the features converge to a Simplex ETF. + +# 2.1 Problem Formulation Based on Unconstrained Feature Models + +In deep network models, the nonlinearity and interaction between a large number of layers results in tremendous challenges for analyzing this learning problem. Since modern networks are often highly overparameterized to approximate any continuous function and the characterization of $\mathcal{NC}$ only involves the last-layer features $\phi_{\theta}(\pmb{x})$ , a natural idea to simplify the analysis is to treat these features as free optimization variables $\pmb{h} = \phi_{\theta}(\pmb{x}) \in \mathbb{R}^d$ , which motivates the name unconstrained feature model[8] (see Figure 2 for an illustration). In this way, we can rewrite the network output as $\psi_{\Theta}(\pmb{x}) = W_L \pmb{h} + \pmb{b}_L$ . + +For simplicity, we consider the setting where the number of training samples in each class is balanced (i.e., $n_k = n$ for all $k \in [K] := \{1, 2, \dots, K\}$ ). We also write $\bar{\boldsymbol{W}} = \boldsymbol{W}_L$ and $\boldsymbol{b} = \boldsymbol{b}_L$ for conciseness. Based on the unconstrained feature model, we consider a slight variant of (2), given by + +$$ +\min _ {\boldsymbol {W}, \boldsymbol {H}, \boldsymbol {b}} f (\boldsymbol {W}, \boldsymbol {H}, \boldsymbol {b}) := \frac {1}{K n} \sum_ {k = 1} ^ {K} \sum_ {i = 1} ^ {n} \mathcal {L} _ {\mathrm {C E}} \left(\boldsymbol {W} \boldsymbol {h} _ {k, i} + \boldsymbol {b}, \boldsymbol {y} _ {k}\right) + \frac {\lambda_ {\boldsymbol {W}}}{2} \| \boldsymbol {W} \| _ {F} ^ {2} + \frac {\lambda_ {\boldsymbol {H}}}{2} \| \boldsymbol {H} \| _ {F} ^ {2} + \frac {\lambda_ {\boldsymbol {b}}}{2} \| \boldsymbol {b} \| _ {2} ^ {2}, \tag {3} +$$ + +with $\pmb{W} \in \mathbb{R}^{K \times d}$ , $\pmb{H} = [h_{1,1} \cdots h_{K,n}] \in \mathbb{R}^{d \times N}$ (here, we denote $N = nK$ ), $\pmb{b} \in \mathbb{R}^K$ , and $\lambda_W, \lambda_H, \lambda_b > 0$ are the penalty parameters for the weight decay. + +As summarized in Table 1, similar optimization problems have been considered in [24-26]. In contrast to these, our problem formulation here (3), with bias and weight decay, is closer to the loss used in practice for training neural networks; existing work [24-26] considered constrained9 variants of (3) and without the bias term, which can be implemented but seldom used in practice due to the difficulty of optimization. In the following, we briefly discuss the differences between our simplification and practical settings for training neural networks. + +The nonlinear operator may include activations such as ReLU [67], pooling, and normalization [68], etc. +This model is also called layer-peeled model in [26], where one "peels" off the first $L - 1$ layers. It has also been recently studied in [24,25]. Throughout the paper, we will simply call it unconstrained feature model. +For example, the work [26] considers inequality constraints such that the energy of $\mathbf{W}$ and $\mathbf{H}$ are bounded; the other work [24, 25] enforces $\mathbf{W}$ and $\mathbf{H}$ on the spheres up to scaling. + +- Weight Decay on $W$ and $H$ . One simplification of our formulation is in the weight decay. In practice, weight decay is usually imposed on the network parameters $\Theta$ , while we enforce weight decay on the last layer's classifier, $W$ , and features, $H$ . However, this idealization is reasonable since the energy of the features (i.e., $\| H \|_F$ ) can indeed be upper bounded by the energy of the weights at every layer if the inputs are bounded (which holds in practice), implying that the norm of $H$ is implicitly penalized by penalizing $\Theta$ . Our experiments in the Appendix demonstrate that both approaches exhibit similar $\mathcal{NC}$ phenomena and comparable performance in practice. +- Treating the Last-layer Features as Optimization Variables. One may question that "peeling off" the $L - 1$ layers might oversimplify the problem. Nonetheless, this simplification (which is also adopted in [23-26]) is based on the fact that neural networks with sufficient overparameterization can approximate any function – in Section 4.2, we numerically demonstrate that $\mathcal{NC}$ persists even when we train overparametrized networks on randomly generated labels. Moreover, as we shall see in the following sections, both our theory and experiments demonstrate that our simplification preserves the core properties of last-layer classifiers and features during training – the $\mathcal{NC}$ phenomenon. More specifically, in Section 3 we show that Simplex ETFs are the only global minimizers to our simplified loss function (3), and the loss function is a strict saddle function with no other spurious local minimizers so that it can be optimized efficiently to global optimality. + +# 3 Main Theoretical Results + +In this section, we present our study on global optimality conditions as well as the optimization landscape of the nonconvex loss in (3). + +Theorem 3.1 (Global Optimality Conditions) Assume that the feature dimension $d$ is no smaller than the number of classes $K$ , i.e. $d \geq K - 1$ , and the number of training samples in each class is balanced, $n = n_1 = \dots = n_K$ . Then any global minimizer $(\mathbf{W}^{\star}, \mathbf{H}^{\star}, \mathbf{b}^{\star})$ of $f$ in (3) satisfies + +$$ +w ^ {\star}: = \left\| \boldsymbol {w} ^ {\star 1} \right\| _ {2} = \left\| \boldsymbol {w} ^ {\star 2} \right\| _ {2} = \dots = \left\| \boldsymbol {w} ^ {\star K} \right\| _ {2}, a n d \boldsymbol {b} ^ {\star} = b ^ {\star} \mathbf {1}, +$$ + +$$ +\boldsymbol {h} _ {k, i} ^ {\star} = \sqrt {\frac {\lambda_ {W}}{\lambda_ {H} n}} \boldsymbol {w} ^ {\star k}, \quad \forall k \in [ K ], i \in [ n ], \quad a n d \quad \overline {{\boldsymbol {h}}} _ {i} ^ {\star} := \frac {1}{K} \sum_ {j = 1} ^ {K} \boldsymbol {h} _ {j, i} ^ {\star} = \mathbf {0}, \quad \forall i \in [ n ], \tag {4} +$$ + +where either $b^{\star} = 0$ or $\lambda_{b} = 0$ , and the matrix $W^{\star \top} \in \mathbb{R}^{d \times K}$ forms a $K$ -Simplex ETF (defined in Definition C.1) up to some scaling, in the sense that the normalized matrix $M := \frac{1}{w^{\star}} W^{\star \top}$ satisfies + +$$ +M ^ {\top} M = \frac {K}{K - 1} \left(I _ {K} - \frac {1}{K} \mathbf {1} _ {K} \mathbf {1} _ {K} ^ {\top}\right). \tag {5} +$$ + +At a high level, our proof (in Appendix D) finds lower bounds for the loss in (3) and studies the conditions for the lower bounds to be achieved, similar to [24, 26]. As can be seen in this result, any global solution of the loss function (3) exhibits $\mathcal{NC}$ in the sense that the variability of output features $\{h_{k,i}^{\star}\}_{i=1}^{n}$ of each class $k$ ( $1 \leq k \leq K$ ) collapses to zero, and any pair of features $(h_{k_1,i}^{\star}, h_{k_2,j}^{\star})$ from different classes $k_1 \neq k_2$ are maximally separated. Similar results have been obtained in [24-26], which considered different problem formulations, as we have discussed in Section 2.1. + +- Relationship between Class Number $K$ and Feature Dimension $d$ . The requirement that $d \geq K - 1$ is necessary for Theorem 3.1 to hold, simply because $K$ vectors in $\mathbb{R}^d$ cannot form a $K$ -Simplex ETF if $K > d + 1$ . However, the relationship $d \geq K$ is often true in practice. In general, and in overparameterized models in particular, the feature dimension, $d$ , is significantly larger than the number of classes, $K$ . For example, the dimension of the features of a ResNet [18] is typically set to $d = 512$ for CIFAR10 [21], a dataset with $K = 10$ classes. This dimension grows to $d = 2048$ for ImageNet [22], a dataset with $K = 1000$ classes. +- Interpretations on the Bias Term $b^{\star}$ . In contrast to previous works [24-26], we consider the bias term in the unconstrained feature model (3). Our result indicates that a collapsing phenomenon also exists in the bias term $b^{\star}$ , in the sense that all the elements of $b^{\star}$ are identical. When the features $H$ are completely unconstrained, our result implies that removing the bias term $b$ has no influence on the performance of the classifier. However, it should be noted that the ReLU unit is often applied at the end of the penultimate layer, so that $H$ should be constrained to be nonnegative, $H \geq 0$ . In such cases, $\overline{h}_i^{\star}$ will no longer be zero, and neither will $b^{\star}$ . Here, the bias + +term $b^{\star}$ will compensate for the global mean of the features, so that the globally-centered features still form a Simplex ETF [1].10 + +# 3.1 Characterizations of the Benign Global Landscape for (3) + +The global optimality condition in Theorem 3.1 does not necessarily mean that we can achieve these global solutions efficiently, as the problem is still nonconvex. We now investigate the global optimization landscape of (3) by characterizing all of its critical points. Our next result implies that the training loss is a strict saddle function, and every critical point is either a global minimizer or a strict saddle point that can be escaped using negative curvatures. As a consequence, this implies that the global solutions of the training problem in (3) can be efficiently found from random initializations. + +Theorem 3.2 (No Spurious Local Minima and Strict Saddle Property) Assume that the feature dimension is larger than the number of classes, $d > K$ , and the number of training samples in each class is balanced $n = n_1 = \dots = n_K$ . Then the function $f(\mathbf{W},\mathbf{H},\mathbf{b})$ in (3) is a strict saddle function with no spurious local minimum, in the sense that + +- Any local minimizer of (3) is a global minimizer of the form shown in Theorem 3.1. +- Any critical point $(\mathbf{W}, \mathbf{H}, \mathbf{b})$ of (3) that is not a local minimizer is a strict saddle with negative curvature, i.e. the Hessian $\nabla^2 f(\mathbf{W}, \mathbf{H}, \mathbf{b})$ , at this critical point, is non-degenerate and has at least one negative eigenvalue, i.e. $\exists i: \lambda_i(\nabla^2 f(\mathbf{W}, \mathbf{H}, \mathbf{b})) < 0$ . + +In a nutshell, our proof relies on connecting the original nonconvex optimization problem (3) to its corresponding low-rank convex counterpart, so that we can obtain the global optimality conditions for (3) based on the latter. With this, we can then characterize the properties of all critical points based on the optimality conditions. We defer all details of this proof to Appendix D. + +Existing results [24-26] have only studied the global minimizers of the original problem, which has limited implication for optimization. In contrast, Theorem 3.2 characterizes the properties for all critical points of the function in (3). As a consequence of this result, many first-order and second-order optimization methods [69] optimizing $(\mathbf{W},\mathbf{H},\mathbf{b})$ are guaranteed to converge to a global solution of (3). In particular, the result in [49, 52] ensures that (stochastic) gradient descent with random initialization, the de facto optimization algorithm used in deep learning, almost surely escapes strict saddles and converges to a second-order critical point – which happens to be a global minimizer of form showed in Theorem 3.1 for our problem (3). + +- Constructing the Negative Curvature Direction for Strict Saddles. One of the major difficulties in our proof is to construct the negative curvature direction for strict saddle points. Here, we exploit the fact that the feature dimension $d$ is larger than the number of classes $K$ , and construct the negative curvature direction within the null space of $\mathbf{W} \in \mathbb{R}^{K \times d}$ . This is also the main reason for the requirement $d > K$ in Theorem 3.2, but we conjecture the results also hold for $d = K$ and could be proved with more sophisticated analysis, which is left as future work. +- Relationship to Low-Rank Matrix Recovery. As discussed in Appendix A, it has been recently shown that the strict saddle property holds for a wide range of nonconvex problems in machine learning [70-83], including low-rank matrix recovery [78, 80, 84-87]. As we know that $\| Z \|_* = \min_{\boldsymbol{Z} = \boldsymbol{W} \boldsymbol{H}} \frac{1}{2} (\|\boldsymbol{W}\|_F^2 + \|\boldsymbol{H}\|_F^2)$ (see [32] for a proof), our formulation in (3) is closely related to low-rank matrix problems [78, 80, 84-87] with the Burer-Moneirto factorization approach [88], by viewing $\boldsymbol{W}$ and $\boldsymbol{H}$ as two factors of a matrix $Z = WH$ . The differences lie in the loss functions and statistical properties of the problem. Thus, our result establishes a connection between the study of low-rank matrix factorization and neural networks under the unconstrained feature model. + +- Comparison to Existing Landscape Analysis on Neural Network. Section 1 provided a comprehensive discussion on the relationship between our result and previous works on landscape analysis for deep neural networks. Although the unconstrained feature model can be viewed as a two-layer linear network with input being the columns of an identity matrix, as preluded in Section 1, our result has much broader implications than the previous results [33,34,37,38,40,41,89]. First, our problem formulation (3) is closer to practical settings for classification tasks, which considers the widely adopted cross-entropy loss while including weight decay and a bias term, while most existing results [33,34,37,38,40,41,89] either do not incorporate any regularization and bias, or focus on the squared loss for the regression problem. More importantly, our result characterizes the precise form of the global solutions (i.e., $\mathcal{NC}$ ) for the last layer features and classifiers, and shows that they can be efficiently achieved. Moreover, convincing numerical results in [1] and the next section demonstrate that the global solutions do appear and can be achieved by practical networks on various standard image datasets. Our study of last-layer features could have profound implications for studying generalization and robustness of the deep networks. + +# 4 Experiments + +In this section, we run extensive experiments not only verifying our theoretical results on modern neural networks, but also demonstrating the potential practical benefits of understanding $\mathcal{NC}$ . More specifically, while Theorem 3.2 holds true for the simplified unconstrained feature model, in Section 4.1 we run experiments on practical network architectures and show that our analysis of simplified models captures the gist of $\mathcal{NC}$ . In particular, we demonstrate that this depends on the geometry of the problem rather than the algorithmic bias, by showing that different types of optimization algorithms all achieve $\mathcal{NC}$ during the terminal phase of training. In Section 4.2, we verify the validity of the simplification based on the unconstrained feature model. Moreover, the universality of $\mathcal{NC}$ implies that there is no need for training the last-layer classifiers since the weights can be simply fixed as a Simplex ETF throughout the training process. In Section 4.3, we demonstrate that such a strategy achieves essentially the same generalization performance as classical training algorithms, while improving on memory and computation. We begin by describing the basic experimental setup, including the network architectures, evaluation datasets, training procedures, and metrics for measuring $\mathcal{NC}$ . + +Setup of Network Architectures, Dataset, and Training. In Section 4.1 and Section 4.2, we train a ResNet18 architecture [18] on CIFAR10 [21] for image classification using the cross-entropy loss (2). Due to limited space, we present all the results on MNIST [90] in the Appendix. As is standard, images are normalized (channel-wise) by their mean and standard deviation. We include no data augmentation in this section, as our focus is to study the behavior associated with $\mathcal{NC}$ instead of obtaining state-of-the-art performance. We train the network for 200 epochs with three distinct optimizers: two first-order methods (SGD and Adam) and one second-order method (LBFGS [69]). In particular, we use SGD with momentum 0.9, Adam with $\beta_{1} = 0.9$ , $\beta_{2} = 0.999$ , and LBFGS with a memory size of 10. The initial learning rates for SGD and Adam are set to 0.05 and 0.001, respectively, and decreased by a factor of 10 for every 40 epochs. For LBFGS, we use an initial learning rate of 0.1 and employ a strong Wolfe line-search strategy for subsequent iterations. Except otherwise specified, the weight decay is set to $5 \times 10^{-4}$ for all the experiments. + +Metrics for Measuring $\mathcal{NC}$ During Network Training. We measure $\mathcal{NC}$ for the learned last-layer classifiers and features based on the properties presented in Section 1. Some of the metrics are similar to those presented in [1]. We first measure the within-class variability collapse by measuring the magnitude of the between-class covariance $\pmb{\Sigma}_{B} \in \mathbb{R}^{d \times d}$ compared to the within-class covariance $\pmb{\Sigma}_{W} \in \mathbb{R}^{d \times d}$ of the learned features via $\mathcal{NC}_{1} := \frac{1}{K} \text{trace}(\pmb{\Sigma}_{W} \pmb{\Sigma}_{B}^{\dagger})$ , where $\pmb{\Sigma}_{B}^{\dagger}$ denotes the pseudo inverse of $\pmb{\Sigma}_{B}$ . For the learned classifier $\pmb{W} \in \mathbb{R}^{K \times d}$ , we quantify its closeness to a Simplex ETF up to scaling by $\mathcal{NC}_{2} := \left\| \frac{\pmb{W} \pmb{W}^{\top}}{\|\pmb{W} \pmb{W}^{\top}\|_{F}} - \frac{1}{\sqrt{K-1}} (\pmb{I}_{K} - \frac{1}{K} \pmb{1}_{K} \pmb{1}_{K}^{\top}) \right\|_{F}$ , where we rescale the ETF in (5) so that $\frac{1}{\sqrt{K-1}} (\pmb{I}_{K} - \frac{1}{K} \pmb{1}_{K} \pmb{1}_{K}^{\top})$ has unit energy (in Frobenius norm). It should be noted that our metric $\mathcal{NC}_{2}$ combines two metrics used in [1] to quantify to what extent the classifier approaches equiangularity and maximal-angle equiangularity. We then measure the duality between the classifiers $\pmb{W}$ and the centered class-means $\overline{\pmb{H}}$ by $\mathcal{NC}_{3} := \left\| \frac{\overline{\pmb{W} \overline{\pmb{H}}}}{\|\overline{\pmb{W} \overline{\pmb{H}}}\|_{F}} - \frac{1}{\sqrt{K-1}} (\pmb{I}_{K} - \frac{1}{K} \pmb{1}_{K} \pmb{1}_{K}^{\top}) \right\|_{F}$ . + +![](images/bd2b1e1fb9b6a9d372b94d09e30837e4416a7e129be6dea979441cf5bf586865.jpg) + +![](images/64e9f6117a71e29d402099c9e769e0358440a95a686e3c27df2f53dc9768f7ba.jpg) + +![](images/0f915d54dc77f59143ef84a44993b4e8d67fe2e77f57140ad9da97883618db13.jpg) + +![](images/173836f11bcfa3f99b51e187a8067314d2a2c338240ba9ab185e19deca31532b.jpg) + +![](images/15870dd05f0a63690b7facbb876ad41a13536c9524bdd6d19598f8b7dcd3b14a.jpg) +Figure 4: Training results of ResNet18 with various feature width on CIFAR10 with completely random label. From the left to the right: $\mathcal{NC}_1, \mathcal{NC}_2, \mathcal{NC}_3$ , and the misclassification percentage of training samples. + +![](images/13594e5018d54a8eb6a9a8a142c4032df709547ef6e3917a0c495924d9f0f36a.jpg) +Figure 3: Illustration of $\mathcal{NC}$ across different training algorithms with ResNet18 on CIFAR10. From the left to the right, the plots show the four metrics, $\mathcal{NC}_1, \mathcal{NC}_2, \mathcal{NC}_3$ , and $\mathcal{NC}_4$ , respectively. + +![](images/c4b29f286f1469548f48da814fa3f85f066ff1bc628b8b15ef95d244b81e65bf.jpg) + +![](images/e5cf6921b24e8f72f5724af6ba40efcf4eb33a5f2aab9289a34ebe14b3db0884.jpg) + +In many cases, the global mean $h_G$ of the features might not be zero, $^{12}$ and the bias term $\pmb{b}$ would compensate for the global mean $h_G$ . Thus, we capture this collapsing phenomenon by measuring $\mathcal{NC}_4 := \| \pmb{b} + \pmb{W}h_G\|_2$ . The detailed descriptions of the four metrics are given in Appendix B. + +# 4.1 The Prevalence of $\mathcal{NC}$ Across Different Optimization Algorithms + +We show different types of training methods (e.g., SGD, Adam, and LBFGS) all achieve $\mathcal{NC}$ during the terminal phase of training. Figure 3 shows the evolution of the four metrics $\mathcal{NC}_1, \mathcal{NC}_2, \mathcal{NC}_3,$ and $\mathcal{NC}_4$ , for measuring $\mathcal{NC}$ as training progresses. We consistently observe that all four metrics collapse to zero, trained by different types of algorithms. This implies that $\mathcal{NC}$ occurs regardless of the choice of training methods. The last-layer features learned by the network are always maximally linearly separable, and correspondingly the last-layer classifier is a perfect linear classifier for the features. See Appendix for the testing performance of the networks learned by different algorithms. + +# 4.2 The Validity of (3) Based on Unconstrained Feature Models for $\mathcal{NC}$ + +The premise of our global landscape analysis of (3) for studying $\mathcal{NC}$ in deep neural networks is based upon the unconstrained feature model introduced in Section 2.1, which simplifies the network by synthesizing the first $L - 1$ layers as a universal approximator that generates a simple decision variable for each training sample. Here, we demonstrate through experiments that such a simplification is reasonable for overparameterized networks, in the sense that they are sufficient for characterizing $\mathcal{NC}$ in practical network training. In particular, we demonstrate that overparameterization is crucial for $\mathcal{NC}$ phenomenon during network training, while the input plays minimal influence. To that goal, we modify the training dataset CIFAR10 by replacing all the correct label for each training sample with a random counterpart. $^{13}$ We report the corresponding $\mathcal{NC}$ behaviors in Figure 4, which shows how training misclassification rate and $\mathcal{NC}$ evolve over epochs of training for networks with different widths $^{14}$ . As the network is sufficiently large, it has enough capacity to memorize the training data and achieves zero training error, which is consistent with the observations in [11]. Moreover, we find from Figure 4 that the training accuracy is highly correlated with $\mathcal{NC}$ in the sense that a larger network (i.e., larger width) tends to exhibit severe $\mathcal{NC}$ and achieves smaller training error. In other words, while the emerging consensus is that the network can interpolate any training data, our results show that such interpolation happens in a particular way – the features are maximally separated, followed by a max-margin linear classifier. In Appendix B, we also report experiments on weight decay imposed on the features $H$ , as in (3). + +![](images/de6170d3650bb3b78cd42de56cc6c5600b8698b40071afd2778478d3244133b1.jpg) +Figure 5: Comparison of the performances of ResNet 50 with learned vs. fixed last-layer classifiers on CIFAR10. From left to right): $\mathcal{NC}_1$ , $\mathcal{NC}_3$ , Training Accuracy, Testing Accuracy. + +![](images/d93c4d64dad687505a6f61a727935563eb3b89358fb8d826420a5d50dac64acd.jpg) + +![](images/9540567cb20599def1b3546263176ecf7d8351f75d64828c4d64e538ae43b4f0.jpg) + +![](images/c5d6c2b268e61caf9b383a0fc008959424aae7d365bc25c5ff87173a653ecb78.jpg) + +# 4.3 Insights from $\mathcal{NC}$ for Improving Network Designs + +Finally, we conduct exploratory experiments to demonstrate the practical benefits of $\mathcal{NC}$ phenomenon. The universality of $\mathcal{NC}$ implies that the final classifier (i.e. the $L$ -th layer) of a neural network always converges to a Simplex ETF, which is fully determined up to an arbitrary rotation and happens when $K \leq d$ . Thus, based on these understandings, we show that we can substantially improve the computational cost by modifying the architecture without the sacrificing performance, by (i) fixing the last-layer classifier as a Simplex ETF15, and (ii) reducing the feature dimension $d = K$ . Here, to demonstrate our method can achieve state-of-the-art performance, we do include data augmentation in the training of our ResNet50 model [91] on CIFAR10, achieving around 95% test accuracy. See Appendix B for the results on MNIST and CIFAR10 with ResNet18. + +Fixing the Last-layer Classifier as a Simplex ETF. Figure 5 presents a comparison of learned and fixed classifiers in terms of within-class variation collapse $(\mathcal{NC}_1)$ , self-duality $(\mathcal{NC}_3)$ , training accuracy, and test accuracy. These results imply that the fixed classifier exhibits the same within-class variation collapse for the features $H$ , and achieves the same classification accuracy as the fully-trained classifier. On the other hand, fixing the classifier can reduce the number of parameters and the computational complexity for training. The number of parameters in the classifier can be significant for tasks with a large number of classes and large feature dimensions. For example, for ImageNet, a dataset with $K = 1000$ classes, fixing the classifier can reduce $8.01\%$ , $11.76\%$ , and $52.56\%$ of total learning parameters for ResNet50, DenseNet169 [19], and ShuffleNet [92], respectively. We note that our result also provides a theoretical justification for the work in [93] that fixes the classifier as orthonormal matrices. Indeed, these are close to simplex ETFs, particularly when the number of classes is large. + +Feature Dimension Reduction for $H \in \mathbb{R}^{d \times nK}$ by Choosing $d = K$ . In many classification problems, the practice of deep learning typically uses a feature dimension $d$ that is much larger than the number of classes $K$ . In contrast, $\mathcal{NC}$ implies that there is no need to choose a $d$ that is much larger than the number of classes $K$ . Reducing the dimension $d$ can lead to substantial reductions in memory and computation cost. As shown in Figure 5, we also train all the weights of ResNet50 on CIFAR10 using SGD with $d = K$ . The results demonstrate that $\mathcal{NC}$ persists even when we choose $d = K$ , and the network achieves on-par performance with networks of large $d$ , in terms of training and test accuracy. This implies that when the number of classes $K$ is small, we can choose a small feature dimension $d = K$ (or $d \gtrsim K$ ) instead of using a large universal $d$ to reduce the computation and memory costs for training. By setting $d = K$ , this reduces the amount of parameters and hence the memory cost in ResNet18 and ResNet50 by $20.70\%$ and $4.45\%$ respectively. + +# 5 Conclusion + +In this work, we have provided an in-depth analysis to demystify the $\mathcal{NC}$ phenomenon, which appears during the terminal phase of training deep networks in classification problems. Based on the unconstrained feature model [24-26], we proved that Simplex ETFs are the only global minimizers of the cross-entropy training loss with weight decay and bias. Moreover, we showed that the loss function is a strict saddle function with respect to the last-layer features and classifiers, with no other spurious local minimizers. In contrast to existing landscape analyses for deep neural networks, which mostly focus on the optimization perspective, our simplified analysis not only characterizes + +the features that are learned in the last layer, but also explains why they can be efficiently optimized. This provides support for empirical observations in practical deep network architectures. Moreover, the study of last-layer features could have profound implications for optimization, generalization, and robustness of broad interests, which are the subjects of future work. It is also of interest to extend the current study to the case where $d < K$ , which is the case in contrastive learning [94, 95] and many applications, such as recommendation systems [96] and document retrieval [97]. + +# Acknowledgment + +ZZ acknowledges support from NSF grant CCF 2008460. XL and QQ acknowledge support from NSF grant DMS 2009752. JS acknowledges support from NSF grant CCF 2007649. We would like to thank Qinqing Zheng (Facebook AI Research), Vardan Papyan (U. Toronto), and Felix Yu (Google Research) for timely pointing us to some important references and valuable feedback on the final draft. We thank Christina Baek (UC Berkeley) and Sam Buchanan (Columbia U.) for fruitful discussions during various stages of the work. We also thank Zhexin Wu (U. Michigan) for proofreading and pointing out several typos in the draft, and the four anonymous reviewers for their constructive comments. + +# References + +[1] 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. +[2] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems, pages 1097-1105, 2012. +[3] Yann LeCun, Yoshua Bengio, and Geoffrey Hinton. Deep learning. nature, 521(7553):436-444, 2015. +[4] Ian Goodfellow, *Yoshua Bengio*, Aaron Courville, and *Yoshua Bengio*. *Deep learning*, volume 1. MIT press Cambridge, 2016. +[5] Andrew W Senior, Richard Evans, John Jumper, James Kirkpatrick, Laurent Sifre, Tim Green, Chongli Qin, Augustin Žídek, Alexander WR Nelson, Alex Bridgland, et al. Improved protein structure prediction using potentials from deep learning. Nature, 577(7792):706-710, 2020. +[6] Behnam Neyshabur, Ryota Tomioka, and Nathan Srebro. In search of the real inductive bias: On the role of implicit regularization in deep learning. arXiv preprint arXiv:1412.6614, 2014. +[7] 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. +[8] Sanjeev Arora, Nadav Cohen, Wei Hu, and Yuping Luo. Implicit regularization in deep matrix factorization. Advances in Neural Information Processing Systems, 32, 2019. +[9] Edward Moroshko, Blake E Woodworth, Suriya Gunasekar, Jason D Lee, Nati Srebro, and Daniel Soudry. Implicit bias in deep linear classification: Initialization scale vs training accuracy. Advances in Neural Information Processing Systems, 33, 2020. +[10] Noam Razin and Nadav Cohen. Implicit regularization in deep learning may not be explainable by norms. Advances in Neural Information Processing Systems, 33, 2020. +[11] Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016. +[12] 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. +[13] Song Mei and Andrea Montanari. The generalization error of random features regression: Precise asymptotics and double descent curve. arXiv preprint arXiv:1908.05355, 2019. +[14] Preetum Nakkiran, Gal Kaplun, Yamini Bansal, Tristan Yang, Boaz Barak, and Ilya Sutskever. Deep double descent: Where bigger models and more data hurt. arXiv preprint arXiv:1912.02292, 2019. +[15] Zitong Yang, Yaodong Yu, Chong You, Jacob Steinhardt, and Yi Ma. Rethinking bias-variance trade-off for generalization of neural networks. In International Conference on Machine Learning, pages 10767-10777. PMLR, 2020. +[16] Vardan Papyan. Traces of class/cross-class structure pervade deep learning spectra. Journal of Machine Learning Research, 21(252):1-64, 2020. + +[17] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. +[18] 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, pages 770-778, 2016. +[19] 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, pages 4700-4708, 2017. +[20] Yann LeCun, Corinna Cortes, and CJ Burges. Mnist handwritten digit database. at&t labs, 2010. +[21] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. +[22] 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, pages 248–255. Ieee, 2009. +[23] Dustin G Mixon, Hans Parshall, and Jianzong Pi. Neural collapse with unconstrained features. arXiv preprint arXiv:2011.11619, 2020. +[24] Jianfeng Lu and Stefan Steinerberger. Neural collapse with cross-entropy loss. arXiv preprint arXiv:2012.08465, 2020. +[25] E Weinan and Stephan Wojtowtysch. On the emergence of tetrahedral symmetry in the final and penultimate layers of neural network classifiers. arXiv preprint arXiv:2012.05420, 2020. +[26] Cong Fang, Hangfeng He, Qi Long, and Weijie J Su. Layer-peeled model: Toward understanding well-trained deep neural networks. arXiv preprint arXiv:2101.12699, 2021. +[27] Florian Graf, Christoph Hofer, Marc Niethammer, and Roland Kwitt. Dissecting supervised constrastive learning. In International Conference on Machine Learning, pages 3821-3830. PMLR, 2021. +[28] Tolga Ergen and Mert Pilanci. Revealing the structure of deep neural networks via convex duality. In International Conference on Machine Learning, pages 3004-3014. PMLR, 2021. +[29] John Zarka, Florentin Guth, and Stéphane Mallat. Separation and concentration in deep networks. arXiv preprint arXiv:2012.10424, 2020. +[30] Yaodong Yu, Kwan Ho Ryan Chan, Chong You, Chaobing Song, and Yi Ma. Learning diverse and discriminative representations via the principle of maximal coding rate reduction. arXiv preprint arXiv:2006.08558, 2020. +[31] Kwan Ho Ryan Chan, Yaodong Yu, Chong You, Haozhi Qi, John Wright, and Yi Ma. Deep networks from the principle of rate reduction. arXiv preprint arXiv:2010.14765, 2020. +[32] Benjamin D Haeffele and René Vidal. Global optimality in tensor factorization, deep learning, and beyond. arXiv preprint arXiv:1506.07540, 2015. +[33] Pierre Baldi and Kurt Hornik. Neural networks and principal component analysis: Learning from examples without local minima. Neural networks, 2(1):53-58, 1989. +[34] Kenji Kawaguchi. Deep learning without poor local minima. Advances in neural information processing systems, 29:586-594, 2016. +[35] Itay Safran and Ohad Shamir. Spurious local minima are common in two-layer relu neural networks. In International Conference on Machine Learning, pages 4433-4441. PMLR, 2018. +[36] Chulhee Yun, Suvrit Sra, and Ali Jabbabaie. Small nonlinearities in activation functions create bad local minima in neural networks. In International Conference on Learning Representations, 2018. +[37] Thomas Laurent and James Brecht. Deep linear networks with arbitrary loss: All local minima are global. In International conference on machine learning, pages 2902-2907. PMLR, 2018. +[38] Maher Nouiehed and Meisam Razaviyayn. Learning deep models: Critical points and local openness. arXiv preprint arXiv:1803.02968, 2018. +[39] Shiyu Liang, Ruoyu Sun, Jason D Lee, and R Srikant. Adding one neuron can eliminate all bad local minima. Advances in Neural Information Processing Systems, 2018:4350-4360, 2018. +[40] Zhihui Zhu, Daniel Soudry, Yonina C Eldar, and Michael B Wakin. The global optimization geometry of shallow linear neural networks. Journal of Mathematical Imaging and Vision, pages 1-14, 2019. +[41] Chulhee Yun, Suvrit Sra, and Ali Jabbabaie. Global optimality conditions for deep neural networks. In International Conference on Learning Representations, 2018. +[42] Mo Zhou, Rong Ge, and Chi Jin. A local convergence theory for mildly over-parameterized two-layer neural network. arXiv preprint arXiv:2102.02410, 2021. + +[43] G Cybenko. Approximation by superposition of sigmoidal functions. Mathematics of Control, Signals and Systems, 2(4):303-314, 1989. +[44] Kurt Hornik. Approximation capabilities of multilayer feedforward networks. Neural networks, 4(2):251-257, 1991. +[45] Zhou Lu, Hongming Pu, Feicheng Wang, Zhiqiang Hu, and Liwei Wang. The expressive power of neural networks: a view from the width. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 6232-6240, 2017. +[46] Uri Shaham, Alexander Cloninger, and Ronald R Coifman. Provable approximation properties for deep neural networks. Applied and Computational Harmonic Analysis, 44(3):537-557, 2018. +[47] XY Han, Vardan Papyan, and David L Donoho. Neural collapse undermse loss: Proximity to and dynamics on the central path. arXiv preprint arXiv:2106.02073, 2021. +[48] Wenlong Ji, Yiping Lu, Yiliang Zhang, Zhun Deng, and Weijie J Su. An unconstrained layer-peeled perspective on neural collapse. arXiv preprint arXiv:2110.02796, 2021. +[49] Rong Ge, Furong Huang, Chi Jin, and Yang Yuan. Escaping from saddle points—online stochastic gradient for tensor decomposition. In Proceedings of The 28th Conference on Learning Theory, pages 797–842, 2015. +[50] Ju Sun, Qing Qu, and John Wright. When are nonconvex problems not scary? arXiv preprint arXiv:1510.06096, 2015. +[51] Yuqian Zhang, Qing Qu, and John Wright. From symmetry to geometry: Tractable nonconvex problems. arXiv preprint arXiv:2007.06753, 2020. +[52] Jason D Lee, Max Simchowitz, Michael I Jordan, and Benjamin Recht. Gradient descent only converges to minimizers. In Conference on learning theory, pages 1246-1257. PMLR, 2016. +[53] Michael Elad, Dror Simon, and Aviad Aberdam. Another step toward demystifying deep neural networks. Proceedings of the National Academy of Sciences, 117(44):27070-27072, 2020. +[54] Suriya Gunasekar, Jason Lee, Daniel Soudry, and Nathan Srebro. Implicit bias of gradient descent on linear convolutional networks. In Advances in Neural Information Processing Systems, 2018. +[55] Gauthier Gidel, Francis Bach, and Simon Lacoste-Julien. Implicit regularization of discrete gradient dynamics in linear neural networks. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 32, 2019. +[56] Mor Shpigel Nacson, Jason Lee, Suriya Gunasekar, Pedro Henrique Pamplona Savarese, Nathan Srebro, and Daniel Soudry. Convergence of gradient descent on separable data. In The 22nd International Conference on Artificial Intelligence and Statistics, pages 3420-3428. PMLR, 2019. +[57] Ziwei Ji, Miroslav Dudík, Robert E Schapire, and Matus Telgarsky. Gradient descent follows the regularization path for general losses. In Conference on Learning Theory, pages 2109-2136. PMLR, 2020. +[58] Kaifeng Lyu and Jian Li. Gradient descent maximizes the margin of homogeneous neural networks. In International Conference on Learning Representations, 2019. +[59] Ohad Shamir. Gradient methods never overfit on separable data. Journal of Machine Learning Research, 22(85):1-20, 2021. +[60] Meena Jagadeesan, Ilya Razenshteyn, and Suriya Gunasekar. Inductive bias of multi-channel linear convolutional networks with bounded weight norm. arXiv preprint arXiv:2102.12238, 2021. +[61] Chong You, Zhihui Zhu, Qing Qu, and Yi Ma. Robust recovery via implicit bias of discrepant learning rates for double over-parameterization. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 17733-17744. Curran Associates, Inc., 2020. +[62] John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of machine learning research, 12(7), 2011. +[63] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. +[64] Mor Shpigel Nacson, Nathan Srebro, and Daniel Soudry. Stochastic gradient descent on separable data: Exact convergence with a fixed learning rate. In The 22nd International Conference on Artificial Intelligence and Statistics, pages 3051-3059. PMLR, 2019. +[65] Qian Qian and Xiaoyuan Qian. The implicit bias of adagrad on separable data. arXiv preprint arXiv:1906.03559, 2019. +[66] Suriya Gunasekar, Jason Lee, Daniel Soudry, and Nathan Srebro. Characterizing implicit bias in terms of optimization geometry. In International Conference on Machine Learning, pages 1832-1841. PMLR, 2018. + +[67] Vinod Nair and Geoffrey Hinton. Rectified linear units improve restricted boltzmann machines. volume 27, pages 807-814, 2010. +[68] Sergey Ioffe and Christian Szegedy. Batch normalization: Accelerating deep network training by reducing internal covariate shift. In ICML, pages 448-456, 2015. +[69] Léon Bottou, Frank E Curtis, and Jorge Nocedal. Optimization methods for large-scale machine learning. Siam Review, 60(2):223-311, 2018. +[70] Qing Qu, Ju Sun, and John Wright. Finding a sparse vector in a subspace: Linear sparsity using alternating directions. In Advances in Neural Information Processing Systems, pages 3401-3409, 2014. +[71] Tuo Zhao, Zhaoran Wang, and Han Liu. A nonconvex optimization framework for low rank matrix estimation. In Advances in Neural Information Processing Systems, pages 559-567, 2015. +[72] Ju Sun, Qing Qu, and John Wright. Complete dictionary recovery over the sphere I: Overview and the geometric picture. IEEE Transactions on Information Theory, 63(2):853-884, 2016. +[73] Ju Sun, Qing Qu, and John Wright. Complete dictionary recovery over the sphere II: Recovery by Riemannian trust-region method. IEEE Transactions on Information Theory, 63(2):853-884, 2017. +[74] Qiuwei Li, Zhihui Zhu, and Gongguo Tang. The non-convex geometry of low-rank matrix optimization. Information and Inference: A Journal of the IMA, 8(1):51-96, 2018. +[75] Qing Qu, Yuqian Zhang, Yonina Eldar, and John Wright. Convolutional phase retrieval. In Advances in Neural Information Processing Systems, pages 6086-6096, 2017. +[76] Ju Sun, Qing Qu, and John Wright. A geometric analysis of phase retrieval. Foundations of Computational Mathematics, 18(5):1131-1198, 2018. +[77] Zhihui Zhu, Qiuwei Li, Gongguo Tang, and Michael B Wakin. Global optimality in low-rank matrix optimization. IEEE Transactions on Signal Processing, 66(13):3614-3628, 2018. +[78] Xingguo Li, Junwei Lu, Raman Arora, Jarvis Haupt, Han Liu, Zhaoran Wang, and Tuo Zhao. Symmetry, saddle points, and global optimization landscape of nonconvex matrix factorization. IEEE Transactions on Information Theory, 65(6):3489-3514, 2019. +[79] Zhihui Zhu, Qiuwei Li, Xinshuo Yang, Gongguo Tang, and Michael B Wakin. Distributed low-rank matrix factorization with exact consensus. In Advances in Neural Information Processing Systems, pages 8422-8432, 2019. +[80] Yuejie Chi, Yue M Lu, and Yuxin Chen. Nonconvex optimization meets low-rank matrix factorization: An overview. IEEE Transactions on Signal Processing, 67(20):5239-5269, 2019. +[81] Qing Qu, Yuexiang Zhai, Xiao Li, Yuqian Zhang, and Zhihui Zhu. Geometric analysis of nonconvex optimization landscapes for overcomplete learning. In International Conference on Learning Representations, 2020. +[82] Qing Qu, Zhihui Zhu, Xiao Li, Manolis C. Tsakiris, John Wright, and René Vidal. Finding the sparsest vectors in a subspace: Theory, algorithms, and applications. arXiv preprint arXiv:2001.06970, 2020. +[83] Qing Qu, Xiao Li, and Zhihui Zhu. Exact recovery of multichannel sparse blind deconvolution via gradient descent. SIAM Journal on Imaging Sciences, 13(3):1630-1652, 2020. +[84] Rong Ge, Jason D Lee, and Tengyu Ma. Matrix completion has no spurious local minimum. arXiv preprint arXiv:1605.07272, 2016. +[85] Srinadh Bhojanapalli, Behnam Neyshabur, and Nathan Srebro. Global optimality of local search for low rank matrix recovery. In Proceedings of the 30th International Conference on Neural Information Processing Systems, pages 3880-3888, 2016. +[86] Rong Ge, Chi Jin, and Yi Zheng. No spurious local minima in nonconvex low rank problems: A unified geometric analysis. In International Conference on Machine Learning, pages 1233-1242. PMLR, 2017. +[87] Qiuwei Li, Zhihui Zhu, and Gongguo Tang. The non-convex geometry of low-rank matrix optimization. Information and Inference: A Journal of the IMA, 8(1):51-96, 2019. +[88] Samuel Burer and Renato DC Monteiro. A nonlinear programming algorithm for solving semidefinite programs via low-rank factorization. Mathematical Programming, 95(2):329-357, 2003. +[89] Daniel Kunin, Jonathan Bloom, Aleksandrina Goeva, and Cotton Seed. Loss landscapes of regularized linear autoencoders. In International Conference on Machine Learning, pages 3560-3569. PMLR, 2019. +[90] Yann LeCun. The mnist database of handwritten digits. http://yann.lecun.com/exdb/mnist/, 1998. +[91] kuang Liu, Wei Yang, Yang Peiwen, and Felipe Ducau. Train cifar10 with pytorch. https://github.com/kuangliu/pytorch-cifar/blob/master/models/resnet.py. +[92] Xiangyu Zhang, Xinyu Zhou, Mengxiao Lin, and Jian Sun. Shufflenet: An extremely efficient convolutional neural network for mobile devices. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 6848-6856, 2018. + +[93] Elad Hoffer, Itay Hubara, and Daniel Soudry. Fix your classifier: the marginal value of training the last weight layer. In International Conference on Learning Representations, 2018. +[94] Ting Chen, Simon Kornblith, Mohammad Norouzi, and Geoffrey Hinton. A simple framework for contrastive learning of visual representations. arXiv preprint arXiv:2002.05709, 2020. +[95] 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, pages 9729-9738, 2020. +[96] Paul Covington, Jay Adams, and Emre Sargin. Deep neural networks for youtube recommendations. In Proceedings of the 10th ACM conference on recommender systems, pages 191-198, 2016. +[97] Wei-Cheng Chang, X Yu Felix, Yin-Wen Chang, Yiming Yang, and Sanjiv Kumar. Pre-training tasks for embedding-based large-scale retrieval. In International Conference on Learning Representations, 2019. +[98] Ruo-Yu Sun. Optimization for deep learning: An overview. Journal of the Operations Research Society of China, 8(2):249-294, 2020. +[99] Ruoyu Sun, Dawei Li, Shiyu Liang, Tian Ding, and Rayadurgam Srikant. The global landscape of neural networks: An overview. IEEE Signal Processing Magazine, 37(5):95-108, 2020. +[100] Zeyuan Allen-Zhu, Yuanzhi Li, and Zhao Song. A convergence theory for deep learning via overparameterization. In International Conference on Machine Learning, pages 242-252, 2019. +[101] Simon Du, Jason Lee, Haochuan Li, Liwei Wang, and Xiyu Zhai. Gradient descent finds global minima of deep neural networks. In International Conference on Machine Learning, pages 1675-1685, 2019. +[102] Arthur Jacot, Clément Hongler, and Franck Gabriel. Neural tangent kernel: Convergence and generalization in neural networks. In NeurIPS, 2018. +[103] Difan Zou, Yuan Cao, Dongruo Zhou, and Quanquan Gu. Gradient descent optimizes overparameterized deep relu networks. Machine Learning, 109(3):467-492, 2020. +[104] Andrea Montanari and Yiqiao Zhong. The interpolation phase transition in neural networks: Memorization and generalization under lazy training. arXiv preprint arXiv:2007.12826, 2020. +[105] Sam Buchanan, Dar Gilboa, and John Wright. Deep networks and the multiple manifold problem. arXiv preprint arXiv:2008.11245, 2020. +[106] Lénaïc Chizat, Edouard Oyallon, and Francis Bach. On lazy training in differentiable programming. Advances in Neural Information Processing Systems, 32:2937-2947, 2019. +[107] Marina Danilova, Pavel Dvurechensky, Alexander Gasnikov, Eduard Gorbunov, Sergey Guminov, Dmitry Kamzolov, and Innokentiy Shibaev. Recent theoretical advances in non-convex optimization. arXiv preprint arXiv:2012.06188, 2020. +[108] Chi Jin, Praneeth Netrapalli, Rong Ge, Sham M. Kakade, and Michael I. Jordan. On nonconvex optimization for machine learning: Gradients, stochasticity, and saddle points. J. ACM, 68(2), February 2021. +[109] Yenson Lau, Qing Qu, Han-Wen Kuo, Pengcheng Zhou, Yuqian Zhang, and John Wright. Short and sparse deconvolution — a geometric approach. In International Conference on Learning Representations, 2020. +[110] Han-Wen Kuo, Yenson Lau, Yuqian Zhang, and John Wright. Geometry and symmetry in short-andsparse deconvolution. In International Conference on Machine Learning, pages 3570-3580. PMLR, 2019. +[111] Yuqian Zhang, Han-Wen Kuo, and John Wright. Structured local optima in sparse blind deconvolution. IEEE Transactions on Information Theory, 66(1):419-452, 2019. +[112] Raghu Bollapragada, Jorge Nocedal, Dheevatsa Mudigere, Hao-Jun Shi, and Ping Tak Peter Tang. A progressive batching l-bfgs method for machine learning. In International Conference on Machine Learning, pages 620-629. PMLR, 2018. +[113] Yi Ren and Donald Goldfarb. Kronecker-factored quasi-newton methods for convolutional neural networks. arXiv preprint arXiv:2102.06737, 2021. +[114] Roger A Horn and Charles R Johnson. Matrix analysis. Cambridge University Press, 2012. +[115] Carlo Ciliberto, Dimitris Stamos, and Massimiliano Pontil. Reexamining low rank matrix factorization for trace norm regularization. arXiv preprint arXiv:1706.08934, 2017. +[116] G Alistair Watson. Characterization of the subdifferential of some matrix norms. Linear algebra and its applications, 170:33-45, 1992. +[117] Benjamin Recht, Maryam Fazel, and Pablo A Parrilo. Guaranteed minimum-rank solutions of linear matrix equations via nuclear norm minimization. SIAM Review, 52(3):471-501, 2010. + +# Checklist + +1. For all authors... + +(a) Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope? [Yes] +(b) Did you describe the limitations of your work? [Yes] In the abstract, introduction, main results, and conclusion, we explicitly stat that our results are about unconstrained feature model. +(c) Did you discuss any potential negative societal impacts of your work? [N/A] This paper mainly focuses on understanding the neural collapse phenomena observed in practical neural networks. Based on this understanding, we propose to fix the last layer classifier as a Simplex ETF. So no potential negative societal impact is expected of this work. +(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] + +2. If you are including theoretical results... + +(a) Did you state the full set of assumptions of all theoretical results? [Yes] We explicitly mention the assumptions in Theorem 3.1 and Theorem 3.2. +(b) Did you include complete proofs of all theoretical results? [Yes] We include all the proofs in the Appendix. + +3. If you ran experiments... + +(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] See Section 4 and Appendix. +(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 4 and Appendix. +(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] All the results are reported in terms of learning curves and each figure includes many plots, so error bars are not reported. Bud we do run the experiments multiple times, and observe very similar performance in terms of $\mathcal{NC}$ , testing accuracy, etc. +(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Appendix B. + +4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... + +(a) If your work uses existing assets, did you cite the creators? [Yes] We cite them in Section 4. +(b) Did you mention the license of the assets? [Yes] This is mentioned in Appendix B. +(c) Did you include any new assets either in the supplemental material or as a URL? [N/A] +(d) Did you discuss whether and how consent was obtained from people whose data you're using/curating? [Yes] This is discussed in Appendix B. +(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] + +5. If you used crowdsourcing or conducted research with human subjects... + +(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] +(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] +(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] \ No newline at end of file diff --git a/ageometricanalysisofneuralcollapsewithunconstrainedfeatures/images.zip b/ageometricanalysisofneuralcollapsewithunconstrainedfeatures/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..6a11fdef7ea7d49c0dec9150663e8eab1d40a828 --- /dev/null +++ b/ageometricanalysisofneuralcollapsewithunconstrainedfeatures/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5844a54c81d2f1b90d51528ab819d5cead779d9e484862a4314d56e6fb9a1117 +size 230585 diff --git a/ageometricanalysisofneuralcollapsewithunconstrainedfeatures/layout.json b/ageometricanalysisofneuralcollapsewithunconstrainedfeatures/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a0812cc4cdb108e0374774c1ae4b80e15233a61a --- /dev/null +++ b/ageometricanalysisofneuralcollapsewithunconstrainedfeatures/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea2b6b7a75392475f36d24a2d0430643f3d71764500ad3718216ef333c833c94 +size 678732 diff --git a/ageometricperspectivetowardsneuralcalibrationviasensitivitydecomposition/188c28df-4201-43ce-83ae-d0591d7a80ca_content_list.json b/ageometricperspectivetowardsneuralcalibrationviasensitivitydecomposition/188c28df-4201-43ce-83ae-d0591d7a80ca_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ec3ca3e94d2c6a189e5cb7b73fe88abcd9e13bf0 --- /dev/null +++ b/ageometricperspectivetowardsneuralcalibrationviasensitivitydecomposition/188c28df-4201-43ce-83ae-d0591d7a80ca_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c18a70fc7d50fd8ebc5ca762f4f11979685dfd4ea603c4dad1d0c400695e083 +size 81804 diff --git a/ageometricperspectivetowardsneuralcalibrationviasensitivitydecomposition/188c28df-4201-43ce-83ae-d0591d7a80ca_model.json b/ageometricperspectivetowardsneuralcalibrationviasensitivitydecomposition/188c28df-4201-43ce-83ae-d0591d7a80ca_model.json new file mode 100644 index 0000000000000000000000000000000000000000..7402f0fae2619e011cb1b1af4599656588b247b9 --- /dev/null +++ b/ageometricperspectivetowardsneuralcalibrationviasensitivitydecomposition/188c28df-4201-43ce-83ae-d0591d7a80ca_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:80080951c6baf4649bb127441c21f0a48ab6b16fa2cee94f18c12771ba1acd3b +size 98338 diff --git a/ageometricperspectivetowardsneuralcalibrationviasensitivitydecomposition/188c28df-4201-43ce-83ae-d0591d7a80ca_origin.pdf b/ageometricperspectivetowardsneuralcalibrationviasensitivitydecomposition/188c28df-4201-43ce-83ae-d0591d7a80ca_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e27f7025d66f6b735c6f1a150ec2de815bef4202 --- /dev/null +++ b/ageometricperspectivetowardsneuralcalibrationviasensitivitydecomposition/188c28df-4201-43ce-83ae-d0591d7a80ca_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aca782170cbfae56aa614642b175564c54d0e48ac1b19cb33c4618e24f5b4382 +size 1065082 diff --git a/ageometricperspectivetowardsneuralcalibrationviasensitivitydecomposition/full.md b/ageometricperspectivetowardsneuralcalibrationviasensitivitydecomposition/full.md new file mode 100644 index 0000000000000000000000000000000000000000..cac6d5c52818acc6f332e6659e392d21412b4647 --- /dev/null +++ b/ageometricperspectivetowardsneuralcalibrationviasensitivitydecomposition/full.md @@ -0,0 +1,322 @@ +# A Geometric Perspective towards Neural Calibration via Sensitivity Decomposition + +Junjiao Tian + +Georgia Institute of Technology + +jtian73@gatech.edu + +Yen-Chang Hsu + +Samsung Research America + +yenchang.hsu@samsung.com + +Dylan Yung + +Georgia Institute of Technology + +dyung6@gatech.edu + +Zsolt Kira + +Georgia Institute of Technology + +zkira@gatech.edu + +# Abstract + +It is well known that vision classification models suffer from poor calibration in the face of data distribution shifts. In this paper, we take a geometric approach to this problem. We propose Geometric Sensitivity Decomposition (GSD) which decomposes the norm of a sample feature embedding and the angular similarity to a target classifier into an instance-dependent and an instance-independent component. The instance-dependent component captures the sensitive information about changes in the input while the instance-independent component represents the insensitive information serving solely to minimize the loss on the training dataset. Inspired by the decomposition, we analytically derive a simple extension to current softmax-linear models, which learns to disentangle the two components during training. On several common vision models, the disentangled model outperforms other calibration methods on standard calibration metrics in the face of out-of-distribution (OOD) data and corruption with significantly less complexity. Specifically, we surpass the current state of the art by $30.8\%$ relative improvement on corrupted CIFAR100 in Expected Calibration Error. Code available at https://github.com/GT-RIPL/Geometric-Sensitivity-Decomposition.git. + +# 1 Introduction + +During development, deep learning models are trained and validated on data from the same distribution. However, in the real world sensors degrade and weather conditions change. Similarly, subtle changes in image acquisition and processing can also lead to distribution shift of the input data. This is often known as covariate shift, and will typically decrease the performance (e.g. classification accuracy). However, it has been empirically found that the model's confidence remains high even when accuracy has degraded [1]. The process of aligning confidence to empirical accuracy is called model calibration. Calibrated probability provides valuable uncertainty information for decision making. For example, knowing when a decision cannot be trusted and more data is needed is important for safety and efficiency in real world applications such as self-driving [2] and active learning [3]. + +A comprehensive comparison of calibration methods has been studied for in-distribution (IND) data [4], However, these methods lead to unsatisfactory performance under distribution shift [5]. To resolve the problem, high-quality uncertainty estimation [6, 5] is required. Principled Bayesian methods [7] model uncertainty directly but are computationally heavy. Recent deterministic methods [8, 9] propose to improve a model's sensitivity to input changes by regularizing the model's intermediate layers. In this context, sensitivity is defined as preserving distance between two different input samples through layers of the model. We would like to utilize the improved sensitivity to better detect + +Out-of-Distribution (OOD) data. However, these methods introduce added architecture changes and large combinatorics of hyperparameters. + +Unlike existing works, we propose to study sensitivity from a geometric perspective. The last linear layer in a softmax-linear model can be decomposed into the multiplication of a norm and a cosine similarity term [10, 11, 12, 13]. Geometrically, the angular similarity dictates the membership of an input and the norm only affects the confidence in a softmax-linear model. Counter-intuitively, the norm of a sample's feature embedding exhibits little correlation to the hardness of the input [11]. Based on this observation, we explore two questions: 1) why is a model's confidence insensitive to distribution shift? 2) how do we improve model sensitivity and calibration? + +We hypothesize that in part an insensitive norm is responsible for bad calibration especially on shifted data. We observe that the sensitivity of the angular similarity increases with training whereas the sensitivity of the norm remains low. More importantly, calibration worsens during the period when the norm increases while the angular similarity changes slowly. This shows a concrete example of the inability of the norm to adapt when accuracy has dropped. Intuitively, training on clean datasets encourages neural networks to always output increasingly large feature norm to continuously minimize the training loss. Because the probability of the prevalent class of an input is proportional to its norm, larger norms lead to smaller training loss when most training data have been classified correctly (See Sec. 3.1). This renders the norm insensitive to input differences because the model is trained to always output features with large norm on clean data. While we have put forth that the norm is poorly calibrated, we must emphasize that it can still play an important role in model calibration (See Sec. 4.1). + +To encourage sensitivity, we propose to decompose the norm of a sample's feature embedding and the angular similarity into two components: instance-dependent and instance-independent. The instance-dependent component captures the sensitive information about the input while the instance-independent component represents the insensitive information serving solely to minimize the loss on the training dataset. Inspired by the decomposition, we analytically derive a simple extension to the current softmax-linear model, which learns to disentangle the two components during training. We show that our model outperforms other deterministic methods (despite their significant complexity) and is comparable to multi-pass methods with fewer training hyperparameters in Sec. 4.1. + +In summary, our contributions are four fold: + +- We study the problem of calibration geometrically and identify that the insensitive norm is responsible for bad calibration under distribution shift. +- We derive a principled but simple geometric decomposition that decomposes the norm into an instance-dependent and instance-independent component. +- Based on the decomposition, we propose a simple training and inference scheme to encourage the norm to reflect distribution changes. +- We achieve state of the art results in calibration metrics in the face of corruptions while having arguably the simplest calibration method to implement. + +# 2 Related Work + +Methods dedicated to strengthening calibration can be divided into two camps: multi-pass models and single-pass deterministic models. The current state-of-the-art multi-pass models are: Bayesian Monte Carlo Drop Out (MCDO) [7] and Deep Ensembles [14]. Bayesian methods are the most principled way to model uncertainty. Instead of optimizing max likelihood for a single set of parameters, Bayesian methods obtain a posterior distribution over possible parameters given a prior distribution over parameters and calculated data likelihood assuming some process noise. The posterior distribution over parameters captures epistemic uncertainty or uncertainty due to the limits of what the model knows. The final predictive distribution is obtained by marginalizing out model parameters. While Bayesian methods are theoretically sound, they are intractable in practice. Deep Ensembles averages multiple models trained using different random initialization so they learn different classification functions. + +A recent trend is to use a single-pass deterministic non-Bayesian model to improve uncertainty estimation. Two recent works DUQ [8] and SNGP [9] propose to improve uncertainty-awareness of + +deterministic networks by improving the networks' sensitivity to input changes. Intuitively, a sensitive model should map samples further from the training data as they become more out-of-distribution. This can be achieved at two levels: feature level and output level. At the feature level, both methods require the feature extractors (CNNs) to be regularized to prevent feature collapse, which is the mapping of two different data points to the same embedded vector. This is ensured by having input distance awareness, which is equivalent to ensuring bi-Lipschitz continuity [15]. + +In order to achieve this, DUQ [8] uses a two-sided gradient penalty [16] and SNGP [9] uses bounded spectral normalization [15]. The output level needs to reflect the changes in feature space. This can be done by adopting distance-aware classifiers. DUQ [8] uses a RBF networks with learned centroids for each class and SNGP [9] uses an approximate Gaussian Process layer. We were inspired by temperature scaling [4], which is another method for bettering calibration, but fails under distribution shift [5]. Our method does not require input distance awareness and instead leverages the geometric intuitions about the output layer, specifically properties of the norm of the input embedding. + +# 3 Method + +Following our hypothesise that the insensitivity of the norm is responsible for bad calibration on distribution shifted data, we propose geometric sensitivity decomposition (GSD) for the norm. We first introduce the geometric perspective of the last linear layer in Sec. 3.1 and then derive GSD in Sec. 3.2. To improve sensitivity of the norm and model calibration on shifted data, we propose a GSD-inspired training and inference procedure in Sec. 3.3 and Sec. 3.4. + +# 3.1 Norm and Similarity + +The output layer of a neural network can be written as a dot-product $< \mathbf{x}, \mathbf{w}_{\mathbf{y}} >$ , where $\mathbf{x}$ is the embedded input and $\mathbf{w}_{\mathbf{y}}$ is the weight vector associated with class $y$ . Though seemingly simple there are strong geometric and calibration related intuitions drawn from this. Several prior works [10, 12, 11] have studied the effects decomposition of the last linear layer in a softmax model can have on classification. The output layer can be decomposed into angular similarity $\cos \phi_{y}$ and norm $\| \mathbf{x} \|_2$ . + +$$ +P (y | x) = \frac {\exp l _ {y}}{\sum_ {j = 1} ^ {c} \exp l _ {j}} = \frac {\exp \left(\| \mathbf {w} _ {\mathbf {y}} \| _ {2} \| \mathbf {x} \| _ {2} \cos \phi_ {y}\right)}{\sum_ {j = 1} ^ {c} \exp \left(\| \mathbf {w} _ {\mathbf {j}} \| _ {2} \| \mathbf {x} \| _ {2} \cos \phi_ {j}\right)} \tag {1} +$$ + +where $\| \mathbf{w}_{\mathbf{y}}\| _2$ is the norm of a specific classifier in the linear layer. We'll use this geometric view of the linear layer instead of the dot-product representation. + +Based on this perspective, we base the foundation of our work on the following observations from prior works [10, 12, 11]: 1) The probability/confidence of the prevalent class of an input is proportional to its norm [12]. 2) While the norm of a feature strongly scales the predictive probability, due to it's unregularized nature the norm is not sensitive to the hardness of the input [11]. In other words, the norm could be the reason for bad sensitivity of the confidence to input distribution shift. Consequently, the insensitive norm can be causally related to bad calibration. We will examine a strong correlation between the quality of calibration and the magnitude of norm in Sec. 4.2. + +# 3.2 Geometric Sensitivity Decomposition of Norm and Angular Similarity + +To motivate the subsequent geometric decomposition, we can revisit the softmax model, $P(y|x) \propto \exp \left( \| \mathbf{w_y} \|_2 \| \mathbf{x} \|_2 \cos \phi_y \right)$ . There are three terms contributing to the magnitude of the exponential function, $\| \mathbf{w_y} \|_2$ , $\| \mathbf{x} \|_2$ and $\cos \phi_y$ . Due to weight regularizations, $\| \mathbf{w_y} \|_2$ is most likely very small, while $\cos \phi_y \in [-1, 1]$ . Therefore, the only way to obtain a high probability/confidence on training data and minimize cross-entropy loss is to 1) push the norm $\| \mathbf{x} \|_2$ to a large value and 2) keep $\cos |\phi_y|$ of the ground truth class close to one, i.e., $|\phi_y|$ close to zero. This is further supported by [17], where it was shown that logits of the ground truth class must diverge to infinity in order to minimize cross-entropy loss under gradient descent. In this process, models tend towards large norms and small angles for all training samples. + +Therefore, we propose to decompose the norms of features into two components: an instance-independent scalar offset and an instance-dependent variance factor, which we define in Eq. 2. The role of the instance-independent offset $\mathcal{C}_x$ is to minimize the loss on the entire training set and + +the instance-dependent component $\Delta x$ accounts for differences in samples. Therefore, if we can disentangle the instance-independent component from the instance-dependent component, we can obtain a norm that is sensitive to the hardness of data. Following this logic, we decompose the norm into two components. + +$$ +\left\| \mathbf {x} \right\| _ {2} = \left\| \Delta x \right\| _ {2} + \mathcal {C} _ {x} \tag {2} +$$ + +Similarly, we relax the angles such that the predicted angular similarity does not need to be close to one on the training data, i.e., making the angles larger. To achieve this, we introduce an instance-independent relaxation angle $\mathcal{C}_{\phi}$ and an instance-dependent angle $\Delta \phi_y$ . Analogous to the norm decomposition, the scalar $\mathcal{C}_{\phi}$ serves solely to minimize the training loss while the instance-dependent $\Delta \phi_y$ accounts for differences in samples. Because we need to account for the sign of the angle, we put an absolute value on it. + +$$ +\left| \phi_ {y} \right| = \left| \Delta \phi_ {y} \right| - \left| \mathcal {C} _ {\phi} \right| \tag {3} +$$ + +The $\| \Delta \mathbf{x} \|_2$ , $|\Delta \phi_y|$ are the instance-dependent components and $\mathcal{C}_x$ , $|\mathcal{C}_{\phi}|$ are the instance-independent components. We can rewrite the pre-softmax logits in Eq. 1 with the decomposed norm and angular similarity. (Detailed derivation in Sec. A.1 in the Appendix.) + +$$ +\begin{array}{l} \left\| \mathbf {x} \right\| _ {2} \cos \phi_ {y} = \left\| \mathbf {x} \right\| _ {2} \cos | \phi_ {y} | = \left(\left\| \Delta \mathbf {x} \right\| _ {2} + \mathcal {C} _ {x}\right) \cos \left(\left| \Delta \phi_ {y} \right| - \left| \mathcal {C} _ {\phi} \right|\right) \tag {4} \\ = \left(\| \Delta \mathbf {x} \| _ {2} + \mathcal {C} _ {x}\right) \frac {1}{\cos | \mathcal {C} _ {\phi} |} \cos | \Delta \phi_ {y} | \left(1 - \sin | \mathcal {C} _ {\phi} | ^ {2} \left(1 - \frac {\cos | \mathcal {C} _ {\phi} | \sin | \Delta \phi_ {y} |}{\sin | \mathcal {C} _ {\phi} | \cos | \Delta \phi_ {y} |}\right)\right) \\ \end{array} +$$ + +We can simplify the equation by assuming $\cos |\phi_y|$ is close to one, which means $|\phi_y|$ is small. This is due to the fact that $|\phi_y|$ is the angle between the correct class weight and $x$ , which means as training ensues, the angle converges to 0 and thus the cosine similarity converges to 1. (Please see Sec. A.2 for empirical support.) + +$$ +\frac {\cos \left| \mathcal {C} _ {\phi} \right| \sin \left| \Delta \phi_ {y} \right|}{\sin \left| \mathcal {C} _ {\phi} \right| \cos \left| \Delta \phi_ {y} \right|} = \frac {\sin \left(\left| \Delta \phi_ {y} \right| + \left| \mathcal {C} _ {\phi} \right|\right) + \sin \left| \phi_ {y} \right|}{\sin \left(\left| \Delta \phi_ {y} \right| + \left| \mathcal {C} _ {\phi} \right|\right) - \sin \left| \phi_ {y} \right|} \approx 1 \tag {5} +$$ + +Therefore, Eq. 4, omitting the absolute value on angles because $\cos$ is an even function, simplifies: + +$$ +\begin{array}{l} \left\| \mathbf {x} \right\| _ {2} \cos \phi_ {y} \approx \left(\left\| \Delta \mathbf {x} \right\| _ {2} + \mathcal {C} _ {x}\right) \frac {1}{\cos \mathcal {C} _ {\phi}} \cos \Delta \phi_ {y} \tag {6} \\ = \left(\frac {1}{\cos \mathcal {C} _ {\phi}} \| \Delta \mathbf {x} \| _ {2} + \frac {1}{\cos \mathcal {C} _ {\phi}} \mathcal {C} _ {x}\right) \cos \Delta \phi_ {y} \\ = \left(\frac {1}{\alpha} \| \Delta \mathbf {x} \| _ {2} + \frac {\beta}{\alpha}\right) \cos \Delta \phi_ {y} \\ \end{array} +$$ + +Because $\cos \mathcal{C}_{\phi}$ and $\mathcal{C}_x$ are instance-independent, we denote them as $\alpha$ and $\beta$ respectively. This geometric decomposition of norm and cosine similarity inspires us to include $\alpha$ and $\beta$ as free trainable parameters in a new network and the network can learn to predict the more input-sensitive $\| \Delta \mathbf{x}\| _2$ and $\Delta \phi_y$ instead of the original $\| \mathbf{x}\| _2$ and $\phi_y$ . While both the angle and norm can be decomposed we direct the focus to the norm as the angle is already calibrated to accuracy [11]. In other words, angles have been shown to be sensitive to input changes in [11]. + +# 3.3 Disentangled Training + +Following the derivation in Eq 6, we replace the norm, $\| \mathbf{x}\| _2$ , in Eq. 1 by $\left(\frac{1}{\alpha}\| \Delta \mathbf{x}\| _2 + \frac{\beta}{\alpha}\right)$ and $\phi_y$ by $\Delta \phi_y$ . $\| \Delta \mathbf{x}\| _2$ and $\Delta \phi_y$ are now learned outputs from a new network instead as shown in Eq. 6: + +$$ +P (y | x) = \frac {\exp l _ {y}}{\sum_ {j = 1} ^ {c} \exp l _ {j}} = \frac {\exp \left(\| \mathbf {w} _ {\mathbf {y}} \| _ {2} \left(\frac {1}{\alpha} \| \Delta \mathbf {x} \| _ {2} + \frac {\beta}{\alpha}\right) \cos \Delta \phi_ {y}\right)}{\sum_ {j = 1} ^ {c} \exp \left(\| \mathbf {w} _ {\mathbf {j}} \| _ {2} \left(\frac {1}{\alpha} \| \Delta \mathbf {x} \| _ {2} + \frac {\beta}{\alpha}\right) \cos \Delta \phi_ {j}\right)} \tag {7} +$$ + +![](images/e6ac0c1b8592301e535cb03926110ebc6ba5ebb71d852f466274c2aeed043ff7.jpg) +(a) Temperature Scaling + +![](images/7527e4a35afe37139ba64ffdfeaad32cbee86be2fd8ec003eaff0e9c5ec69fd8.jpg) +(b) Ours: calibration Step 1 +Figure 1: Calibration Procedure (a): Temperature Scaling [4] changes the slope of the effective norm based on in-distribution (IND) data (See A.9 in Appendix) + +![](images/90d635ad63acedd11dcae877b9da8dcf0bbe3b42f3d892b948e9926c62893356.jpg) +(c) Ours: Calibration Step 2 + +The new model can be trained using the same training procedures as the vanilla network without additional hyperparameter tuning, changing the architecture or extended training time. Even though the outputs of the new network, $\| \Delta \mathbf{x} \|_2$ and $\Delta \phi_y$ , only approximate the original geometric relationships with Eq. 6, the effect of $\alpha$ and $\beta$ reflects the decomposition in Eq. 3 and Eq. 2. + +- $\beta$ encodes an instance-independent scalar $C_x$ of the norm. A larger $\beta$ corresponds to a smaller instance-dependent component $\|\Delta \mathbf{x}\|_2$ . +- $\alpha$ encodes the cosine of a relaxation angle $\mathcal{C}_{\phi}$ . A larger $\arccos \alpha$ corresponds to a larger $\mathcal{C}_{\phi}$ and therefore a larger $\Delta \phi_{j}$ . + +Because $\beta$ encodes the independent component, the new feature norm $\| \Delta \mathbf{x}\| _2$ becomes sensitive to input changes and maps OOD data to lower norms than IND data as we can see in Fig. 3a, 3b. We regularize $\alpha$ such that the instance-independent component $\mathcal{C}_{\phi}$ is small. Specifically, we penalize $\| \alpha -1\| _2^2$ because $\alpha = \cos \mathcal{C}_{\phi}$ , i.e., if $\alpha \approx 1$ , $\mathcal{C}_{\phi}\approx 0$ . We empirically found that a larger relaxation angle $\mathcal{C}_{\phi}$ deteriorates performance because the angular similarity already correlates well with difficulty of data [11] and we do not need to encourage a large relaxation. Sec. 4.3 will empirically verify this. + +# 3.4 Disentangled Inference + +The decomposition theory in Sec. 3.2 provides a geometric perspective on the sensitivity of the norm and the angular similarity to input changes and inspires a disentangled model in Sec. 3.3. The new model uses a learnable affine transformation on the norm $\| \Delta \mathbf{x}\| _2$ . Let's denote the affine transformed norm as the effective norm $\mathcal{N}(\Delta \mathbf{x})\doteq \frac{1}{\alpha}\| \Delta \mathbf{x}\| _2 + \frac{\beta}{\alpha}$ . However, the training only separates the sensitive components of the norm and angular similarity, the model can still be overconfident due to the existence of insensitive components. Therefore, we can improve calibration by modifying insensitive components, e.g., $\beta$ in our case. We propose a two-step calibration procedure that combines in-distribution calibration (Fig. 1b) and out-of-distribution detection (Fig. 1c) based on two observations: 1) overconfident IND data can be easily calibrated on a validation set, similar to temperature scaling [4]. 2) for OOD data, without access to a calibration set for OOD data, the best strategy is to map them far away from the IND data given that the model clearly distinguishes them. + +The first step is calibrating the model on IND validation set (note our method does not rely on OOD validation data), similar to temperature calibration [4]. However, instead of tuning a temperature parameter as shown in Fig. 1a, we simply tune the offset parameter $\beta$ on the validation set in one of two ways: 1) grid-search based on minimizing Expected Calibration Error (see Sec. 4) 2) SGD optimization based on Negative Log Likelihood [4]. Because these are post-training procedures, both methods are very efficient. We denote the new parameter as $\beta^{\prime}$ . As shown in Fig. 1b, by changing the offset, we decrease the magnitude of the norms after the affine transformation. Formally, + +$$ +\mathcal {N} (\Delta \mathbf {x}) = \frac {1}{\alpha} \| \Delta \mathbf {x} \| _ {2} + \frac {\beta}{\alpha} \rightarrow \mathcal {N} (\Delta \mathbf {x}) = \frac {1}{\alpha} \| \Delta \mathbf {x} \| _ {2} + \frac {\beta^ {\prime}}{\alpha} \tag {8} +$$ + +The second step approximates the calibrated affine mapping in Eq. 8 by a non-linear function which covers a wider range of the effective norm as shown in Eq. 9 and maps OOD data further away from IND data. Intuitively, when a sample is more likely IND, the non-linear function maps it closer to the + +calibrated transformation. When a sample is OOD, the non-linear function maps it more aggressively to a smaller magnitude, exponentially away from the IND samples. + +$$ +\mathcal {N} (\Delta \mathbf {x}) = \frac {1}{\alpha} \| \Delta \mathbf {x} \| _ {2} + \frac {\beta^ {\prime}}{\alpha} (1 - e ^ {- c \| \Delta \mathbf {x} \| _ {2}}) \tag {9} +$$ + +where $c$ is a hyperparameter which can be calculated as in Eq. 10. The non-linear function grows exponentially close to the calibrated affine mapping in Eq. 8 dictated by $1 - e^{-c\|\Delta \mathbf{x}\|_2}$ as shown in 1c. Therefore, $e^{-c\|\Delta \mathbf{x}\|_2}$ can be viewed as an error term that quantifies how close the non-linear function is to the calibrated affine function in Eq. 8. Let $\mu_x$ and $\sigma_x$ denote the mean and standard deviation of the distribution of the norm of IND sample embedding calculated on the validation set. We use the heuristic that when evaluated at one standard deviation below the mean, $\|\Delta \mathbf{x}\|_2 = \mu_x - \sigma_x$ , the approximation error $e^{-c(\mu_x - \sigma_x)} = 0.1$ . Even though the error threshold is a hyperparameter, using an error of 0.1 leads to state-of-the-art results across all models applied. + +$$ +c = \frac {- l n (1 - e r r o r)}{\mu_ {x} - \sigma_ {x}} = \frac {- l n (0 . 9)}{\mu_ {x} - \sigma_ {x}} \tag {10} +$$ + +In summary, the sensitive norm $\| \Delta \mathbf{x} \|_2$ is used both as a soft threshold for OOD detection and as a criterion for calibration. While similar post-processing calibration procedure exists, such as temperature scaling [4] (illustrated in Fig. 1a and further introduced in A.9) it only provides good calibration on IND data and does not provide any mechanism to improve calibration on shifted data [5]. Our calibration procedure can improve calibration on both IND and OOD data, without access to OOD data, because the training method extracts the sensitive component in a principled manner. Just as temperature scaling, the non-linear mapping needs only to be calculated once and adds no computation at inference. + +# 4 Experiments + +# 4.1 Experiments on Calibration + +Table 1: ResNet-28-10 on CIFAR10 averaged over 10 seed. $\dagger$ denotes results from [9]. Our method outperforms other single-pass methods and is comparable to Deep Ensemble [14] on corrupted data. While the ensembled version of our model beats all multi-pass models. + +
MethodAccuracy ↑ECE ↓NLL ↓
CleanCorruptedCleanCorruptedCleanCorrupted
Single-PassVanilla†96.0±0.0172.9±0.010.023±0.0020.153±0.0110.158±0.011.059±0.02
DUQ†94.7±0.0271.6±0.020.034±0.0020.183±0.0110.239±0.021.348±0.01
SNGP†95.9±0.0174.6±0.010.018±0.0010.090±0.0120.138±0.010.935±0.01
Ours β' Grid-Searches95.9±0.0174.9±0.050.018±0.0030.067±0.0100.148±0.0030.826±0.03
Ours β' Optimized95.9±0.0174.9±0.050.008±0.0020.085±0.0120.140±0.0040.853±0.04
Multi-PassDeep Ensembles†96.6±0.0177.9±0.010.010±0.0010.087±0.0040.114±0.010.815±0.01
MC Dropout†96.0±0.0170.0±0.020.021±0.0020.116±0.0090.173±0.0011.152±0.01
Ours β'Grid-Searches96.6277.90.0070.0690.1080.773
+ +Table 2: ResNet-28-10 on CIFAR100 averaged over 10 seeds. † denotes results from [9]. Our method outperforms other single-pass methods and Deep Ensemble [14] on corrupted data. While the ensembled version of our model beats all multi-pass models + +
Method†Accuracy↑ECE↓NLL↓
CleanCorruptedCleanCorruptedCleanCorrupted
Single-PassVanilla†79.8±0.0250.5±0.040.085±0.0040.239±0.0200.872±0.012.756±0.03
DUQ†78.5±0.0250.4±0.020.119±0.0010.281±0.0120.980±0.022.841±0.01
SNGP†79.9±0.0349.0±0.020.025±0.0120.117±0.0140.847±0.012.626±0.01
Ours β' Grid-Searches79.8±0.0349.8±0.0030.027±0.0030.081±0.0070.787±0.0092.23±0.02
Ours β' Optimized79.8±0.0349.8±0.030.027±0.0030.088±0.0070.784±0.0112.236±0.021
Multi-PassDeep Ensembles†80.2±0.0154.1±0.040.021±0.0040.138±0.0130.666±0.022.281±0.03
MC Dropout†79.6±0.0242.6±0.080.050±0.0030.202±0.0100.825±0.012.881±0.01
Ours β' Grid-Searches83.0954.10.0180.0860.6142.042
+ +The ultimate goal of the paper is to improve model calibration under distribution shift by improving sensitivity. Popular metrics for measuring calibration include: Negative Log-Likelihood (NLL [18]), + +Table 3: Generalizability Experiments Our method is effective with different feature backbones. + +
CleanCorrupt/Rotate
modeldatasetaccuracy↑ECE↓NLL↓Brier↓accuracy↑ECE↓NLL↓Brier↓
ResNet34CIFAR1095.63%0.0260.1860.00781.96%0.1641.1140.039
GSD ResNet34CIFAR1095.9%0.0050.1480.00676.54%0.0880.8820.037
ResNet50CIFAR1095.32%0.030.2030.00876.32%0.171.230.039
GSD ResNet50CIFAR1095.82%0.0080.1470.00776.23%0.0570.7660.033
ResNet101CIFAR1095.61%0.0280.1970.00777.59%0.1541.1180.037
GSD ResNet101CIFAR1095.62%0.0070.1580.00777.21%0.0750.8520.036
ResNet152CIFAR1095.7%0.0280.1960.00775.2%0.1791.3370.041
GSD ResNet152CIFAR1095.63%0.0070.1510.00776.58%0.0580.7650.033
ResNet34CIFAR10078.81%0.0710.8680.00351.16%0.192.3870.007
GSD ResNet34CIFAR10078.02%0.0370.9380.00349.27%0.0982.3610.007
ResNet50CIFAR10079.28%0.0750.8610.00349.71%0.2132.4770.007
GSD ResNet50CIFAR10078.97%0.0330.8790.00350.12%0.082.2640.006
ResNet101CIFAR10080.17%0.0920.8460.00358.19%0.2532.5750.007
GSD ResNet101CIFAR10079.82%0.0340.8340.00353.14%0.0822.110.006
ResNet152CIFAR10080.71%0.0900.8150.00354.2%0.2332.450.007
GSD ResNet152CIFAR10079.85%0.0360.8270.00353%0.0782.120.006
+ +Table 4: Importance of Norm While norm is poorly calibrated, it is important for calibration. + +
ECENLLBrierEntropyAccuracy
Vanilla (||w_y|||x|| cos φy)0.025±0.0010.186±0.0060.001±0.00.082±0.00295.4±0.1%
No Weight Norm (w/o ||w_y||)0.061±0.00030.206±0.0060.001±0.00.527±0.01495.4±0.1%
No x Norm (w/o ||x||)0.893±0.0022.837±0.0050.009±0.04.537±0.00195.4±0.1%
Only Cosine (w/o ||w_y||,||x||)0.914±0.0013.235±0.0010.009±0.04.546±0.00095.3±0.1%
+ +Brier [19] and Expected Calibration Error (ECE [20]). Our goal is for our model to produce values close to 0 in these metrics, which maximizes calibration. Please refer to Sec. A.3 (Appendix) for more detailed discussion on these metrics. Following prior works [9, 8, 5], we will use CIFAR10 and CIFAR100 as the in-distribution training and testing dataset, and apply the image corruption library provided by [1] to benchmark calibration performance under distribution shift. The library provides 16 types of noises with 5 severity scales. In this section, we show that our model outperforms other deterministic methods (despite their significant complexity + +Compared Methods We compare to several popular state-of-the-art models including stochastic Bayesian methods (multi-pass): Deep Ensemble [14] and MC dropout [7], and recent deterministic methods (single pass): SNGP [9] and DUQ [8]. + +Results In Tab. 1 and 2, we compare our model to the most recent state of art deterministic methods SNGP and DUQ using Wide ResNet 28-10 [21] as the model backbone and each model evaluated using the average of 10 seeds. We report accuracy, ECE and NLL on clean and corrupted CIFAR10/100 datasets [1]. Our method outperforms all single-pass methods on calibration when data is corrupted, and even surpass ensembles on error metrics for corrupted data. We had 2 versions of our model: Grid Searched: grid search $\beta^{\prime}$ on the validation set to minimize ECE and Optimized: optimize $\beta^{\prime}$ on the validation set via gradient descent to minimize NLL for 10 epochs, similar to temperature scaling. We report additional results with ResNet18 in Sec. A.4 and Sec. A.5 (Appendix) with image noise and rotation respectively. + +Generalizability We explored how generalizable our method (Grid Searched) is by applying it to 12 different models and 4 different datasets in Tab. 3. We can see consistently that our model had stronger calibration across all models and metrics, including models known to be well calibrated like LeNet [22]. All models were tested on CIFAR10C and CIFAR100C datasets offered by [1] where the original CIFAR10 and CIFAR100 were pre-corrupted; these were used for consistent corruption benchmarking across all models. All non-CIFAR datasets were corrupted via rotation from angles [0,350] with 10 step angles in between and the average calibration and accuracy was taken across all + +![](images/baad9e37e4c6164a37c4c0b2ed343d0d87e950d1f5a420c4ea74e3bbce346781.jpg) +(a) CIFAR100 Accuracy + +![](images/bc6105a5aa6f07a3c87938eee268ccbf2ad8cf76a1cb59346e7cf5ab949e56ff.jpg) +(b) CIFAR100ECE +Figure 2: Accuracy, ECE, norm and cosine similarity on CIFAR100 validation set with clean and Gaussian noise trained on vanilla ResNet. In the shaded region, increase in norm is responsible for increase in ECE because cosine similarity is relatively flat. Throughout training, sensitivity of the cosine similarity improves while that of the norm remains insensitive. + +![](images/12f50e488321ed24d74c7d8c3f38b47dfd1732dd2e365ad1c3ca39fcc62f8723.jpg) +(c) CIFAR100 Norm + +![](images/ebe886cd31fc6518cd57dbb3b4fa513e2bb84e507d55e47d5164a8249be11991.jpg) +(d) CIFAR100 Cosine + +Table 5: Pearson Correlation of Cosine Similarity and Norm vs. ECE during training on CIFAR100. Norm is consistently positively correlated with ECE whereas the similarity is either negatively or not correlated with ECE. + +
ResNet18ResNet34ResNet101ResNet152
shotGaussianDefocusshotGaussianDefocusshotGaussianDefocusshotGaussianDefocus
Cosine Sim0.090.030.730.090.030.32-0.03-0.04-0.88-0.970.04-0.81
Norm0.820.820.780.820.810.780.870.870.850.860.850.81
+ +degrees of rotation. Our models included: DenseNet [23], LeNet [22] and 6 varying sizes of ResNet, which are described in [24]. The datasets we experimented on CIFAR10 [25], CIFAR100 [25], MNIST [26] and SVHN [27], CIFAR10C [1], CIFAR100C [1]. We report Optimized results in Tab. 14 in A.7 (Appendix). Both tuning methods yield similar performance. + +Qualitative Comparison The current state-of-the-art single pass models for inference on OOD data, without training on OOD data, are SNGP [9] and DUQ [8]. The primary disadvantages of these models are: 1) Hyperparameter Combinatorics: Both DUQ and SNGP require many hyperparameters as shown in Tab. 13 in A.6 (Appendix). Our model only has one hyperparameter that is tuned post-training, which is quicker and less costly than the other methods that require pre-training tuning. 2) Extended Training Time: DUQ requires a centroid embedding update every epoch, while SNGP requires sampling potentially high dimensional embeddings of training points, thus increasing training time while our model trains in the same amount of time as the model it is applied to. Bayesian MCDO [7] and Deep Ensemble [14] are considered the current state-of-the-art methods for multi-pass calibration. Bayesian MCDO requires multiple passes with dropout during inference. Deep Ensembles requires $N$ times the number of parameters as the single model it is assembling where $N$ is the number of models ensembled. The main disadvantage of multi-pass models is high inference complexity while our model adds no overhead computation at inference. + +Importance of the Norm While we have shown and conjectured that the norm of $x$ is uncalibrated to OOD data and not always well calibrated to IND data, one might suggest to simply remove the norm. We show in Tab. 4 though the norm is uncalibrated it is still important for inference. We trained ResNet18 on CIFAR10 and then ran inference with ResNet18 modified in the following: dividing out the norms of the weights for each class, dividing out the norm of the input and then dividing out both. As we can see the weight norm contributes minimally to inference as accuracy decreased by $0.03\%$ without it and as previous work has shown the angle dominates classification. We can see with $||\mathbf{x}||$ removed the entropy is at its highest while calibration is very poor, implying the distribution is much more uniform when it should be peaked, as a larger entropy implies a more uniform distribution. Thus the root of the issue does not lie in the existence of the norm, but it's lack of sensitivity. + +# 4.2 Reasons for Bad Calibration under Distribution Shift + +To identify the cause of bad calibration, we record the accuracy, ECE, norm and cosine similarity of a model during training of a vanilla ResNet model. Specifically, we record the evaluation statistics on clean data and also on data corrupted with Gaussian noise on CIFAR100. Fig. 2a and 2b show the accuracy and ECE respectively. We observe that evaluation on Gaussian noise corrupted data yields lower accuracy and higher ECE compared to evaluation on clean data. This demonstrates that + +![](images/2022439af47370c7c92fcd3acbc67268a549517d4f7de2102d8c3d6fae6568b0.jpg) +(a) CIFAR10 vs. SVHN + +![](images/9205be2efba0a0898b2fa9c4385a57ffaab8658714257890ed3a792f30ea1bf3.jpg) +(b) CIFAR100 vs. SVHN +Figure 3: Histogram of Norm Distribution Our model ( $\alpha$ -regularized) improves separation of norm between IND and OOD data. + +the model's confidence fails to adapt to the decreasing accuracy. Fig. 2c and 2d show the change of average norm and average cosine similarity throughout training. The difference between Gaussian noised data and clean data is also reported. We observe that the norm of clean data and the norm of Gaussian noised data are close and the difference remains constantly low whereas the cosine similarity of the two diverges with training. This indicates that sensitivity of cosine similarity increases whereas sensitivity of the norm remains low with training. In the shaded region of Fig. 2b-2d where ECE increases the most, we observe that the norm also increases but the cosine similarity only increases slowly. The observation also holds for other noises and architectures. We further present Pearson correlation between ECE and cosine similarity or norm on 4 models and 3 noises in Tab. 5. A large correlation coefficient indicates a higher positive correlation. Norm is consistently positively correlated with ECE whereas the similarity is either negatively or not correlated with ECE. This shows that the worsening of ECE (large ECE) is correlated with the increasing norm. Based on supporting literature [12], [11] and this correlation, the observation supports the conjecture that the insensitivity of the norm is responsible for bad calibration. + +# 4.3 Empirical Support for the Disentangled Training + +Table 6: OOD AUROC $\uparrow$ using Norm and Similarity We show OOD detection results using norm and cosine similarity. SVHN [27] is used as the OOD dataset. Our method ( $\alpha$ -regularized) significantly increases the sensitivity of feature norm. + +
ResNet18CriterionCIFAR10CIFAR10 (Incorrect)
VanillaNorm90.4867.23
Similarity93.8756.98
α- regularizedNorm99.0593.16
Similarity97.0974.82
α- unregularizedNorm98.2088.29
Similarity94.7260.63
+ +(a) CIFAR10 vs. SVHN AUROC + +
ResNet18CriterionCIFAR100CIFAR100 (Incorrect)
vanillaNorm79.3862.66
Similarity82.2655.54
α- regularizedNorm94.4686.67
Similarity85.6863.24
α- unregularizedNorm84.7873.11
Similarity72.6142.90
+ +(b) CIFAR100 vs. SVHN AUROC + +In the first set of experiments, we show that $\alpha$ and $\beta$ reflect the effects of the geometric decomposition as claimed in Sec. 3.2 with different $\alpha - \beta$ configurations. From Fig. 4a - 4d, we observe that the norm decreases linearly with $\beta$ for fixed $\alpha$ . From Fig. 4e - 4h, we observe that the angle increases linearly with $\arccos(\alpha)$ . The observations are consistent with the original geometric motivation. $\beta$ encodes an instance-independent portion, $C_x$ , of the norm. As $\beta$ increases, $C_x$ increases and therefore the magnitude of the dependent component, $\| \Delta x \|_2$ decreases linearly. $\alpha$ encodes the inverse of the cosine of a relaxation angle, $C_\phi$ . As $\arccos(\alpha)$ increases, the resulting angle, $\Delta \phi$ increases linearly due to the increased relaxation angle encoded by $\alpha$ . + +In the second set of experiments, we show that the new model effectively increases the sensitivity of both the norm and the angle to input distribution shift as claimed in Sec. 3.3. Specifically, we measure OOD detection performance of the models using both the norm and the cosine similarity with the Area Under the Receiver Operating Characteristic (AUROC) curve metric. We use CIFAR10/100 as + +Table 7: Average norm and accuracy across different corruptions on GSD ResNet18. The table is organized in decreasing accuracy order. + +
ResNet GSDcleanbrightnessfogelasticsnowdefocusfrostmotion blurjpegzoom blurpixelatecontrastshotglass blurimpulseGaussian
accuracy95.3393.8288.7585.0983.8782.9580.4179.7179.3178.4876.475.2959.4659.2957.2647.33
norm0.730.660.520.420.460.460.440.370.390.350.50.390.340.270.30.28
+ +![](images/6b200507e4067bd7b0558b9e00e369cce0b1d7c0a1b27d8f4418098efbb9a883.jpg) + +![](images/e92d2339992ec961e35eff8c70d763befe14c6916ef7202ddb18145bcb1d3f1c.jpg) + +![](images/2777735364bc9142f16bb3f303937e3956fb8bdd36439fc157b9f632895312d7.jpg) +(c) $\alpha = 2.0$ + +![](images/b0f324704262f5d44b924c693e32f5ad59171bb181c295b37bf26ede1ea2126d.jpg) + +![](images/4fc1d2514db2e5cf90f6a98e6b975128d449fbbfdf8c66f4a3b13a6a83ac73a2.jpg) +(a) $\alpha = 1$ +(e) $\beta = 0$ + +![](images/0d91eb7187aa9d7b3cca0fa6306ff7e817f8e4b28626d34861472f94709223f8.jpg) +(b) $\alpha = 1.5$ +(f) $\beta = 2$ + +![](images/e3a25b36e48c8bf77dcb6a3917661b4de3304f7eaef09b0e34e56e68d3db146e.jpg) +(g) $\beta = 2$ + +![](images/b849180e7506208cafd46cf2389c00a73e81c65f365a465295ad7f3642af5586.jpg) +(d) $\alpha = 2.5$ +(h) $\beta = 3$ +Figure 4: Properties of $\| \Delta x\| _2$ and $\Delta \phi$ . (a) - (b): $\| \Delta x\| _2$ decreases linearly with $\beta$ for fixed $\alpha$ reflecting Eq. 2 and 6. (e) - (h) $\Delta \phi$ increases linearly with $arccos(\alpha)$ for fixed $\beta$ reflecting Eq. 3 and 6. All plots include R-squared values to indicate goodness-of-fit of the linear relationship. + +the IND data and SVHN [27] as the OOD data. In Tab. 6a and 6b we show two configurations of models in addition to vanilla ResNet18: ( $\alpha$ -regularized) we regularize $\alpha$ such that it stays close to one as described in Sec. 3.3; ( $\alpha$ -unregularized) we optimize both $\alpha$ and $\beta$ freely without constraints. Compared to vanilla ResNet, the norms predicted by our models achieve significant improvement in separating IND data from OOD data. Additionally, we visualize the distribution of norms in Fig. 3a and 3b. The separation between IND and OOD data increases significantly compared to vanilla ResNet18. However, a large $\alpha$ (see $\alpha$ -unregularized in Tab. 6a and 6b) leads to marginal cosine similarity sensitivity improvement on CIFAR10 and CIFAR100. This indirectly confirms our observations in Sec. 4.2 and in prior works [11] that cosine similarity correlates well with distribution shift. Introducing further angle relaxation might not be always beneficial. While we mainly focus on calibration, our method also strengthens its base model's ability for OOD detection. + +The assumption that OOD data have smaller norms is based on the expectation that a model should be less confident on OOD data. Practically, the norm acts as a temperature in softmax as shown in Eq. 1. Intuitively, larger always yields more peaked/confident predictions, and smaller always yields flatter predictive distributions. Therefore, we expect less confident data such as OOD data to have smaller because we expect the output distribution to be flatter. The assumption is supported by the following empirical evidence. In Tab. 7 we show the norm of in-distribution and out-of-distribution data on CIFAR10 using ResNet50-GSD (ours). The OOD data is produced by the 15 corruptions used in the paper. OOD data have consistently smaller norms and the accuracy decreases with decreasing norm with a Pearson correlation of 0.9 as an indicator of more out-of-distribution. + +# 5 Conclusion + +In this paper, we studied the geometry of the last linear decision layer and identified the insensitivity of the norm as the culprit of bad calibration under distribution shift. To encourage sensitivity, we derived a general theory to decompose the norm and angular similarity. Inspired by the theory, we proposed a simple yet very effective training and inference scheme that encourages the norm to reflect distribution changes. The model outperforms other deterministic single pass-methods in calibration metrics with much fewer hyperparameters. We also demonstrated its superior generalizability on a variety of popular neural networks. Note that our problem and method have positive societal impact, as calibration under shift improves overall confidence and robustness of these models. + +# 6 Acknowledgements + +This work was partially supported by ONR grant N00014-18-1-2829. + +# References + +[1] Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. Proceedings of the International Conference on Learning Representations, 2019. +[2] Sebastian Brechtel, Tobias Gindele, and Rüdiger Dillmann. Probabilistic decision-making under uncertainty for autonomous driving using continuous pomdpms. In 17th international IEEE conference on intelligent transportation systems (ITSC), pages 392-399. IEEE, 2014. +[3] Yi Yang, Zhigang Ma, Feiping Nie, Xiaojun Chang, and Alexander G Hauptmann. Multi-class active learning by uncertainty sampling with diversity maximization. International Journal of Computer Vision, 113(2):113-127, 2015. +[4] Chuan Guo, Geoff Pleiss, Yu Sun, and Kilian Q Weinberger. On calibration of modern neural networks. In International Conference on Machine Learning, pages 1321-1330. PMLR, 2017. +[5] Yaniv Ovadia, Emily Fertig, Jie Ren, Zachary Nado, David Sculley, Sebastian Nowozin, Joshua V Dillon, Balaji Lakshminarayanan, and Jasper Snoek. Can you trust your model's uncertainty? evaluating predictive uncertainty under dataset shift. arXiv preprint arXiv:1906.02530, 2019. +[6] Alex Kendall and Yarin Gal. What uncertainties do we need in bayesian deep learning for computer vision? arXiv preprint arXiv:1703.04977, 2017. +[7] Yarin Gal and Zoubin Ghahramani. Dropout as a bayesian approximation: Representing model uncertainty in deep learning. In international conference on machine learning, pages 1050–1059. PMLR, 2016. +[8] Joost Van Amersfoort, Lewis Smith, Yee Whye Teh, and Yarin Gal. Uncertainty estimation using a single deep deterministic neural network. In International Conference on Machine Learning, pages 9690-9700. PMLR, 2020. +[9] Jeremiah Zhe Liu, Zi Lin, Shreyas Padhy, Dustin Tran, Tania Bedrax-Weiss, and Balaji Lakshminarayanan. Simple and principled uncertainty estimation with deterministic deep learning via distance awareness. arXiv preprint arXiv:2006.10108, 2020. +[10] Weiyang Liu, Zhen Liu, Zhiding Yu, Bo Dai, Rongmei Lin, Yisen Wang, James M Rehg, and Le Song. Decoupled networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 2771-2779, 2018. +[11] Beidi Chen, Weiyang Liu, Zhiding Yu, Jan Kautz, Anshumali Shrivastava, Animesh Garg, and Animashree Anandkumar. Angular visual hardness. In International Conference on Machine Learning, pages 1637-1648. PMLR, 2020. +[12] Ioannis Kansizoglou, Loukas Bampis, and Antonios Gasteratos. Deep feature space: A geometrical perspective. arXiv preprint arXiv:2007.00062, 2020. +[13] Weiyang Liu, Yandong Wen, Zhiding Yu, and Meng Yang. Large-margin softmax loss for convolutional neural networks. In ICML, 2016. +[14] Balaji Lakshminarayanan, Alexander Pritzel, and Charles Blundell. Simple and scalable predictive uncertainty estimation using deep ensembles. arXiv preprint arXiv:1612.01474, 2016. +[15] Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. arXiv preprint arXiv:1802.05957, 2018. +[16] Ishaan Gulrajani, Faruk Ahmed, Martin Arjovsky, Vincent Dumoulin, and Aaron C Courville. Improved training of wasserstein gans. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017. +[17] Daniel Soudry, Elad Hoffer, Mor Shpigel Nacson, Suriya Gunasekar, and Nathan Srebro. The implicit bias of gradient descent on separable data. In *The Journal of Machine Learning Research*, page 2822–2878, 2018. + +[18] Trevor Hastie, Robert Tibshirani, and Jerome Friedman. The Elements of Statistical Learning. Springer Series in Statistics. Springer New York Inc., New York, NY, USA, 2001. +[19] Glenn W Brier. Verification of forecasts expressed in terms of probability. Monthly weather review, 78(1):1-3, 1950. +[20] Mahdi Pakdaman Naeini, Gregory Cooper, and Milos Hauskrecht. Obtaining well calibrated probabilities using bayesian binning. In Proceedings of the AAAI Conference on Artificial Intelligence, 2015. +[21] Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. CoRR, abs/1605.07146, 2016. +[22] Yann Lecun, León Bottou, Yoshua Bengio, and Patrick Haffner. Gradient-based learning applied to document recognition. In Proceedings of the IEEE, pages 2278-2324, 1998. +[23] Gao Huang, Zhuang Liu, Laurens van der Maaten, and Kilian Q. Weinberger. Densely connected convolutional networks. In CVPR, pages 2261-2269. IEEE Computer Society, 2017. +[24] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. CoRR, abs/1512.03385, 2015. +[25] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. +[26] Yann LeCun and Corinna Cortes. MNIST handwritten digit database. 2010. +[27] Yuval Netzer, Tao Wang, Adam Coates, Alessandro Bissacco, Bo Wu, and Andrew Y Ng. Reading digits in natural images with unsupervised feature learning. In Advances in Neural Information Processing Systems, 2011. +[28] Tilmann Gneiting and Adrian E Raftery. Strictly proper scoring rules, prediction, and estimation. Journal of the American statistical Association, 102(477):359-378, 2007. +[29] Allan H Murphy. A new vector partition of the probability score. Journal of Applied Meteorology and Climatology, 12(4):595-600, 1973. +[30] John Platt et al. Probabilistic outputs for support vector machines and comparisons to regularized likelihood methods. Advances in large margin classifiers, 10(3):61-74, 1999. \ No newline at end of file diff --git a/ageometricperspectivetowardsneuralcalibrationviasensitivitydecomposition/images.zip b/ageometricperspectivetowardsneuralcalibrationviasensitivitydecomposition/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9a6e8da53f06f92f2df3ce5efa8dff2ee86a4201 --- /dev/null +++ b/ageometricperspectivetowardsneuralcalibrationviasensitivitydecomposition/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40c1f4b5be97eea835b06d49259f87c6f5cdfc5684dea6aeb40f0f93bc9cc258 +size 624140 diff --git a/ageometricperspectivetowardsneuralcalibrationviasensitivitydecomposition/layout.json b/ageometricperspectivetowardsneuralcalibrationviasensitivitydecomposition/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a10dde444e6ca689e5955fdece869583fed7a619 --- /dev/null +++ b/ageometricperspectivetowardsneuralcalibrationviasensitivitydecomposition/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c32872ef61862da0eb0aa1fdcd22c86f5594f1cb4e2635e4db8e9477ca9f1fb9 +size 425501 diff --git a/ageometricstructureofaccelerationanditsroleinmakinggradientssmallfast/2107af99-8362-4edd-b328-85cc986611c2_content_list.json b/ageometricstructureofaccelerationanditsroleinmakinggradientssmallfast/2107af99-8362-4edd-b328-85cc986611c2_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..11d7fd454e40ede41344e1909f6b52e7bff6bca0 --- /dev/null +++ b/ageometricstructureofaccelerationanditsroleinmakinggradientssmallfast/2107af99-8362-4edd-b328-85cc986611c2_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8bb1597da9f0e07d2af15b477d8d09c6a7027295a6e816c486db639560d9cfef +size 94427 diff --git a/ageometricstructureofaccelerationanditsroleinmakinggradientssmallfast/2107af99-8362-4edd-b328-85cc986611c2_model.json b/ageometricstructureofaccelerationanditsroleinmakinggradientssmallfast/2107af99-8362-4edd-b328-85cc986611c2_model.json new file mode 100644 index 0000000000000000000000000000000000000000..e0b1b981870e7368303784b56dbc7f0ea5fb0eb8 --- /dev/null +++ b/ageometricstructureofaccelerationanditsroleinmakinggradientssmallfast/2107af99-8362-4edd-b328-85cc986611c2_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2751fa1bcdd4e020f6309370c4aa55259c0da08e9eca6fa5641b83913f99e181 +size 119589 diff --git a/ageometricstructureofaccelerationanditsroleinmakinggradientssmallfast/2107af99-8362-4edd-b328-85cc986611c2_origin.pdf b/ageometricstructureofaccelerationanditsroleinmakinggradientssmallfast/2107af99-8362-4edd-b328-85cc986611c2_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8bf38286018ea93fc6fe1ce686be01baacad1eb8 --- /dev/null +++ b/ageometricstructureofaccelerationanditsroleinmakinggradientssmallfast/2107af99-8362-4edd-b328-85cc986611c2_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5009564adb6d5e32dcda95e6478469e680500c0937ba826b4e526bb76d15f249 +size 1677007 diff --git a/ageometricstructureofaccelerationanditsroleinmakinggradientssmallfast/full.md b/ageometricstructureofaccelerationanditsroleinmakinggradientssmallfast/full.md new file mode 100644 index 0000000000000000000000000000000000000000..55362225ff3151f3c38621d12f4581f9418ae7fa --- /dev/null +++ b/ageometricstructureofaccelerationanditsroleinmakinggradientssmallfast/full.md @@ -0,0 +1,523 @@ +# A Geometric Structure of Acceleration and Its Role in Making Gradients Small Fast + +Jongmin Lee + +Seoul National University dlwhd2000@snu.ac.kr + +Chanwoo Park + +Seoul National University chanwoo.park@snu.ac.kr + +Ernest K. Ryu + +Seoul National University ernestryu@snu.ac.kr + +# Abstract + +Since Nesterov's seminal 1983 work, many accelerated first-order optimization methods have been proposed, but their analyses lack a common unifying structure. In this work, we identify a geometric structure satisfied by a wide range of first-order accelerated methods. Using this geometric insight, we present several novel generalizations of accelerated methods. Most interesting among them is a method that reduces the squared gradient norm with $\mathcal{O}(1 / K^4)$ rate in the prox-grad setup, faster than the $\mathcal{O}(1 / K^3)$ rates of Nesterov's FGM or Kim and Fessler's FPGM-m. + +# 1 Introduction + +Since Nesterov's seminal 1983 work [57], accelerated methods in optimization have been widely used in large-scale optimization and machine learning. However, the many accelerated methods have been developed and analyzed with disparate techniques, without a unified framework. + +In this work, we identify geometric structures, which we call the parallel and collinear structures, satisfied by a wide range of gradient- and prox-based accelerated methods including: Nesterov's FGM [57], OGM [47], OGM-G [47], Nesterov's FGM in the strongly convex setup (SC-FGM) [60, (2.2.22)], SC-OGM [63], TMM [78], non-stationary SC-FGM [19, §4.5], ITEM [73], geometric descent [13], Güler's first and second accelerated proximal methods [37], and FISTA [11] Using the insight provided by these geometric structures, we present several novel generalizations of accelerated methods. + +Among these novel generalizations, the most interesting is FISTA-G, which reduces the squared gradient norm with $\mathcal{O}(1 / K^4)$ rate when combined with FISTA in the prox-grad (composite minimization) setup. The rate is optimal as it matches the $\Omega(1 / K^4)$ complexity lower bound [55, 56] and is faster than the $\mathcal{O}(1 / K^3)$ rates achieved by of Nesterov's AGM [46, 69] in the smooth convex setup or Kim and Fessler's FPGM-m [45] in the prox-grad setup. + +# 1.1 Preliminaries and notations + +For $L > 0$ , $f \colon \mathbb{R}^n \to \mathbb{R}$ is $L$ -smooth if $f$ is differentiable and + +$$ +\| \nabla f (x) - \nabla f (y) \| \leq L \| x - y \| \quad \forall x, y \in \mathbb {R} ^ {n}. +$$ + +For $\mu > 0$ , $g \colon \mathbb{R}^n \to \mathbb{R} \cup \{\infty\}$ is $\mu$ -strongly convex if $g(x) - (\mu/2)\|x\|^2$ is convex. Let $L$ and $\mu$ respectively denote the smoothness and strong convexity parameters of $f$ . Write the gradient steps with step sizes $1/L$ and $1/\mu$ as + +$$ +x ^ {+} = x - \frac {1}{L} \nabla f (x), \quad x ^ {+ +} = x - \frac {1}{\mu} \nabla f (x). +$$ + +For $\lambda > 0$ , the proximal operator [53, 62] $\operatorname{Prox}_{\lambda g} \colon \mathbb{R}^n \to \mathbb{R}^n$ is defined as + +$$ +x ^ {\circ} = \operatorname {P r o x} _ {\lambda g} (x) = \underset {y \in \mathbb {R} ^ {n}} {\arg \min } \left\{g (y) + \frac {1}{2 \lambda} \| y - x \| ^ {2} \right\}. +$$ + +When $g$ is closed, convex, and proper [65], the proximal operator is well-defined i.e., the arg min exists and is unique [52]. Define the prox-grad step as + +$$ +x ^ {\oplus} = \underset {y \in \mathbb {R} ^ {n}} {\arg \min } \left\{f (x) + \langle \nabla f (x), y - x \rangle + g (y) + \frac {L}{2} \| y - x \| ^ {2} \right\}. +$$ + +If $g = 0$ , then $x^{\oplus} = x^{+}$ . If $f = 0$ and $1 / \lambda = L$ , then $x^{\oplus} = x^{\circ}$ . Furthermore, write + +$$ +\tilde {\nabla} _ {L} F (x) := - L (x ^ {\oplus} - x), \qquad \tilde {\nabla} _ {1 / \lambda} g (x) := - \frac {1}{\lambda} (x ^ {\circ} - x). +$$ + +$u\in \mathbb{R}^n$ is a subgradient of convex function $g$ at $x$ if + +$$ +g (x) + \langle u, y - x \rangle \leq g (y) \quad \forall y \in \mathbb {R} ^ {n}. +$$ + +Subdifferential of $g$ at $x$ , denoted $\partial g(x)$ , is the set of subgradients of $g$ at $x$ . Throughout this paper, we consider the problem + +$$ +\underset {x \in \mathbb {R} ^ {n}} {\text {m i n i m i z e}} F (x) := f (x) + g (x), \tag {P} +$$ + +where $f \colon \mathbb{R}^n \to \mathbb{R}$ is convex and $L$ -smooth and $g \colon \mathbb{R}^n \to \mathbb{R} \cup \{\infty\}$ is closed, convex, and proper. We say we are in the smooth convex setup if $f \neq 0$ and $g = 0$ , the proximal-point setup if $f = 0$ and $g \neq 0$ , and the prox-grad setup if $f \neq 0$ and $g \neq 0$ . Write $f_{\star}, g_{\star}$ , and $F_{\star}$ to respectively denote the infima of $f, g,$ and $F$ . We also informally assume $\operatorname{Prox}_{\lambda g}$ is efficient to evaluate [17]. + +# 1.2 Prior works + +In convex optimization and machine learning, the classical goal of algorithms is to reduce the function value efficiently. In the smooth convex setup, Nesterov's celebrated fast gradient method (FGM) [57] achieves an accelerated rate, and the optimized gradient method (OGM) [44] improves this rate by a factor of 2, which is in fact exactly optimal [27]. In the smooth strongly convex setup, the strongly convex fast gradient method (SC-FGM) [60, (2.2.22)], strongly convex optimized gradient method (SC-OGM) [63], and non-stationary SC-FGM [19, §4.5] achieves an accelerated rate, and the triple momentum method (TMM) [78] and information theoretic exact method (ITEM) [73] achieve exact optimal rates [28]. In the proximal-point setup, there are Guler's first and second accelerated proximal methods [37]. There are also other variants of accelerated proximal methods [51, 49, 39, 77]. + +The study of algorithms for reducing the gradient magnitude, which can help us understand nonconvex optimization better and design faster non-convex machine learning algorithms, was initiated by Nesterov [58]. For smooth nonconvex minimization, gradient descent (GD) achieves $\mathcal{O}((f(x_0) - f_\star) / K)$ rate [54, Proposition 3.3.1]. In the smooth convex setup, combining $K$ iterations of FGM with $K$ iterations of GD achieves $\mathcal{O}(\| x_0 - x_\star \| ^2 /K^3)$ rate [58]. Adding a strongly convex regularization and then using SC-FGM achieves $\tilde{\mathcal{O}} (\| x_0 - x_\star \| ^2 /K^4)$ rate, where $\tilde{\mathcal{O}}$ ignores logarithmic factors [58]. Finally, OGM-G [47] achieved $\mathcal{O}((f(x_0) - f_\star) / K^2)$ rate and $\mathcal{O}(\| x_0 - x_\star \| ^2 /K^4)$ rate is achieved by combining FGM with OGM-G [61, Remark 2.1]. This rate is optimal as it matches the $\Omega (\| x_0 - x_\star \| ^2 /K^4)$ lower bound [55, 56]. Making gradients small have also been studied in the setup with stochastic gradients [2, 3, 33, 79, 34], for composite problems with strong convexity and non-Euclidean norms [23], and for convex-concave saddle-point problems [22, 24, 80]. + +In the prox-grad setup, iterative shrinkage-thresholding algorithm (ISTA) [12, 64, 20, 18] achieves $\mathcal{O}(\| x_0 - x_\star \|^2 / K)$ rate on function-value suboptimality and fast iterative shrinkage-thresholding algorithm (FISTA) [11] accelerates this rate to $\mathcal{O}(\| x_0 - x_\star \|^2 / K^2)$ . On the squared gradient magnitude, FPGM-m achieves $\mathcal{O}(\| x_0 - x_\star \|^2 / K^3)$ rate [45]. + +The performance estimation problem (PEP) is a computer-assisted proof methodology based on semidefinite programming [29, 75, 74]. Extensions and variations of the PEP have been utilized to obtain analyses and algorithms that would be difficult to obtain without the assistance of computers [67, 72, 10, 76, 21, 36, 50, 26, 43]. In particular, OGM [29, 44], OGM-G [47], and ITEM [73] were obtained with the PEP. Integral quadratic constraints is a related computer-assisted approach based on control-theoretic ideas [48, 38, 78, 31]. + +A Lyapunov analysis constructs a nonincreasing quantity, and many modern analyses of accelerated first-order methods are based on this technique [11, 70, 9, 72, 1, 6, 7, 8, 63]. In fact, Nesterov's original presentation of FGM was a Lyapunov analysis [57]. + +Finally, we mention some closely related prior work. The scaled relative graph (SRG) analyzes optimization algorithms via Euclidean geometry [66, 40, 41, 68], but the SRG has not been used to analyze accelerated methods. Linear coupling [4, 5] interprets acceleration as a coupling between gradient descent and mirror descent to efficiently reduce function values. Geometric descent [13, 16, 42] is an accelerated algorithm designed expressly based on geometric principles, and quadratic averaging [30] is an equivalent algorithm with an alternate interpretation. The method of similar triangles (MST) generalizes FGM with geometric notions [32, 60, 1]. The parallel and collinear structures of this work, in our view, expand these prior notions and concretely articulate ideas that had been utilized implicitly. In particular, the prior interpretations, as is, are insufficient for analyzing OGM-G and deriving our newly proposed method FISTA-G. In Section H of the appendix, we further discuss the relationship of our contributions with these prior works. + +# 1.3 Contribution + +This paper presents two major contributions, one conceptual and one concrete. The first is the identification of the parallel and collinear geometric structures, which are observed in a wide variety of accelerated first-order methods. This geometric structure provides us with valuable insight into the mechanism of acceleration and enables us to obtain results that would be otherwise difficult to discover, including FISTA-G. The second major contribution is the novel method FISTA-G and FISTA+FISTA-G. To the best of our knowledge, FISTA+FISTA-G is the first method to achieve the rate $\mathcal{O}(1 / K^{-4})$ on the squared gradient norm in the prox-grad setup. + +In addition, we use the geometric structures to find G-FISTA-G, G-FGM-G, G-Güler-G, Proximal-TMM, and Proximal-ITEM, novel variants of accelerated first-order methods, and present them as minor contributions. (G-FGM-G is the abbreviation for Generalized-FGM-(for reducing Gradients).) + +# 2 Making gradients small at rate $\mathcal{O}(1 / K^4)$ in the prox-grad setup + +In this section, we present a novel method FISTA-G, which reduces the squared gradient norm with $\mathcal{O}(1 / K^4)$ rate when combined with FISTA in the prox-grad setup. Our analysis uses a novel and unusual Lyapunov function, whose discovery crucially relied on the geometric insights presented later in Section 3. Here, we provide a self-contained analysis that uses, but does not explain this Lyapunov function. + +Smooth convex setup. Kim and Fessler's (OGM-G) [47] is + +$$ +x _ {k + 1} = x _ {k} ^ {+} + \frac {\left(\theta_ {k} - 1\right) \left(2 \theta_ {k + 1} - 1\right)}{\theta_ {k} \left(2 \theta_ {k} - 1\right)} \left(x _ {k} ^ {+} - x _ {k - 1} ^ {+}\right) + \frac {2 \theta_ {k + 1} - 1}{2 \theta_ {k} - 1} \left(x _ {k} ^ {+} - x _ {k}\right) \quad \text {f o r} k = 0, 1, \dots , K - 1, +$$ + +where $x_{-1}^{+} \coloneqq x_{0}, \theta_{K} = 1, \theta_{k} = \frac{1 + \sqrt{1 + 4\theta_{k + 1}^{2}}}{2}$ for $k = 1, 2, \ldots, K - 1$ , and $\theta_0 = \frac{1 + \sqrt{1 + 8\theta_1^2}}{2}$ . Note, $K$ is the total number of iterations and $\theta_0 = \mathcal{O}(K)$ , so $\theta_0$ is a function of $K$ . OGM-G is the first method to achieve the accelerated rate $\mathcal{O}((f(x_0) - f_\star) / K^2)$ on the squared gradient norm, and the method was originally obtained through a computer-assisted methodology. However, the computer-generated analysis is verifiable but arguably difficult to understand. + +We characterize the convergence of OGM-G with the following novel Lyapunov function + +$$ +\begin{array}{l} U _ {k} = \frac {1}{\theta_ {k} ^ {2}} \left(\frac {1}{2 L} \| \nabla f (x _ {K}) \| ^ {2} + \frac {1}{2 L} \| \nabla f (x _ {k}) \| ^ {2} + f (x _ {k}) - f (x _ {K}) - \left\langle \nabla f (x _ {k}), x _ {k} - x _ {k - 1} ^ {+} \right\rangle\right) \\ + \frac {L}{\theta_ {k} ^ {4}} \left\langle z _ {k} - x _ {k - 1} ^ {+}, z _ {k} - x _ {K} ^ {+} \right\rangle , \qquad \text {f o r} k = 1, 2, \dots , K, \\ \end{array} +$$ + +where $z_{k} = x_{k} + \frac{(\theta_{k} - 1)^{2}}{2\theta_{k} - 1} (x_{k} - x_{k - 1}^{+})$ for $k = 1,2,\ldots ,K$ (note $z_{K} = x_{K}$ ) through the steps + +$$ +\frac {1}{L} \| \nabla f (x _ {K}) \| ^ {2} = U _ {K} \leq U _ {K - 1} \leq \dots \leq U _ {1} \leq \frac {2}{\theta_ {0} ^ {2}} \left(\frac {1}{2 L} \| \nabla f (x _ {K}) \| ^ {2} + f (x _ {0}) - f (x _ {K})\right). +$$ + +Section 3 explains the geometric insights behind the discovery of this Lyapunov function and the proof that $\{U_k\}_{k=1}^K$ is nonincreasing. As related work, Diakonikolas and Wang [24] presented a human-understandable analysis of OGM-G, but their analysis is not a Lyapunov analysis since (as they acknowledge) they do not establish a nonincreasing quantity. In any case, our main contribution of this section is the following generalization of the method and analysis to the prox-grad setup. + +# 2.1 Accelerated $\mathcal{O}((F(x_0) - F_\star) / K^2)$ rate with FISTA-G + +We now present the novel method (FISTA-G): + +$$ +x _ {k + 1} = x _ {k} ^ {\oplus} + \frac {\varphi_ {k + 1} - \varphi_ {k + 2}}{\varphi_ {k} - \varphi_ {k + 1}} (x _ {k} ^ {\oplus} - x _ {k - 1} ^ {\oplus}) \qquad \mathrm {f o r} k = 0, 1, \ldots , K - 1, +$$ + +where $x_{-1}^{\oplus} \coloneqq x_0, \varphi_{K+1} = 0, \varphi_K = 1$ , and + +$$ +\varphi_ {k} = \frac {\varphi_ {k + 2} ^ {2} - \varphi_ {k + 1} \varphi_ {k + 2} + 2 \varphi_ {k + 1} ^ {2} + (\varphi_ {k + 1} - \varphi_ {k + 2}) \sqrt {\varphi_ {k + 2} ^ {2} + 3 \varphi_ {k + 1} ^ {2}}}{\varphi_ {k + 1} + \varphi_ {k + 2}} \quad \mathrm {f o r} k = - 1, 0, \ldots , K - 1. +$$ + +Note that $K$ is the total number of iterations. + +Theorem 1. Consider (P). FISTA-G's final iterate $x_{K}$ exhibits the rate + +$$ +\min \left\| \partial F (x _ {K} ^ {\oplus}) \right\| ^ {2} \leq 4 \left\| \tilde {\nabla} _ {L} F (x _ {K}) \right\| ^ {2} \leq \frac {2 6 4 L}{(K + 2) ^ {2}} \left(F (x _ {0}) - F _ {\star}\right). +$$ + +We clarify that $\min \| \partial F(x)\| ^2 = \min \{\| u\| ^2 |u\in \partial F(x)\}$ for $x\in \mathbb{R}^n$ + +Proof outline. Define $z_0 = x_0$ , $z_k = \frac{\varphi_k}{\varphi_k - \varphi_{k+1}} x_k - \frac{\varphi_{k+1}}{\varphi_k - \varphi_{k+1}} x_{k-1}^{\oplus}$ for $k = 0, 1, \ldots, K$ , and + +$$ +\begin{array}{l} U _ {k} = \frac {2 \varphi_ {k - 1}}{(\varphi_ {k - 1} - \varphi_ {k}) ^ {2}} \left(\frac {1}{2 L} \left\| \tilde {\nabla} _ {L} F (x _ {k}) \right\| ^ {2} + F (x _ {k} ^ {\oplus}) - F (x _ {K} ^ {\oplus}) - \left\langle \tilde {\nabla} _ {L} F (x _ {k}), x _ {k} - x _ {k - 1} ^ {\oplus} \right\rangle\right) \\ + \frac {L}{\varphi_ {k}} \left\langle z _ {k} - x _ {k - 1} ^ {\oplus}, z _ {k} - x _ {K} ^ {\oplus} \right\rangle \quad \text {f o r} k = 0, 1, \dots , K. \\ \end{array} +$$ + +(Note that $z_{K} = x_{K}$ .) We can show that $\{U_k\}_{k=0}^K$ is nonincreasing. Then + +$$ +\begin{array}{l} \frac {1}{2 L} \left\| \tilde {\nabla} _ {L} F (x _ {K}) \right\| ^ {2} = U _ {K} \leq \dots \leq U _ {0} = \frac {2 \varphi_ {- 1}}{(\varphi_ {- 1} - \varphi_ {0}) ^ {2}} \left(\frac {1}{2 L} \left\| \tilde {\nabla} _ {L} F (x _ {0}) \right\| ^ {2} + F (x _ {0} ^ {\oplus}) - F (x _ {K} ^ {\oplus})\right) \\ \leq \frac {2 \varphi_ {- 1}}{(\varphi_ {- 1} - \varphi_ {0}) ^ {2}} \left(F (x _ {0}) - F (x _ {K} ^ {\oplus})\right) \leq \frac {3 3 L}{(K + 2) ^ {2}} \left(F (x _ {0}) - F _ {\star}\right), \\ \end{array} +$$ + +where we used $\frac{1}{2L}\left\| \tilde{\nabla}_L F(x_0)\right\|^2 \leq F(x_0) - F(x_0^\oplus)$ , stated as Lemma 9 in the appendix. + +![](images/30f757565bfce6055b62086aa0483dfa454b23a01d3323cc7dc81437bab8f0dd.jpg) + +The complete proof is presented in Section E of the appendix. In fact, FISTA-G is the best instance within the family of methods G-FISTA-G presented in Section E of the appendix, in the sense that FISTA-G is the instance for which we could obtain the smallest constant in the bound. + +# 2.2 Accelerated $\mathcal{O}(\| x_0 - x_\star \| ^2 /K^4)$ rate with FISTA+FISTA-G + +Define the method (FISTA+FISTA-G) as: from a starting point $x_0$ run $K$ iterations of FISTA [11] and then from the output of FISTA start FISTA-G and run $K$ iterations. (2K iterations total.) We denote the final iterate of this method as $x_{2K}$ . + +Corollary 1. Consider (P). Assume $F$ has a minimizer $x_{\star}$ . FISTA+FISTA-G's final iterate $x_{2K}$ exhibits the rate1 + +$$ +\min \left\| \partial F (x _ {2 K} ^ {\oplus}) \right\| ^ {2} \leq 4 \left\| \tilde {\nabla} _ {L} F (x _ {2 K}) \right\| ^ {2} \leq \frac {5 2 8 L ^ {2}}{(K + 2) ^ {4}} \| x _ {0} - x _ {\star} \| ^ {2}. +$$ + +Proof. Combining the $F(x_{K}^{\oplus}) - F_{\star} \leq 2L \| x_0 - x_{\star} \|^2 / (K + 2)^2$ rate of FISTA [11, Theorem 4.4] with Theorem 1, we get the rate of FISTA+FISTA-G: + +$$ +\min \left\| \partial F (x _ {2 K} ^ {\oplus}) \right\| ^ {2} \leq 4 \left\| \tilde {\nabla} _ {L} F (x _ {2 K}) \right\| ^ {2} \leq \frac {2 6 4 L}{(K + 2) ^ {2}} (F (x _ {K} ^ {\oplus}) - F _ {\star}) \leq \frac {5 2 8 L ^ {2}}{(K + 2) ^ {4}} \| x _ {0} - x _ {\star} \| ^ {2}. +$$ + +![](images/c0ccbd4b702c0488ad6d08b44217a5f2724d2530de2f52e79931225bf463ac2d.jpg) + +FISTA+FISTA-G was inspired by the FGM+OGM-G method, which has $\mathcal{O}(\| x_0 - x_\star \|^2 / K^4)$ rate on the squared gradient norm in the smooth convex setup [61, Remark 2.1]. Nesterov FGM by itself only achieves $\mathcal{O}(\| x_0 - x_\star \|^2 / K^3)$ rate [75, 71, 46, 69, 24]. In the prox-grad setup, FPGM-m [45] held the prior state-of-the-art rate of $\mathcal{O}(\| x_0 - x_\star \|^2 / K^3)$ . Our $\mathcal{O}(\| x_0 - x_\star \|^2 / K^4)$ rate matches the known complexity lower bound [55, 56] and therefore is optimal in the case $g = 0$ . + +# 3 Parallel structure for the convex setup + +In this section, we present the parallel structure, a geometric structure observed in a wide range of accelerated first-order methods. We then utilize the parallel structure to obtain novel variants of accelerated first-order methods and, in particular, obtain the Lyapunov analysis presented in Section 2. + +# 3.1 Parallel structure of acceleration + +Nesterov's (FGM) [57] has the form: + +$$ +\begin{array}{l} x _ {k + 1} = x _ {k} ^ {+} + \frac {\theta_ {k} - 1}{\theta_ {k + 1}} \left(x _ {k} ^ {+} - x _ {k - 1} ^ {+}\right) \\ z _ {k} = x _ {k} + \left(\theta_ {k} - 1\right) \left(x _ {k} - x _ {k - 1} ^ {+}\right) \quad \text {f o r} k = 0, 1, \dots , \\ \end{array} +$$ + +where $x_{-1}^{+} \coloneqq x_{0}, x_{0} = z_{0}, \theta_{0} = 1$ , and $\theta_{k + 1} = \frac{1 + \sqrt{1 + 4\theta_k^2}}{2}$ for $k = 0, 1, \ldots$ . The $z_{k}$ -iterates are known as the auxiliary sequence, and they play a key role in the Lyapunov analysis of FGM [57]. Figure 1 (left) depicts $x_{k - 1}^{+}, x_{k}, x_{k}^{+}, x_{k + 1}, z_{k}$ , and $z_{k + 1}$ . These points in $\mathbb{R}^n$ lie on a 2D-plane, which we call the plane of iteration. Observe that the line segments representing $x_{k}^{+} - x_{k}$ and $z_{k + 1} - z_{k}$ are parallel. (We prove observations 1 and 2 in Section B of the appendix.) + +Observation 1. In FGM, $x_{k}^{+} - x_{k}$ and $z_{k + 1} - z_{k}$ are parallel2. + +![](images/f2400a021c81ef84dd1d2bb2334998ca52524f02e26d00fb54ca6e58e909de10.jpg) +Figure 1: Plane of iteration of FGM (left), OGM (middle), and FISTA-G (right) + +![](images/91b0f4e52ec62ebd9b33df097007ccc073a970587f8594d200be6fb69c38d074.jpg) + +![](images/94a9dce0e0a5c6d49b55235bec1c2595fcbec48c6890d5d7d73a3c97517945bd.jpg) + +Drori, Teboulle, Kim, and Fessler's (OGM) [29, 44] has the form: + +$$ +\begin{array}{l} x _ {k + 1} = x _ {k} ^ {+} + \frac {\theta_ {k} - 1}{\theta_ {k + 1}} \left(x _ {k} ^ {+} - x _ {k - 1} ^ {+}\right) + \frac {\theta_ {k}}{\theta_ {k + 1}} \left(x _ {k} ^ {+} - x _ {k}\right) \\ z _ {k} = x _ {k} + (\theta_ {k} - 1) (x _ {k} - x _ {k - 1} ^ {+}) \qquad \mathrm {f o r} k = 0, 1, \ldots K - 1, \\ \end{array} +$$ + +where $x_{-1}^{+} \coloneqq x_{0}, z_{0} = x_{0}, \theta_{0} = 1, \theta_{k + 1} = \frac{1 + \sqrt{1 + 4\theta_{k}^{2}}}{2}$ for $k = 0, 1, \ldots, K - 1$ , and $\theta_{K} = \frac{1 + \sqrt{1 + 8\theta_{K - 1}^{2}}}{2}$ . OGM improves upon the rate of FGM [44]. Interestingly, OGM also exhibits a similar geometric structure as depicted in Figure 1 (middle), and the auxiliary sequence, the $z_{k}$ -iterates, plays a similar role in the Lyapunov analysis [63]. + +Observation 2. In OGM, $x_{k}^{+} - x_{k}$ and $z_{k + 1} - z_{k}$ are parallel. + +We refer to this geometric structure as the parallel structure. Given an algorithm expressed with momentum and correction terms, one can define the $z_{k}$ -iterates to exhibit the parallel structure: + +$$ +x _ {k + 1} = x _ {k} ^ {+} + a _ {k + 1} (x _ {k} ^ {+} - x _ {k - 1} ^ {+}) + b _ {k + 1} (x _ {k} ^ {+} - x _ {k}) \quad \Longrightarrow \begin{array}{c} x _ {k} = c _ {k} x _ {k - 1} ^ {+} + (1 - c _ {k}) z _ {k} \\ z _ {k + 1} = z _ {k} - d _ {k} \nabla f (x _ {k}) \end{array} +$$ + +where $a_{k + 1}, b_{k + 1}, c_k,$ and $d_{k}$ satisfy an appropriate relationship as shown in Section B of the appendix. The $z_{k}$ -iterates of FGM and OGM have this form. The parallel structure also holds for Guler's accelerated methods [37] for the proximal-point setup and FISTA [11] for the prox-grad setup with analogous definitions of the $z_{k}$ -iterates. The table of Section A.1 of the appendix presents the precise forms. + +# 3.2 Parallel structure for OGM-G and FISTA-G + +We equivalently write (OGM-G) as + +$$ +x _ {k} = \frac {\theta_ {k + 1} ^ {4}}{\theta_ {k} ^ {4}} x _ {k - 1} ^ {+} + \left(1 - \frac {\theta_ {k + 1} ^ {4}}{\theta_ {k} ^ {4}}\right) z _ {k} +$$ + +$$ +z _ {k + 1} = z _ {k} - \frac {\theta_ {k}}{L} \nabla f (x _ {k}) \qquad \text {f o r} k = 1, 2, \dots , K, +$$ + +where $z_0 = x_0, z_1 = z_0 - \frac{\theta_0 + 1}{2L} \nabla f(x_0), \theta_{K+1} = 0$ , and $\theta_k = \frac{1 + \sqrt{1 + 4\theta_{k+1}^2}}{2}$ for $k = 1, 2, \ldots, K$ , and $\theta_0 = \frac{1 + \sqrt{1 + 8\theta_1^2}}{2}$ . The key point is that the auxiliary $z_k$ -sequence is defined to exhibit the parallel structure. As a comparison, [47, Equation (43)] provides a different auxiliary sequence for OGM-G that does not exhibit the parallel structure, but this sequence does not lead to a Lyapunov analysis. + +Here, we show how the Lyapunov function $U_{k}$ is obtained from the parallel structure of OGM-G. For $k \geq 1$ , combine the cocoercivity inequalities between $(x_{k + 1}, x_{k})$ and $(x_{k}, x_{K})$ to get + +$$ +\begin{array}{l} 0 \geq \frac {1}{\theta_ {k + 1} ^ {2}} \left(f (x _ {k + 1}) - f (x _ {k}) - \langle \nabla f (x _ {k + 1}), x _ {k + 1} - x _ {k} \rangle + \frac {1}{2 L} \| \nabla f (x _ {k + 1}) - \nabla f (x _ {k}) \| ^ {2}\right) \\ \left. + \left(\frac {1}{\theta_ {k + 1} ^ {2}} - \frac {1}{\theta_ {k} ^ {2}}\right) \left(f (x _ {k}) - f (x _ {K}) - \langle \nabla f (x _ {k}), x _ {k} - x _ {K} \rangle + \frac {1}{2 L} \| \nabla f (x _ {k}) - \nabla f (x _ {K}) \| ^ {2}\right) \right. \\ = \frac {1}{\theta_ {k + 1} ^ {2}} \left(\frac {1}{2 L} \| \nabla f (x _ {K}) \| ^ {2} + \frac {1}{2 L} \| \nabla f (x _ {k + 1}) \| ^ {2} + f (x _ {k + 1}) - f (x _ {K}) - \left\langle \nabla f (x _ {k + 1}), x _ {k + 1} - x _ {k} ^ {+} \right\rangle\right) \\ \left. - \frac {1}{\theta_ {k} ^ {2}} \left(\frac {1}{2 L} \| \nabla f (x _ {K}) \| ^ {2} + \frac {1}{2 L} \| \nabla f (x _ {k}) \| ^ {2} + f (x _ {k}) - f (x _ {K}) - \left\langle \nabla f (x _ {k}), x _ {k} - x _ {k - 1} ^ {+} \right\rangle\right) \right. \\ \underbrace {- \left\langle \nabla f (x _ {k}) , \theta_ {k + 1} ^ {- 2} x _ {k} ^ {+} - \theta_ {k} ^ {- 2} x _ {k - 1} ^ {+} - \left(\theta_ {k + 1} ^ {- 2} - \theta_ {k} ^ {- 2}\right) x _ {K} ^ {+} \right\rangle .} _ {:= T} \\ \end{array} +$$ + +With the following geometric arguments, we analyze the term $T$ and conclude $0 \geq U_{k+1} - U_k$ . Let $t \in \mathbb{R}^n$ be the (orthogonal) projection of $x_K^+$ onto the plane of iteration. For $u, v \in \mathbb{R}^n$ , define $\vec{u\upsilon} = v - u$ . Then + +$$ +\frac {1}{L} T \stackrel {\mathrm {(i)}} {=} \left\langle \overrightarrow {x _ {k} x _ {k} ^ {+}}, \left(\theta_ {k + 1} ^ {- 2} - \theta_ {k} ^ {- 2}\right) \overrightarrow {t x _ {k} ^ {+}} + \theta_ {k} ^ {- 2} \overrightarrow {x _ {k - 1} ^ {+} x _ {k} ^ {+}} \right\rangle +$$ + +$$ +\begin{array}{l} \stackrel {\mathrm {(i i)}} {=} \left\langle \overrightarrow {x _ {k} x _ {k} ^ {\uparrow}}, \left(\theta_ {k + 1} ^ {- 2} - \theta_ {k} ^ {- 2}\right) \left(\overrightarrow {t z _ {k + 1}} - \overrightarrow {z _ {k} z _ {k + 1}} - \overrightarrow {x _ {k} z _ {k}} + \overrightarrow {x _ {k} x _ {k} ^ {\uparrow}}\right) \right. \\ + \theta_ {k} ^ {- 2} (\overrightarrow {x _ {k - 1} ^ {+} x _ {k}} + \overrightarrow {x _ {k} x _ {k} ^ {+}}) \Bigg > \\ \end{array} +$$ + +$$ +\begin{array}{l} \stackrel {\mathrm {(i i i)}} {=} \left\langle \overrightarrow {x _ {k} x _ {k} ^ {+}}, \left(\theta_ {k + 1} ^ {- 2} - \theta_ {k} ^ {- 2}\right) \overrightarrow {t z _ {k + 1}} - \left(\theta_ {k + 1} ^ {- 2} - \theta_ {k} ^ {- 2}\right) \left(\theta_ {k} - 1\right) \overrightarrow {x _ {k} x _ {k} ^ {+}} \right. \\ \left. - \left(\theta_ {k + 1} ^ {- 2} - \theta_ {k} ^ {- 2}\right) \overrightarrow {x _ {k} z _ {k}} + (2 \theta_ {k} - 1) \theta_ {k + 1} ^ {- 4} \overrightarrow {x _ {k} z _ {k}} + \theta_ {k} ^ {- 2} \overrightarrow {x _ {k} x _ {k} ^ {\frac {1}{2}}} \right\rangle \\ \end{array} +$$ + +$$ +\begin{array}{l} \stackrel {\text {(i v)}} {=} \left\langle \overrightarrow {x _ {k} x _ {k} ^ {+}}, \left(\theta_ {k + 1} ^ {- 2} - \theta_ {k} ^ {- 2}\right) \overrightarrow {t z _ {k + 1}} + \theta_ {k + 1} ^ {- 2} \left(\theta_ {k} - 1\right) ^ {- 1} \overrightarrow {x _ {k} z _ {k}} \right\rangle \\ \stackrel {(\mathrm {v})} {=} \theta_ {k + 1} ^ {- 4} \left\langle \overrightarrow {x _ {k} ^ {+} z _ {k + 1}} - \overrightarrow {x _ {k} z _ {k}}, \overrightarrow {t z _ {k + 1}} \right\rangle + \theta_ {k + 1} ^ {- 4} \left\langle \overrightarrow {t z _ {k + 1}} - \overrightarrow {t z _ {k}}, \overrightarrow {x _ {k} z _ {k}} \right\rangle \\ \stackrel {\mathrm {(v i)}} {=} \theta_ {k + 1} ^ {- 4} \left\langle z _ {k + 1} - x _ {k} ^ {+}, z _ {k + 1} - x _ {K} ^ {+} \right\rangle - \theta_ {k} ^ {- 4} \left\langle z _ {k} - x _ {k - 1} ^ {+}, z _ {k} - x _ {K} ^ {+} \right\rangle , \\ \end{array} +$$ + +where (i) follows from the definition of $t$ and the fact that we can replace $x_{K}^{+}$ with $t$ , the projection of $x_{K}$ onto the plane of iteration, without affecting the inner products, (ii) from vector addition, + +![](images/f03429fc1dc9f732a35b97d8bc5ee799789d370e446158f22153814e6a3fbd81.jpg) + +(iii) from the fact that $\overrightarrow{z_k z_{k+1}}$ and $\overrightarrow{x_k x_k^+}$ are parallel and their lengths satisfy $\overrightarrow{z_k z_{k+1}} = \theta_k \overrightarrow{x_k x_k^+}$ and $\overrightarrow{x_{k-1}x_k}$ and $\overrightarrow{x_k z_k}$ are parallel and their lengths satisfy $\overrightarrow{x_{k-1}x_k} = \frac{\theta_k^2(2\theta_k - 1)}{\theta_{k+1}^4} \overrightarrow{x_k z_k}$ , (iv) from the identity $(\theta_{k+1}^{-2} - \theta_k^{-2})(\theta_k - 1) = \theta_k^{-2}$ and $(2\theta_k - 1)\theta_{k+1}^{-4} - (\theta_{k+1}^{-2} - \theta_k^{-2}) = \theta_{k+1}^{-2}(\theta_k - 1)^{-1}$ , (v) from distributing the product and substituting $\overrightarrow{x_k x_k^+} = (\theta_k - 1)^{-1}(\overrightarrow{x_k z_k + x_{k+1}} - \overrightarrow{x_k z_k})$ (which follows from $\overrightarrow{x_k x_k^+} = \overrightarrow{x_k z_k} + \overrightarrow{z_k z_{k+1}} - \overrightarrow{x_k^+ z_{k+1}} = \overrightarrow{x_k z_k} + \theta_k \overrightarrow{x_k x_k^+} - \overrightarrow{x_k^+ z_{k+1}}$ into the first term and $\overrightarrow{x_k x_k^+} = \theta_k^{-1} \overrightarrow{z_k z_{k+1}} = \theta_k^{-1}(\overrightarrow{t z_{k+1}} - \overrightarrow{t z_k})$ into the second term, and the identity $(\theta_{k+1}^{-2} - \theta_k^{-2})(\theta_k - 1)^{-1} = \theta_{k+1}^{-2}(\theta_k - 1)^{-1}\theta_k^{-1} = \theta_{k+1}^{-4}$ , and (vi) from cancelling out the cross terms, using $\theta_k^{-4} x_{k-1}^{+} z_k = \theta_{k+1}^{-4} x_{k} z_k$ , and by replacing $t$ with $x_K^+$ in the inner products. At this point, the proof is essentially done. The remaining few details of the analysis of OGM-G are presented in Section C of the appendix. + +This geometric reasoning naturally extends to the prox-grad setup. Using analogous Lyapunov functions and proof structure, we obtain convergence rates of FISTA-G and the other generalizations presented in Section 3.3. Figure 1 (right) illustrates the parallel structure of FISTA-G with the $z_{k}$ -iterates defined as in Section A.2 of the appendix. + +# 3.3 Other generalizations + +Using the parallel structure, we find several novel variants of accelerated first-order methods: + +G-FISTA-G, G-FGM-G, and G-Guler-G. We discuss them in detail in Sections A.2, E, and F of the appendix. Here, we briefly highlight the two special cases that we found most interesting. + +We present (FGM-G) for the smooth convex setup: + +$$ +x _ {k + 1} = x _ {k} ^ {+} + \frac {\varphi_ {k + 1} - \varphi_ {k + 2}}{\varphi_ {k} - \varphi_ {k + 1}} \left(x _ {k} ^ {+} - x _ {k - 1} ^ {+}\right) \quad \text {f o r} k = 0, 1, \dots , K - 1, +$$ + +where $x_{-1}^{+} = x_{0}$ and $\{\varphi_k\}_{k = 0}^{K + 1}$ is the same as the $\{\varphi_k\}_{k = 0}^{K + 1}$ of FISTA-G. We can view FGM-G as a special case of FISTA-G with $g = 0$ or as a special case of G-FGM-G. In any case, FGM-G's final iterate $x_{K}$ exhibits the rate + +$$ +\left\| \nabla f \left(x _ {K}\right) \right\| ^ {2} \leq \frac {6 6 L}{(K + 2) ^ {2}} \left(f \left(x _ {0}\right) - f _ {\star}\right). +$$ + +OGM-G uses the "correction term" $\frac{2\theta_{k+1}-1}{2\theta_k-1}(x_k^+ - x_k)$ and the "first-step modification", i.e., $\theta_0$ is defined separately from $\{\theta_k\}_{k=1}^{K-1}$ . FGM-G demonstrates that these features are not necessary for achieving the accelerated $\mathcal{O}((f(x_0) - f_\star) / K^2)$ rate. However, the simplification does come at the cost of a worse constant. + +We present (Güler-G) for the proximal-point setup: + +$$ +x _ {k} = \frac {\theta_ {k + 1} ^ {4}}{\theta_ {k} ^ {4}} x _ {k - 1} ^ {\circ} + \left(1 - \frac {\theta_ {k + 1} ^ {4}}{\theta_ {k} ^ {4}}\right) z _ {k} +$$ + +$$ +z _ {k + 1} = z _ {k} - \theta_ {k} \tilde {\nabla} _ {1 / \lambda} g (x _ {k}) \qquad \text {f o r} k = 0, 1, \ldots , K, +$$ + +where $z_0 = x_0, \theta_{K + 1} = 0$ , and $\theta_k = \frac{1 + \sqrt{1 + 4\theta_{k + 1}^2}}{2}$ for $k = 0, 1, \ldots, K$ . + +Theorem 2. Consider (P) with $f = 0$ . Güler-G's final iterate $x_{K}$ exhibits the rate + +$$ +\left\| \tilde {\nabla} _ {1 / \lambda} g (x _ {K}) \right\| ^ {2} \leq \frac {4}{\lambda (K + 2) ^ {2}} (g (x _ {0}) - g _ {\star}). +$$ + +Furthermore assume $g$ has a minimizer $x_{\star}$ and define the method Guler+Guler-G as: from a starting point $x_0$ run $K$ iterations of Guler second method [37] and then from the output start Guler-G and run $K$ iterations. Then the final iterate $x_{2K}$ exhibits the rate + +$$ +\left\| \tilde {\nabla} _ {1 / \lambda} g (x _ {2 K}) \right\| ^ {2} \leq \frac {4}{\lambda^ {2} (K + 2) ^ {4}} \| x _ {0} - x _ {\star} \| ^ {2}. +$$ + +# 4 Collinear structure for the strongly convex setup + +In this section, we present the collinear structure, a geometric structure observed in a wide range of accelerated first-order methods for the strongly convex setup. We then utilize this structure to obtain novel variants of accelerated first-order methods. We specifically consider two strongly convex setups: $f$ is $L$ -smooth and $\mu$ -strongly convex and $g = 0$ in Section 4.1, while $f = 0$ and $g$ is $\mu$ -strongly convex in Section 4.3. + +# 4.1 Collinear structure + +Nesterov's (SC-FGM) [60] has the form: + +$$ +x _ {k + 1} = x _ {k} ^ {+} + \frac {\sqrt {\kappa} - 1}{\sqrt {\kappa} + 1} \left(x _ {k} ^ {+} - x _ {k - 1} ^ {+}\right) +$$ + +$$ +z _ {k + 1} = x _ {k + 1} + \sqrt {\kappa} \left(x _ {k + 1} - x _ {k} ^ {+}\right) \quad \text {f o r} k = 0, 1, \dots , +$$ + +where $\kappa = \frac{L}{\mu}$ and $x_{-1}^{+} \coloneqq x_{0}$ . Again, the auxiliary $z_{k}$ -iterates reveal the geometric structure and play a key role in the Lyapunov analysis [9, §5.5]. Figure 2 (left) depicts $x_{k-1}^{+}$ , $x_{k}$ , $x_{k}^{+}$ , $x_{k}^{++}$ , $x_{k+1}$ , $z_{k}$ , and $z_{k+1}$ . These points in $\mathbb{R}^n$ lie on a 2D-plane, which we again call the plane of iteration. Note that $z_{k}$ , $z_{k+1}$ , and $x_{k}^{++}$ are collinear, i.e., there is a line in $\mathbb{R}^n$ intersecting the three points. (We prove observations 3 and 4 in Section B of the appendix.) + +Observation 3. In SC-FGM, $z_{k}, z_{k + 1}$ , and $x_{k}^{++}$ are collinear3. + +![](images/5b4abfc9c13eb290033e127767387afde3d76ab73f3c5ee2b59fd15e143ff6a4.jpg) +Figure 2: Plane of iteration of SC-FGM (left), TMM (middle), and Proximal-TMM (right) + +![](images/594cbb31ac9c0d914b40d0012c98cae6c1638e41e88e6c96b558e0b6b83c8680.jpg) + +![](images/520a89c2cfba773a0f4e0104087a246d00e658b6869d7f6993625b9a0c548fe7.jpg) + +Van Scoy, Freeman, and Lynch's (TMM) [78], which improves upon SC-FGM, has the form: + +$$ +x _ {k + 1} = x _ {k} ^ {+} + \frac {(\sqrt {\kappa} - 1) ^ {2}}{\sqrt {\kappa} (\sqrt {\kappa} + 1)} (x _ {k} ^ {+} - x _ {k - 1} ^ {+}) + \frac {\sqrt {\kappa} - 1}{\sqrt {\kappa}} (x _ {k} ^ {+} - x _ {k}) +$$ + +$$ +z _ {k + 1} = x _ {k + 1} + \frac {\sqrt {\kappa} - 1}{2} \left(x _ {k + 1} - x _ {k} ^ {+}\right) \quad \text {f o r} k = 0, 1, \dots , +$$ + +where $x_{-1}^{+} \coloneqq x_{0}$ and $\kappa = \frac{L}{\mu}$ . TMM also exhibits a similar geometric structure as depicted in Figure 2 (middle), and the $z_{k}$ -iterates play a similar role in the Lyapunov analysis [19, Theorem 4.19]. + +Observation 4. In TMM, $z_{k}, z_{k + 1}$ , and $x_{k}^{++}$ are collinear. + +We refer to this geometric structure as the collinear structure. Given an algorithm expressed with momentum and correction terms, one can define the $z_{k}$ -iterates to exhibit the collinear structure: + +$$ +x _ {k - 1} = x _ {k} ^ {+} \mid c _ {k} (x _ {k} ^ {+}, x _ {k} ^ {+}) \mid b _ {k} (x _ {k} ^ {+}, x _ {k}) \longrightarrow \quad x _ {k} = c _ {k} x _ {k - 1} ^ {+} + (1 - c _ {k}) z _ {k} +$$ + +$$ +z _ {k + 1} = d _ {k} x _ {k} ^ {+ +} + \left(1 - d _ {k}\right) z _ {k} +$$ + +where $a_{k}, b_{k}, c_{k}$ , and $d_{k}$ satisfy an appropriate relationship as shown in Section B of the appendix. The collinear structure also holds for non-stationary SC-FGM [19, §4.5], SC-OGM [63], ITEM [73], and geometric descent [13, 30]. The table of Section A.1 presents the precise forms. + +# 4.2 Collinear to parallel structure as $\mu \to 0$ + +We briefly discuss how the parallel structure arises as the limit of the collinear structure as $\mu \to 0$ . When $\mu = 0$ , the collinear structure is undefined, as $x_{k}^{+ + } = x_{k} - (1 / \mu)\nabla f(x_{k})$ is undefined. In the limit $\mu \to 0$ , however, $x_{k}^{+ + }$ diverges to a point of infinity in the plane of iteration, and the collinear structure becomes the parallel structure since $z_{k}, z_{k + 1}$ , and $x_{k}^{+ + }$ are collinear and $x_{k}, x_{k}^{+}$ , and $x_{k}^{+ + }$ are collinear. + +There are two possible scenarios. In the first degenerate case, $z_{k}$ and $z_{k + 1}$ diverges to infinity. This is the case with SC-FGM, SC-OGM, and TMM. In the second scenario, $z_{k}$ and $z_{k + 1}$ stay bounded and $x_{k}^{+} - x_{k}$ and $z_{k + 1} - z_{k}$ become parallel. This is the case with non-stationary $^{4}$ SC-FGM and ITEM, which respectively converge to FGM and OGM. + +![](images/e63230944f655be8e1633f8af007801299da9ec17bb43c28c1a4d193f1d992be.jpg) +Figure 3: Collinear to parallel structure as $\mu \rightarrow 0$ (ITEM (left) $\rightarrow$ OGM (right)) + +# 4.3 Other generalizations + +Using the collinear structure, we find two novel methods: Proximal-TMM and Proximal-ITEM. These methods can be viewed as proximal versions of TMM [78] and ITEM [73], and they improve upon the accelerated proximal point method [19, 10]. We provide the proofs in Section G. + +We present (Proximal-TMM) for the strongly convex proximal-point setup: + +$$ +x _ {k} = \frac {1 - \sqrt {q}}{1 + \sqrt {q}} x _ {k - 1} ^ {\circ} + \left(1 - \frac {1 - \sqrt {q}}{1 + \sqrt {q}}\right) z _ {k} +$$ + +$$ +z _ {k + 1} = \sqrt {q} x _ {k} ^ {\circ \circ} + (1 - \sqrt {q}) z _ {k} \quad \text {f o r} k = 0, 1, \dots , +$$ + +where $q = \frac{\lambda\mu}{\lambda\mu + 1}$ , $x_{k}^{\circ \circ} = x_{k} - \left(\lambda +\frac{1}{\mu}\right)\tilde{\nabla}_{1 / \lambda}g(x_{k})$ , and $x_{-1}^{\circ} = x_{0} = z_{0}$ . + +Theorem 3. Consider (P). Assume $g$ is $\mu$ -strongly convex, $g$ has a minimizer $x_{\star}$ , and $f = 0$ . Proximal-TMM's $z_{k}$ -iterates exhibit the rate + +$$ +\left\| z _ {k} - x _ {\star} \right\| ^ {2} \leq \frac {2}{\mu} (1 - \sqrt {q}) ^ {2 k} (g (x _ {0}) - g (x _ {\star})). +$$ + +We present (Proximal-ITEM) for the strongly convex proximal-point setup: + +$$ +x _ {k} = \gamma_ {k} x _ {k - 1} ^ {\circ} + (1 - \gamma_ {k}) z _ {k} +$$ + +$$ +z _ {k + 1} = q \delta_ {k} x _ {k} ^ {\circ \circ} + (1 - q \delta_ {k}) z _ {k} \quad \text {f o r} k = 0, 1, \dots , +$$ + +where $q = \frac{\lambda\mu}{\lambda\mu + 1}$ , $x_{k}^{\circ \circ} = x_{k} - \left(\lambda +\frac{1}{\mu}\right)\tilde{\nabla}_{1 / \lambda}g(x_{k})$ , $x_{-1}^{\circ} = x_{0} = z_{0}$ , $A_0 = 0$ , $A_{k + 1} = \frac{(1 + q)A_k + 2\left(1 + \sqrt{(1 + A_k)(1 + qA_k)}\right)}{(1 - q)^2}$ , $\gamma_{k} = \frac{A_{k}}{(1 - q)A_{k + 1}}$ , and $\delta_{k} = \frac{(1 - q)^{2}A_{k + 1} - (1 + q)A_{k}}{2(1 + q + qA_{k})}$ for $k = 0,1,\ldots$ + +Theorem 4. Consider (P). Assume $g$ is $\mu$ -strongly convex, $g$ has a minimizer $x_{\star}$ , and $f = 0$ . Proximal-ITEM's $z_{k}$ -iterates exhibit the rate + +$$ +\left\| z _ {k} - x _ {\star} \right\| ^ {2} \leq \frac {(1 - \sqrt {q}) ^ {2 k}}{(1 - \sqrt {q}) ^ {2 k} + q} \left\| z _ {0} - x _ {\star} \right\| ^ {2}. +$$ + +# 5 Experiments + +We consider the compressed sensing [25, 15, 14] problems + +$$ +\underset {x \in \mathbb {R} ^ {n}} {\text {m i n i m i z e}} \| A x - b \| ^ {2} + \lambda \| x \| _ {1}, \quad \underset {x \in \mathbb {R} ^ {n}} {\text {m i n i m i z e}} \| A x - b \| ^ {2} + \lambda \| x \| _ {\text {n u c}}, +$$ + +where $\lambda > 0$ , $\| \cdot \|_1$ is the $\ell_1$ -norm, $\| \cdot \|_{\mathrm{nuc}}$ is the nuclear norm, and the data $A \in \mathbb{R}^{m \times n}$ and $b \in \mathbb{R}^m$ are generated synthetically. We describe the data generation in Section I of the appendix. Figure 4 presents the comparison of ISTA, FISTA, FPGM-m, FISTA, FISTA-G, and FISTA+FISTA-G. The results indicate that FISTA+FISTA-G is indeed the most effective at reducing the gradient magnitude. + +![](images/3c923682cffa4a95d45796c0eddb03eedf7b3e20d0921013044a329dbb84e68f.jpg) +Figure 4: Minimizing the gradient magnitude for compressed sensing problems with $\ell_1$ regularizer (left) and nuclear norm regularizer (right). + +![](images/a20844c51ed57c69683d794dd5519f29e06675e2db431f984f8e970ee63b9e28.jpg) + +# 6 Conclusion + +In this work, we identified geometric structures of accelerated first-order methods and utilized them to find novel variants. Specifically, we found that appropriate auxiliary $z_{k}$ -iterates reveal parallel and collinear structures and that these iterates are crucial for the Lyapunov analyses. Among the new methods, we highlight FISTA-G, which, combined with FISTA, achieves a $\mathcal{O}\left(\| x_0 - x_\star \|^2 / K^4\right)$ rate on the squared gradient norm in the prox-grad setup. + +FISTA-G and FISTA+FISTA-G have last-iterate rates, i.e., the bound is on $\|\tilde{\nabla}_L F(x_K)\|^2$ rather than $\min_{k=0,\dots,K} \|\tilde{\nabla}_L F(x_k)\|^2$ , but are not anytime algorithms, i.e., the total iteration count $K$ must be known in advance and intermediate iterates have no guarantees. In contrast, the FGM achieves acceleration on function-value suboptimality with a last-iterate rate as an anytime algorithm. Interestingly, all known algorithms for the smooth convex setup or the prox-grad setup with rate $\mathcal{O}\left(\|x_0 - x_\star\|^2 / K^3\right)$ or better do not have this property. For example, OGM+OGM-G is not an anytime algorithm but has a last-iterate bound, while FGM is an anytime algorithm with a best-iterate, not a last-iterate, bound. In the prox-grad setup, FPGM-m [45] is not an anytime algorithm but has a last-iterate rate. Whether an anytime algorithm can achieve a last-iterate rate of $\mathcal{O}\left(\|x_0 - x_\star\|^2 / K^3\right)$ or better is an open problem. On a related note, Diakonikolas and Wang conjecture that a $\mathcal{O}\left((f(x_0) - f_\star) / K^2\right)$ rate is impossible to achieve with an anytime algorithm in the smooth convex setup [24, Conjecture 1]. + +# Acknowledgments and Disclosure of Funding + +JL and EKR were supported by the National Research Foundation of Korea (NRF) Grant funded by the Korean Government (MSIP) [No. 2020R1F1A1A01072877], the National Research Foundation of Korea (NRF) Grant funded by the Korean Government (MSIP) [No. 2017R1A5A1015626], and by the Samsung Science and Technology Foundation (Project Number SSTF-BA2101-02). CP was supported by an undergraduate research internship in the first half of the 2021 Seoul National University College of Natural Sciences. We thank Jaewook Suh, Jisun Park, and TaeHo Yoon for providing valuable feedback. We also thank anonymous reviewers for giving thoughtful comments. + +# References + +[1] K. Ahn and S. Sra. From Nesterov's estimate sequence to Riemannian acceleration. $COLT$ , 2020. +[2] Z. Allen-Zhu. How to make the gradients small stochastically: Even faster convex and nonconvex SGD. NeurIPS, 2018. +[3] Z. Allen-Zhu and Y. Li. NEON2: Finding local minima via first-order oracles. NeurIPS, 2018. +[4] Z. Allen-Zhu and L. Orecchia. Linear coupling: An ultimate unification of gradient and mirror descent. *ITCS*, 2017. +[5] Z. Allen-Zhu, Z. Qu, P. Richtárik, and Y. Yuan. Even faster accelerated coordinate descent using non-uniform sampling. ICML, 2016. +[6] J.-F. Aujol and C. Dossal. Optimal rate of convergence of an ODE associated to the fast gradient descent schemes for $b > 0$ . HAL Archives Ouvertes, 2017. +[7] J.-F. Aujol, C. Dossal, G. Fort, and É. Moulines. Rates of convergence of perturbed FISTA-based algorithms. HAL Archives Ouvertes, 2019. +[8] J.-F. Aujol, C. Dossal, and A. Rondepierre. Optimal convergence rates for Nesterov acceleration. SIAM Journal on Optimization, 29(4):3131-3153, 2019. +[9] N. Bansal and A. Gupta. Potential-function proofs for gradient methods. Theory of Computing, 15(4):1-32, 2019. +[10] M. Barre, A. Taylor, and F. Bach. Principled analyses and design of first-order methods with inexact proximal operators. arXiv preprint arXiv:2006.06041, 2020. +[11] A. Beck and M. Teboulle. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM Journal on Imaging Sciences, 2(1):183-202, 2009. +[12] R. E. Bruck. On the weak convergence of an ergodic iteration for the solution of variational inequalities for monotone operators in Hilbert space. Journal of Mathematical Analysis and Applications, 61(1):159-164, 1977. +[13] S. Bubeck. Convex optimization: Algorithms and complexity. Foundations and Trends® in Machine Learning, 8(3-4):231-357, 2015. +[14] E. J. Candès, J. Romberg, and T. Tao. Robust uncertainty principles: Exact signal reconstruction from highly incomplete frequency information. IEEE Transactions on Information Theory, 52(2):489-509, 2006. +[15] E. J. Candès and T. Tao. Near-optimal signal recovery from random projections: Universal encoding strategies? IEEE Transactions on Information Theory, 52(12):5406-5425, 2006. +[16] S. Chen, S. Ma, and W. Liu. Geometric descent method for convex composite minimization. NeurIPS, 2017. +[17] P. L. Combettes and J.-C. Pesquet. Proximal splitting methods in signal processing. In H. H. Bauschke, R. S. Burachik, P. L. Combettes, V. Elser, D. R. Luke, and H. Wolkowicz, editors, Fixed-Point Algorithms for Inverse Problems in Science and Engineering, pages 185–212. 2011. +[18] P. L. Combettes and V. R. Wajs. Signal recovery by proximal forward-backward splitting. Multiscale Modeling and Simulation, 4(4):1168-1200, 2005. +[19] A. d'Aspremont, D. Scieur, and A. Taylor. Acceleration methods. arXiv preprint arXiv:2101.09545, 2021. +[20] I. Daubechies, M. Defrise, and C. De Mol. An iterative thresholding algorithm for linear inverse problems with a sparsity constraint. Communications on Pure and Applied Mathematics, 57(11):1413-1457, 2004. + +[21] E. De Klerk, F. Glineur, and A. B. Taylor. Worst-case convergence analysis of inexact gradient andNewton methods through semidefinite programming performance estimation.SIAM Journal on Optimization, 30(3):2053-2082, 2020. +[22] J. Diakonikolas. Halpern iteration for near-optimal and parameter-free monotone inclusion and strong solutions to variational inequalities. $COLT$ , 2020. +[23] J. Diakonikolas and C. Guzmán. Complementary composite minimization, small gradients in general norms, and applications to regression problems. arXiv preprint arXiv:2101.11041, 2021. +[24] J. Diakonikolas and P. Wang. Potential function-based framework for making the gradients small in convex and min-max optimization. arXiv preprint arXiv:2101.12101, 2021. +[25] D. L. Donoho. Compressed sensing. IEEE Transactions on Information Theory, 52(4):1289-1306, 2006. +[26] R.-A. Dragomir, A. B. Taylor, A. d'Aspremont, and J. Bolte. Optimal complexity and certification of Bregman first-order methods. Mathematical Programming, 2021. +[27] Y. Drori. The exact information-based complexity of smooth convex minimization. Journal of Complexity, 39:1-16, 2017. +[28] Y. Drori and A. Taylor. On the oracle complexity of smooth strongly convex minimization. arXiv preprint arXiv:2101.09740, 2021. +[29] Y. Drori and M. Teboulle. Performance of first-order methods for smooth convex minimization: a novel approach. Mathematical Programming, 145(1):451-482, 2014. +[30] D. Drusvyatskiy, M. Fazel, and S. Roy. An optimal first order method based on optimal quadratic averaging. SIAM Journal on Optimization, 28(1):251-271, 2018. +[31] M. Fazlyab, A. Ribeiro, M. Morari, and V. M. Preciado. Analysis of optimization algorithms via integral quadratic constraints: Nonstrongly convex problems. SIAM Journal on Optimization, 28(3):2654-2689, 2018. +[32] A. V. Gasnikov and Y. E. Nesterov. Universal method for stochastic composite optimization problems. Computational Mathematics and Mathematical Physics, 58(1):48-64, 2018. +[33] R. Ge, F. Huang, C. Jin, and Y. Yuan. Escaping from saddle points — online stochastic gradient for tensor decomposition. *COLT*, 2015. +[34] S. Ghadimi and G. Lan. Accelerated gradient methods for nonconvex nonlinear and stochastic programming. Mathematical Programming, 156(1-2):59-99, 2016. +[35] N. Golowich, S. Pattathil, C. Daskalakis, and A. Ozdaglar. Last iterate is slower than averaged iterate in smooth convex-concave saddle point problems. $COLT$ , 2020. +[36] G. Gu and J. Yang. Tight sublinear convergence rate of the proximal point algorithm for maximal monotone inclusion problems. SIAM Journal on Optimization, 30(3):1905-1921, 2020. +[37] O. Güler. New proximal point algorithms for convex minimization. SIAM Journal on Optimization, 2(4):649-664, 1992. +[38] B. Hu and L. Lessard. Dissipativity theory for Nesterov's accelerated method. ICML, 2017. +[39] W. Huang and K. Wei. Riemannian proximal gradient methods. Mathematical Programming, 2021. +[40] X. Huang, E. K. Ryu, and W. Yin. Scaled relative graph of normal matrices. arXiv preprint arXiv:2001.02061, 2019. +[41] X. Huang, E. K. Ryu, and W. Yin. Tight coefficients of averaged operators via scaled relative graph. Journal of Mathematical Analysis and Applications, 490(1):124211, 2020. + +[42] S. Karimi and S. Vavasis. A single potential governing convergence of conjugate gradient, accelerated gradient and geometric descent. arXiv preprint arXiv:1712.09498, 2017. +[43] D. Kim. Accelerated proximal point method for maximally monotone operators. Mathematical Programming, 2021. +[44] D. Kim and J. A. Fessler. Optimized first-order methods for smooth convex minimization. Mathematical Programming, 159(1):81-107, 2016. +[45] D. Kim and J. A. Fessler. Another look at the fast iterative shrinkage/thresholding algorithm (FISTA). SIAM Journal on Optimization, 28(1):223-250, 2018. +[46] D. Kim and J. A. Fessler. Generalizing the optimized gradient method for smooth convex minimization. SIAM Journal on Optimization, 28(2):1920-1950, 2018. +[47] D. Kim and J. A. Fessler. Optimizing the efficiency of first-order methods for decreasing the gradient of smooth convex functions. Journal of Optimization Theory and Applications, 188(1):192-219, 2021. +[48] L. Lessard, B. Recht, and A. Packard. Analysis and design of optimization algorithms via integral quadratic constraints. SIAM Journal on Optimization, 26(1):57-95, 2016. +[49] H. Li and Z. Lin. Accelerated proximal gradient methods for nonconvex programming. NeurIPS, 2015. +[50] F. Lieder. On the convergence rate of the Halpern-iteration. Optimization Letters, 15(2):405–418, 2021. +[51] Q. Lin, Z. Lu, and L. Xiao. An accelerated proximal coordinate gradient method. NeurIPS, 2014. +[52] J. J. Moreau. Fonctions convexes duales et points proximaux dans un espace hilbertien. Comptes rendus hebdomadaires des séances de l'Académie des sciences, 255:2897-2899, 1962. +[53] J.-J. Moreau. Proximate et dualité dans un espace hilbertien. Bulletin de la Société mathématique de France, 93:273-299, 1965. +[54] A. S. Nemirovski. Optimization II: Numerical methods for nonlinear continuous optimization. lecture note, 1999. +[55] A. S. Nemirovsky. On optimality of Krylov's information when solving linear operator equations. Journal of Complexity, 7(2):121-130, 1991. +[56] A. S. Nemirovsky. Information-based complexity of linear operator equations. Journal of Complexity, 8(2):153-175, 1992. +[57] Y. Nesterov. A method for unconstrained convex minimization problem with the rate of convergence $\mathcal{O}(1 / k^2)$ . Proceedings of the USSR Academy of Sciences, 269:543-547, 1983. +[58] Y. Nesterov. How to make the gradients small. Optima. Mathematical Optimization Society Newsletter, (88):10-11, 2012. +[59] Y. Nesterov. Gradient methods for minimizing composite functions. Mathematical Programming, 140(1):125-161, 2013. +[60] Y. Nesterov. Lectures on Convex Optimization. 2nd edition, 2018. +[61] Y. Nesterov, A. Gasnikov, S. Guminov, and P. Dvurechensky. Primal-dual accelerated gradient methods with small-dimensional relaxation oracle. Optimization Methods and Software, pages 1-38, 2020. +[62] N. Parikh and S. Boyd. Proximal algorithms. Foundations and Trends in Optimization, 1(3):127-239, 2014. +[63] C. Park, J. Park, and E. K. Ryu. Factor- $\sqrt{2}$ acceleration of accelerated gradient methods. arXiv preprint arXiv:2102.07366, 2021. + +[64] G. B. Passty. Ergodic convergence to a zero of the sum of monotone operators in Hilbert space. Journal of Mathematical Analysis and Applications, 72(2):383-390, 1979. +[65] R. T. Rockafellar. Convex Analysis. 1970. +[66] E. K. Ryu, R. Hannah, and W. Yin. Scaled relative graph: Nonexpansive operators via 2d euclidean geometry. Mathematical Programming, 2021. +[67] E. K. Ryu, A. B. Taylor, C. Bergeling, and P. Giselsson. Operator splitting performance estimation: Tight contraction factors and optimal parameter selection. SIAM Journal on Optimization, 30(3):2251-2271, 2020. +[68] E. K. Ryu and W. Yin. Large-Scale Convex Optimization via Monotone Operators. Draft, 2021. +[69] B. Shi, S. S. Du, M. I. Jordan, and W. J. Su. Understanding the acceleration phenomenon via high-resolution differential equations. Mathematical Programming, 2021. +[70] W. Su, S. Boyd, and E. Candes. A differential equation for modeling Nesterov's accelerated gradient method: Theory and insights. NeurIPS, 2014. +[71] A. B. Taylor. Convex interpolation and performance estimation of first-order methods for convex optimization. PhD thesis, Catholic University of Louvain, Louvain-la-Neuve, Belgium, 2017. +[72] A. B. Taylor and F. Bach. Stochastic first-order methods: non-asymptotic and computer-aided analyses via potential functions. $COLT$ , 2019. +[73] A. B. Taylor and Y. Drori. An optimal gradient method for smooth (possibly strongly) convex minimization. arXiv preprint arXiv:2101.09741, 2021. +[74] A. B. Taylor, J. M. Hendrickx, and F. Glineur. Exact worst-case performance of first-order methods for composite convex optimization. SIAM Journal on Optimization, 27(3):1283-1313, 2017. +[75] A. B. Taylor, J. M. Hendrickx, and F. Glineur. Smooth strongly convex interpolation and exact worst-case performance of first-order methods. Mathematical Programming, 161(1-2):307-345, 2017. +[76] A. B. Taylor, J. M. Hendrickx, and F. Glineur. Exact worst-case convergence rates of the proximal gradient method for composite convex minimization. Journal of Optimization Theory and Applications, 178(2):455-476, 2018. +[77] P. Tseng. On accelerated proximal gradient methods for convex-concave optimization. submitted to SIAM Journal on Optimization, 2008. +[78] B. Van Scoy, R. A. Freeman, and K. M. Lynch. The fastest known globally convergent first-order method for minimizing strongly convex functions. IEEE Control Systems Letters, 2(1):49-54, 2017. +[79] Y. Xu, R. Jin, and T. Yang. First-order stochastic algorithms for escaping from saddle points in almost linear time. NeurIPS, 2018. +[80] T. Yoon and E. K. Ryu. Accelerated algorithms for smooth convex-concave minimax problems with $\mathcal{O}(1 / k^2)$ rate on squared gradient norm. ICML, 2021. \ No newline at end of file diff --git a/ageometricstructureofaccelerationanditsroleinmakinggradientssmallfast/images.zip b/ageometricstructureofaccelerationanditsroleinmakinggradientssmallfast/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..c1afe3e2adc4347df81a597d3718c757ce098a9c --- /dev/null +++ b/ageometricstructureofaccelerationanditsroleinmakinggradientssmallfast/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1855ba09b55f3656079b9cdc16f5a393e4ce43cbb31b3092b098e95d1661f77f +size 515875 diff --git a/ageometricstructureofaccelerationanditsroleinmakinggradientssmallfast/layout.json b/ageometricstructureofaccelerationanditsroleinmakinggradientssmallfast/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..f1636d8621f63386d0a9d8b110636b13c33b690a --- /dev/null +++ b/ageometricstructureofaccelerationanditsroleinmakinggradientssmallfast/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5288ece6f875b601594e661505da4cbb949f0c933eb5fb5dfd34db68ef575236 +size 652563 diff --git a/agradientmethodformultileveloptimization/86e64e8b-fc87-4050-bf54-12f45a27d70e_content_list.json b/agradientmethodformultileveloptimization/86e64e8b-fc87-4050-bf54-12f45a27d70e_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..2c06d31f368c5dd5d0d2d812cfeea3199f8a7145 --- /dev/null +++ b/agradientmethodformultileveloptimization/86e64e8b-fc87-4050-bf54-12f45a27d70e_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:75b769ce989af767e0c25870ac9f6d8f26a394f16adc34db3acea66b832b81bb +size 75842 diff --git a/agradientmethodformultileveloptimization/86e64e8b-fc87-4050-bf54-12f45a27d70e_model.json b/agradientmethodformultileveloptimization/86e64e8b-fc87-4050-bf54-12f45a27d70e_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b2e3bce4798aeb8913b88de9a034d3a8a4a0a418 --- /dev/null +++ b/agradientmethodformultileveloptimization/86e64e8b-fc87-4050-bf54-12f45a27d70e_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c96abd7ed168b52f8140e43968283b0d33c1bdcf5c0050e4717643e4af035bd0 +size 95135 diff --git a/agradientmethodformultileveloptimization/86e64e8b-fc87-4050-bf54-12f45a27d70e_origin.pdf b/agradientmethodformultileveloptimization/86e64e8b-fc87-4050-bf54-12f45a27d70e_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..744ea88f49afece9d9f4b23eb7ac9d5388fcb2e5 --- /dev/null +++ b/agradientmethodformultileveloptimization/86e64e8b-fc87-4050-bf54-12f45a27d70e_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f2725445e7e45dfd7fbe700c8775005e382a037d6fb11c448541301a27f8af51 +size 731853 diff --git a/agradientmethodformultileveloptimization/full.md b/agradientmethodformultileveloptimization/full.md new file mode 100644 index 0000000000000000000000000000000000000000..1c42d0755909081d2902790ac3931db67a1123f7 --- /dev/null +++ b/agradientmethodformultileveloptimization/full.md @@ -0,0 +1,382 @@ +# A Gradient Method for Multilevel Optimization + +Ryo Sato + +The University of Tokyo + +Mirai Tanaka + +The Institute of Statistical Mathematics RIKEN + +Akiko Takeda + +The University of Tokyo RIKEN + +# Abstract + +Although application examples of multilevel optimization have already been discussed since the 1990s, the development of solution methods was almost limited to bilevel cases due to the difficulty of the problem. In recent years, in machine learning, Franceschi et al. have proposed a method for solving bilevel optimization problems by replacing their lower-level problems with the $T$ steepest descent update equations with some prechosen iteration number $T$ . In this paper, we have developed a gradient-based algorithm for multilevel optimization with $n$ levels based on their idea and proved that our reformulation asymptotically converges to the original multilevel problem. As far as we know, this is one of the first algorithms with some theoretical guarantee for multilevel optimization. Numerical experiments show that a trilevel hyperparameter learning model considering data poisoning produces more stable prediction results than an existing bilevel hyperparameter learning model in noisy data settings. + +# 1 Introduction + +Multilevel optimization When modeling real-world problems, there is often a hierarchy of decision-makers, and decisions are taken at different levels in the hierarchy. In this work, we consider multilevel optimization problems whose simplest form1 is the following: + +$$ +\begin{array}{l} \min _ {x _ {1} \in S _ {1} \subseteq \mathbb {R} ^ {d _ {1}}, x _ {2} ^ {*}, \ldots , x _ {n} ^ {*}} f _ {1} (x _ {1}, x _ {2} ^ {*}, \ldots , x _ {n} ^ {*}) \text {s . t .} \\ x _ {2} ^ {*} = \quad \operatorname {a r g m i n} \quad f _ {2} \left(x _ {1}, x _ {2}, x _ {3} ^ {*}, \dots , x _ {n} ^ {*}\right) \text {s . t .} \\ x _ {2} \in \mathbb {R} ^ {d _ {2}}, x _ {3} ^ {*}, \dots , x _ {n} ^ {*} \tag {1} \\ \end{array} +$$ + +中 + +$$ +x _ {n} ^ {*} = \operatorname * {a r g m i n} _ {x _ {n} \in \mathbb {R} ^ {d _ {n}}} f _ {n} (x _ {1}, x _ {2}, \ldots , x _ {n}), +$$ + +where $d_{i}$ is positive integers, $x_{i} \in \mathbb{R}^{d_{i}}$ is the decision variable at the $i$ th level, and $f_{i} \colon \mathbb{R}^{d_{i}} \to \mathbb{R}$ is the objective function of the $i$ th level for $i = 1, \dots, n$ . In the formulation, an optimization problem contains another optimization problem as a constraint. The framework can be used to formulate problems in which decisions are made in sequence and earlier decisions influence later decisions. An optimization problem in which this structure is $n$ -fold is called an $n$ -level optimization problem or a multilevel optimization problem especially when $n \geq 3$ . + +Existing study on bilevel optimization Especially, when $n = 2$ in (1), it is called a bilevel optimization problem. Bilevel optimization or multilevel optimization has been a well-known problem in the field of optimization since the 1980s or 1990s respectively (see the survey paper [24] for the research at that time), and their solution methods have been studied mainly on bilevel + +optimization until now. Recently, studies on bilevel optimization have received significant attention from the machine learning community due to practical applications and the development of efficient algorithms. For example, bilevel optimization was used to formulate decision-making problems for players in conflict [25, 22], and to formulate hyperparameter learning problems in machine learning [5, 11, 12]. Franceschi et al. [11] constructed a single-level problem that approximates a bilevel problem by replacing the lower-level problem with $T$ steepest descent update equations using a prechosen iteration number $T$ . It is shown that the optimization problem with $T$ steepest descent update equations asymptotically converges to the original bilevel problem as $T \to \infty$ . It is quite different from the ordinary approach (e.g., [1]) that transforms bilevel optimization problems into single-level problems using the optimality condition of the lower-level problem. The application of the steepest descent method to bilevel optimization problems has recently attracted attention, resulting in a stream of papers; e.g., [13, 20, 18]. + +Existing study on multilevel optimization Little research has been done on decision-making models (1) that assume the multilevel hierarchy, though various applications of multilevel optimization have been already discussed in the 1990s [24]. As far as we know, few solution methods with a theoretical guarantee have been proposed. A metaheuristic algorithm based on a perturbation, i.e., a solution method in which the neighborhood is randomly searched for a better solution in the order of $x_{1}$ to $x_{n}$ has been proposed in [23] for general $n$ -level optimization problems. The effect of updating $x_{i}$ on the decision variables $x_{i + 1},\ldots ,x_{n}$ of the lower-level problems is not considered, and hence, the hierarchical structure of the multilevel optimization problem cannot be fully utilized in updating the solution. Because of this, the algorithm does not have a theoretical guarantee for the obtained solution. Very recently (two days before the NeurIPS 2021 abstract deadline), a proximal gradient method based on the fixed-point theory for trilevel optimization problem [21] has been proposed. This paper has proved convergence to an optimal solution assuming the convexity of the objective functions. However, it does not include numerical results and hence its practical efficiency is unclear. + +Contribution of this paper In this paper, by extending the gradient method for bilevel optimization problems [11] to multilevel optimization problems, we propose an algorithm with a convergence guarantee for multilevel optimization other than one by [21]. Increasing the problem hierarchy from two to three drastically makes developing algorithms and showing theoretical guarantees difficult. In fact, as discussed above, in the case of bilevel, replacing the second-level optimization problem with its optimality condition or replacing it with $T$ steepest-descent sequential updates immediately results in a one-level optimization problem. However, when it comes to $n \geq 3$ levels, it may be necessary to perform this replacement $n$ times, and it seems not easy to construct a solution method with a convergence guarantee. It is not straightforward at all to give our method a theoretical guarantee similar to the one [11] developed for bilevel optimization. We have confirmed the effectiveness of the proposed method by applying it to hyperparameter learning with real data. Experimental verifications of the effectiveness of trilevel optimization using real-world problems are the first ones as far as we know. + +# 2 Related existing methods + +# 2.1 Two-stage robust optimization problems + +When making long-term decisions, it is also necessary to make many decisions according to the situation. If the same objective function is acceptable throughout the period, i.e., $f_{1} = \dots = f_{n}$ , and there are hostile players, such a problem is often formulated as a multistage robust optimization problem. Especially, the concept of two-stage robust optimization (so-called adjustable robust optimization) $\min_{x_1\in S_1}\max_{x_2\in S_2}\min_{x_3\in S_3}f_1(x_1,x_2,x_3)$ was introduced with feasible sets $S_{i}\subseteq \mathbb{R}^{d_{i}}$ for $i = 1,2,3$ , and methodology based on affine decision rules was developed by [4]. Researches based on affine policies are still being actively conducted; see, e.g., [6, 26]. The two-stage robust optimization can be considered as a special case of (1) with $n = 3$ when constraints $x_{2}\in S_{2}\subseteq \mathbb{R}^{d_{2}}$ and $x_{3}\in S_{3}\subseteq \mathbb{R}^{d_{3}}$ are added. This approach is unlikely to be applicable to our problem (1) without strong assumptions such as affine decision rules. + +There is another research stream on min-max-min problems including integer constraints (see e.g., [7, 25]). They transform the problem into the min-max problem by taking the dual for the inner "min" and apply cut-generating approaches or Benders decomposition techniques with the property of + +integer variables. While the approach is popular in the application studies of electric grid planning, it is restricted to the specific min-max-min problems and no more applicable to multilevel optimization problems (1). + +# 2.2 Existing methods for bilevel optimization problems + +Various applications are known for bilevel optimization problems, i.e., the case of $n = 2$ in (1): + +$$ +\min _ {x _ {1} \in S _ {1}} f _ {1} \left(x _ {1}, x _ {2}\right) \text {s . t .} x _ {2} = \underset {x _ {2} ^ {\prime}} {\operatorname {a r g m i n}} f _ {2} \left(x _ {1}, x _ {2} ^ {\prime}\right). \tag {2} +$$ + +One of the most well-known applications in machine learning is hyperparameter learning. For example, the problem that finds the best hyperparameter value in the ridge regression is formulated as + +$$ +\min _ {\lambda \geq 0} \| y _ {\text {v a l i d}} - X _ {\text {v a l i d}} \theta \| _ {2} ^ {2} \text {s . t .} \theta = \underset {\theta^ {\prime}} {\operatorname {a r g m i n}} \| y _ {\text {t r a i n}} - X _ {\text {t r a i n}} \theta^ {\prime} \| _ {2} ^ {2} + \lambda \| \theta^ {\prime} \| _ {2} ^ {2}, +$$ + +where $(X_{\mathrm{train}},y_{\mathrm{train}})$ are training samples, $(X_{\mathrm{valid}},y_{\mathrm{valid}})$ are validation samples, and $\lambda$ is a hyperparameter that is optimized in this problem. Under Assumption 1 restricted to $n = 2$ shown later, the existence of an optimal solution to the bilevel problem (2) is ensured by [12, Theorem 3.1]. + +There are mainly two approaches to solve bilevel optimization problems. The old practice is to replace the lower-level problem with its optimality condition and to solve the resulting single-level problem. It seems difficult to use this approach to multilevel problems because we need to apply the replacement $n$ -times. The other one is to use gradient-based methods developed by Franceschi et al. [11, 12] for bilevel optimization problems. Their approach reduces (2) to a single-level problem by replacing the lower-level problem with $T$ equations using a prechosen number $T$ . + +Hereinafter, we briefly summarize the results of Franceschi et al. [11, 12] for bilevel optimization. Under the continuous differentiability assumption for $f_{2}$ , $x_{2}$ is iteratively updated by $x_{2}^{(t)} = \Phi^{(t)}(x_{1}, x_{2}^{(t-1)})$ at the $t$ th iteration using an iterative method, e.g., the gradient descent method: + +$$ +\Phi^ {(t)} (x _ {1}, x _ {2} ^ {(t - 1)}) = x _ {2} ^ {(t - 1)} - \alpha^ {(t)} \nabla_ {x _ {2}} f _ {2} (x _ {1}, x _ {2} ^ {(t - 1)}). +$$ + +Then, the bilevel optimization problem is approximated by the single-optimization problem with $T$ equality constraints and new variables $\{x_2^{(t)}\}_{t = 1}^T$ instead of $x_{2}$ : + +$$ +\min _ {x _ {1} \in S _ {1}, \left\{x _ {2} ^ {(t)} \right\}} f _ {1} \left(x _ {1}, x _ {2} ^ {(T)}\right) \text {s . t .} x _ {2} ^ {(t)} = \Phi^ {(t)} \left(x _ {1}, x _ {2} ^ {(t - 1)}\right) (t = 1, \dots , T), \tag {3} +$$ + +where $x_{2}^{(0)}$ is a given constant. Eliminating $x_{2}^{(1)},\ldots ,x_{2}^{(T)}$ using constraints, we can equivalently recast the problem above into the unconstrained problem $\min_{x_1\in S_1}\tilde{F}_1(x_1)$ . + +Under assumption on differentiability, the gradient of $\tilde{F}_1(x_1)$ is given in [11, Section 3] by + +$$ +\nabla_ {x _ {1}} \tilde {F} _ {1} (x _ {1}) = \nabla_ {x _ {1}} f _ {1} (x _ {1}, x _ {2} ^ {(T)}) + \sum_ {t = 1} ^ {T} B ^ {(t)} \left(\prod_ {s = t + 1} ^ {T} A ^ {(s)}\right) \nabla_ {x _ {2}} f _ {1} (x _ {1}, x _ {2} ^ {(T)}), +$$ + +$$ +A ^ {(t)} = \nabla_ {x _ {2}} \Phi^ {(t)} (x _ {1}, x _ {2} ^ {(t - 1)}) (t = 1, \dots , T), +$$ + +$$ +B ^ {(t)} = \nabla_ {x _ {1}} \Phi^ {(t)} (x _ {1}, x _ {2} ^ {(t - 1)}) (t = 1, \ldots , T). +$$ + +Roughly speaking, [12, Theorem 3.2] proved that the optimal value and the solution set of (3) converge to those of (2) as $T \to \infty$ under Assumptions 1 and 3 restricted to $n = 2$ . + +# 3 Multilevel optimization problems and their approximation + +We will develop an algorithm for multilevel optimization problems (1) under some assumptions by extending the studies [11, 12] on bilevel problems. Our algorithm and its theoretical guarantee look similar to those in [11, 12], but they are not straightforwardly obtained. As emphasized in Section 1, unlike the bilevel problem, even if the lower-level problem is replaced with $T$ steepest-descent sequential updates, the resulting problem is still a multilevel problem. In this section, we show how to resolve these difficulties that come from the multilevel hierarchy. + +# 3.1 Existence of optima of multilevel optimization problems + +First, we discuss the existence of an optimal solution of the multilevel optimization problem (1). To do so, we introduce the following assumption, which is a natural extension of that in [12]. + +# Assumption 1. + +(i) $S_{1}$ is compact. +(ii) For $i = 1,\dots ,n,f_{i}$ is jointly continuous. +(iii) For $i = 2, \ldots, n$ , the set of optimal solutions of the $i$ th level problem with arbitrarily fixed $(x_{1}, \ldots, x_{i-1})$ is a singleton. +(iv) For $i = 2, \dots, n$ , the optimal solution of the $i$ th level problem remains bounded as $x_{1}$ varies in $S_{1}$ . + +Assumption 1-(iii) means that the $i$ th level problem with parameter $(x_{1},\ldots ,x_{i - 1})$ has a unique optimizer, that is described as $x_{i}^{*}$ in (1) though it should be formally written as $x_{i}^{*}(x_{1},\dots,x_{i - 1})$ since it is determined by $x_{1},\ldots ,x_{i - 1}$ . We define $F_{i}(x_{1},\ldots ,x_{i}):=f_{i}(x_{1},\ldots ,x_{i},x_{i + 1}^{*},\ldots ,x_{n}^{*})$ by eliminating $x_{i + 1}^{*},\ldots ,x_{n}^{*}$ since it depends only on $(x_{1},\ldots ,x_{i})$ . Then, the $i$ th level problem with parameter $(x_{1},\ldots ,x_{i - 1})$ can be written as $\min_{x_i}F_i(x_1,\ldots ,x_i)$ . Similarly, in the 1st level problem, for fixed $x_{1}$ , the remaining variables $x_{2},x_{3},\ldots ,x_{n}$ can be represented as $x_{2}^{*}(x_{1}),x_{3}^{*}(x_{1},x_{2}^{*}(x_{1}))$ and so on. In what follows, we denote them by $x_{2}^{*}(x_{1}),x_{3}^{*}(x_{1}),\ldots ,x_{n}^{*}(x_{1})$ since they are determined by $x_{1}$ . Eliminating them, we can rewrite the 1st level problem, equivalently (1), as + +$$ +\min _ {x _ {1} \in S _ {1}} F _ {1} \left(x _ {1}\right). \tag {4} +$$ + +Theorem 2. Under Assumption 1, Problem (4) admits optimal solutions. + +Theorem 2 is a generalization of [12, Theorem 3.1], which is valid only for $n = 2$ , to general $n$ . It is difficult to extend the original proof to general $n$ because, to derive the continuity of $x_{i}^{*}$ extending the original proof, a sequence $(x_{1},\ldots ,x_{i - 1})$ approaches to its accumulation point only from a specific direction. Instead, in the multilevel case, we employ the theory of point-to-set mapping. A proof of Theorem 2 is shown in Supplementary material A.1. + +# 3.2 Approximation by iterative methods + +We extend the gradient method for bilevel optimization problems proposed by Franceschi et al. [11] to multilevel optimization problems (1). Based on an argument similar to one in Subsection 2.2, we approximate lower level problems in (1) by applying an iterative method with $T_{i}$ iterations to the $i$ th level problem for $i = 2,\dots ,n$ . Then, we obtain the following approximated problem: + +$$ +\begin{array}{l} \min _ {x _ {1} \in S _ {1}, \{x _ {2} ^ {(t _ {2})} \}, \dots , \{x _ {n} ^ {(t _ {n})} \}} f _ {1} (x _ {1}, x _ {2} ^ {(T _ {2})}, \dots , x _ {n} ^ {(T _ {n})}) \\ \text {s . t .} x _ {i} ^ {(t _ {i})} = \Phi_ {i} ^ {(t _ {i})} \left(x _ {1}, x _ {2} ^ {(T _ {2})}, \dots , x _ {i - 1} ^ {(T _ {i - 1})}, x _ {i} ^ {(t _ {i} - 1)}\right) (i = 2, \dots , n; t _ {i} = 1, \dots , T _ {i}), \tag {5} \\ \end{array} +$$ + +where $\Phi_i^{(t_i)}(x_1,x_2^{(T_2)},\ldots ,x_{i - 1}^{(T_{i - 1})},x_i^{(t_i)})$ is the $t_i$ th iteration formula of an iterative method for the $i$ th level approximated problem with parameters $(x_{1},\dots,x_{i - 1}) = (x_{1},x_{2}^{(T_{2})},\dots,x_{i - 1}^{(T_{i - 1})})$ , i.e., + +$$ +\begin{array}{l} \min_{\substack{x_{i},\{x_{i + 1}^{(t_{i + 1})}\} ,\ldots ,\{x_{n}^{(t_{n})}\}}}f_{i}(x_{1},\ldots ,x_{i},x_{i + 1}^{(T_{i + 1})},\ldots ,x_{n}^{(T_{n})}) \\ \mathrm {s . t .} x _ {j} ^ {(t _ {j})} = \Phi_ {j} ^ {(t _ {j})} (x _ {1}, \ldots , x _ {i}, x _ {i + 1} ^ {(T _ {i + 1})}, \ldots , x _ {j - 1} ^ {(T _ {j - 1})}, x _ {j} ^ {(t _ {j} - 1)}) (j = i + 1, \ldots , n; t _ {j} = 1, \ldots , T _ {j}), \\ \end{array} +$$ + +and its initial point $x_{i}^{(0)}$ for each $i$ are regarded as a given constant. For $i = 1, \dots, n$ , if we fix $x_{1}, \ldots, x_{i}$ , each remaining variable $x_{j}^{(t)}$ is determined by constraints and thus, we denote it by $x_{j}^{(t_{j})}(x_{1}, \ldots, x_{i})$ for $j = i + 1, \ldots, n$ . Using this notation, the $i$ th level objective function can be written as + +$$ +\begin{array}{l} \tilde {F} _ {i} (x _ {1}, \dots , x _ {i}) \\ := f _ {i} (x _ {1}, \ldots , x _ {i - 1}, x _ {i}, x _ {i + 1} ^ {(T _ {i + 1})} (x _ {1}, \ldots , x _ {i}), \ldots , x _ {n} ^ {(T _ {n})} (x _ {1}, \ldots , x _ {n - 1} ^ {(T _ {n - 1})} (\dots (x _ {i + 1} ^ {(T _ {i + 1})} (x _ {1}, \ldots , x _ {i})) \dots))), \\ \end{array} +$$ + +where $(x_{1},\ldots ,x_{i - 1})$ acts as a fixed parameter in the $i$ th level problem. When we approximate the $i$ th level problem with the steepest descent method for example, we use $\Phi_i^{(t_i)}(x_1,\dots,x_{i - 1},x_i^{(t_i)}) = x_i^{(t_i - 1)} - \alpha_i^{(t_i - 1)}\nabla_{x_i}\tilde{F}_i(x_1,\dots,x_{i - 1},x_i^{(t_i - 1)})$ . + +Especially, all variables other than $x_{1}$ in (5) can be expressed as $\{x_2^{(t_2)}(x_1)\}, \ldots, \{x_n^{(t_n)}(x_1)\}$ since it is determined by $x_{1}$ . By plugging the constraints into the objective function and eliminating them, we can reformulate (5) as + +$$ +\min _ {x _ {1} \in S _ {1}} \tilde {F} _ {1} \left(x _ {1}\right). \tag {6} +$$ + +In the remainder of this subsection, we assume $T_{2} = \dots = T_{n} = T$ for simplicity. Then, the optimal value and solutions of Problem (6) converge to those of Problem (4) as $T \to \infty$ in some sense. To derive it, we introduce the following assumption, which is also a natural extension of that in [12]. + +# Assumption 3. + +(i) $f_{1}(x_{1},\cdot ,\dots ,\cdot)$ is uniformly Lipschitz continuous on $S_{1}$ +(ii) For all $i = 2,\ldots ,n$ , sequence $\{x_i^{(T)}(x_1)\}$ converges uniformly to $x_{i}^{*}(x_{1})$ on $S_{1}$ as $T\to \infty$ + +Theorem 4. Under Assumptions 1 and 3, the followings hold: + +(a) The optimal value of Problem (6) converges to that of Problem (4) as $T \to \infty$ . +(b) The set of the optimal solutions of Problem (6) converges to that of Problem (4); more precisely, denoting an optimal solution of Problem (6) by $x_{1,T}^{*}$ , we have + +- $\{x_{1,T}^{*}\}_{T = 1}^{\infty}$ admits a convergent subsequence; +- for every subsequence $\{x_{1,T_k}^*\}_{k=1}^{\infty}$ such that $x_{1,T_k}^* \to x_1^*$ as $k \to \infty$ , the accumulation point $x_1^*$ is an optimal solution of Problem (4). + +See Supplementary material A.2 for a proof of this theorem. + +# 4 Proposed method: Gradient computation in the approximated problem + +Now we propose to apply a projected gradient method to the approximated problem (6) for multilevel optimization problems (1) because (6) asymptotically converges to (1) as shown in Theorem 4. In this section, we derive the formula of $\nabla_{x_1}\tilde{F}_1(x_1)$ and confirm the local and global convergence of the resulting projected gradient method. + +# 4.1 Gradient of the objective function in the approximated problem + +The following theorem provides a computation formula of $\nabla_{x_1}\bar{F}_1(x_1)$ + +Theorem 5 (Gradient formula for the $n$ -level optimization problems). The gradient $\nabla_{x_1}\tilde{F}_1(x_1)$ can be expressed as follows: + +$$ +\nabla_ {x _ {1}} \tilde {F} _ {1} (x _ {1}) = \nabla_ {x _ {1}} f _ {1} (x _ {1}, x _ {2} ^ {(T _ {2})}, \ldots , x _ {n} ^ {(T _ {n})}) + \sum_ {i = 2} ^ {n} Z _ {i} \nabla_ {x _ {i}} f _ {1} (x _ {1}, x _ {2} ^ {(T _ {2})}, \ldots , x _ {n} ^ {(T _ {n})}), +$$ + +$$ +Z _ {i} = \sum_ {t = 1} ^ {T _ {i}} \left(\sum_ {j = 2} ^ {i - 1} Z _ {j} C _ {i j} ^ {(t)} + B _ {i} ^ {(t)}\right) \prod_ {s = t + 1} ^ {T _ {i}} A _ {i} ^ {(s)}, +$$ + +$$ +A _ {i} ^ {(t)} = \nabla_ {x _ {i}} \Phi_ {i} ^ {(t)} (x _ {1}, x _ {2} ^ {(T _ {2})}, \ldots , x _ {i - 1} ^ {(T _ {i - 1})}, x _ {i} ^ {(t - 1)}), +$$ + +$$ +B _ {i} ^ {(t)} = \nabla_ {x _ {1}} \Phi_ {i} ^ {(t)} (x _ {1}, x _ {2} ^ {(T _ {2})}, \dots , x _ {i - 1} ^ {(T _ {i - 1})}, x _ {i} ^ {(t - 1)}), +$$ + +$$ +C _ {i j} ^ {(t)} = \nabla_ {x _ {j}} \Phi_ {i} ^ {(t)} (x _ {1}, x _ {2} ^ {(T _ {2})}, \ldots , x _ {i - 1} ^ {(T _ {i - 1})}, x _ {i} ^ {(t - 1)}) +$$ + +for any $i = 2, \ldots, n$ ; $t = 1, \ldots, T_i$ ; and $j = 2, \ldots, i - 1$ , where we define $\prod_{s=t+1}^{T_i} A_i^{(s)} := A_i^{(t+1)} A_i^{(t+2)} \ldots A_i^{(T_i)}$ for $t < T_i$ and $\prod_{s=T_i+1}^{T_i} A_i^{(s)} = I$ . + +See supplementary material A.3 for a proof of this theorem. + +We consider computing $\nabla_{x_1}\tilde{F}_1(x_1)$ using Theorem 5. Notice that we can easily compute $Z_{2} = \sum_{t=1}^{T_{2}}B_{2}^{(t)}\prod_{s=t+1}^{T_{2}}A_{2}^{(s)}$ . For $i = 3,\dots,n$ , when we have $Z_{2},\ldots,Z_{i-1}$ , we can compute $Z_{i}$ . We show an algorithm that computes $\nabla_{x_1}\tilde{F}_1(x_1)$ by computing $Z_{2},\ldots,Z_{n}$ in this order in Algorithm 1. + +# Algorithm 1 Computation of $\nabla_{x_1}\tilde{F}_1(x_1)$ + +Input: $x_{1}$ : current value of the 1st level variable. $\{x_{i}^{(0)}\}_{i = 2}^{n}$ : initial values of the lower level iteration. + +Output: The exact value of $\nabla_{x_1}\tilde{F}_1(x_1)$ + +1: $g\coloneqq (0,\ldots ,0)^{\top}$ +2: for $i := 2, \ldots, n$ do +3: $Z_{i}:= O$ . +4: for $t\coloneqq 1,\ldots ,T_i$ do +5: $x_{i}^{(t)}\coloneqq \Phi_{i}^{(t)}(x_{1},x_{2}^{(T_{2})},\ldots ,x_{i - 1}^{(T_{i - 1})},x_{i}^{(t - 1)})$ +6: $\bar{B}_i^{(t)}\coloneqq \sum_{l = 2}^{i - 1}Z_lC_{il}^{(t)} + B_i^{(t)}.$ +7: $Z_{i} := Z_{i}A_{i}^{(t)} + \bar{B}_{i}^{(t)}$ . +8: for $i = 2,\dots ,n$ do +9: $g\coloneqq g + Z_{i}\nabla_{x_{i}}f_{1}.$ +10: $g\coloneqq g + \nabla_{x_1}f_1$ +11: return $g$ + +For $i = 2, \ldots, n$ and $t = 1, \ldots, T_i$ , $\Phi_i^{(t)}$ , which appears in the 5th line of Algorithm 1, is the update formula based on the gradient $\nabla_{x_i} \tilde{F}_i(x_1, \ldots, x_i)$ of the $i$ th level objective function. $\nabla_{x_i} \tilde{F}_i(x_1, \ldots, x_i)$ can be computed by applying Algorithm 1 to the $(n - i + 1)$ -level optimization problem with objective functions $\tilde{F}_i, \ldots, \tilde{F}_n$ . Therefore, recursively calling Algorithm 1 in the computation of $\Phi_i^{(t)}$ , we can compute $\nabla_{x_1} \tilde{F}_1(x_1)$ . For an example of applying Algorithm 1 to Problem (6) arising from a trilevel optimization problem, i.e., Problem (1) with $n = 3$ , see Supplementary material B. + +# 4.2 Complexity of the gradient computation + +We analyze the complexity for computing $\nabla_{x_1}\tilde{F}_1(x_1)$ by recursively calling Algorithm 1. In the following theorem, the asymptotic big O notation is denoted by $\mathrm{O}(\cdot)$ . + +Theorem 6. Let the time and space complexity for computing $\nabla_{x_i}\tilde{F}_i(x_i)$ be $c_{i}$ and $s_i$ , respectively. We use $\Phi_i^{(t_i)}$ based on $\nabla_{x_i}\tilde{F}_i(x_i)$ and recursively call Algorithm 1 for computing $\nabla_{x_i}\tilde{F}_i(x_1,\ldots ,x_i)$ . In addition, we assume the followings: + +- The time and space complexity for evaluating $\Phi_i^{(t_i)}$ are $\mathrm{O}(c_i)$ and $\mathrm{O}(s_i)$ . +- The time and space complexity of $\nabla_{x_1}f_1$ and $\nabla_{x_i}f_1$ for $i = 1,\dots ,n$ are smaller in the sense of the order than those of for loops in lines 2-9 in Algorithm 1. + +Then, the overall time complexity $c_{1}$ and space complexity $s_{1}$ for computing $\nabla_{x_i}\tilde{F}_i(x_1,\ldots ,x_i)$ can be written as + +$$ +c _ {1} = \mathrm {O} \left(p ^ {n} n! c _ {n} \prod_ {i = 1} ^ {n - 1} \left(T _ {i + 1} d _ {i}\right)\right), \quad s _ {1} = \mathrm {O} \left(q ^ {n} s _ {n}\right), \tag {7} +$$ + +respectively, for some constant $p, q > 1$ . + +For a proof, see Supplementary material A.4. Note that, if $n$ is a fixed parameter, those complexity reduces to a polynomial of $T_{i}$ 's, $d_{i}$ 's, $c_{n}$ , and $s_{n}$ . Hence, Algorithm 1 can be regarded as a fixed-parameter tractable algorithm. + +# 4.3 Global convergence of the projected gradient method + +Here, we consider solving Problem (6) by the projected gradient method, which calculates the gradient vector by Algorithm 1 and projects the updated point on $S_{1}$ in each iteration. When all lower-level updates are based on the steepest descent method, we can derive the Lipschitz continuity of the gradient of the objective function of (6). Hence, we can guarantee the local and global convergence of the projected gradient method for (6) by taking a sufficiently small step size. + +Theorem 7. Suppose $\Phi_i^{(t)}(x_1,\ldots ,x_{i - 1},x_i^{(t - 1)}) = x_i^{(t - 1)} - \alpha_i^{(t - 1)}\nabla_{x_i}\tilde{F}_i(x_1,\ldots ,x_{i - 1},x_i^{(t - 1)})$ for all $i = 2,\dots ,n$ and $t_i = 1,\dots ,T_i$ where $\alpha_{i}^{(t - 1)}$ and $x_{i}^{(0)}$ are given parameters for all $i$ and $t$ . Assume that $\nabla_{x_j}f_i$ is Lipschitz continuous and bounded for all $i = 1,\dots ,n$ and $j = 1,\dots ,n$ ; and also $\nabla_{x_i}\Phi_i^{(t)},\nabla_{x_1}\Phi_i^{(t)},$ and $\nabla_{x_j}\Phi_i^{(t)}$ are Lipschitz continuous and bounded for all $i = 2,\dots ,n$ ; $j = 2,\dots ,i - 1$ ; $t = 1,\dots ,T_i$ . Then, $\nabla_{x_1}\tilde{F}_1$ is Lipschitz continuous. + +See Supplementary material A.5 for a proof of this theorem. + +Corollary 8. Suppose the same assumption as Theorem 7. Assume $S_{1}$ is a compact convex set. Let $L$ be the Lipschitz constant of $\nabla_{x_1}\tilde{F}_1$ . Then, a sequence $\{x_1^{(t)}\}$ generated by the projected gradient method with sufficiently small constant step size, e.g., smaller than $2 / L$ , for Problem (6) from any initial point has a convergent subsequence that converges to a stationary point with convergence rate $\mathrm{O}(1 / \sqrt{t})$ . + +Proof. From Theorem 7, the gradient of the objective function of Problem (6) is $L$ -Lipschitz continuous. Let $G$ : $\mathrm{int}(\mathrm{dom}(\tilde{F}_1)) \to \mathbb{R}^{d_1}$ be the gradient mapping [3, Definition 10.5] corresponding to $\tilde{F}_1$ , the indicator function of $S_1$ , and the constant step size $\alpha_1^{(t)}$ with satisfying $0 < \alpha_1^{(t)} < 2 / L$ for all $t$ . Note that $\| G(x_1)\| = 0$ if and only if $x_1$ is a stationary point of Problem (6) [3, Theorem 10.7]. By applying [3, Theorem 10.15], we obtain $\min_{s=0}^t \| G(x_1^{(s)})\| \leq O(1/\sqrt{t})$ and $\| G(\bar{x}_1)\| = 0$ , where $\bar{x}_1$ is a limit point of $\{x_1^{(t)}\}$ . + +# 5 Numerical experiments + +To validate the effectiveness of our proposed method, we conducted numerical experiments on an artificial problem and a hyperparameter optimization problem arising from real data (see Supplementary material C for complete results). In our numerical experiments, we implemented all codes with Python 3.9.2 and JAX 0.2.10 for automatic differentiation and executed them on a computer with 12 cores of Intel Core i7-7800X CPU 3.50 GHz, 64 GB RAM, Ubuntu OS 20.04.2 LTS. + +In this section, we used Algorithm 1 to calculate the gradient of $\tilde{F}_i$ in problem 5, and used automatic differentiation to calculate the gradient of $\Phi_i^{(t)}$ in problem 5. + +# 5.1 Convergence to the optimal solution + +We solved the following trilevel optimization problem with Algorithm 1 to evaluate the performance: + +$$ +\begin{array}{l} \min _ {x _ {1} \in \mathbb {R} ^ {2}} f _ {1} (x _ {1}, x _ {2} ^ {*}, x _ {3} ^ {*}) = \| x _ {3} ^ {*} - x _ {1} \| _ {2} ^ {2} + \| x _ {1} \| _ {2} ^ {2} \mathrm {s . t .} \\ x _ {2} ^ {*} \in \underset {x _ {2} \in \mathbb {R} ^ {2}} {\operatorname {a r g m i n}} f _ {2} \left(x _ {1}, x _ {2}, x _ {3} ^ {*}\right) = \| x _ {2} - x _ {1} \| _ {2} ^ {2} \text {s . t .} \tag {8} \\ x_{3}^{*}\in \operatorname *{argmin}_{x_{3}\in \mathbb{R}^{2}}f_{3}(x_{1},x_{2},x_{3}) = \| x_{3} - x_{2}\|_{2}^{2}. \\ \end{array} +$$ + +Clearly, the optimal solution for this problem is $x_{1} = x_{2} = x_{3} = (0,0)^{\top}$ . + +We solved (8) with fixed constant step size and initialization but different $(T_{2}, T_{3})$ . For the iterative method in Algorithm 1, we employed the steepest descent method at all levels. We show the transition of the value of the objective functions in Figure 1 and the trajectories of each decision variable in Figure 2. Since updates of $x_{3}$ is the most inner iteration, the time required to update $x_{3}$ does not change when $T_{2}$ or $T_{3}$ changes. Hence the number of updates of $x_{3}$ is proportional to the total computational time. Therefore, we can compare the time efficiency of the optimization algorithm by + +![](images/9777a511b7e5ef63faf04c6451d4692ffa2d8982a86c33ca82b6c49d8421a17e.jpg) +(a) $T_{2} = 10,T_{3} = 10$ + +![](images/aa5d5c9d544e2d9cebf6ce6f1844f9b116b8d47d58dcd2fc9a8dd1606ca41be5.jpg) +(b) $T_{2} = 1, T_{3} = 1$ + +![](images/bba1fac5b172bf4d09c3346f607466bb512513da4f643a3d28038e5beb29657f.jpg) +Figure 1: Performance of Algorithm 1 for Problem (8). The objective values linearly decreased. +(a) $T_{2} = 10, T_{3} = 10$ +Figure 2: Trajectories of each variable. $(0,0)^{\top}$ is the optimal solution of each level. Our algorithm with few iterations for lower-level problems $T_{2} = T_{3} = 1$ performed well. + +![](images/22efef7995a181fcc4b84fdd07e17d0f79855a4b80550e2f7fd772a2d9dfd3fc.jpg) +(b) $T_{2} = 1, T_{3} = 1$ + +focusing on the number of updates of $x_{3}$ . We confirmed that the values of $f_{1}, f_{2}$ , and $f_{3}$ converge to the optimal value 0 at all levels and the gradient method outputs the optimal solution $(0,0)^{\top}$ even if we use small iteration numbers $T_{2} = 1$ and $T_{3} = 1$ for the approximation problem (5). + +We also made comparison Algorithm 1 and an existing algorithm [23] based on evolutionary strategy by solving (8) using both algorithms. Algorithm 1 outperformed the existing algorithm. For detail, see Supplementary material C.2. + +# 5.2 Application to hyperparameter optimization + +For deriving a machine learning model robust to noise in input data, we formulate a trilevel model by assuming two players: a model learner and an attacker. The model learner decides the hyperparameter $\lambda$ to minimize the validation error, while the attacker tries to poison training data so as to make the model less accurate. This model is inspired by bilevel hyperparameter optimization [12] and adversarial learning [16, 17] and formulated as follows: + +$$ +\begin{array}{l} \min _ {\lambda} \frac {1}{m} \| y _ {\text {v a l i d}} - f (X _ {\text {v a l i d}}; \theta) \| _ {2} ^ {2} \text {s . t .} \\ P \in \operatorname * {a r g m a x} _ {P ^ {\prime}} \frac {1}{n} \| y _ {\text {t r a i n}} - f (X _ {\text {t r a i n}} + P ^ {\prime}; \theta) \| _ {2} ^ {2} - \frac {c}{n d} \| P ^ {\prime} \| _ {2} ^ {2} \text {s . t .} \\ \theta \in \operatorname * {a r g m i n} _ {\theta^ {\prime}} \frac {1}{n} \| y _ {\mathrm {t r a i n}} - f (X _ {\mathrm {t r a i n}} + P ^ {\prime}; \theta^ {\prime}) \| _ {2} ^ {2} + \exp (\lambda) \frac {\| \theta^ {\prime} \| _ {1 ^ {*}}}{d}, \\ \end{array} +$$ + +where $f$ denotes the output of a three-layer perceptron which has 3 hidden units, $\theta$ denotes the parameter of the model $f$ , $d$ denotes the dimension of $\theta$ , $n$ denotes the number of the training data + +![](images/5b8fd729a82942c08b9ccec7e8b9ebd005aace90fafa6ebeda2aa72b6ae47017.jpg) +(a) $\sigma = 0.01$ + +![](images/af948608077c3d4966224c07d624a706f292b7fd9901726710cddd42a35d68ad.jpg) +(b) $\sigma = 0.08$ + +![](images/61f7555735f644de554c2dc13c71bff14a410a2919581572ad2dafa56e21210c.jpg) +Figure 3: MSE of test data with Gaussian noise with the standard deviation of $\sigma$ on diabetes dataset. +(a) Diabetes dataset +Figure 4: MSE of test data with Gaussian noise, using early-stopped parameters for prediction. + +![](images/5ca4b5965db32262c3a3d3668741fda39e9599cc43ee951a20d52dc2a0447110.jpg) +(b) Red wine quality dataset + +$X_{\mathrm{train}}$ , $m$ denotes the number of the validation data $X_{\mathrm{val}}$ , $c$ denotes the penalty for the noise $P$ , and $\| \cdot \|_{1^*}$ is a smoothed $\ell_1$ -norm [19, Eq. (18) with $\mu = 0.25$ ], which is a differentiable approximation of the $\ell_1$ -norm. We used the hyperbolic tangent function as the activation function for the hidden layer of the multilayer perceptron. Here, we use $\exp (\lambda)$ to express a nonnegative penalty parameter instead of the constraint $\lambda \geq 0$ . + +To validate the effectiveness of our proposed method, we compared the results by the trilevel model with those of the following bilevel model: + +$$ +\min _ {\lambda} \frac {1}{m} \| y _ {\text {v a l i d}} - f (X _ {\text {v a l i d}}; \theta) \| _ {2} ^ {2} \text {s . t .} \theta \in \operatorname * {a r g m i n} _ {\theta^ {\prime}} \frac {1}{n} \| y _ {\text {t r a i n}} - f (X _ {\text {t r a i n}}; \theta^ {\prime}) \| _ {2} ^ {2} + \exp (\lambda) \frac {\| \theta^ {\prime} \| _ {1 ^ {*}}}{d}. +$$ + +This model is equivalent to the trilevel model without the attacker's level. + +We used Algorithm 1 to compute the gradient of the objective function in the trilevel and bilevel models with real datasets. For the iterative method in Algorithm 1, we employed the steepest descent method at all levels. We set $T_{2} = 30$ and $T_{3} = 3$ for the trilevel model and $T_{2} = 30$ for the bilevel model. In each dataset, we used the same initialization and step sizes in the updates of $\lambda$ and $\theta$ in trilevel and bilevel models. We compared these methods on the regression tasks with the following datasets: the diabetes dataset [10], the (red and white) wine quality datasets [8], the Boston dataset [14]. For each dataset, we standardized each feature and the objective variable; randomly chose 40 rows for training data $(X_{\mathrm{train}}, y_{\mathrm{train}})$ , chose other 100 rows for validation data $(X_{\mathrm{valid}}, y_{\mathrm{valid}})$ , and used the rest of the rows for test data. + +We show the transition of the mean squared error (MSE) by test data with Gaussian noise in Figure 3. The solid line and colored belt respectively indicate the mean and the standard deviation over 500 times of generation of Gaussian noise. The dashed line indicates the MSE without noise as a baseline. In the results of the diabetes dataset (Figure 3), the trilevel model provided a more robust parameter than the bilevel model, because the MSE of the trilevel model rises less in the large noise setting for test data. + +Next, we compared the quality of the resulting model parameters by the trilevel and bilevel models. We set an early-stopping condition on learning parameters: after 1000 times of updates on the model + +Table 1: MSE of test data with Gaussian noise with the standard deviation of 0.08, using early-stopped parameters for prediction. The better values are shown in boldface. + +
diabetesBostonwine (red)wine (white)
Trilevel0.8601 ± 0.04790.4333 ± 0.00320.7223 ± 0.00190.8659 ± 0.0013
Bilevel1.0573 ± 0.07200.4899 ± 0.00330.7277 ± 0.00190.8750 ± 0.0014
+ +parameter, if one time of update on hyperparameter $\lambda$ did not improve test error, terminate the iteration and return the parameters at that time. By using the early-stopped parameters, we show the relationship of test error and standard deviation of the noise on the test data in Figure 4 and Table 1. For the diabetes dataset, the growth of MSE of the trilevel model was slower than that of the bilevel model. For wine quality and Boston house-prices datasets, the MSE of the trilevel model was consistently lower than that of the bilevel model. Therefore, the trilevel model provides more robust parameters than the bilevel model in these settings of problems. + +# 5.3 Relationship between $(T_{2}, T_{3})$ and the convergence speed + +In the first experiment in Section 5.1, there is no complex relationship between variables at each level, and therefore, the objective function value at one level is not influenced significantly when variables at other levels is changed. In such a problem setting, by setting $T_{2}$ and $T_{3}$ to small values, we update $x_{1}$ many times and the generated sequence $\{x_{1}^{(t)}\}$ quickly converges to a stationary point. On the other hand, for example, if we set $T_{3}$ to a large value, $x_{3}$ is well optimized for some fixed $x_{1}$ and $x_{2}$ , and hence, our whole algorithm may need more computation time until convergence. In the second experiment in Section 5.2, the relationship between variables at each level is more complicated than in the first experiment. Setting $T_{2}$ or $T_{3}$ smaller in such a problem is not necessarily considered to be efficient because the optimization algorithm proceeds without fully approximating the optimality condition of $x_{i}$ at the $i$ th level. + +# 6 Conclusion + +Summary In this paper, we have provided an approximated formulation for a multilevel optimization problem by iterative methods and discussed its asymptotical properties of it. In addition, we have proposed an algorithm for computing the gradient of the objective function of the approximated problem. Using the gradient information, we can solve the approximated problem by the projected gradient method. We have also established the local and global convergence of the projected gradient method. + +**Limitation and future work** Our proposed gradient computation algorithm is fixed-parameter tractable and hence it works efficiently for small $n$ . For large $n$ , however, the exact computation of the gradient is expensive. Development of heuristics for approximately computing the gradient is left for future research. Weakening assumptions in the theoretical contribution is also left for future work. In addition, there is a possibility of another algorithm to solve the approximated problem 5. In this paper, we propose Algorithm 1, which corresponds to forward mode automatic differentiation. On the other hand, in the prior research for bilevel optimization [11], two algorithms were proposed from the perspective of forward mode automatic differentiation and reverse mode automatic differentiation, respectively. Therefore, there is a possibility of another algorithm for problem 5 which corresponds to the reverse mode automatic differentiation, and that is left for future work. + +# Acknowledgments and Disclosure of Funding + +This work was partially supported by JSPS KAKENHI (JP19K15247, JP17H01699, and JP19H04069). + +# References + +[1] G. B. Allende and G. Still. Solving bilevel programs with the KKT-approach. Mathematical Programming, 138(1):309-332, 2013. +[2] A. G. Baydin, B. A. Pearlmutter, A. A. Radul, and J. M. Siskind. Automatic differentiation in machine learning: A survey. Journal of Machine Learning Research, 18(153):1-43, 2017. +[3] A. Beck. First-Order Methods in Optimization. SIAM, 2017. +[4] A. Ben-Tal, A. Goryashko, E. Guslitzer, and A. Nemirovski. Adjustable robust solutions of uncertain linear programs. Mathematical Programming, 99(2):351-376, 2004. +[5] K. P. Bennett, J. Hu, X. Ji, G. Kunapuli, and J.-S. Pang. Model selection via bilevel optimization. In The 2006 IEEE International Joint Conference on Neural Network Proceedings, pages 1922-1929, 2006. +[6] D. Bertsimas and F. J. C. T. de Ruiter. Duality in two-stage adaptive linear optimization: Faster computation and stronger bounds. INFORMS Journal on Computing, 28(3):500-511, 2016. +[7] A. Billionnet, M.-C. Costa, and P.-L. Poirion. 2-stage robust MILP with continuous recourse variables. Discrete Applied Mathematics, 170:21-32, 2014. +[8] P. Cortez, A. Cerdeira, F. Almeida, T. Matos, and J. Reis. Modeling wine preferences by data mining from physicochemical properties. Decision Support Systems, 47:547-553, 2009. +[9] A. L. Dontchev and T. Zolezzi. Well-Posed Optimization Problems. Springer-Verlag Berlin Heidelberg, 1993. +[10] D. Dua and C. Graff. UCI machine learning repository, 2017. http://archive.ics.uci.edu/ml. +[11] L. Franceschi, M. Donini, P. Frasconi, and M. Pontil. Forward and reverse gradient-based hyperparameter optimization. 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 1165-1173, 2017. +[12] L. Franceschi, P. Frasconi, S. Salzo, R. Grazzi, and M. Pontil. Bilevel programming for hyperparameter optimization and meta-learning. In J. Dy and A. Krause, editors, Proceedings of the 35th International Conference on Machine Learning, volume 80 of Proceedings of Machine Learning Research, pages 1568-1577, 2018. +[13] L. Franceschi, M. Niepert, M. Pontil, and X. He. Learning discrete structures for graph neural networks. In K. Chaudhuri and R. Salakhutdinov, editors, Proceedings of the 36th International Conference on Machine Learning, volume 97 of Proceedings of Machine Learning Research, pages 1972-1982, 2019. +[14] D. Harrison and D. L. Rubinfeld. Hedonic prices and the demand for clean air. Journal of Environmental Economics and Management, 5:81-102, 1978. +[15] W. W. Hogan. Point-to-set maps in mathematical programming. SIAM Review, 15:591-603, 1973. +[16] M. Jagielski, A. Oprea, B. Biggio, C. Liu, C. Nita-Rotaru, and B. Li. Manipulating machine learning: Poisoning attacks and countermeasures for regression learning. In 2018 IEEE Symposium on Security and Privacy, pages 19-35, 2018. +[17] S. Liu, S. Lu, X. Chen, Y. Feng, K. Xu, A. Al-Dujaili, M. Hong, and U.-M. O'Reilly. Minmax optimization without gradients: Convergence and applications to black-box evasion and poisoning attacks. In H. Daumé III and A. Singh, editors, Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pages 6282-6293, 2020. + +[18] J. Lorraine, P. Vicol, and D. Duvenaud. Optimizing millions of hyperparameters by implicit differentiation. In S. Chiappa and R. Calandra, editors, Proceedings of the Twenty Third International Conference on Artificial Intelligence and Statistics, volume 108 of Proceedings of Machine Learning Research, pages 1540–1552, 2020. +[19] B. Saheya, C. T. Nguyen, and J.-S. Chen. Neural network based on systematically generated smoothing functions for absolute value equation. Journal of Applied Mathematics and Computing, 61:533-558, 2019. +[20] A. Shaban, C.-A. Cheng, N. Hatch, and B. Boots. Truncated back-propagation for bilevel optimization. In K. Chaudhuri and M. Sugiyama, editors, Proceedings of the Twenty-Second International Conference on Artificial Intelligence and Statistics, volume 89 of Proceedings of Machine Learning Research, pages 1723–1732, 2019. +[21] A. Shafiei, V. Kungurtsev, and J. Marecek. Trilevel and multilevel optimization using monotone operator theory, 2021. arXiv:2105.09407v1. +[22] A. Sinha, P. Malo, and K. Deb. A review on bilevel optimization: From classical to evolutionary approaches and applications. IEEE Transactions on Evolutionary Computation, 22(2):276-295, 2018. +[23] S. L. Tilahun, S. M. Kassa, and H. C. Ong. A new algorithm for multilevel optimization problems using evolutionary strategy, inspired by natural adaptation. In PRICAI 2012: Trends in Artificial Intelligence, pages 577-588, 2012. +[24] L. N. Vicente and P. H. Calamai. Bilevel and multilevel programming: A bibliography review. Journal of Global Optimization, 5:291-306, 1994. +[25] X. Wu and A. J. Conejo. An efficient tri-level optimization model for electric grid defense planning. IEEE Transactions on Power Systems, 32(4):2984-2994, 2017. +[26] I. Yanikoglu, B. L. Gorissen, and D. den Hertog. A survey of adjustable robust optimization. European Journal of Operational Research, 277(3):799-813, 2019. \ No newline at end of file diff --git a/agradientmethodformultileveloptimization/images.zip b/agradientmethodformultileveloptimization/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..eb26927b706b3c1e1aa35b44f96fbf76e3780bc8 --- /dev/null +++ b/agradientmethodformultileveloptimization/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e76a208b96f9055cc75ae5d939ff058d0d87acb9cdfb6c56d351ceb9701ff956 +size 403887 diff --git a/agradientmethodformultileveloptimization/layout.json b/agradientmethodformultileveloptimization/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..6a2f69d62281d5d25f057831cb43dcb01021c3ea --- /dev/null +++ b/agradientmethodformultileveloptimization/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:907a01480a419ae0d186beac2bec580b3e6a47f4a05480bdbfc0d27f46d9894d +size 566408 diff --git a/ahierarchicalreinforcementlearningbasedoptimizationframeworkforlargescaledynamicpickupanddeliveryproblems/06c143a4-8203-41a5-97ad-dfec41956d97_content_list.json b/ahierarchicalreinforcementlearningbasedoptimizationframeworkforlargescaledynamicpickupanddeliveryproblems/06c143a4-8203-41a5-97ad-dfec41956d97_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..81107382f1ead97cbf28147a552c8e44871037be --- /dev/null +++ b/ahierarchicalreinforcementlearningbasedoptimizationframeworkforlargescaledynamicpickupanddeliveryproblems/06c143a4-8203-41a5-97ad-dfec41956d97_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:44e48c9e2983e536d1ed89d06e8280d6643b459b5ee1f53e3b4e059621ad250f +size 75974 diff --git a/ahierarchicalreinforcementlearningbasedoptimizationframeworkforlargescaledynamicpickupanddeliveryproblems/06c143a4-8203-41a5-97ad-dfec41956d97_model.json b/ahierarchicalreinforcementlearningbasedoptimizationframeworkforlargescaledynamicpickupanddeliveryproblems/06c143a4-8203-41a5-97ad-dfec41956d97_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a3072be5f0ee2ba2ada81ebf6007fda66a1c8ad9 --- /dev/null +++ b/ahierarchicalreinforcementlearningbasedoptimizationframeworkforlargescaledynamicpickupanddeliveryproblems/06c143a4-8203-41a5-97ad-dfec41956d97_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e433fa14a463341e8e9a3ccdb693a1cbd917582e1e19922a6f63d101623f023b +size 90170 diff --git a/ahierarchicalreinforcementlearningbasedoptimizationframeworkforlargescaledynamicpickupanddeliveryproblems/06c143a4-8203-41a5-97ad-dfec41956d97_origin.pdf b/ahierarchicalreinforcementlearningbasedoptimizationframeworkforlargescaledynamicpickupanddeliveryproblems/06c143a4-8203-41a5-97ad-dfec41956d97_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..83ae1ae48b50f951fdf3009aeaf1859c496f5bf8 --- /dev/null +++ b/ahierarchicalreinforcementlearningbasedoptimizationframeworkforlargescaledynamicpickupanddeliveryproblems/06c143a4-8203-41a5-97ad-dfec41956d97_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:60843b07424a41a43d2618906e91c342daa0b054c65e70f7b9e4cc204d51753c +size 541933 diff --git a/ahierarchicalreinforcementlearningbasedoptimizationframeworkforlargescaledynamicpickupanddeliveryproblems/full.md b/ahierarchicalreinforcementlearningbasedoptimizationframeworkforlargescaledynamicpickupanddeliveryproblems/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a1ce89ca3e9b2b04951cb0a728dff359035b1aa3 --- /dev/null +++ b/ahierarchicalreinforcementlearningbasedoptimizationframeworkforlargescaledynamicpickupanddeliveryproblems/full.md @@ -0,0 +1,256 @@ +# A Hierarchical Reinforcement Learning Based Optimization Framework for Large-scale Dynamic Pickup and Delivery Problems + +Yi Ma1; Xiaotian Hao1; Jianye Hao12; Jiawen Lu2, Xing Liu2, Xialiang Tong2, Mingxuan Yuan2, Zhigang Li1, Jie Tang3, Zhaopeng Meng1 + +1College of Intelligence and Computing, Tianjin University + +{mayi,xiaotianhao, jianye.hao, scs_lzg, mengzp} @tju.edu.cn + +$^{2}$ Noah's Ark Lab, Huawei, {jiawen.lu, tongxialiang, Yuan.Mingxuan} @huawei.com + +$^{3}$ Tsinghua University, jietang@tsinghua.edu.cn + +# Abstract + +The Dynamic Pickup and Delivery Problem (DPDP) is an essential problem in the logistics domain, which is NP-hard. The objective is to dynamically schedule vehicles among multiple sites to serve the online generated orders such that the overall transportation cost could be minimized. The critical challenge of DPDP is the orders are not known a priori, i.e., the orders are dynamically generated in real-time. To address this problem, existing methods partition the overall DPDP into fixed-size sub-problems by caching online generated orders and solve each sub-problem, or on this basis to utilize the predicted future orders to optimize each sub-problem further. However, the solution quality and efficiency of these methods are unsatisfactory, especially when the problem scale is very large. In this paper, we propose a novel hierarchical optimization framework to better solve large-scale DPDPs. Specifically, we design an upper-level agent to dynamically partition the DPDP into a series of sub-problems with different scales to optimize vehicles routes towards globally better solutions. Besides, a lower-level agent is designed to efficiently solve each sub-problem by incorporating the strengths of classical operational research-based methods with reinforcement learning-based policies. To verify the effectiveness of the proposed framework, real historical data is collected from the order dispatching system of Huawei Supply Chain Business Unit and used to build a functional simulator. Extensive offline simulation and online testing conducted on the industrial order dispatching system justify the superior performance of our framework over existing baselines. + +# 1 Introduction + +The Dynamic Pickup and Delivery Problem (DPDP) constitutes an important family of routing problems, which generally contains three key elements: orders, goods and vehicles as shown in Figure 1. Orders are generated in real-time. Different orders contain different types and quantities of goods. A number of vehicles are scheduled to serve the orders by transporting the desired goods from different origins to different destinations. The objective of DPDP is to dynamically assign each order to the most appropriate vehicle so that the overall transportation cost (e.g., overall distances) could be minimized. DPDPs are widespread in order dispatching systems of the supply chain, express mail delivery services and elsewhere. + +DPDP is a complex variant of the Travelling Salesman Problem (TSP) and Vehicle Routing Problem (VRP), which are both NP-Hard combinatorial optimization problems [25]. The main difficulty of DPDP comes from the dynamically generated orders in real-time, thus the order dispatching decisions cannot be made beforehand in an offline style. Besides, compared with TSP and VRP, there exist various additional complex constraints in DPDP such as pickup and delivery constraint, Last-In-First-Out (LIFO) constraint, time window constraint, split demand constraint, etc. + +Traditional methods for DPDP. Existing solutions for DPDP fall into two categories. The first category maintains a fixed buffer to cache the most recent generated orders and periodically dispatches all cached orders in a delayed mode. By this way, the overall dynamic problem is partitioned into a series of static sub-problems with subsets of known orders, i.e., static Pickup and Delivery Problems (PDPs). Then, operational research-based (OR) methods [22, 20], heuristic and + +![](images/888c9494a54e8a99cc13459a4b76fdda6ead1c096f19b9900f764394743d055a.jpg) +Figure 1: Demonstration of DPDP + +meta-heuristic methods [7, 16, 25, 4, 5, 3, 11, 26, 23, 9] are designed to solve each sub-problem. However, myopically optimizing each static sub-problem cannot guarantee the overall dynamic problem could be optimized from a long-term perspective since the split sub-problems are not independent of each other. The main reasons are previous orders assignment results will influence (1) the number of remaining orders to be dispatched, (2) the vehicle's remaining capacity and (3) the relative positions to the following orders. To acquire better solutions, the second category methods [24, 8, 12] try to predict the distribution of future orders and take the predicted orders into consideration when computing the solution for each sub-problem. However, predicting future orders is not realistic due to the high uncertainty in the real world. Inaccurate predictions will mislead the order dispatcher and route planner, and result in poor solution quality. + +Learning-based methods for VRP. Additionally, a common flaw of traditional OR and metaheuristic methods is that they are computationally expensive and normally unable to obtain a desired solution within the allowable time. Besides, the design of them heavily relies on complex domain knowledge. To improve the solution computing efficiency and ease the difficulty of the algorithm design, recently, several learning-based methods are proposed [27, 1, 18, 6, 13]. These methods have demonstrated that the solution computing efficiency can be significantly improved by leveraging the generalization ability of the trained models. Besides, they could obtain solutions with competitive qualities compared with the state-of-the-art traditional methods. Although these methods mainly focus on TSPs or VRPs, of which all orders' information is known in advance and much fewer constraints are considered comparing with DPDP, learning-based methods have shown great potential to help solve large-scale DPDPs and reach superior performance. + +In this paper, we propose a novel hierarchical reinforcement learning (RL) based optimization framework to solve the real-world large-scale DPDPs. Considering that order dispatching has a long-term impact on the overall optimization objective, the upper-level RL agent dynamically determines whether to wait longer at each moment for caching more future orders. In this way, the orders can be more flexibly assigned to vehicles (since each vehicle will have more candidate orders to choose) and the routes of vehicles could be optimized towards globally better solutions. The lower-level RL agent is responsible for assigning the cached orders to the most appropriate vehicles by sequentially manipulating heuristic operators to improve the solution quality iteratively. To verify the effectiveness of the framework, we collected real historical data from the order dispatching system of Huawei Supply Chain and built a simulator to simulate the order dispatching and vehicle transportation process. Further, we deployed our method on the company's Supply Chain Business Unit. Extensive offline simulation and online testing showed the superior performance of our algorithm. + +Our main contributions are as follows: + +- We are the first to propose a practical hierarchical RL framework to efficiently and far-sightedly compute superior solutions for the real-world large-scale DPDPs with complex constraints. +- We design a simulator using real industrial data to be the experimental benchmark to verify the proposed method, which is available here for interested researchers. +- We show that our approach considerably improves the optimization objectives compared with existing algorithms both in the offline evaluation and online testing. The ablation study indicates our approach can obtain high-quality solutions with fast running speed and has strong generalization ability. + +# 2 Problem Formulation + +We now give the formulation of DPDP in our logistics scenario. For the orders dynamically generated in real-time at different nodes (i.e., factories and warehouses) within a day, vehicles should be scheduled to transport the goods from pickup nodes to delivery nodes to fulfil the orders with minimal transportation cost. In our case, the objective is to minimize $K$ vehicles average travelling distances $D(K)$ of the entire DPDP: + +$$ +\min D (K) \tag {1} +$$ + +while meeting several constraints: Pickup and Delivery Constraint, Capacity Constraint, LIFO Constraint, Time Window Constraint, etc. Detailed constraints are shown in Appendix A. + +In practice, however, some orders are destined to violate time window constraints2. Thus, we add it to the objective function as an associated penalty to convert the hard time window constraint to a soft one. The penalty function is defined as the overtime beyond the specified completion time of each order. The optimization objective is then reformulated as minimizing the weighted sum3 of average vehicles travelling distances (kilometers) $D(K)$ and total overtime (seconds) $OT$ of all orders $C$ : + +$$ +\min D (K) + \lambda * O T (C) \tag {2} +$$ + +Apart from the various complex constraints mentioned above, the additional difficulties of this problem mainly come from two aspects: + +(1) The problem scale is very large. In practical logistic scenarios of the company, millions of products and intermediate materials are manufactured every day. As these products and materials might be used in the subsequent phases (e.g., assembling or selling), they have to be scheduled and transported between hundreds of factories and warehouses by dozens of vehicles within stringent timeline constraints, which constitutes a very large-scale and complex DPDP. +(2) Besides, as the orders are generated online in real-time, the schedule planning cannot be made beforehand in an offline style. From the oracle's point of view, i.e., when all orders of a day are known in advance, the uncertainty is eliminated and this DPDP can be formulated as a complex Mixed Integer Programming (MIP) Problem, of which the optimal solution could be obtained utilizing exact algorithms (e.g., cutting plane algorithms, branch-and-bound algorithms or modern solvers such as Gurobi[20]) [22]. However, in reality, it's impossible to know all the orders in advance, thus these approaches are not applicable. + +To eliminate the uncertainties brought by the unknown orders, a practical way is to utilize a buffer to cache the most recent generated orders and periodically dispatches all cached orders in a little delayed mode. With the known orders in the cache, the static PDP can be formulated as an MIP as shown in Appendix A. We could resort to modern solvers to solve this MIP. However, even for the static PDP with very few orders, it still costs several hours to compute a feasible solution, which is beyond the acceptable limits (details are shown in Table 2 and 3). Besides, even if we could obtain the optimal solution for each fixed split static PDP, we still cannot guarantee the global DPDP can be optimized as these static sub-problems are not independent of each other. + +# 3 Method + +# 3.1 Overall Framework + +![](images/c489bba325337a00f8ac86d3f7bf0e0a9b1c046eeb20bfba6194eb8e941de1f1.jpg) +Figure 2: Hierarchical Optimization Framework + +In this paper, considering the challenges mentioned above, we propose a novel hierarchical reinforcement learning based optimization framework, which contains two levels of agents. As shown in Figure 2, we maintain a buffer to cache the newly generated orders and periodically dispatch all cached orders at once. But instead of dispatching the cached orders of fixed numbers or predicting future orders, we design an upper-level agent to dynamically determine whether to wait longer for caching more future orders at each moment. Though waiting longer will postpone the dispatching and transportation of the earlier cached orders, additional future orders can be taken into account for the vehicle-order matching. In this way, each vehicle will have more candidate orders to choose, thus the overall travelling distances will be more potentially to be optimized for shorter4. This process could be regarded as sacrificing a little time in exchange for a precise estimation of future orders. However, waiting for too long will also increase the risk of overtime of the earlier cached orders. Thus, whether to wait longer to cache more orders at each moment will have a long-term impact on the overall dispatching results, and can be naturally modeled as a sequential decision-making problem. We model this procedure as a Markov Decision Process (MDP). Depending on whether to wait longer at each moment, the overall DPDP can be dynamically partitioned into a series of static sub-problems, each of which includes different numbers of orders. As shown in Figure 2, the generated orders are accumulated in the buffer until the upper-level agent decides to stop caching at time $t_{i+k}$ . Then, the agent releases the cached orders to the lower-level agent and clears the buffer. + +Given the released orders (which form a static sub-problem, i.e., a PDP), the lower-level agent is appointed to assign the orders to the most appropriate vehicles and arrange the transportation route of each vehicle, such that the transportation cost of these orders could be minimized. First, a set of basic operators are maintained, whose roles are converting one feasible solution to another. For instance, given an initial solution's route $\{\mathrm{A - > B - > C}\}$ with three nodes A, B and C, a typical operator is swapping two nodes[13], e.g., swapping A and B. After applying this operator, $\{\mathrm{A - > B - > C}\}$ is converted to $\{\mathrm{B - > A - > C}\}$ . If the travelling cost of $\{\mathrm{B - > A - > C}\}$ is less than $\{\mathrm{A - > B - > C}\}$ , the initial solution is improved. On this basis, we design the lower-level agent similar to the traditional metaheuristic algorithms which sequentially manipulates these operators to improve the solution of each PDP. The difference is that we model the process of sequentially manipulating these operators as an MDP and incorporate RL methods to optimize the policy instead of manually designing complex rules. Finally, the best found solution is adopted by the order dispatching system to assign the orders to the vehicles and arrange their transportation routes. In the following two subsections, we will go into more details of the designed two agents. + +# 3.2 Upper-level Agent + +# 3.2.1 Workflow + +The workflow of the upper-level agent is described in Figure 2. We partition a day into $T = 144$ fixed time intervals, and the time span of each interval is ten minutes. Each time interval starts at time $t_{i-1}$ and ends at time $t_i$ , $i \leq T$ is a positive integer. We name $t_1, \dots, t_i, \dots, t_T$ as decision points. At each decision point $t_i$ , the upper-level agent decides whether to release the accumulated orders to the lower-level agent according to their overtime risk. Taking Figure 2 as an example, at decision point $t_{i-1}$ , the buffer already cached some orders $O_{i-1}$ . At $t_{i-1}$ , the upper-level agent makes a decision and determines to wait longer and not to release $O_{i-1}$ to the lower-level agent. Thus $O_{i-1}$ are still maintained in the buffer. Thereafter, at all decision points before $t_{i+k}$ , the upper-level agent makes the same decisions as at $t_{i-1}$ , i.e., 'not release'. Therefore, new generated orders $\langle O_i, \dots, O_{i+k} \rangle$ between $t_{i-1}$ and $t_{i+K}$ are all appended to the buffer as well. At $t_{i+k}$ , the upper-level agent makes a change and determines to release all accumulated orders $\langle O_{i-1}, O_i, \dots, O_{i+k} \rangle$ to the lower-level agent. At this time, all accumulated orders together with the remaining orders $O_{\text{remain}}$ (assigned to the vehicles before $t_{i-1}$ ) but the goods of the orders are still not loaded onto the vehicles even at $t_{i+k}$ ) will be released by the upper-level agent. In this way, we get a static sub-problem constituting of orders $\langle O_{i-1}, O_i, \dots, O_{i+k}, O_{\text{remain}} \rangle$ for the lower-level agent. By analogy, the overall DPDP can be divided into a series of static PDPs with different scales. We model the procedure of whether to wait longer at each decision moment as an MDP described in the following subsection. + +# 3.2.2 Markov Decision Process (MDP) + +State: The state includes the number of orders accumulated in the buffer, the number of available vehicles, the amount of time left before exceeding the time limit of each order, etc. All these features are normalized and concatenated together. Detailed descriptions are postponed to the Appendix F due to the space limitation. + +Action: The action is a binary variable indicates whether to release orders to the lower-level agent. + +**Reward:** Our ultimate goal is to minimize the optimization objective for the entire dynamic problem. Therefore, we first get the overtime of the orders completed and the corresponding vehicle travelling distances between two consecutive decision moments $t_{i-1}$ and $t_i$ as shown in Figure 2, i.e., avg_distance + λ * overtime. Then we set the immediate reward of action executed at $t_{i-1}$ as -(avg_distance + λ * overtime). By this rule, the sum of the immediate rewards forms the negative value of the total objective for the entire dynamic problem. With this reward, the overall objective for the entire dynamic problem could be optimized. In other words, we encourage the upper-level agent to optimize the overall dynamic problem from a long-term perspective when making decisions. + +# 3.2.3 Agent Model + +For the upper-level agent, we use Deep Q Network (DQN) [17]. We parameterize a value function $Q(s,a;\phi_l)$ using the deep neural network of MLPs in which $\phi_{l}$ are the parameters of the Q-network at updating iteration $l$ . When reaching decision point $t_i$ , we obtain the state $s_{t_i}$ , action $a_{t_i}$ , and reward $r_{t_i}$ according to Section 3.2.2 for the current static problem and save them to the replay buffer. When reaching decision point $t_{i + 1}$ , we obtain the state $s_{t_{i + 1}}$ , which is the next state of the previous static sub-problem and we get a new transition $e_{t_i} = (s_{t_i},a_{t_i},r_{t_i},s_{t_i + 1})$ . We store the transitions into buffer $D = \{e_{t_1},\dots ,e_{t_i},\dots \}$ during the running of simulator. During the training, we apply Q-learning updates on uniformly sampled transitions $(s,a,r,s^{\prime})\sim U(D)$ from the replay buffer. The model updates at iteration $l$ uses the following Temporal Difference (TD) loss function: + +$$ +L _ {i} \left(\phi_ {l}\right) = \mathbb {E} _ {\left(s, a, r, s ^ {\prime}\right) \sim U (D)} \left[ \left(r + \gamma \max _ {a ^ {\prime}} Q \left(s ^ {\prime}, a ^ {\prime}; \phi_ {l} ^ {-}\right) - Q \left(s, a; \phi_ {l}\right)\right) ^ {2} \right] \tag {3} +$$ + +where $\gamma$ is the discount factor, $\phi_l$ are the parameters of the Q-network at iteration $l$ and $\phi_l^-$ are the parameters of the target network at iteration $l$ . + +![](images/d140e3e10d65988af20e81d74ac4a3c0768f06a95ad3be13ab528194da3daa66.jpg) +Figure 3: Workflow of Lower-level Agent + +# 3.3 Lower-level Agent + +# 3.3.1 Workflow + +The workflow of the lower-level agent is described in Figure 3. We first generate a feasible initial solution of the static sub-problem using greedy algorithm (described in Section 4.2). Given the initial solution, the lower-level agent iteratively improves the solution by manipulating different operators according to solution states as mentioned in Section 3.1 (we call this step Improvement [6, 13]). When the improved solution reaches a local optimum (i.e., the solution could not be improved further for a series of steps), we will partially or entirely re-assigning the orders using the greedy algorithm (we call this step Reconstruction). The improvement of the next iteration will start from the reconstructed solution. Note that the lower-level agent only selects improvement operators as reconstruction operator has a long-lasting effect on solutions compared with improvement operators and we found mixing up them will lead to instability during the training. The process of improvement and reconstruction alternates until reaching the maximum number of steps or the maximum allowable running time. The best generated solution during the improvements and reconstructions will be adopted to dispatch orders to vehicles. Note that the final accepted solution is ensured to be at least as good as the initial solution. Overall, by transferring the knowledge learned from previously solved PDPs to the new ones, the agent could efficiently and monotonically improve the solution quality. The MDP definition of the operators-manipulating procedure is described in the following subsection. + +# 3.3.2 Markov Decision Process (MDP) + +State: The state of the current solution consists of the states of all nodes, i.e., $s = \{s_1, s_2, \dots, s_{|V|}\}$ , where $s_v$ is the state of node $v$ . Each $s_v$ includes the position information, order information, vehicle information and objective-related information. Details can be found in Appendix F. + +Action: The action set consists of 4 carefully designed operators, i.e., inner-exchange, inner-relocate, inter-exchange and inter-relocate. We provide a proof in Appendix G that any feasible solution (including the optimal one) could be obtained by iteratively applying these 4 operators from any given initial solution. Details are described in Appendix G. + +**Reward:** We find that the total objective can be easily reduced by a large margin during the first few improvement steps of an initial solution or reconstructed solution in the experiments (See Figure 4). If we assign the actions at these improvement steps a large reward, it's not fair for the actions in the subsequent steps. This is because the actions in the subsequent steps also play important roles in improving solutions in the complex solution space. Therefore, the overall objective $\mathrm{OBJ}_b$ of the sub-problem after the first iteration (e.g., Iteration 1 in Figure 3) is used as the baseline following [13]. For each subsequent iteration $i$ , we first get the optimized objective after the iteration as $\mathrm{OBJ}_i$ and then assign $(|\mathrm{OBJ}_b - \mathrm{OBJ}_i|)/n_i$ to all $n_i$ actions executed in iteration $i$ as reward. + +# 3.3.3 Agent Policy Network + +The policy network of the lower-level agent inputs the state of the current solution and outputs action probabilities of length $|A|$ where $A$ is the set of operators. In our case, a critical challenge of designing the policy network is the number of orders and the number of available vehicles are different for each static sub-problem. As the quantity of the combination of orders and vehicles are extremely huge, we cannot train a separate model for every combination of different numbers of orders and vehicles. Thus, the desired model should be able to transfer the knowledge learned from the previously solved + +problems and generalize to new problems of any scale without fine-tuning. Besides, the routes of a solution naturally form a certain topological graph structure as shown in Figure 3. Therefore, in this paper, we incorporate GIN (Graph Isomorphism Network)[30], a powerful Graph Neural Network (GNN), to be the basis of the policy network of the lower-level agent. We use the REINFORCE algorithm [28] to train the policy network. Details of the policy network are shown in Appendix H. + +# 4 Offline Evaluation + +# 4.1 Experiments Settings + +We start with designing a simulator to shed light on the contributions of the proposed framework under more controlled settings. Details of the simulator can be found in Appendix C. To comprehensively verify the effectiveness of our approach on problems of different scales, we use four types of datasets of different sizes, i.e., 15 orders with 5 vehicles, 50 orders with 5 vehicles, 300 orders with 20 vehicles, 1000 orders with 50 vehicles (matching the practical problem of thousand scales). Note that the orders/vehicles ratios are set according to realistic business settings. Each type of datasets contains 10 datasets, including 7 training sets and 3 test sets according to the ratio of 7:3 (e.g., 300-1, 300-2 and 300-3 are test sets with 300 orders). The vehicles have the same load capacity. Details of the datasets are described in Appendix D. According to the realistic business settings, the time span between two consecutive decision points is set to 10 minutes in the simulator. + +The comparisons of different methods proceed as follows. For our approach, we first train a shared model on each type of training datasets and then evaluate the model on the test datasets of the same size. At each decision point, the upper-level agent decides whether to release orders to the lower-level agent. The lower-level agent is executed for no more than 10 minutes after receiving orders from the upper-level agent. Both agents are trained simultaneously. This training process is relatively stable due to the following reasons. The iterative solution optimization process (starts from an initial greedy solution) of our lower-level agent can ensure the obtained solutions have relatively high quality even at the initial training stages. In other words, the solutions given by the lower-level agent are relatively stable. Therefore, the unstable issue of co-training both levels of policies in our case is negligible, and thus both levels can be trained simultaneously. For baselines showed in Section 4.2, we also run them for up to 10 minutes at each decision point. We run the simulator until all the orders of the dataset are dispatched and completed to ensure fair comparisons. All the results in the experiments are obtained by running each algorithm ten times to get the mean and variance value of the optimization objective. + +# 4.2Baselines + +To help readers better understand the baselines, we name them in the format of 'upper-level method + lower-level method' except for the Optimal baseline. '10min-Interval' means the dynamic problem is partitioned into static sub-problems with a fixed interval of ten minutes. '1order-Interval' means the dynamic problem is partitioned into static sub-problems consists of a single order. + +10min-Interval + Greedy: Greedy [15] is the most widely-used method in industry, which is also the online deployed baseline method. The solution routes are expanded by greedily inserting new pickup and delivery nodes until all the orders are inserted. + +10min-Interval + ALNS: ALNS [29] is one of the most representative meta-heuristic local search frameworks for solving DPDP that uses a series of operators to improve the solution. In each iteration, an operator is selected to destroy the current solution, and an operator is selected to repair the solution. + +1order-Interval + E2ERL: According to [14], we use a DQN model to assign vehicles to each generated order and insert each order into the vehicle's order queue using the Greedy algorithm. It's an E2ERL (end-to-end RL) algorithm. + +10min-Interval + ST-DDGN: ST-DDGN [12] is the state-of-the-art method that predicts future orders of DPDP. Then both the predicted orders and real generated orders are considered when solving each sub-problem using E2ERL. + +Optimal: We convert DPDPs to static PDPs as we can obtain all the orders' information beforehand in offline style. Then we use Gurobi to solve the corresponding MIP model to get the optimal solution. As Gurobi can only solve small-scale PDPs within acceptable time due to the NP-hard property, we only compare with the optimal solution on problems of 15 and 50 orders in Section 4.4.1. + +# 4.3 Main Results + +Here we show part of the experimental results in Table 1. The complete results are shown in Table 6 of Appendix I. The objective improvement measurement is the improvement percentage of each algorithm compared with the Greedy algorithm. Our approach consistently outperforms all baselines + +Table 1: Main results of different methods on test datasets + +
DatasetAlgorithmOvertimeAvg_DisObjectiveObj Impro
50-110min-Interval + Greedy0109.30109.300.00%
1order-Interval + E2ERL096.5696.5611.66%
10min-Interval + ALNS0107.95107.951.24%
10min-Interval + ST-DDGN0108.95108.950.32%
Our (Upper-level RL + Lower-level RL)093.7093.7014.27%
300-110min-Interval + Greedy0147.78147.780.00%
1order-Interval + E2ERL0158.39158.39-7.18%
10min-Interval + ALNS0137.31137.317.08%
10min-Interval + ST-DDGN0131.99131.9910.68%
Our (Upper-level RL + Lower-level RL)0122.42122.4217.16%
1000-110min-Interval + Greedy0183.04183.040.00%
1order-Interval + E2ERL0180.36180.361.46%
10min-Interval + ALNS0174.68174.684.57%
10min-Interval + ST-DDGN0171.09171.096.53%
Our (Upper-level RL + Lower-level RL)0159.18159.1813.04%
+ +on all datasets (lower total objective is better). On some datasets, the baselines have overtime results due to their lack of long-term planning and exhaustively optimization of each static problem from a myopic perspective. As a result, dispatching of some orders is delayed for too long, and finally, overtime is inevitable in any case. In contrast to this, our upper-level RL partitions the dynamic problem into sub-problems considering the balance between the orders overtime (seconds) risk and optimization of vehicle travelling distances (kilometers), and our lower-level RL is responsible for the optimization of each static sub-problem. The cooperation of the two agents enables our method to find solutions with less overtime and vehicle travelling distances on the overall dynamic problem from a long-term perspective. The comparison of the learning curves of all learning-based methods on 50-1 are shown in Figure 11 in Appendix I. + +# 4.4 Ablation Studies + +# 4.4.1 How far is our lower-level agent from the optimal one on static PDP? + +We convert the DPDP to a single static PDP as described in Section 4.2. As the orders should be assigned to vehicles all at once, there is no need to use an upper-level agent. Similarly, without the prediction of future orders, ST-DDGN is essentially the same as E2ERL. Therefore we only use the lower-level agent and E2ERL in the static PDP. Each algorithm is run without time or step limitation to discover its full potential. As shown in Table 2 and 3, the difference of the total objective of our method with the optimal solution is much smaller than the baselines (as all the overtime is 0, the column is omitted from the two Tables). The time consumption is much shorter than ALNS and Gurobi. It is because our method can exert the generalization ability to quickly improve the initial solution by using the most appropriate operators based on the experiences obtained from training, without the need of manually designing complicated search as in ALNS and Gurobi. Note that the time consumption of Gurobi on problems of 50 orders is represented using hyphen symbol '-', which means we can't get results even after 100 hours due to the various complex constraints as described in Appendix A. Comparing with baselines, our method is the most qualified to meet the online deployment requirements that the algorithm should obtain high-quality solutions with fast speed. + +Table 2: Results on static 15-1, 15-2, 15-3 + +
AlgorithmAvg_DisObjectiveObj ImproTime
Greedy53.8553.850.00%0.38s
E2ERL51.7051.703.99%0.58s
ALNS51.5851.584.22%405s
Our (Lower-level RL)45.7245.7215.10%68.21s
Optimal44.3544.3517.64%141360s
Greedy69.6169.610.00%0.40s
E2ERL68.0068.002.31%0.79s
ALNS62.6262.6210.04%606s
Our (Lower-level RL)62.3262.3210.47%27.96s
Optimal57.4857.4817.43%193680s
Greedy78.7378.730.00%0.34s
E2ERL59.0259.0225.03%0.83s
ALNS52.2152.2133.68%920s
Our (Lower-level RL)50.9550.9535.29%71.98s
Optimal50.7550.7535.54%28651s
+ +Table 3: Results on static 50-1, 50-2, 50-3 + +
AlgorithmAvg_DisObjectiveObj ImproTime
Greedy98.6898.680.00%66.73s
E2ERL94.9494.943.79%52.64s
ALNS96.9896.981.72%10728.34s
Our (Lower-level RL)82.4382.4316.47%1459.23s
Optimal----
Greedy80.6780.670.00%22.27s
E2ERL76.0476.045.74%16.66s
ALNS65.3165.3119.04%6012.56s
Our (Lower-level RL)58.4258.4227.58%1152.64s
Optimal----
Greedy83.3483.340.00%44.31s
E2ERL80.9280.922.90%20.34s
ALNS80.5180.513.40%4140.15s
Our (Lower-level RL)72.6672.6612.81%1998.09s
Optimal----
+ +# 4.4.2 Does lower-level agent learn how to select operators? + +To verify that our lower-level agent learns to choose the most suitable operators at different states, we compare the results of different operator selection methods on both static problems and dynamic problems. We first compare the total objective during the solution improvement process on the static problems using the lower-level agent with the method that randomly selects operators. As the improvement-reconstruct iteration process designed in Section 3.3 ensures the quality of the solution can be monotonically improved, selecting operators randomly is also a powerful baseline that can achieve satisfactory performance for the static PDP. + +Therefore, for the static problem, we mainly focus on whether the lower-level agent can improve the solving speed. As we can see in Figure 4, at the same step, choosing operators using lower-level RL can reach a better objective than randomly choosing operators, which indicates our lower-level method learned to accelerate the searching for better solutions. Since the static sub-problems of a dynamic problem are not independent of each other, the small gap between the above + +![](images/7578984ba0a3827edee1677f50d001f5e3dfdafe270b01ae239e6d19e188adc3.jpg) +(a) 50-1 + +![](images/c367563c101871c0f734cdbd5efa8dfd77ae94b22883042c697a3f71aaa520ad.jpg) +(b) 50-2 + +![](images/6f7ce1d086580a0ff9db9bc7cdcb834404e06526f04a99292aea5802fa4d6136.jpg) +(c) 50-3 +Figure 4: Comparison of different selection methods of operators on static problems + +two methods in a static sub-problem will continue to enlarge in the subsequent sub-problems, resulting in a very large result gap on the entire dynamic problem. We compare the total objectives of the entire dynamic problems in Table 4. To ensure fairness, we control the upper-level methods to be '10min-Interval' and use the lower-level agent and random selection as lower-level methods, respectively. As we can see in Table 4, using the lower-level agent can help find better solutions on the entire dynamic problems. + +# 4.4.3 Does the upper-level agent learn to partition DPDP from a long-term perspective? + +To verify that our upper-level agent learns to partition the dynamic problem into static subproblems from a long-term perspective, we compare the results of differ + +Table 4: Effectiveness of lower-level agent and upper-level agent + +
DatasetMethodOvertimeAvg DisObjectiveObj Impro
300-110min-Interval + Random Search0139.16 ± 8.59139.160.00%
10min-Interval + Lower-level RL0126.95 ± 4.80126.958.77%
Our (Upper-level RL + Lower-level RL)0122.42 ± 4.02122.4212.03%
300-210min-Interval + Random Search0166.31 ± 10.20166.310.00%
10min-Interval + Lower-level RL0154.39 ± 8.13154.397.17%
Our (Upper-level RL + Lower-level RL)0142.33 ± 7.47142.3314.42%
300-310min-Interval + Random Search0168.69 ± 7.70168.690.00%
10min-Interval + Lower-level RL0156.64 ± 7.50156.647.14%
Our (Upper-level RL + Lower-level RL)0146.88 ± 13.91146.8812.93%
+ +ent static sub-problems partitioning methods. We compare our upper-level agent with the '10min-Interval' method. As we can see in Table 4, using an upper-level agent to partition the dynamic problem reaches the best objective. The results illustrate that our upper-level agent can partition the problem from a long-term perspective to balance the orders overtime risk and optimization of vehicle travelling distances. + +# 4.4.4 Can our method generalized to larger-scale problems? + +To verify our method's generalization ability, we evaluate the models trained using datasets of 300 orders / 20 vehicles on larger-scale datasets, i.e., 1000 orders / 50 vehicles. As shown in Table 5, the model trained on datasets of 300 orders achieves similar performance with the one trained on datasets of 1000 orders. + +Table 5: Generalization verification + +
DatasetModelOvertimeAvg_DisObjective
1000-1Trained on 10000159.18 ± 4.10159.18
Trained on 3000170.78 ± 10.27170.78
1000-2Trained on 10000196.66 ± 9.52196.66
Trained on 3000209.48 ± 8.68209.48
1000-3Trained on 10000176.39 ± 7.61176.39
Trained on 3000182.83 ± 5.64182.83
+ +Note that the model trained on datasets of 300 orders also outperforms the baselines in Table 1. It verifies that our method can be generalized to new problems of different scales without fine-tuning after well trained on existing problems. + +# 5 Online Testing + +We deployed our method on the order dispatching system in Huawei supply chain. In the online experiments, we compare our method with the previously online deployed greedy algorithm (10min-Interval + Greedy). For a fair comparison, we control the vehicles and the nodes (factories and warehouses) involved in the online testing to be the same. Normally, a standard A/B testing is required to be performed on homogeneous experimental groups using different methods + +![](images/7600866461ebc3a6afed928522dd0a15b51e9b5f6d809fffe7ed0752659cef6e.jpg) +Figure 5: Online Results + +at the same time dimension. Then experimental data of each group are collected and evaluated to choose the best method. However, in our situation, it's unrealistic to split each order into two sub-orders to ensure the experimental groups are homogeneous. Besides, a large number of offline experiments have demonstrated that our method is significantly better than the greedy algorithm. Even in the worst case when there is no improvement in each sub-problem, our method is still the same with Greedy. Thus, we directly replaced the greedy algorithm for online deployment. Figure 5 summarises the results from Nov 2020 to Apr 2021. The points of Nov and Dec 2020 shown in Figure 5 are generated by greedy algorithm and our method is deployed from Jan to Apr 2021. As we can see, our method can reduce the average orders' overtime and vehicles' travelling distances compared with the greedy baseline. Even with more orders, our method can still reach a better optimization objective. Note that in the actual business scenario, orders generated in each day follow a similar distribution with a small variance. These results indicate that our method could achieve a better performance in the realistic deployment environment with varied data distributions. + +# 6 Conclusions + +In this paper, we propose a novel hierarchical reinforcement learning based optimization framework to solve the large-scale DPDP in the real world. The upper-level agent is equipped with the far-sight ability whose target is to optimize the long-term cumulative objective. The lower-level agent exerts the generalization ability of GNN to quickly improve the solution quality by transferring the knowledge (policy) learned from training. The cooperation of the upper-level and lower-level agents enables our method to find globally better solutions. Extensive offline simulation on the simulator built on real historical data and online testing verify that our method can obtain higher-quality solutions with faster running speed. + +The core idea of our learning-based framework are beneficial to a number of similar problems in the supply chain community that have time-evolving components (e.g., orders/customers/tasks), such as dynamic routing problems, dynamic flow shop scheduling, dynamic job shop scheduling, dynamic bin packing and so on. As orders/customers/tasks of all these dynamic problems are online generated that are not known a priori, the orders/customers/tasks should first be cached and then be dispatched. In this way, these problems can be modeled as hierarchical optimization problems like DPDP that the upper-level problem is "how to cache orders/customers/tasks" and the lower-level problem is "how to dispatch cached orders/customers/tasks". We will verify our proposed framework in these fields in the future work. + +# Acknowledgments and Disclosure of Funding + +The work is supported by the National Natural Science Foundation of China (Grant Nos: U1836214) and the New Generation of Artificial Intelligence Science and Technology Major Project of Tianjin under grant: 19ZXZNGX00010. + +# References + +[1] Irwan Bello, Hieu Pham, Quoc V Le, Mohammad Norouzi, and Samy Bengio. Neural combinatorial optimization with reinforcement learning. arXiv preprint arXiv:1611.09940, 2016. +[2] Enrique Benavent, Mercedes Landete, Enrique Mota, and Gregorio Tirado. The multiple vehicle pickup and delivery problem with lifo constraints. European Journal of Operational Research, 243(3):752-762, 2015. +[3] Gerardo Berbeglia, Jean-François Cordeau, and Gilbert Laporte. Dynamic pickup and delivery problems. European journal of operational research, 202(1):8-15, 2010. +[4] Francesco Carrabs, Jean-François Cordeau, and Gilbert Laporte. Variable neighborhood search for the pickup and delivery traveling salesman problem with lifo loading. INFORMS Journal on Computing, 19 (4):618-632, 2007. +[5] Brenda Cheang, Xiang Gao, Andrew Lim, Hu Qin, and Wenbin Zhu. Multiple pickup and delivery traveling salesman problem with last-in-first-out loading and distance constraints. European journal of operational research, 223(1):60-75, 2012. +[6] Xinyun Chen and Yuandong Tian. Learning to perform local rewriting for combinatorial optimization. In Hanna M. Wallach, Hugo Larochelle, Alina Beygelzimer, Florence d'Alché-Buc, Emily B. Fox, and Roman Garnett, editors, Advances in Neural Information Processing Systems 32: Annual Conference on Neural Information Processing Systems 2019, NeurIPS 2019, December 8-14, 2019, Vancouver, BC, Canada, pages 6278-6289, 2019. URL https://proceedings.neurips.cc/paper/2019/bit/131f383b434fdf48079bddf1e44e2d9a5-AAbstract.html. +[7] Michel Gendreau, Francois Guertin, Jean-Yves Potvin, and René Séguin. Neighborhood search heuristics for a dynamic vehicle dispatching problem with pick-ups and deliveries. Transportation Research Part C: Emerging Technologies, 14(3):157-174, 2006. +[8] Gianpaolo Ghiani, Emanuele Manni, Antonella Quaranta, and Chefi Triki. Anticipatory algorithms for same-day courier dispatching. Transportation Research Part E: Logistics and Transportation Review, 45 (1):96-106, 2009. +[9] Péter Györgyi and Tamás Kis. A probabilistic approach to pickup and delivery problems with time window uncertainty. European Journal of Operational Research, 274(3):909–923, 2019. +[10] Matheus Nohra Haddad, Rafael Martinelli, Thibaut Vidal, Simone Martins, Luiz Satoru Ochi, Marcone Jamilson Freitas Souza, and Richard Hartl. Large neighborhood-based metaheuristic and branch-and-price for the pickup and delivery problem with split loads. European Journal of Operational Research, 270(3): 1014-1027, 2018. +[11] Farzaneh Karami, Wim Vancroonenburg, and Greet Vanden Berghe. A periodic optimization approach to dynamic pickup and delivery problems with time windows. Journal of Scheduling, 23(6):711-731, 2020. +[12] Xijun Li, Weilin Luo, Mingxuan Yuan, Jun Wang, Jiawen Lu, Jie Wang, Jinhu Lv, and Jia Zeng. Learning to optimize industry-scale dynamic pickup and delivery problems. 37th IEEE International Conference on Data Engineering, 2021. +[13] Hao Lu, Xingwen Zhang, and Shuang Yang. A learning-based iterative method for solving vehicle routing problems. In 8th International Conference on Learning Representations, ICLR 2020, Addis Ababa, Ethiopia, April 26-30, 2020. OpenReview.net, 2020. URL https://openreview.net/forum?id=BJe1334YDH. +[14] Hongzi Mao, Malte Schwarzkopf, Shaileshh Bojja Venkatakrishnan, Zili Meng, and Mohammad Alizadeh. Learning scheduling algorithms for data processing clusters. In Proceedings of the ACM Special Interest Group on Data Communication, pages 270-288. 2019. +[15] Snežana Mitrovic-Minić and Gilbert Laporte. Waiting strategies for the dynamic pickup and delivery problem with time windows. Transportation Research Part B: Methodological, 38(7):635-655, 2004. +[16] Snezana Mitrovic-Minic, Ramesh Krishnamurti, Gilbert Laporte, et al. Double-horizon based heuristics for the dynamic pickup and delivery problem with time windows. Transportation Research Part B: Methodological, 38(8):669-685, 2004. +[17] 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. + +[18] MohammadReza Nazari, Afshin Oroojlooy, Lawrence V. Snyder, and Martin Takác. Reinforcement learning for solving the vehicle routing problem. In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicolò Cesa-Bianchi, and Roman Garnett, editors, Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada, pages 9861-9871, 2018. URL https://proceedings.neurips.cc/paper/2018/hash/9fb4651c05b2ed70fba5afe0b039a550-Abstract.html. +[19] Maciek Nowak, Özlem Ergun, and Chelsea C White III. Pickup and delivery with split loads. Transportation Science, 42(1):32-43, 2008. +[20] GUROBI OPTIMIZATION. Inc. gurobi optimizer reference manual, 2015. URL: http://www.gurobi.com, page 29, 2014. +[21] Bo Peng, Yuan Zhang, Zhipeng Lu, TCE Cheng, and Fred Glover. A learning-based memetic algorithm for the multiple vehicle pickup and delivery problem with lifo loading. Computers & Industrial Engineering, 142:106241, 2020. +[22] Martin Savelsbergh and Marc Sol. Drive: Dynamic routing of independent vehicles. Operations Research, 46(4):474-490, 1998. +[23] Zhiyuan Su, Wantao Li, Jicao Li, and Bin Cheng. Heterogeneous fleet vehicle scheduling problems for dynamic pickup and delivery problem with time windows in shared logistics platform: formulation, instances and algorithms. International Journal of Systems Science: Operations & Logistics, pages 1-25, 2021. +[24] Barrett W Thomas. Waiting strategies for anticipating service requests from known customer locations. Transportation Science, 41(3):319-331, 2007. +[25] Paolo Toth and Daniele Vigo. Vehicle routing: problems, methods, and applications. SIAM, 2014. +[26] Marlin W Ulmer, Barrett W Thomas, Ann Melissa Campbell, and Nicholas Woyak. The restaurant meal delivery problem: Dynamic pickup and delivery with deadlines and random ready times. Transportation Science, 55(1):75-100, 2021. +[27] Oriol Vinyals, Meire Fortunato, and Navdeep Jaitly. Pointer networks. In Corinna Cortes, Neil D. Lawrence, Daniel D. Lee, Masashi Sugiyama, and Roman Garnett, editors, Advances in Neural Information Processing Systems 28: Annual Conference on Neural Information Processing Systems 2015, December 7-12, 2015, Montreal, Quebec, Canada, pages 2692-2700, 2015. URL https://proceedings.neurips.cc/paper/2015/bit/29921001f2f04bd3baee84a12e98098f-Abstraction.html. +[28] Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229-256, 1992. +[29] David Wolfinger. A large neighborhood search for the pickup and delivery problem with time windows, split loads and transshipments. Computers & Operations Research, 126:105110. +[30] Keyulu Xu, Weihua Hu, Jure Leskovec, and Stefanie Jegelka. How powerful are graph neural networks? In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019. URL https://openreview.net/forum?id=ryGs6iA5Km. \ No newline at end of file diff --git a/ahierarchicalreinforcementlearningbasedoptimizationframeworkforlargescaledynamicpickupanddeliveryproblems/images.zip b/ahierarchicalreinforcementlearningbasedoptimizationframeworkforlargescaledynamicpickupanddeliveryproblems/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f75436c4826790d9374d9ce3c041746141b78655 --- /dev/null +++ b/ahierarchicalreinforcementlearningbasedoptimizationframeworkforlargescaledynamicpickupanddeliveryproblems/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:47e03784c0e6dbba3d008aaaf00ac83574e438aa81dc023e58e97b641c724a41 +size 366150 diff --git a/ahierarchicalreinforcementlearningbasedoptimizationframeworkforlargescaledynamicpickupanddeliveryproblems/layout.json b/ahierarchicalreinforcementlearningbasedoptimizationframeworkforlargescaledynamicpickupanddeliveryproblems/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..e497f43152b9de75a94593ef01e4ef036cf20518 --- /dev/null +++ b/ahierarchicalreinforcementlearningbasedoptimizationframeworkforlargescaledynamicpickupanddeliveryproblems/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8f11abda4b8d5118bf56df0f7926eaed4ea48434ed1289901967b7d4ca66cf5 +size 319259 diff --git a/ahighlyefficientgroupelasticnetalgorithmwithanapplicationtofunctiononscalarregression/6d0c258a-1463-4641-a4b9-7eea86c27652_content_list.json b/ahighlyefficientgroupelasticnetalgorithmwithanapplicationtofunctiononscalarregression/6d0c258a-1463-4641-a4b9-7eea86c27652_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..e829e6e942d15dcedd2b3691dad47fa75dee099c --- /dev/null +++ b/ahighlyefficientgroupelasticnetalgorithmwithanapplicationtofunctiononscalarregression/6d0c258a-1463-4641-a4b9-7eea86c27652_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:df877b0b049093b4a81cc2d207585b9f90025b402e50fb3af70ee48a01d37bba +size 95788 diff --git a/ahighlyefficientgroupelasticnetalgorithmwithanapplicationtofunctiononscalarregression/6d0c258a-1463-4641-a4b9-7eea86c27652_model.json b/ahighlyefficientgroupelasticnetalgorithmwithanapplicationtofunctiononscalarregression/6d0c258a-1463-4641-a4b9-7eea86c27652_model.json new file mode 100644 index 0000000000000000000000000000000000000000..eb5a8fbd30f982250cc75904af8fd8bffe5a0681 --- /dev/null +++ b/ahighlyefficientgroupelasticnetalgorithmwithanapplicationtofunctiononscalarregression/6d0c258a-1463-4641-a4b9-7eea86c27652_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5363eb54a360172fde41b964a4d9a03f25ffac98b0f9d9b2f5204216a8b06fc2 +size 121019 diff --git a/ahighlyefficientgroupelasticnetalgorithmwithanapplicationtofunctiononscalarregression/6d0c258a-1463-4641-a4b9-7eea86c27652_origin.pdf b/ahighlyefficientgroupelasticnetalgorithmwithanapplicationtofunctiononscalarregression/6d0c258a-1463-4641-a4b9-7eea86c27652_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c396ff121976c533c68b32a9dc7fb4bcb0e84d9e --- /dev/null +++ b/ahighlyefficientgroupelasticnetalgorithmwithanapplicationtofunctiononscalarregression/6d0c258a-1463-4641-a4b9-7eea86c27652_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:642e4446a73c81a8870fe43982a72822cb24a40f858ba83d35092b702800ecac +size 1106756 diff --git a/ahighlyefficientgroupelasticnetalgorithmwithanapplicationtofunctiononscalarregression/full.md b/ahighlyefficientgroupelasticnetalgorithmwithanapplicationtofunctiononscalarregression/full.md new file mode 100644 index 0000000000000000000000000000000000000000..7b65e488cd8cdf4ccad6db4c6936d9204e7cc710 --- /dev/null +++ b/ahighlyefficientgroupelasticnetalgorithmwithanapplicationtofunctiononscalarregression/full.md @@ -0,0 +1,423 @@ +# A Highly-Efficient Group Elastic Net Algorithm with an Application to Function-On-Scalar Regression + +Tobia Boschi + +Department of Statistics + +Penn State University tub37@psu.edu + +Matthew Reimherr + +Department of Statistics + +Penn State University mlr36@psu.edu + +Francesca Chiaromonte + +Department of Statistics + +Penn State University, EMbeDS + +Sant'Anna School of + +Advanced Studies + +fxc11@psu.edu + +# Abstract + +Feature Selection and Functional Data Analysis are two dynamic areas of research, with important applications in the analysis of large and complex data sets. Straddling these two areas, we propose a new highly efficient algorithm to perform Group Elastic Net with application to function-on-scalar feature selection, where a functional response is modeled against a very large number of potential scalar predictors. First, we introduce a new algorithm to solve Group Elastic Net in ultra-high dimensional settings, which exploits the sparsity structure of the Augmented Lagrangian to greatly reduce computational burden. Next, taking advantage of the properties of Functional Principal Components, we extend our algorithm to the function-on-scalar regression framework. We use simulations to demonstrate the CPU time gains afforded by our approach compared to its best existing competitors, and present an application to data from a Genome Wide Association Study on childhood obesity. + +# 1 Introduction + +As problems involving very large and potentially structured data become ever more ubiquitous, attention is being devoted to the integration of approaches and techniques from the areas of Feature Selection and Functional Data Analysis (FDA). Indeed, more and more regression applications comprise a large number number of variables – some of which are scalar and some of which are suitable for a functional representation, such as longitudinal measurements or biomedical images (Sorensen et al., 2013; Ullah and Finch, 2013; Cremona et al., 2019). A great deal of recent work has been concerned with feature selection in these applications. Matsui and Konishi (2011); Gertheiss et al. (2013); Fan et al. (2015) study the case where the response is scalar and the features are functional. Chen et al. (2016); Fan and Reimherr (2016); Barber et al. (2017); Parodi et al. (2018); Mirshani and Reimherr (2019) tackle the so called function-on-scalar case, where the response is functional and the features are scalar – focusing on settings in which the number of features is bigger than the number of observations. However, recent developments in optimization have demonstrated that substantial computational gains can still be made when the number of features is massive (e.g $\sim$ 1e6). In this article, we present Functional Group Elastic Net (fgen), a novel and highly efficient method to solve the function-on-scalar feature selection problem in ultra-high-dimensional settings – where the number of features is indeed massive and much larger than the number of observations. The ability to solve these problems with a lower computational burden is increasingly critical. Given the complex, noisy nature of much contemporary data, changing some aspects of their pre-processing or some of the tuning parameters involved in the analysis can lead to completely different results (Krawczyk and Cano, 2018; Murdoch et al., 2019). For this reason, repeating an analysis multiple + +times (e.g., with different choices of data preprocessing pipelines, or to tune certain meta-parameters) is paramount to capture significant signals and ensure the stability of outcomes (Yu and Kumbier, 2020). Substantial reductions in computational burden enable such repetition, allowing scientists and practitioners to conduct truly meaningful and reproducible analyses. + +Group Elastic Net incorporates the group structure (Yuan and Lin, 2006) and the Elastic Net penalty (Zou and Hastie, 2005) into a penalized regression framework. The former allows one to represent each feature (or component) by a group of variables. The latter induces sparsity and regularizes the estimates. We consider the case where all groups have the same size $k$ . The minimization problem is formulated as follows: + +$$ +\min _ {B} (1 / 2) \| X B - Y \| _ {2} ^ {2} + \lambda_ {1} \sum_ {i = 1} ^ {p} \| B _ {i} \| _ {2} + (\lambda_ {2} / 2) \sum_ {i = 1} ^ {p} \| B _ {i} \| _ {2} ^ {2}. \tag {1} +$$ + +Let $p$ be the number of features, $n$ the number of statistical units, and $\| \cdot \|_2$ the $l_2$ norm for matrices, i.e. the Frobenius norm, and vectors. Then, $X \in \mathbb{R}^{n \times p}$ is the design matrix (that we assume to have standardized columns), $Y \in \mathbb{R}^{n \times k}$ the response matrix, and $B \in \mathbb{R}^{p \times k}$ the coefficient matrix. In other words, (1) describes a sparse multi-task model where the response and each of the features are represented by a group of $k$ coefficients (Zhang and Yang, 2018). Throughout this article, we follow the notation in Johnson et al. (2014) and we use the subscripts $i$ and $(i)$ to indicate the $i$ -th row and the $i$ -th column of a matrix, respectively. Thus, $B_i \in \mathbb{R}^k$ are the coefficient values associated with the $i$ -th group, and $X_{(i)} \in \mathbb{R}^n$ are the observed values relative to the $i$ -th feature. Before proceeding, note that (1) can be expressed as + +$$ +\min _ {B} (h (X B) + \pi (B)), \tag {P} +$$ + +where $h(XB) = (1/2)\|XB - Y\|_2^2$ is the least-squares loss function and $\pi(B) = \sum_{i=1}^{p}\pi(B_i) = \lambda_1\sum_{i=1}^{p}\|B_i\|_2 + (\lambda_2/2)\sum_{i=1}^{p}\|B_i\|_2^2$ is the Group Elastic Net penalty function. The first term in $\pi$ is not differentiable and creates sparsity at the group level, i.e., if a component is selected, then all its coefficients are selected and vice-versa. The second term is a Ridge-type penalty which reduces model complexity and tries to control variance inflation due to multicollinearity – feature selection models are indeed known to be less effective and not reliable in scenarios characterized by very high collinearity among features (Katrutsa and Strijov, 2015). $\lambda_1$ and $\lambda_2$ are penalty parameters $>0$ and control the weight of the two penalties with respect to the least square loss. + +To solve (1), we develop a new Semi-smooth Newton Augmented Lagrangian (SsNAL) algorithm. We then extend it to the function-on-scalar regression framework by means of Functional Principal Components (FPC) (James et al., 2000; Chiou et al., 2004; Hall and Hosseini-Nasab, 2006). SsNAL exploits the sparsity induced by the augmented Lagrangian second order information to guarantee a super-linear convergence and greatly reduce the computational cost. This methodology, first introduced by Tomioka and Sugiyama (2009) and Tomioka et al. (2011), has been recently used in several applications, e.g., to regular Lasso (Li et al., 2018), constrained Lasso (Deng and So, 2019), and Elastic-Net (Boschi et al., 2020). However, incorporating the group structure significantly increases the dimension of the problem. Indeed, (1) is not separable and the optimization must be carried out jointly across the coordinates of the outcome. Therefore, considering a new group penalty while preserving the efficiency of the method requires that we carefully redefine a set of all-new mathematical operators and the theory behind them. + +We implemented an efficient version of fgen in python and benchmarked it against the two best Group Elastic Net solvers we found in the literature: the python package sklearn (Pedregosa et al., 2011) and the R package glmnet (Friedman et al., 2010), which is written in fortran. Both of these solvers implement a highly optimized coordinate descent algorithm (Friedman et al., 2010; Breheny and Huang, 2015) and outperform competitors such as FISTA (Beck and Teboulle, 2009; Bonnefoy et al., 2015), ADMM (Deng et al., 2013; Zhu, 2017), and proximal gradient (Chen et al., 2010) by at least one order of magnitude in terms of CPU time. Our simulation results demonstrate that in sparse scenarios fgen is at least 3 times faster than glmnet and more than 10 times faster than sklearn. We also applied fgen to the Intervention Nurses Start Infants Growing on Healthy Trajectories (INSIGHT) study (Paul et al., 2014), which investigates risk factors for childhood obesity. Specifically, we examined the association between hundreds of thousand of Single Nucleotide Polymorphisms (SNPs) and growth curves, which represent a functional outcome. + +The remainder of the article is organized as follows. In Section 2 we describe the Group Elastic Net problem and introduce some preliminary results. In Section 3 we present our new methodology + +and illustrate how to extend it to a function-on-scalar feature selection problem. In Section 4 we investigate the performance of our method on simulated data and apply it to data from INSIGHT. In Section 5 we provide final remarks and discuss future developments. Proofs of theoretical results and additional simulations are included in the Supplement. The fgen code is available at https://github.com/tobiaboschi/fgen + +# 2 Preliminaries + +In this section we define the Group Elastic Net problem and we introduce some results related to Fenchel conjugate functions and proximal operators, which are essential tools in our developments. + +# 2.1 Fenchel conjugate function and proximal operator of $\pi (\mathbf{B})$ + +Fenchel conjugate functions (Fenchel, 1949) allow one to more readily define the dual problem (Boyd and Vandenberghe, 2004) of (P), which is called the primal problem. Let $\mathcal{X} \subseteq \mathbb{R}^p$ be a convex set and $f: \mathcal{X} \to \mathbb{R}$ . Then, the conjugate function of $f$ is $f^*: \mathcal{X}^* \to \mathbb{R}$ defined as $f^*(z) = \sup_{x \in \mathcal{X}} (\langle z, x \rangle - f(x))$ , where $\mathcal{X}^* = \{z : \sup_{x \in \mathcal{X}} (\langle z, x \rangle - f(x)) < \infty\}$ . $\langle \cdot, \cdot \rangle$ indicates the inner product. i.e. the dot product. If $\mathcal{X} \subseteq \mathbb{R}^{p \times k}$ , i.e. if $z$ is a matrix, the definition is still valid but $\langle \cdot, \cdot \rangle$ is the Frobenius inner product. In our first proposition we provide a closed form solution for the Group Elastic Net penalty conjugate function (see Supplemental Section A.1 for a proof). + +Proposition 1. Given $Z \in \mathbb{R}^{p \times k}$ , the conjugate function of $\pi$ has the form + +$$ +\pi^ {*} (Z) = \sum_ {i = 1} ^ {p} \pi^ {*} \left(Z _ {i}\right) = \left(2 \lambda_ {2}\right) ^ {- 1} \sum_ {i = 1} ^ {p} \left(\left[ \| Z _ {i} \| _ {2} - \lambda_ {1} \right] _ {+}\right) ^ {2}, \tag {2} +$$ + +where $[\cdot ]_{+}$ is the positive part operator; $[s]_{+} = s$ if $s > 0$ and 0 otherwise. + +Note that $\pi^{*}(Z)$ is a continuous differentiable function. This is a more general result than the one presented in Li et al. (2018); Boschi et al. (2020), because we extend the definition of $\pi^{*}$ to the case where $Z$ is a matrix and not just a vector. In the simple scenario where $k = 1$ , i.e. when every group consists of just one variable, we obtain again the conjugate function of the standard Elastic Net penalty. Notably, starting from a non-separable objective function, we derive a $\pi^{*}$ which does separate. As we will see in Section 3.1, this allows one to induce a new level of sparsity in the Lagrangian problem which is actually key for the massive computational advantage offered by fgen. + +Proximal operators (Rockafellar, 1976a,b) are fundamental in many optimization algorithms. Given a lower semi-continuous convex function $f: \mathbb{R}^p \to \mathbb{R}$ , the proximal operator of $f$ at $x$ with parameter $\sigma > 0$ is denoted as $\operatorname{prox}_{\sigma f}: \mathbb{R}^p \to \mathbb{R}^p$ and defined as $\operatorname{prox}_{\sigma f}(x) = \arg \min_t(f(t) + (2\sigma)^{-1} \| t - x \|_2^2)$ . If $f: \mathbb{R}^{p \times k} \to \mathbb{R}$ , i.e. if $x$ is a matrix, then $\operatorname{prox}_{\sigma f}: \mathbb{R}^{p \times k} \to \mathbb{R}^{p \times k}$ and $\| \cdot \|_2$ is the Frobenius norm. Parikh et al. (2014) and Beck (2017) (Chapter 6) provide numerous examples and properties. Combining their results, one can easily find the form of the proximal operator of $\pi(B)$ provided in our second proposition (see Supplemental Section A.2 for a proof). + +Proposition 2. The proximal operator of $\pi (B)$ is: $\mathrm{prox}_{\sigma \pi}(B) = \left(\mathrm{prox}_{\sigma \pi}(B_1),\dots ,\mathrm{prox}_{\sigma \pi}(B_p)\right)^T$ where + +$$ +\operatorname {p r o x} _ {\sigma \pi} \left(B _ {i}\right) = \left(1 + \sigma \lambda_ {2}\right) ^ {- 1} \left[ 1 - \left\| B _ {i} \right\| _ {2} ^ {- 1} \sigma \lambda_ {1} \right] _ {+} B _ {i}. \tag {3} +$$ + +Note that $\mathrm{prox}_{\sigma \pi}(B): \mathbb{R}^{p \times k} \to \mathbb{R}^{p \times k}$ . To implement fgen, one also needs the proximal operator of $\pi^*$ , which can be obtained through the Moreau decomposition: + +$$ +x = \operatorname {p r o x} _ {\sigma \pi} (x) + \sigma \operatorname {p r o x} _ {\pi^ {*} / \sigma} (x / \sigma), \sigma > 0. \tag {4} +$$ + +# 2.2 Dual formulation and Augmented Lagrangian + +Here we introduce the dual Group Elastic Net problem and its augmented Lagrangian. From Boyd and Vandenberghe (2004), a possible dual formulation of (P) is + +$$ +\min _ {V, Z} \left(h ^ {*} (V) + \pi^ {*} (Z)\right) \text {s . t .} X ^ {T} V + Z = 0 \tag {D} +$$ + +# Algorithm 1 Semi-smooth Augmented Lagrangian (SsNAL) method + +# Augmented Lagrangian method + +Start from the initial values $V^0, Z^0, B^0, \sigma^0$ + +# while not converged do + +(1) Given $B^k$ , find $V^{k + 1}$ and $Z^{k + 1}$ which approximately solve the inner subproblem + +$$ +\left(V ^ {k + 1}, Z ^ {k + 1}\right) \approx \arg \min _ {V, Z} \mathcal {L} _ {\sigma} \left(V, Z \mid B ^ {k}\right) \tag {7} +$$ + +(2) Update the Lagrangian multiplier $B$ and the parameter $\sigma$ : + +$$ +\begin{array}{l} B ^ {k + 1} = B ^ {k} - \sigma_ {k} \left(X ^ {T} V ^ {k + 1} + Z ^ {k + 1}\right) \tag {8} \\ \sigma^ {k + 1} \uparrow \sigma^ {\infty} \leq \infty \\ \end{array} +$$ + +# end while + +# Semi-smooth Newton method for (7) + +To solve (7) and find $\left(V^{k + 1},Z^{k + 1}\right)$ : + +# while not converged do + +$$ +\partial^ {2} \psi (V ^ {j}) \operatorname {v e c} (D ^ {j}) = - \operatorname {v e c} (\nabla \psi (V ^ {j})) \tag {9} +$$ + +$$ +\psi \left(V ^ {j} + s ^ {j} D ^ {j}\right) \leq \psi \left(V ^ {j}\right) + \mu s ^ {j} \left\langle \nabla \psi \left(V ^ {j}\right), D ^ {j} \right\rangle +$$ + +(1) Find the descent direction $D^j$ solving exactly or by conjugate gradient the linear system +(2) Line search (Li et al., 2018): choose $\mu \in (0,1 / 2)$ and reduce the step size $s^j$ until +(3) Update $V\colon V^{j + 1} = V^j +s^j D^j$ +(4) Update $Z \colon Z^{j + 1} = \mathrm{prox}_{\frac{\pi^*}{\sigma}}\left(\frac{B^k}{\sigma^k} - X^T V^{j + 1}\right)$ + +# end while + +where $V \in \mathbb{R}^{n \times k}$ and $Z \in \mathbb{R}^{p \times k}$ are the dual variables matrices. In particular $V_{i}, Z_{i} \in \mathbb{R}^{k}$ are the dual variables associated with the $i$ -th group. $h^{*}$ and $\pi^{*}$ are the Fenchel conjugate functions of $h$ and $\pi$ , respectively. Specifically, $h^{*}(V) = (1/2)\| V\|_{2}^{2} + \langle Y, V \rangle$ (Dünner et al., 2016) and $\pi^{*}(Z)$ is given in Proposition 1. We can now define the augmented Lagrangian function and the Karush-Kuhn-Tucker (KKT) system associated with (D). The augmented Lagrangian is given by + +$$ +\mathcal {L} _ {\sigma} (V, Z, B) = h ^ {*} (V) + \pi^ {*} (Z) - \sum_ {i = 1} ^ {p} \left\langle B _ {i}, V ^ {T} X _ {(i)} + Z _ {i} \right\rangle + (\sigma / 2) \sum_ {i = 1} ^ {p} \left\| V ^ {T} X _ {(i)} + Z _ {i} \right\| _ {2} ^ {2}, \tag {5} +$$ + +where $\sigma > 0$ . $B$ is both the primal variable and the Lagrangian multiplier which penalizes the constraints' violations. The KKT system is given by the following three equations: + +$$ +\nabla h ^ {*} (V) - X B = 0, \quad 0 = \nabla \pi^ {*} (Z) - B = 0, \quad X ^ {T} V + Z = 0. \tag {6} +$$ + +Note that $\nabla h^{*}(V) = V + Y$ . A closed form of $\nabla \pi^{*}(Z)$ is not essential for our SsNAL method. The KKT equations will be useful to determine the convergence of our algorithm, since the set $(V^{\star}, Z^{\star}, B^{\star})$ solves the KKT (6) if and only if $(V^{\star}, Z^{\star})$ and $B^{\star}$ are the optimal solutions of (D) and (P), respectively (Boyd and Vandenberghe, 2004). + +# 3 Methodology + +In this section we present our new methodology. First, we introduce a SsNAL algorithm to solve the Group Elastic Net problem. Next, we illustrate how to extend it to the function-on-scalar regression framework. Finally, we describe how to implement a solution path over different values of $\lambda_{1}$ . + +# 3.1 SsNAL method + +The SsNAL method is summarized in Algorithm 1. It consists of an Augmented Lagrangian method characterized by an inner subproblem. The subproblem is solved with a Semi-smooth Newton method which exploits the sparsity of the augmented Lagrangian second order information and greatly reduces computational costs. We now provide the details of its implementation and some important theoretical results. From Rockafellar (1976a), one can find the optimal solution of (D) by solving the Augmented Lagrangian method described in Algorithm 1. The essential part of the algorithm is the subproblem (7). As described in Li et al. (2018), an approximate solution $(\bar{V},\bar{Z})$ for a given $B$ can be found as + +$$ +\bar {V} = \arg \min _ {V} \mathcal {L} _ {\sigma} (V \mid \bar {Z}, B), \quad \bar {Z} = \arg \min _ {Z} \mathcal {L} _ {\sigma} (Z \mid \bar {V}, B). \tag {10} +$$ + +With a slight abuse of notation, we indicate by $L_{\sigma}(V|Z,B)$ the function $L_{\sigma}(V,Z,B)$ where the parameter $Z$ and $B$ are fixed. Similarly for $L_{\sigma}(Z|V,B)$ . Our third proposition provides explicit forms for $\mathcal{L}_{\sigma}\left(V|\bar{Z},B\right)$ and $\bar{Z}$ (see Supplemental Section A.3 for a proof). + +Proposition 3. Define $\psi (V)\coloneqq \mathcal{L}_{\sigma}\left(V\mid \bar{Z},B\right)$ . Then, for the Group Elastic Net problem we have + +$$ +\begin{array}{l} (a) \psi (V) = h ^ {*} (V) + \frac {1 + \sigma \lambda_ {2}}{2 \sigma} \sum_ {i = 1} ^ {p} \| \operatorname {p r o x} _ {\sigma \pi} \left(B _ {i} - \sigma V ^ {T} X _ {(i)}\right) \| _ {2} ^ {2} - \frac {1}{2 \sigma} \sum_ {i = 1} ^ {p} \| B _ {i} \| _ {2} ^ {2} \tag {11} \\ (b) \bar {Z} = \mathrm {p r o x} _ {\pi^ {*} / \sigma} \left(B / \sigma - X ^ {T} \bar {V}\right), \\ \end{array} +$$ + +where $\mathrm{prox}_{\pi^{*} / \sigma}\left(B / \sigma -X^{T}\bar{V}\right) = \left(\mathrm{prox}_{\pi^{*} / \sigma}\left(B_{1} / \sigma -\bar{V}^{T}X_{(1)}\right),\dots ,\mathrm{prox}_{\pi^{*} / \sigma}\left(B_{p} / \sigma -\bar{V}^{T}X_{(p)}\right)\right)^{T}$ . + +$\bar{Z}$ has a closed form. To find $\bar{V}$ one has to minimize $\psi$ or, equivalently, find the solution of $\nabla \psi = 0$ . Note that $\psi$ is continuous and differentiable, and thus $\nabla \psi$ is well defined. + +To solve the subproblem (7), we propose the Semi-smooth Newton method in Algorithm 1. $V$ and $Z$ are updated iteratively $-Z$ according to the rule in Proposition 3, and $V$ by minimizing $\psi$ through one Newton step. The main computational cost is solving the linear system (9). This leads to our next crucial result (see Supplemental Section A.4 for a proof). + +Theorem 1. Let $T = B - \sigma X^T V$ , $\hat{X} = X \otimes I_k$ (the $nk \times pk$ Kronecker product between $X$ and the $k \times k$ identity matrix), $\hat{\partial}^2\psi$ be the generalized Hessian of $\psi$ , and $\partial \mathrm{prox}_{\sigma \pi}$ be the Clarke sub-differential of $\mathrm{prox}_{\sigma \pi}$ (Clarke, 1990). Then we have + +$$ +(i) \nabla \psi (V) = V + Y - X \operatorname {p r o x} _ {\sigma \pi} (T) \quad (i i) \hat {\partial} ^ {2} \psi (V) = I _ {n k} + \sigma \hat {X} \partial \operatorname {p r o x} _ {\sigma \pi} (T) \hat {X} ^ {T} \tag {12} +$$ + +Moreover, let $Q \in \mathbb{R}^{pk \times pk}$ be the block-diagonal matrix $Q = \left[ \begin{array}{ccc} P_1 & & \\ & \ddots & \\ & & P_p \end{array} \right]$ , where each $P_i$ is a + +squared $k\times k$ matrix defined as + +$$ +\left(i i i\right) P _ {i} = \left\{ \begin{array}{l l} (1 + \sigma \lambda_ {2}) ^ {- 1} \left(1 - \| T _ {i} \| _ {2} ^ {- 1} \sigma \lambda_ {1}\right) I _ {k} + \| T _ {i} \| _ {2} ^ {- 3} \sigma \lambda_ {1} T _ {i} T _ {i} ^ {T}) & \| T _ {i} \| _ {2} > \sigma \lambda_ {1} \\ 0 & o. w. \end{array} . \right. \tag {13} +$$ + +Then $Q \in \partial \operatorname{prox}_{\sigma \pi}(T)$ and $\partial^2 \psi(V) \operatorname{vec}(D) = (I_{nk} + \sigma \hat{X} Q \hat{X}^T) \operatorname{vec}(D)$ for every $D \in \mathbb{R}^{n \times k}$ in the domain of $V$ - where $\operatorname{vec}(D) \in \mathbb{R}^{nk}$ is obtained by stacking all the columns of $D$ . + +Note that, while in Li et al. (2018); Deng and So (2019); Boschi et al. (2020) $\nabla \psi$ and $\partial^2\psi$ are a vector and a matrix, respectively, here the dimensions of these operators increase due to the group nature of the problem. In particular, $\nabla \psi$ becomes a matrix and $\partial^2\psi$ a higher order tensor - which we express as an $nk\times nk$ matrix by stacking its dimensions. Moreover, $Q$ is not a simple diagonal matrix as in the previous SsNAL algorithms, but is now characterized by blocks associated to the different groups of variables. + +Theorem 1 is critical for preserving the efficiency of fgen, while integrating groups into the problem. First, it states that solving (9) is equivalent to solving $\left(I_{nk} + \sigma \hat{X} Q\hat{X}^T\right)\operatorname {vec}(D) = -\operatorname {vec}\left(\nabla \psi (V)\right)$ . Second, the form of $Q$ still allows one to induce sparsity in the linear system and drastically reduce the computational cost. Indeed, let $\mathcal{J} = \{j:\| T_j\| _2\geq \sigma \lambda_1\}$ and let $r = |\mathcal{J}|$ be the cardinality of $\mathcal{J}$ . Then the linear system (9) is equivalent to + +$$ +\left(I _ {n k} + \sigma \hat {X} _ {\mathcal {J}} Q _ {\mathcal {J}} \hat {X} _ {\mathcal {J}} ^ {T}\right) \operatorname {v e c} (D) = - \operatorname {v e c} (\nabla \psi (V)). \tag {14} +$$ + +Here, $\hat{X}_{\mathcal{J}} \in \mathbb{R}^{nk \times rk}$ is defined as $\hat{X}_{\mathcal{J}} = X_{\mathcal{J}} \otimes I_k$ , with $X_{\mathcal{J}} \in \mathbb{R}^{n \times r}$ being the sub-matrix of $X$ restricted to the columns in $\mathcal{J}$ . In addition, $Q_{\mathcal{J}} \in \mathbb{R}^{rk \times rk}$ is the block-diagonal matrix formed by all the $P_i$ such that $i \in \mathcal{J}$ . Using the Cholesky factorization (the generalized Hessian is positive semidefinite) the total cost of solving the linear system reduces from $\mathcal{O}\left(nk^3 (n^2 + p^2 + np)\right)$ to $\mathcal{O}\left(nk^3 (n^2 + r^2 + nr)\right)$ . This includes computing $\hat{X}_{\mathcal{J}} Q_{\mathcal{J}} \hat{X}_{\mathcal{J}}^T$ , which is $\mathcal{O}\left(nr k^3 (n + r)\right)$ , and the Cholesky factorization, which is $\mathcal{O}(n^3 k^3)$ . Because of the sparsity induced by the Group Elastic Net penalty, $r$ is usually much smaller than $p$ - implying a substantial computational gain. Even when $p$ is very large ( $\sim 10^6$ ), one can still solve the linear system efficiently, as long as the dimension $k$ of each group is relatively small ( $< 10^2$ ). Furthermore, if $r < n$ , which is often the case when + +# Algorithm 2 Functional Group Elastic Net method + +(1) Perform FPC of $\mathcal{B}$ and find the first $k$ basis components $(\gamma_{i},\dots \gamma_{k})$ with their eigenvalues $(\rho_{1},\ldots \rho_{k})$ +(2) Find the first $k$ FPC scores for each response function $\mathcal{Y}_i\colon Y_i = (\langle \mathcal{Y}_i,\gamma_1\rangle_{\mathbb{L}^2},\dots ,\langle \mathcal{Y}_i,\gamma_k\rangle_{\mathbb{L}^2})$ +(3) Using $Y$ as response matrix, apply SsNAL to solve (1) and find the coefficient scores estimates $B$ . +(4) Project $B$ into the FPC basis to find the coefficient curve estimates: $\mathcal{B}_i = \sum_{j=1}^k B_{(i,j)} \gamma_j$ + +the solution of the Group Elastic Net problem is sparse, one can factorize an $rk \times rk$ (instead of $nk \times nk$ ) matrix using the Sherman-Morrison-Woodbury formula (Van Loan and Golub, 1983): + +$$ +\left(I _ {n k} + \sigma \hat {X} _ {\mathcal {J}} Q _ {\mathcal {J}} \hat {X} _ {\mathcal {J}} ^ {T}\right) ^ {- 1} = I _ {n k} - \hat {X} _ {\mathcal {J}} \left(\left(\sigma Q _ {\mathcal {J}}\right) ^ {- 1} + \hat {X} _ {\mathcal {J}} ^ {T} \hat {X} _ {\mathcal {J}}\right) ^ {- 1} \hat {X} _ {\mathcal {J}} ^ {T}. \tag {15} +$$ + +The total cost is further reduced from $\mathcal{O}\left(nk^3 (n^2 +r^2 +nr)\right)$ to $\mathcal{O}\left(rk^3 (n^2 +r^2 +nr + 1)\right)$ , including the computation of $Q_{\mathcal{J}}^{-1}$ which can be done with a cost of $\mathcal{O}(rk^3)$ by inverting each one of the $P_{i}$ blocks independently. Finally, if in the first iterations of the algorithm $n$ and $r$ are both larger than $10^{4}$ , one can solve (9) approximately using the conjugate gradient method (Polyak, 1969). + +To determine the convergence of the Augmented Lagrangian and the Semi-smooth Newton methods, we check the residuals of the third and first KKT in (6), respectively, i.e.: + +$$ +\operatorname {r e s} \left(\mathrm {k k t} _ {3}\right) = \frac {\sum_ {i = 1} ^ {p} \left\| V ^ {T} X _ {(i)} + Z _ {i} \right\| _ {2}}{1 + \sum_ {i = 1} ^ {m} \left\| V _ {i} \right\| _ {2} + \sum_ {i = 1} ^ {p} \left\| Z _ {i} \right\| _ {2}}, \quad \operatorname {r e s} \left(\mathrm {k k t} _ {1}\right) = \frac {\sum_ {i = 1} ^ {n} \left\| V _ {i} + Y _ {i} - X _ {i} B \right\| _ {2}}{1 + \sum_ {i = 1} ^ {n} \left\| Y _ {i} \right\| _ {2}}. \tag {16} +$$ + +Taking the $l2$ -norm of the KKT residuals, normalizing them and using them to assess convergence is a common procedure in the literature (Li et al., 2018; Deng and So, 2019). Both methods have a super-linear convergence rate. Accordingly, the convergence rate of the entire algorithm, which is the sum of the convergence rate of the two sub-problems (Tomioka and Sugiyama, 2009), is still super-linear. Thus, as we show in Section 4, fgen typically converges in very few iterations. The convergence analysis here follows directly from that in Tomioka et al. (2011) and Boschi et al. (2020), where SsNAL convergence is proved for the standard Elastic Net. The proof leverages results in Rockafellar (1976a,b); Luque (1984); Li et al. (2018) and the fact that $\pi^{*}$ is a continuous differentiable function (which is also true for the Group Elastic Net). + +# 3.2 Extension to function-on-scalar regression + +We now extend fgen to the function-on-scalar features selection problem. In function-on-scalar regression, a functional response is regressed on a set of scalar predictors. Assuming the response belongs to the Hilbert Space $\mathbb{L}^2 ([a,b])$ , the optimization problem (1) becomes + +$$ +\min _ {\mathcal {B}} (1 / 2) \| X \mathcal {B} - \mathcal {Y} \| _ {\mathbb {L} ^ {2}} ^ {2} + \lambda_ {1} \sum_ {i = 1} ^ {p} \| \mathcal {B} _ {i} \| _ {\mathbb {L} ^ {2}} + (\lambda_ {2} / 2) \sum_ {i = 1} ^ {p} \| \mathcal {B} _ {i} \| _ {\mathbb {L} ^ {2}} ^ {2} \tag {17} +$$ + +where $\mathcal{V}$ and $\mathcal{B}$ are functional objects with $n$ and $p$ rows, respectively. Each row $\mathcal{V}_i$ is a response function and each row $\mathcal{B}_i$ is a coefficient function. The squared $\mathbb{L}^2$ -norm of a function $f$ is $\| f\|_{\mathbb{L}^2}^2 = \langle f,f\rangle_{\mathbb{L}^2}$ , where the inner product between two functions $f$ and $g$ is $\langle f,g\rangle_{\mathbb{L}^2} = \int_a^b fg$ . + +Applying SsNAL directly to (17) is not straightforward and would substantially hinder its efficiency. First, the definition of conjugate functions and proximal operators in functional spaces would require a new theoretical background. Second, and perhaps most important from a practical standpoint, computing integrals is much more expensive than computing euclidean norms. For these reasons, in Algorithm 2 we take advantage of Functional Principal Components (FPC) (Horváth and Kokoszka, 2012; Kokoszka and Reimherr, 2017) to solve an optimization problem of the same type as (1), which is in fact a very close approximation to (17). In particular, we build a response matrix $Y$ , where each group $i$ is formed by the first $k$ FPC scores of the function $\mathcal{V}_i$ (Fan and Reimherr, 2016). The level of approximation of $f$ gen thus depends on the number of FPC scores $k$ , i.e the dimension of each group. Indeed, given a function $f$ and its FPC basis $\{\gamma_i\}_{i=1}^{\infty}$ , we have + +$$ +\left\| f \right\| _ {\mathbb {L} ^ {2}} = \sum_ {j = 1} ^ {\infty} \left\| \langle f, \gamma_ {j} \rangle_ {\mathbb {L} ^ {2}} \right\| _ {2}. \tag {18} +$$ + +This property – which is true for every orthonormal basis system – plays a crucial role in the extension of our SsNAL approach to the function-on-scalar regression, since it allows one to approximate the $\mathbb{L}^2$ function norm with the standard $l_{2}$ matrix norm. Consequently, one can use the FPC scores to construct the response matrix $Y$ and the coefficients matrix $B$ in (1) starting from the response functions $\mathcal{V}$ and the coefficient functions $B$ . The number of selected FPC scores determines the dimension $k$ of each group in the Group Elastic Net problem. In many applications just a few FPC scores allow one to obtain a very close approximation of the original functions. Indeed, among the many orthonormal bases one could envision, FPC has the advantage of being the most parsimonious allowing one to reconstruct the response curves using fewer coefficients than any other orthonormal basis. In scenarios investigated by simulation in Section 4, $k = 5$ is sufficient to capture more than the $99\%$ of the $\mathbb{L}^2$ -norm. This produces an almost perfect approximation of (17) while fully preserving fgen efficiency. + +# 3.3 Solution path implementation + +To evaluate different values of the penalty parameter $\lambda_{1}$ , we implement an efficient solution path search. We compute the solution for a decreasing sequence sequence of $\lambda_{1}$ , starting from $\lambda^{max} = \max_{i} \| (X_{i})^{T} Y\|$ which selects 0 active features. When we move to the next $\lambda_{1}$ value, we use the solution obtained at the previous value for initialization (warm start). The two consecutive solutions tend to be close, and fgen converges in very few iterations – usually just one. We also allow the user to specify a maximum number of selected features; when this number is reached the path search is stopped, further reducing computation. + +To guide the choice of $(\lambda_1, \lambda_2)$ we propose two quantitative criteria: $k$ -fold Cross Validation $(cv)$ and an Extended Bayesian Information Criterion (e-bic) (Chen and Chen, 2012), which modifies the standard BIC to also include the number of features $p$ . In symbols, we have + +$$ +\mathrm {e} - \operatorname {b i c} (B) = k \log (\operatorname {r s s} (B) / (n k)) + (k \nu) (\log (n k) + \log p) / n \tag {19} +$$ + +where $\mathrm{rss}(B)$ is the residual sum of squares associated with the solution $B$ , and $\nu$ are the Group Elastic Net degrees of freedom. From Tibshirani et al. (2012), $\nu = \mathrm{tr}\big(X_{\mathcal{J}}\big(X_{\mathcal{J}}^{T}X_{\mathcal{J}} + \lambda_{2}I_{r}\big)^{-1}X_{\mathcal{J}}^{T}\big)$ . Note that $cv$ can be very computationally expensive because it requires to run fgen multiple times for each value of $\lambda_{1}$ and $\lambda_{2}$ under consideration. In contrast, $e$ -bic can be computed directly from the original solution. Before evaluating both criteria, we de-bias the fgen estimates following the approach suggested by Belloni et al. (2014); Zhao et al. (2017). First, we run fgen, then, we fit a standard least squares on the selected features. In the next section, following standard practice in the literature - e.g., Friedman et al. (2010); Pedregosa et al. (2011) - we rewrite $\lambda_{1}$ and $\lambda_{2}$ as $\lambda_{1} = c_{\lambda}\lambda^{max}$ and $\lambda_{2} = (1 - \alpha)c_{\lambda}\lambda^{max}$ , with $c_{\lambda} \in (0,1]$ and $\alpha \in (0,1)$ . $c_{\lambda}$ determines the reduction with respect to $\lambda^{max}$ , $\alpha$ controls the relative weight of the two penalties. + +# 4 Simulation study and INSIGHT data + +In this section we use synthetic data to illustrate the computational efficiency of fgen, and apply our new method to a Genome Wide Association Study (GWAS) on childhood obesity. In the simulations, we benchmark fgen against the two best Group Elastic Net solvers we found in the literature: the python package sklearn and R package glmnet, which is written in fortran. Other functional-on-scalar feature selection methods, such as the ones proposed by Barber et al. (2017); Parodi et al. (2018); Mirshani and Reimherr (2019), have a computational burden more than two orders of magnitudes larger than fgen and could not complete instances with $p > 10^4$ . + +# 4.1 Simulation results + +We generate synthetic data as follows. The entries of the design matrix $X \in \mathbb{R}^{n \times p}$ are each drawn independently from a standard normal distribution. The response curves are created as $\mathcal{Y} = X\mathcal{B} + \epsilon$ . $\mathcal{B}$ contains $p_0$ non-zero curves. These and the errors $\epsilon$ are generated from a 0 mean Gaussian process with a Matérn covariance function (Cressie and Huang, 1999) of the form + +$$ +C (t, s) = \omega^ {2} (\Gamma (\nu) 2 ^ {\nu - 1}) ^ {- 1} ((l) ^ {- 1} (2 \nu) ^ {1 / 2} | t - s |) ^ {\nu} K _ {\nu} ((l) ^ {- 1} (2 \nu) ^ {1 / 2} | t - s |), \tag {20} +$$ + +where $K_{\nu}$ is a modified Bessel function. In particular, we set the point-wise variance $\omega^2 = 1$ and the range $l = 0.25$ (this determines how fast the curves dependency decays). The smooth parameter $\nu$ + +Table 1: $a$ , $b$ and $c$ report CPU time in seconds for fgen, sklearnn and glmnet, respectively. For fgen we also report the number of iterations in parenthesis. $r$ is the number of selected features, $l$ is the range parameter of the Matern process used to generate the coefficients. + +
α=0.8, l=0.25n=500n=1000n=5000
p; p0krabcrabcrabc
2(10^4); 1050.820.1(3)0.50.310.1(2)0.90.610.5(2)9.13.2
0.4100.2(4)0.50.340.3(3)1.10.661.1(3)10.93.1
0.2210.4(4)0.50.480.3(4)1.10.7101.2(3)10.43.4
100.820.2(3)0.90.510.2(2)1.91.211.3(2)18.85.4
0.4100.3(4)0.80.540.4(3)2.11.062.0(3)22.34.9
0.2210.9(4)0.90.580.5(4)2.21.2101.9(3)23.25.3
10^5; 10^250.850.3(2)4.51.540.7(2)9.93.362.6(2)97.917.2
0.6290.6(2)4.71.6170.7(2)9.63.3123.0(2)85.719.8
0.448613.7(3)4.80.2531.4(2)10.23.1424.1(2)99.717.8
100.850.6(2)10.22.641.4(2)22.65.263.5(2)175.227.9
0.6290.9(2)102.4171.5(2)19.64.8123.8(2)183.727.6
0.448679.2(3)9.12.4531.8(2)20.25.3426.7(2)190.728.0
+ +
α=0.5, l=0.25n=500n=1000n=5000
p; p0krabcrabcrabc
2(10^4); 10100.820.1(2)1.00.610.2(2)1.81.310.9(2)18.35.2
0.4100.2(3)0.90.630.2(2)2.50.970.9(2)20.65.3
0.2731.1(3)0.90.580.4(3)2.01.3101.9(3)22.75.2
+ +
α=0.8, l=0.10n=500n=1000n=5000
p; p0krabcrabcrabc
2(10^4); 10100.830.2(3)0.90.630.2(2)1.81.310.9(2)19.75.1
0.4100.3(4)1.20.670.4(3)2.61.1101.9(3)19.85.2
0.2201.5(4)1.20.6100.5(4)2.41.2102.0(3)22.24.0
+ +![](images/f8b3aef611164854f20e2279b73ebaec2a36c272167d58cec45f129a088340ac.jpg) +Figure 1: Curves related to a simulation scenario described in Table 1 (second row, $n = 500$ ). The left and center panels display a sample of 10 response curves and 10 linear model errors terms, respectively. The right panel depicts the true non-zeros coefficients curves (dashed lines) and the fgen de-biased estimates (solid lines). + +![](images/00bdabd5abd88da30981f8f85c38c8e1b8094a93fe94ab30294744bb21fdc101.jpg) + +![](images/a4205a99f7a7a5d7745fc91b3207fade3f953abda7866aa4f615841e8e905a02.jpg) + +is equal to 3.5 for $\mathcal{B}$ and to 1.5 for $\epsilon$ , i.e. the errors are rougher than the coefficients. Each curve is sampled at 1000 evenly spaced points between 0 and 1. Figure 1 shows instances of the response and error curves, $\mathcal{V}$ and $\epsilon$ , and the true non-zero coefficient curves in $\mathcal{B}$ along with their de-biased estimates produced by fgen (the underlying simulation parameters are those in Table 1, second row, $n = 500$ ). In all scenarios, fgen is run with both the tolerances in (16) set to $10^{-6}$ (we set the same tolerance for sklearnnn and glmnet) and $\mu$ in (12) set to 0.2. We start from $\sigma^0 = p_0 / p$ and increase it by a factor of 5 every iteration. If we start from smaller values of $\sigma$ , the algorithm needs more iterations to converge, while if $\sigma^0$ is too large, fgen does not converge to the optimal solution. We set $\lambda_{1} = c_{\lambda}\lambda^{max}$ and $\lambda_{2} = (1 - \alpha)c_{\lambda}\lambda^{max}$ , where $c_{\lambda} \in (0,1]$ , $\alpha \in (0,1)$ , and $\lambda^{max} = \max_{i}\|(X_{i})^{T}Y\|$ . Note that for sklearnnn and sklearnnn we need to divide $\lambda^{max}$ by $n$ since both solvers divide the least squares loss in (1) by the number of observations. + +Table 1 reports CPU times for fgen, sklearn and glmnet under different simulation settings. fgen is the fastest solver in almost every instance. When both $n$ and $p$ are large and the solution is sparse, fgen is approximately 6 times faster than glmnet and more than 30 times faster than sklearn. Note + +![](images/94e1cfd6afaaddc7823b8a24ed78723e2f897d84f2132784aaa7782f7032a952.jpg) +Figure 2: Plots related to the INSIGHT study. The left panel displays the growth curves. The center and right panels depict values of the 10-fold $cv$ Mean Squared Error and the $e$ -bic, respectively, against $c_{\lambda}$ . These are obtained from fgen run with 3 different values of $\alpha$ ; 0.8 (green line), 0.6 (red line), 0.4 (blue line). fgen estimates are de-biased prior to computing both criteria. + +![](images/e8f771b6c00f2565043748aab684aa7f6ddd29480dc8b063678c6228317d5a70.jpg) + +![](images/3f5757a697dc9f14a71f6251a73d544a34ac1ccfae5c0d47715dc00a8f59ebcd.jpg) + +that the super-linear convergence rate allows fgen to converge in very few iterations (no more than 4 in all cases). The CPU time increases with $k$ for all solvers. However, $k = 5$ already captures more than the $99\%$ of the $\mathbb{L}^2$ -norm in all the scenarios considered. If we decrease $\alpha$ from 0.8 to 0.5, fgen need even fewer iterations to converge, increasing its computational gain with respect to the competitors. Considering rougher coefficients (created with a Matern process with range parameter $l = 0.1$ ) does not affect the relative performance of the algorithms. The instance with an active set of 486 features is the only one where fgen performs worse than its competitors. As expected, in the presence of non-sparse solutions fgen looses some of its efficiency. However, to tune the penalty parameters in practice, one evaluates a sequence of $c_{\lambda}$ values starting from very sparse solutions. In the first steps of the solution path, fgen exploits sparsity and is very efficient. In the following steps, it still converges very quickly thanks to the warm-start approach described in Section 3.3. In Supplemental Table B.2 we compare the solution path computing time. fgen outperforms the other solvers in every scenario, being approximately 2 times faster than glmnet and from 10 to more than 30 times faster than sklearnnn. Finally, to gauge uncertainty in our CPU time evaluations, we replicated a subset of the instances explored in Table 1 20 independent times. Mean CPU times and standard errors over such replicates are reported in Supplemental Table B.1. Results agree with those obtained considering just one replication. Furthermore, one can notice that fgen has also a smaller variability in CPU time when $n = 5000$ . + +Taking into account that glmnet (written in fortran) and sklearn are highly optimized packages, the results above provide strong evidence in support of our method. We also tracked prediction performance for all methods and in all simulation settings considered, but we do not report them here since all three solvers solve the same convex minimization problem and therefore converged to the same solution in all settings. + +# 4.2 INSIGHT study + +Here, we apply fgen to data from the Intervention Nurses Start Infants Growing on Healthy Trajectories (INSIGHT) study (Paul et al., 2014). In particular, we focus on data collected to investigate genetic variants that may affect the risk of childhood obesity. As the prevalence of obesity increases also among children, examining possible causes and risk factors has become an essential public health concern. INSIGHT provides genome-wide Single Nucleotide Polymorphisms (SNPs) information for a cohort of very young children, along with longitudinal information on their growth. Selecting SNPs that may affect growth is thus a GWAS (a Genome-Wide Association Study) – where the outcome is a growth curve. In recent years, many GWASs have identified SNPs strongly associated with obesity phenotypes (Locke et al., 2015). Before proceeding with the analysis, we point out that due to high feature collinearity, low signal-to-noise ratio, and ultra-high dimensionality, GWAS data are very hard to examine and users should be very careful in interpreting results; e.g., selected SNPs may just be proxies for other causal SNPs in their vicinity. While being well aware of all its complexities and potential pitfalls, our main aim in presenting a GWAS analysis is to show the efficiency and the broad applicability of fgen. Our functional outcome captures the evolution of weight/height ratios (Daniels et al., 2015) measured at birth and at 4, 16, 28, and 40 weeks for a total of $n = 210$ children. The growth curves – shown in the left panel of Figure 2 – are fitted as in Craig et al. (2019) using + +Principal Analysis by Conditional Estimation (Chen et al., 2017). Building a smooth curve for each child allows one to capture information along the entire time domain and at the same time to de-noise and mitigate the effect of outlying/anomalous raw measurements. The SNPs collected in INSIGHT are available upon request at dbGaP using the access number phs001498.v1.p1. The growth curves are based on privacy protected data and cannot be made publicly available. + +Craig et al. (2019) used flame (Parodi et al., 2018) to solve the function-on-scalar feature selection problem. To do so, they had to reduce the analysis from $p = 342325$ to 10000 SNPs with various preliminary screening steps. The computational efficiency of fgen allows us to inspect all the 342325 SNPs simultaneously. The center and left panels of Figure 2 display 10-fold $cv$ and $e$ -bic for different values of $\alpha$ and $c_{\lambda}$ . Both criteria identify just one ( $c_{\lambda} = 0.99$ ) dominant SNP, rs79187646. Without drawing any strong domain conclusion, we remark that the selected SNP appears to be relevant in the literature. Notably, this is the same SNP selected by Boschi et al. (2020), where the same SNP data were associated to BMI at age 3 – a scalar response. Also notably, this dominant SNP was not among the SNPs identified by Craig et al. (2019). Based on the U.S. National Library of Medicine, rs79187646 is located in NTM, a well known gene. According to the NHGRI-EBI GWAS Catalog, many GWASs, including two recent studies (Kichaev et al., 2019; Pulit et al., 2019), have connected NTM to body mass, food addiction, intake of sweet substances and other obesity-related traits. + +# 5 Conclusions + +In this article we proposed a new Function Group Elastic Net method (fgen) to solve the function-onscalar feature selection problem. Our proposal starts with the development of a novel, highly-efficient SsNAL algorithm to solve the Group Elastic Net – which is then extended to the function-on-scalar regression framework using a Functional Principal Components representation. Though we could rely on critical prior results (Tomioka and Sugiyama, 2009; Li et al., 2018; Boschi et al., 2020), in order to integrate the group structure into SsNAL, we had to tackle more complex mathematical operators and redefine the theoretical foundation. Our simulations show a substantial reduction in CPU time with respect to the best existing Group Elastic Net solvers. Finally, we applied fgen to a GWAS study detecting a SNP that may affect obesity risk in children. + +The current version of fgen is limited to the case where each group has the same size $k$ and to the functional-on-scalar feature selection problem. In the future, we plan to further extend our work investigating more complex optimization problems (e.g., allowing each group to have a different size) and functional regression frameworks. In particular, we aim to adapt our methodology to the function-on-function feature selection scenario, where both the response and the predictors can be represented as functional curves. + +# Acknowledgments and Disclosure of Funding + +We thank Kateryna Makova and her laboratory at Penn State for access to the INSIGHT data, Ana Kenney for help with the data and useful discussions. The work of Tobia Boschi and Francesca Chiaromonte was partially supported by the Huck Institutes of the Life Sciences at Penn State, the work of Matthew Reimherr was partially supported by the Grant NSF SES-1853209. + +# References + +Barber, R. F., M. Reimherr, T. Schill, et al. (2017). The function-on-scalar lasso with applications to longitudinal gwas. Electronic Journal of Statistics 11(1), 1351-1389. +Beck, A. (2017). First-order methods in optimization, Volume 25. SIAM. +Beck, A. and M. Teboulle (2009). A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM journal on imaging sciences 2(1), 183-202. +Belloni, A., V. Chernozhukov, and C. Hansen (2014). Inference on treatment effects after selection among high-dimensional controls. The Review of Economic Studies 81(2), 608-650. +Bonnefoy, A., V. Emiya, L. Ralaivola, and R. Gribonval (2015). Dynamic screening: Accelerating first-order algorithms for the lasso and group-lasso. IEEE Transactions on Signal Processing 63(19), 5121-5132. + +Boschi, T., M. Reimherr, and F. Chiaromonte (2020). An efficient semi-smooth newton augmented lagrangian method for elastic net. arXiv preprint arXiv:2006.03970. +Boyd, S. and L. Vandenberghe (2004). Convex optimization. Cambridge university press. +Breheny, P. and J. Huang (2015). Group descent algorithms for nonconvex penalized linear and logistic regression models with grouped predictors. Statistics and computing 25(2), 173-187. +Chen, J. and Z. Chen (2012). Extended bic for small-n-large-p sparse glm. Statistica Sinica, 555-574. +Chen, K., X. Zhang, A. Petersen, and H.-G. Müller (2017). Quantifying infinite-dimensional data: Functional data analysis in action. Statistics in Biosciences 9(2), 582-604. +Chen, X., Q. Lin, S. Kim, J. G. Carbonell, and E. P. Xing (2010). An efficient proximal gradient method for general structured sparse learning. stat 1050. +Chen, Y., J. Goldsmith, and R. T. Ogden (2016). Variable selection in function-on-scalar regression. Stat 5(1), 88-101. +Chiou, J.-M., H.-G. Müller, and J.-L. Wang (2004). Functional response models. Statistica Sinica, 675-693. +Clarke, F. H. (1990). Optimization and nonsmooth analysis, Volume 5. Siam. +Craig, S. J. C., A. M. Kenney, J. Lin, I. M. Paul, L. L. Birch, J. Savage, M. E. Marini, F. Chiaromonte, M. L. Reimherr, and K. D. Makova (2019). Polygenic risk score based on weight gain trajectories is a strong predictor of childhood obesity. *bioRxiv*, 606277. +Cremona, M. A., H. Xu, K. D. Makova, M. Reimherr, F. Chiaromonte, and P. Madrigal (2019). Functional data analysis for computational biology. Bioinformatics (Oxford, England) 35(17), 3211. +Cressie, N. and H.-C. Huang (1999). Classes of nonseparable, spatio-temporal stationary covariance functions. Journal of the American Statistical Association 94(448), 1330-1339. +Daniels, S. R., S. G. Hassink, et al. (2015). The role of the pediatrician in primary prevention of obesity. Pediatrics 136(1), e275-e292. +Deng, W., W. Yin, and Y. Zhang (2013). Group sparse optimization by alternating direction method. In Wavelets and Sparsity XV, Volume 8858, pp. 88580R. International Society for Optics and Photonics. +Deng, Z. and A. M.-C. So (2019). An efficient augmented lagrangian based method for constrained lasso. arXiv preprint arXiv:1903.05006. +Dünner, C., S. Forte, M. Takáč, and M. Jaggi (2016). Primal-dual rates and certificates. arXiv preprint arXiv:1602.05205. +Fan, Y., G. M. James, P. Radchenko, et al. (2015). Functional additive regression. The Annals of Statistics 43(5), 2296-2325. +Fan, Z. and M. Reimherr (2016). High-dimensional function-on-scale regression via the alternating direction method of multipliers. In 2016 3rd International Conference on Information Science and Control Engineering (ICISCE), pp. 397-399. IEEE. +Fenchel, W. (1949). On conjugate convex functions. Canadian Journal of Mathematics 1(1), 73-77. +Friedman, J., T. Hastie, and R. Tibshirani (2010). Regularization paths for generalized linear models via coordinate descent. Journal of statistical software 33(1), 1. +Gertheiss, J., A. Maity, and A.-M. Staicu (2013). Variable selection in generalized functional linear models. Stat 2(1), 86-101. +Hall, P. and M. Hosseini-Nasab (2006). On properties of functional principal components analysis. Journal of the Royal Statistical Society: Series B (Statistical Methodology) 68(1), 109-126. + +Horváth, L. and P. Kokoszka (2012). Inference for functional data with applications, Volume 200. Springer Science & Business Media. +James, G. M., T. J. Hastie, and C. A. Sugar (2000). Principal component models for sparse functional data. Biometrika 87(3), 587-602. +Johnson, R. A., D. W. Wichern, et al. (2014). Applied multivariate statistical analysis, Volume 6. Pearson London, UK.: +Katrutsa, A. and V. Strijov (2015). Stress test procedure for feature selection algorithms. Chemometrics and Intelligent Laboratory Systems 142, 172-183. +Kichaev, G., G. Bhatia, P.-R. Loh, S. Gazal, K. Burch, M. K. Freund, A. Schoech, B. Pasaniuc, and A. L. Price (2019). Leveraging polygenic functional enrichment to improve gwas power. The American Journal of Human Genetics 104(1), 65-75. +Kokoszka, P. and M. Reimherr (2017). Introduction to functional data analysis. CRC Press. +Krawczyk, B. and A. Cano (2018). Online ensemble learning with abstaining classifiers for drifting and noisy data streams. Applied Soft Computing 68, 677-692. +Li, X., D. Sun, and K.-C. Toh (2018). A highly efficient semismooth newton augmented lagrangian method for solving lasso problems. SIAM Journal on Optimization 28(1), 433-458. +Locke, A. E., B. Kahali, S. I. Berndt, A. E. Justice, T. H. Pers, F. R. Day, C. Powell, S. Vedantam, M. L. Buchkovich, J. Yang, et al. (2015). Genetic studies of body mass index yield new insights for obesity biology. Nature 518(7538), 197. +Luque, F. J. (1984). Asymptotic convergence analysis of the proximal point algorithm. SIAM Journal on Control and Optimization 22(2), 277-293. +Matsui, H. and S. Konishi (2011). Variable selection for functional regression models via the 11 regularization. Computational Statistics & Data Analysis 55(12), 3304-3310. +Mirshani, A. and M. Reimherr (2019). Adaptive function-on-scalar regression with a smoothing elastic net. arXiv preprint arXiv:1905.09881. +Murdoch, W. J., C. Singh, K. Kumbier, R. Abbasi-Asl, and B. Yu (2019). Definitions, methods, and applications in interpretable machine learning. Proceedings of the National Academy of Sciences 116(44), 22071-22080. +Parikh, N., S. Boyd, et al. (2014). Proximal algorithms. Foundations and Trends® in Optimization 1(3), 127-239. +Parodi, A., M. Reimherr, et al. (2018). Simultaneous variable selection and smoothing for high-dimensional function-on-scalar regression. Electronic Journal of Statistics 12(2), 4602-4639. +Paul, I. M., J. S. Williams, S. Anzman-Frasca, J. S. Beiler, K. D. Makova, M. E. Marini, L. B. Hess, S. E. Rzucidlo, N. Verdiglione, J. A. Mindell, et al. (2014). The intervention nurses start infants growing on healthy trajectories (insight) study. BMC pediatrics 14(1), 184. +Pedregosa, F., G. Varoquaux, A. Gramfort, V. Michel, B. Thirion, O. Grisel, M. Blondel, P. Prettenhofer, R. Weiss, V. Dubourg, et al. (2011). Scikit-learn: Machine learning in python. the Journal of machine Learning research 12, 2825-2830. +Polyak, B. T. (1969). The conjugate gradient method in extremal problems. *USSR Computational Mathematics and Mathematical Physics* 9(4), 94-112. +Pulit, S. L., C. Stoneman, A. P. Morris, A. R. Wood, C. A. Glastonbury, J. Tyrrell, L. Yengo, T. Ferreira, E. Marouli, Y. Ji, et al. (2019). Meta-analysis of genome-wide association studies for body fat distribution in 694 649 individuals of european ancestry. Human molecular genetics 28(1), 166-174. +Rockafellar, R. T. (1976a). Augmented lagrangians and applications of the proximal point algorithm in convex programming. Mathematics of operations research 1(2), 97-116. + +Rockafellar, R. T. (1976b). Monotone operators and the proximal point algorithm. SIAM journal on control and optimization 14(5), 877-898. +Sørensen, H., J. Goldsmith, and L. M. Sangalli (2013). An introduction with medical applications to functional data analysis. Statistics in medicine 32(30), 5222-5240. +Tibshirani, R. J., J. Taylor, et al. (2012). Degrees of freedom in lasso problems. The Annals of Statistics 40(2), 1198-1232. +Tomioka, R. and M. Sugiyama (2009). Dual-augmented lagrangian method for efficient sparse reconstruction. IEEE Signal Processing Letters 16(12), 1067-1070. +Tomioka, R., T. Suzuki, and M. Sugiyama (2011). Super-linear convergence of dual augmented lagrangian algorithm for sparsity regularized estimation. Journal of Machine Learning Research 12(5). +Ullah, S. and C. F. Finch (2013). Applications of functional data analysis: A systematic review. BMC medical research methodology 13(1), 1-12. +Van Loan, C. F. and G. H. Golub (1983). Matrix computations. Johns Hopkins University Press. +Yu, B. and K. Kumbier (2020). Veridical data science. Proceedings of the National Academy of Sciences 117(8), 3920-3929. +Yuan, M. and Y. Lin (2006). Model selection and estimation in regression with grouped variables. Journal of the Royal Statistical Society: Series B (Statistical Methodology) 68(1), 49-67. +Zhang, Y. and Q. Yang (2018). An overview of multi-task learning. National Science Review 5(1), 30-43. +Zhao, S., A. Shojaie, and D. Witten (2017). In defense of the indefensible: A very naive approach to high-dimensional inference. arXiv preprint arXiv:1705.05543. +Zhu, Y. (2017). An augmented admm algorithm with application to the generalized lasso problem. Journal of Computational and Graphical Statistics 26(1), 195-204. +Zou, H. and T. Hastie (2005). Regularization and variable selection via the elastic net. Journal of the royal statistical society: series B (statistical methodology) 67(2), 301-320. + +# NeurIPS paper checklist + +1. For all authors... + +(a) Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope? [Yes] +(b) Did you describe the limitations of your work? [Yes] We briefly describe some limitations of our methodology at the end of Section 5 +(c) Did you discuss any potential negative societal impacts of your work? [No] We do not see the potential for adverse societal impacts +(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] + +2. If you are including theoretical results... + +(a) Did you state the full set of assumptions of all theoretical results? [Yes] +(b) Did you include complete proofs of all theoretical results? [Yes] All proofs are included in Supplemental Section A. + +3. If you ran experiments... + +(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] Code to reproduce the simulation results is included in the Supplemental Material. +(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 4. + +(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] We run a subset of experiments multiple times computing mean and standard errors. These results are included in Supplemental Section B. +(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Supplemental Section B. + +4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... + +(a) If your work uses existing assets, did you cite the creators? [Yes] We cited the creators of data from INSIGHT in Section 4.2 +(b) Did you mention the license of the assets? [N/A] +(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] The code to run fgen is included in the Supplementary Material and will be made available on GitHub +(d) Did you discuss whether and how consent was obtained from people whose data you're using/curating? [No] The INSIGHT study operated under an appropriate IRB. We did not reference it or provide details here. We do thank the individuals who provided access to the data in the Acknowledgments Section. +(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes] The INSIGHT data we used for our application is privacy protected. We discuss how parts of it are available upon request through dbGaP, and parts of it are not available, in Section 4.2 + +5. If you used crowdsourcing or conducted research with human subjects... + +(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] +(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] +(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] \ No newline at end of file diff --git a/ahighlyefficientgroupelasticnetalgorithmwithanapplicationtofunctiononscalarregression/images.zip b/ahighlyefficientgroupelasticnetalgorithmwithanapplicationtofunctiononscalarregression/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..1bea192693b3d073fc4161e4502e47081899e93d --- /dev/null +++ b/ahighlyefficientgroupelasticnetalgorithmwithanapplicationtofunctiononscalarregression/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e84638fd95f427a857bbc1b15d41919ed90073f0e5eb07b97aa8c34c0c218a6 +size 426310 diff --git a/ahighlyefficientgroupelasticnetalgorithmwithanapplicationtofunctiononscalarregression/layout.json b/ahighlyefficientgroupelasticnetalgorithmwithanapplicationtofunctiononscalarregression/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a95f020c53ebc2b9c8db31d0af5a552f58b04971 --- /dev/null +++ b/ahighlyefficientgroupelasticnetalgorithmwithanapplicationtofunctiononscalarregression/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ef78bf547ecf33ca8fd7342548e789973a0feed7c814751f2c37e67342f7e71 +size 634801 diff --git a/akernelbasedtestofindependenceforclustercorrelateddata/b9bd4ea8-4df4-40fe-be0c-69511ebe0a7e_content_list.json b/akernelbasedtestofindependenceforclustercorrelateddata/b9bd4ea8-4df4-40fe-be0c-69511ebe0a7e_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..e64f637cc018186a1f8d6a4f78e07511f074ee43 --- /dev/null +++ b/akernelbasedtestofindependenceforclustercorrelateddata/b9bd4ea8-4df4-40fe-be0c-69511ebe0a7e_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5bcc265ec4bf9a1e783c4fa95917d6cb428ab4e4e654703ebd6526c45c98a9df +size 77740 diff --git a/akernelbasedtestofindependenceforclustercorrelateddata/b9bd4ea8-4df4-40fe-be0c-69511ebe0a7e_model.json b/akernelbasedtestofindependenceforclustercorrelateddata/b9bd4ea8-4df4-40fe-be0c-69511ebe0a7e_model.json new file mode 100644 index 0000000000000000000000000000000000000000..7c166aeebb191c652626112cd05397dd217ff7a0 --- /dev/null +++ b/akernelbasedtestofindependenceforclustercorrelateddata/b9bd4ea8-4df4-40fe-be0c-69511ebe0a7e_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:608087e970ed1b21ccdb78cffc871e4d3c8b68d2dea7c6b916b0ca74cd19cc3a +size 91800 diff --git a/akernelbasedtestofindependenceforclustercorrelateddata/b9bd4ea8-4df4-40fe-be0c-69511ebe0a7e_origin.pdf b/akernelbasedtestofindependenceforclustercorrelateddata/b9bd4ea8-4df4-40fe-be0c-69511ebe0a7e_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fa792a22ffaee799cd4ffd999d19d759d820a591 --- /dev/null +++ b/akernelbasedtestofindependenceforclustercorrelateddata/b9bd4ea8-4df4-40fe-be0c-69511ebe0a7e_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cbebb40b78514b141a8752c74607be9d824d46af33cf95047aa614be8eb4f2df +size 2020922 diff --git a/akernelbasedtestofindependenceforclustercorrelateddata/full.md b/akernelbasedtestofindependenceforclustercorrelateddata/full.md new file mode 100644 index 0000000000000000000000000000000000000000..40d1412a40680d5bdfb77ea82c407444ad1f5db2 --- /dev/null +++ b/akernelbasedtestofindependenceforclustercorrelateddata/full.md @@ -0,0 +1,302 @@ +# A Kernel-based Test of Independence for Cluster-correlated Data + +Hongjiao Liu +Department of Biostatistics +University of Washington +liuhj@uw.edu + +Yunhua Xiang +Department of Biostatistics +University of Washington +xiangyh@uw.edu + +Anna M. Plantinga +Department of Mathematics and Statistics +Williams College +amp9@williams.edu + +Michael C. Wu +Public Health Sciences Division +Fred Hutchinson Cancer Research Center +mcwu@fredhutch.org + +# Abstract + +The Hilbert-Schmidt Independence Criterion (HSIC) is a powerful kernel-based statistic for assessing the generalized dependence between two multivariate variables. However, independence testing based on the HSIC is not directly possible for cluster-correlated data. Such a correlation pattern among the observations arises in many practical situations, e.g., family-based and longitudinal data, and requires proper accommodation. Therefore, we propose a novel HSIC-based independence test to evaluate the dependence between two multivariate variables based on cluster-correlated data. Using the previously proposed empirical HSIC as our test statistic, we derive its asymptotic distribution under the null hypothesis of independence between the two variables but in the presence of sample correlation. Based on both simulation studies and real data analysis, we show that, with clustered data, our approach effectively controls type I error and has a higher statistical power than competing methods. + +# 1 Introduction + +We are often interested in studying the dependence between two multivariate variables. For example, in genetic studies, we may want to assess the association between multiple genetic variants within a gene and a group of traits that likely share a common genetic mechanism [1, 2]. In microbiome studies, we may wish to investigate the association between the overall composition of human microbiota, including hundreds of microbial taxa, and multiple host metabolites from a particular metabolic pathway [3, 4]. Such multivariate analyses aggregate information across variables and are often more powerful than univariate analyses. Meanwhile, correlated observations arise in many practical situations. Family-based designs are common in genetic studies [5], where multiple family members are recruited together into the study. Longitudinal data are common in epidemiological studies [6], where variables of interest are measured on the subjects repeatedly over time. Such study designs introduce clustered dependence among the observations and require proper accommodation. In this work, we aim to develop an approach for assessing the dependence between two multivariate variables, based on cluster-correlated data. + +A variety of parametric and semi-parametric methods has been proposed to study the association between one or multiple exposure variables and a multivariate longitudinal (or other cluster-correlated) outcome. These methods often extend upon existing tools for univariate longitudinal data. For example, many studies stack the multivariate outcome into a single response vector and then apply the + +usual methods that account for clustered data, such as generalized estimating equations (GEE) [7, 8] and random effects models [9, 10]. Such approaches generally apply to a low-dimensional setting [11] and are subject to limitations typical of parametric and semi-parametric methods. Random-effect-based methods require assumptions on the distribution of the multivariate outcome. GEE-based methods rely on good estimation of the correlation structure within clusters as well as across different outcome variables to achieve a high efficiency. Finally, both approaches assume parametric (often linear) relationships between the exposure and the outcome. Therefore, they can only evaluate a limited number of dependence patterns, and are not sufficient as independence tests. + +Here we base our approach on the Hilbert-Schmidt Independence Criterion (HSIC), a non-parametric kernel-based measure for assessing the generalized dependence between two multivariate, and potentially high-dimensional, variables [12]. By mapping the two variables into reproducing kernel Hilbert spaces (RKHS's), the population HSIC can be viewed as a measure of maximized covariance between functions in the two RKHS's. When the RKHS's being used are characteristic [13], the population HSIC is zero if and only if the two variables are independent. This measure makes no assumption on the distributions of the variables or the nature of the dependence. + +The original HSIC-based independence test [14] applies to independent and identically distributed (i.i.d.) observations. Several extensions have been made to accommodate non-i.i.d. data, but none of the tests, to our knowledge, directly applies to clustered data at an observation level. Zhang et al. (2008) [15] extended the HSIC to certain sequence data, such as XOR sequence and Gaussian process, by specifying the correlation structure of the data as a graphical model and deriving the test statistic based on the maximal cliques. Chwialkowski et al. [16] and Wang et al. [17] developed HSIC-based tests to evaluate the dependence between two time series or random processes in general. Flaxman et al. [18] considered spatial and temporal data; they proposed to first use Gaussian process regression to remove dependence on space and time from the raw variables, and then perform the HSIC test on the resulting de-correlated residuals. However, their approach generally applies to independence testing between two univariate variables. A study with an aim closest to ours is by Rudra et al. [19]: They analyzed the association between multiple genetic variants and a multivariate longitudinal outcome. Rudra et al. concatenated the outcome measurements from different time points at the subject level, and then applied the HSIC test to the subject-level data. Although this is a straightforward approach to deal with clustered correlation, there could be a loss of statistical power by analyzing data at the subject/cluster level rather than observation level. + +In this work, we present the first HSIC-based independence test for cluster-correlated data. Using the empirical HSIC [14] as our test statistic, we derive its asymptotic distribution under the null hypothesis of independence between the two variables but in the presence of clustered correlation among observations. We also examine the behavior of the test statistic under the alternative hypothesis and establish the consistency of our test. Furthermore, we provide a way to approximate the asymptotic null distribution of the test statistic and allow for statistical testing in practice. In simulation studies, our proposed test controls type I error rates well and has a much higher statistical power than competing methods across a range of scenarios. In an application to a longitudinal microbiome-metabolite data set, compared to other approaches, our proposed test identifies a larger number of metabolic pathways significantly associated with the overall microbiome composition, highlighting the value of our test in scientific studies. + +The remaining sections are organized as following. In Section 2, we provide our background assumption on clustered data and an overview of the HSIC statistic. In Section 3, we study the asymptotic behavior of the HSIC statistic under null and alternative hypotheses, and construct a statistical test of independence for cluster-correlated data. In Section 4, we demonstrate the performance of our proposed test on both simulated and real data. In Section 5, we summarize our work, discuss the limitations of our proposed test and provide a conclusion. + +# 2 Background + +In this section, we introduce our assumption on cluster-correlated data and give an overview of the HSIC statistic. + +# 2.1 General setting + +Let $P_{XY}$ be a probability measure defined on a sample space $\mathcal{X} \times \mathcal{Y}$ , where both $\mathcal{X}$ and $\mathcal{Y}$ can be multi-dimensional. Let $P_{X}$ and $P_{Y}$ be the marginal distributions on $\mathcal{X}$ and $\mathcal{Y}$ , respectively. The variables $X$ and $Y$ are statistically independent if $P_{XY} = P_{X}P_{Y}$ (equivalently, we can write $X \perp Y$ ). + +We consider a sample of clustered data $\{(X_{j},Y_{j})\}_{j = 1}^{n}$ drawn from $P_{XY}$ , where the pattern of clustered correlation is balanced and complete: + +Assumption 2.1. The observations $(X_{1},Y_{1}),\dots ,(X_{n},Y_{n})$ are identically distributed according to $P_{XY}$ , and can be divided into $m$ clusters of fixed size $d$ (i.e., $n = md$ ). In particular, the $m$ clusters + +$$ +\left\{\left[ \left(X _ {d i - d + 1}, Y _ {d i - d + 1}\right), \dots , \left(X _ {d i}, Y _ {d i}\right) \right] \right\} _ {i = 1} ^ {m} +$$ + +are independent from one another while having identical within-cluster correlation structure. + +The specific correlation structure among the observations in each cluster can be arbitrary. We are interested in studying the dependence between $X$ and $Y$ based on the sample $\{(X_j,Y_j)\}_{j = 1}^n$ . + +# 2.2 Hilbert-Schmidt Independence Criterion + +We briefly review the Hilbert-Schmidt Independence Criterion (HSIC) proposed by Gretton et al. (2005a) [12]. The HSIC measures the generalized dependence between two variables $X$ and $Y$ , by embedding $X$ and $Y$ into reproducing kernel Hilbert spaces (RKHS's) and maximizing the covariance between functions of $X$ and $Y$ in the RKHS's. + +Let $\mathcal{H}_X$ be an RKHS on $\mathcal{X}$ with associated kernel function (i.e., inner product in the RKHS) $k_{X}:\mathcal{X}\times \mathcal{X}\to \mathbb{R}$ , and let $\mathcal{H}_Y$ be an RKHS on $\mathcal{V}$ with associated kernel function $k_{Y}:\mathcal{V}\times \mathcal{V}\rightarrow \mathbb{R}$ . Following Gretton et al. (2007) [14], the cross-covariance operator $C_{XY}:\mathcal{H}_Y\to \mathcal{H}_X$ can be defined such that, for any $f\in \mathcal{H}_X$ and $g\in \mathcal{H}_Y$ , + +$$ +\langle f, C _ {X Y} g \rangle_ {\mathcal {H} _ {X}} = \mathbb {E} _ {X Y} \left[ (f (X) - \mathbb {E} _ {X} [ f (X) ]) (g (Y) - \mathbb {E} _ {Y} [ g (Y) ]) \right] = \mathbb {C} \operatorname {o v} (f (X), g (Y)). +$$ + +As shown by Gretton et al. (2005b) [20], the operator norm (i.e., the largest singular value) of $C_{XY}$ , defined by $\|C_{XY}\} \coloneqq \sup_{f \in \mathcal{H}_X, g \in \mathcal{H}_Y, \|f\|_\infty \leq 1, \|g\|_\infty \leq 1} \mathbb{C}\mathrm{ov}\left(f(X), g(Y)\right)$ , is zero if and only if $X \perp Y$ , given that the kernels $k_X$ and $k_Y$ are universal (see Definition 5 of [20]). In this sense, $\|C_{XY}\|$ is a measure of independence between $X$ and $Y$ . + +The largest singular value of $C_{XY}$ becomes zero when the sum of all squared singular values, denoted as the squared Hilbert-Schmidt norm [12], is zero. Therefore, the squared Hilbert-Schmidt norm of $C_{XY}$ , $\| C_{XY}\|_{HS}^2$ , is also an independence criterion. This measure is defined as the population HSIC, which can be expressed conveniently in terms of kernel functions: + +$$ +\begin{array}{l} \mathrm {H S I C} (P _ {X Y}) := \| C _ {X Y} \| _ {H S} ^ {2} = \mathbb {E} _ {X X ^ {\prime} Y Y ^ {\prime}} [ k _ {X} (X, X ^ {\prime}) k _ {Y} (Y, Y ^ {\prime}) ] \\ + \mathbb {E} _ {X X ^ {\prime}} [ k _ {X} (X, X ^ {\prime}) ] \mathbb {E} _ {Y Y ^ {\prime}} [ k _ {Y} (Y, Y ^ {\prime}) ] - 2 \mathbb {E} _ {X Y} \left[ \mathbb {E} _ {X ^ {\prime}} [ k _ {X} (X, X ^ {\prime}) ] \mathbb {E} _ {Y ^ {\prime}} [ k _ {Y} (Y, Y ^ {\prime}) ] \right], \\ \end{array} +$$ + +where $X'$ is an independent copy of $X$ . It is obvious that, if $X$ is independent from $Y$ , then we have $\mathrm{HSIC}(P_{XY}) = 0$ . Furthermore, for certain characteristic $k_{X}$ and $k_{Y}$ [13], $\mathrm{HSIC}(P_{XY}) = 0$ if and only if $X \perp Y$ . Example characteristic kernels include Gaussian kernels and Laplacian kernels [21]. + +To estimate the population HSIC from a sample $\{(X_j,Y_j)\}_{j = 1}^n$ , the empirical HSIC can be used: + +$$ +\begin{array}{l} \mathrm {H S I C} (P _ {n}) := \frac {1}{n ^ {2}} \sum_ {i, j} ^ {n} k _ {X} (X _ {i}, X _ {j}) k _ {Y} (Y _ {i}, Y _ {j}) + \frac {1}{n ^ {4}} \sum_ {i, j, q, r} ^ {n} k _ {X} (X _ {i}, X _ {j}) k _ {Y} (Y _ {q}, Y _ {r}) \\ - \frac {2}{n ^ {3}} \sum_ {i, j, q} ^ {n} k _ {X} (X _ {i}, X _ {j}) k _ {Y} (Y _ {i}, Y _ {q}). \\ \end{array} +$$ + +Define the kernel matrices $\pmb{K}_X$ and $\pmb{K}_Y$ such that the $(i,j)$ -th element of $\pmb{K}_X$ is $k_X(X_i, X_j)$ and the $(i,j)$ -th element of $\pmb{K}_Y$ is $k_Y(Y_i, Y_j)$ . Then the empirical HSIC can also be written in terms of $\pmb{K}_X$ and $\pmb{K}_Y$ : + +$$ +\mathrm {H S I C} (P _ {n}) = \frac {1}{n ^ {2}} \operatorname {t r} (\boldsymbol {H} \boldsymbol {K} _ {X} \boldsymbol {H} \boldsymbol {K} _ {Y}), +$$ + +where $\pmb {H} = \pmb {I} - \frac{1}{n}\pmb{1}\pmb{1}^T$ is a centering matrix. + +Both Gretton et al. (2007) [14] and Zhang et al. (2012) [22] have derived the asymptotic distribution of $\mathrm{HSIC}(P_n)$ under the null hypothesis of independence between $X$ and $Y$ as a weighted sum of chi-square variables, when the observations are i.i.d. In Section 3, we examine the asymptotic behavior of $\mathrm{HSIC}(P_n)$ based on cluster-correlated observations. It turns out that the null distribution in this case is still a weighted sum of chi-square variables, where the weights are now modified. + +# 3 HSIC for cluster-correlated data + +Based on the clustered data setting in Section 2.1, we aim to test the null hypothesis $H_0: X \perp Y$ using the empirical HSIC statistic. We first define some useful parameters and statistics. + +Assume that the kernel matrices $K_{X}$ and $K_{Y}$ defined in Section 2.2 are positive semi-definite. We focus our attention on the centered kernel matrices: $\widetilde{K}_X \coloneqq H K_X H$ and $\widetilde{K}_Y \coloneqq H K_Y H$ . Let $\tilde{k}_X$ and $\tilde{k}_Y$ be the centered kernel functions derived from $k_{X}$ and $k_{Y}$ , with associated RKHS's $\widetilde{\mathcal{H}}_X$ and $\widetilde{\mathcal{H}}_Y$ , respectively. Note that the empirical HSIC can be written as $\mathrm{HSIC}(P_n) = \frac{1}{n^2} \operatorname{tr}(\widetilde{K}_X \widetilde{K}_Y)$ . + +Let $\gamma_{X,r}$ be the $r$ -th largest eigenvalue and $\pmb{u}_{X,r} = (u_{X,r}(X_1),\dots ,u_{X,r}(X_n))^T$ be the $r$ -th eigenvector of $\widetilde{\pmb{K}}_X$ . Similarly, we define the eigenvalues $\gamma_{Y,r}$ 's and eigenvectors $\pmb{u}_{Y,r}$ 's for $\widetilde{\pmb{K}}_Y$ . On the other hand, let $\lambda_{X,r}$ be the $r$ -th largest eigenvalue of the kernel $\tilde{k}_X$ with respect to $P_X$ , with associated eigenfunction $\phi_{X,r}(\cdot)$ , such that $\int \tilde{k}_X(x,x')\phi_{X,r}(x')dP_X(x') = \lambda_{X,r}\phi_{X,r}(x)$ . Similarly, we define the eigenvalues $\lambda_{Y,r}$ 's and eigenfunctions $\phi_{Y,r}$ 's for the kernel $\tilde{k}_Y$ with respect to $P_Y$ . + +For any fixed $R \in \mathbb{N}$ , let $\tilde{k}_{X,R}(x,x') \coloneqq \sum_{r=1}^{R} \lambda_{X,r} \phi_{X,r}(x) \phi_{X,r}(x')$ . For each $r$ where $\gamma_{X,r} > 0$ , let $g_{X,r}(x) \coloneqq \frac{\sqrt{n}}{\gamma_{X,r}} \sum_{j=1}^{n} \tilde{k}_X(x,X_j) u_{X,r}(X_j)$ . Define $\tilde{k}_{Y,R}$ and $g_{Y,r}$ similarly. The upcoming theorems will rely on the following assumption: + +Assumption 3.1. Suppose that $\mathbb{E}[\tilde{k}_X^2 (X,X')] < \infty$ and $\mathbb{E}[\tilde{k}_Y^2 (Y,Y')] < \infty$ . Assume that, for each $R\in \mathbb{N}$ , the classes $\mathcal{C}_X\coloneqq \{x\mapsto (\tilde{k}_X - \tilde{k}_{X,R})^2 (x,x'):x'\in \mathcal{X}\}$ and $\mathcal{C}_Y\coloneqq \{y\mapsto (\tilde{k}_Y - \tilde{k}_{Y,R})^2 (y,y'):y'\in \mathcal{V}\}$ are $P_{X}$ -Donsker and $P_{Y}$ -Donsker [23], respectively. Further assume that, for each $r$ , the functions $x\mapsto g_{X,r}(x)$ and $y\mapsto g_{Y,r}(y)$ converge uniformly in probability as $m\to \infty$ , with their limit functions in $L_{2}(P_{X})$ and $L_{2}(P_{Y})$ , respectively. + +In general, Assumption 3.1 ensures that the data-dependent eigenvalues and (elements of) eigenvectors of the kernel matrices $\widetilde{K}_X$ and $\widetilde{K}_Y$ converge in probability to eigenvalues and eigenfunctions of the kernels $\tilde{k}_X$ and $\tilde{k}_Y$ . We show in Appendix A.1 that the Donsker class condition in Assumption 3.1 holds for Gaussian kernels. Now we can establish the asymptotic distribution of $\mathrm{HSIC}(P_n)$ under $H_0: X \perp Y$ based on clustered data. + +Theorem 3.2. Suppose that, for two multivariate random variables $X$ and $Y$ , we have centered kernels $\tilde{k}_X$ and $\tilde{k}_Y$ with discrete eigenvalues. Suppose that Assumption 2.1 and Assumption 3.1 hold. Under the null hypothesis $H_0: X \perp Y$ , we have + +$$ +n \operatorname {H S I C} \left(P _ {n}\right) = \frac {1}{n} \operatorname {t r} \left(\widetilde {\boldsymbol {K}} _ {X} \widetilde {\boldsymbol {K}} _ {Y}\right) \xrightarrow {d} \sum_ {t = 1} ^ {\infty} \ell_ {t} z _ {t} ^ {2} a s m \rightarrow \infty , \tag {1} +$$ + +where $z_{t}$ 's are i.i.d. standard normal variables, and $\ell_t$ 's are the solutions to the eigenvalue problem + +$$ +\begin{array}{l} \ell_ {t} \psi_ {t, r s} \\ = \frac {1}{d} \sum_ {p, q = 1} ^ {\infty} \mathbb {E} \left[ \left(\sum_ {i = 1} ^ {d} \sqrt {\lambda_ {X , r} \lambda_ {Y , s}} \phi_ {X, r} (X _ {i}) \phi_ {Y, s} (Y _ {i})\right) \left(\sum_ {i = 1} ^ {d} \sqrt {\lambda_ {X , p} \lambda_ {Y , q}} \phi_ {X, p} (X _ {i}) \phi_ {Y, q} (Y _ {i})\right) \right] \psi_ {t, p q} \\ \end{array} +$$ + +for some double sequence $\{\psi_{t,rs}\}_{r,s = 1}^{\infty}\in \mathbb{R}$ + +The proof of Theorem 3.2 is provided in Appendix B. To prove the theorem, we first show the convergence of eigenvalues and eigenvectors of $\widetilde{K}_X$ and $\widetilde{K}_Y$ in the presence of clustered data. We then adopt a strategy similar to that of Zhang et al. (2012) [22]: The test statistic $n\operatorname{HSIC}(P_n)$ can be expressed as a sum of squared terms, $\sum_{r,s=1}^{n}Q_{rs}^2$ , where the terms $Q_{rs}$ 's depend on eigenvalues and eigenvectors of the kernel matrices. We could show that $Q_{rs}$ 's are asymptotically jointly normal with mean zero under $H_0$ , and the asymptotic variances and covariances of these terms depend on eigenvalues and eigenfunctions of the kernels $\tilde{k}_X$ and $\tilde{k}_Y$ . + +As a result, the asymptotic distribution of $\mathrm{HSIC}(P_n)$ under $H_0$ is a weighted sum of chi-square variables. In particular, we require the number of clusters, $m$ , to be sufficiently large. Knowing the null distribution of the test statistic enables us to construct a statistical test at a given significance level. To examine the power of the proposed test, we further explore the behavior of the test statistic when the null hypothesis is violated. The next theorem states the asymptotic behavior of $\mathrm{HSIC}(P_n)$ under the alternative hypothesis $H_1: X \nsubseteq Y$ . + +Theorem 3.3. Suppose that, for two multivariate random variables $X$ and $Y$ , we have centered kernels $\tilde{k}_X$ and $\tilde{k}_Y$ with discrete eigenvalues. Suppose that Assumption 2.1 and Assumption 3.1 hold. If + +there exists some $r,s\in \mathbb{N}$ such that $\mathbb{E}[\phi_{X,r}(X)\phi_{Y,s}(Y)]\neq 0$ (2) + +then + +$$ +n \operatorname {H S I C} \left(P _ {n}\right) = \frac {1}{n} \operatorname {t r} \left(\widetilde {\boldsymbol {K}} _ {X} \widetilde {\boldsymbol {K}} _ {Y}\right) \xrightarrow {p} \infty a s m \to \infty . +$$ + +When $\tilde{k}_X$ and $\tilde{k}_Y$ are characteristic kernels, Condition (2) is equivalent to $H_1: X \not\perp Y$ . + +Here Condition (2) is a sufficient condition for $X \not\perp Y$ : If $X \perp Y$ , then $\mathbb{E}[\phi_{X,r}(X)\phi_{Y,s}(Y)] = \mathbb{E}[\phi_{X,r}(X)]\mathbb{E}[\phi_{Y,s}(Y)] = 0$ for all $r, s \in \mathbb{N}$ ; as a contrapositive, (2) implies $X \not\perp Y$ . When characteristic kernels are used, based on the definition and property of the population HSIC, we can show that $X \not\perp Y$ also implies (2). + +The proof of Theorem 3.3 is provided in Appendix C. To prove the theorem, we show that, under Condition (2), there exists a statistic smaller than $d\operatorname{HSIC}(P_n)$ that converges in probability to a positive constant, which results in $n\operatorname{HSIC}(P_n) = md\operatorname{HSIC}(P_n)$ going to infinity, as the number of clusters $(m)$ goes to infinity. When the test statistic goes to infinity, the rejection rate of the test would approach one. Hence, based on Theorem 3.3, we have established the consistency of the proposed test. + +In practice, the weights $\ell_t$ 's in (1) of Theorem 3.2 are unknown and we need to estimate them with empirical counterparts. In a similar spirit to Theorem 4 of Zhang et al. (2012) [22], the following proposition provides an approximation for the asymptotic null distribution of $\mathrm{HSIC}(P_n)$ and allows for independence testing in clustered data. + +Proposition 3.4. Assume that the conditions in Theorem 3.2 hold. To test the null hypothesis $H_0: X \perp Y$ at a significance level $\alpha$ , we can compare the statistic $n \operatorname{HSIC}(P_n) = \frac{1}{n} \operatorname{tr}(\widetilde{\boldsymbol{K}}_X \widetilde{\boldsymbol{K}}_Y)$ against the $(1 - \alpha)$ -quantile of the distribution of + +$$ +\widetilde {T} = \frac {1}{m} \sum_ {t = 1} ^ {n ^ {2}} \tilde {\ell} _ {t} z _ {t} ^ {2}, +$$ + +where $z_{t}$ 's are i.i.d. standard normal variables and $\tilde{\ell}_{t}$ 's are eigenvalues of $\widetilde{V}\widetilde{V}^T$ , with $\widetilde{V} = [\tilde{v}_1,\dots ,\tilde{v}_m]$ . Each vector $\tilde{v}_i$ is obtained by vectorizing (i.e., stacking the columns of) the $n\times n$ matrix $\widetilde{M}_i$ , whose $(r,s)$ -th entry is + +$$ +\widetilde {M} _ {i, r s} = \frac {1}{\sqrt {d}} \sum_ {j = d i - d + 1} ^ {d i} \sqrt {\gamma_ {X , r} \gamma_ {Y , s}} u _ {X, r} (X _ {j}) u _ {Y, s} (Y _ {j}). +$$ + +The proof of Proposition 3.4 is provided in Appendix D, where we show that $\widetilde{T}$ has the same asymptotic distribution as $n\mathrm{HSIC}(P_n)$ under $H_0$ . Note that the eigenvalues of $\widetilde{\boldsymbol{V}}\widetilde{\boldsymbol{V}}^T$ , an $n^2\times n^2$ matrix, are the same as the eigenvalues of $\widetilde{\boldsymbol{V}}^T\widetilde{\boldsymbol{V}}$ , an $m\times m$ matrix. In practice, we can calculate the eigenvalues of $\widetilde{\boldsymbol{V}}^T\widetilde{\boldsymbol{V}}$ instead to avoid excessive computational burden. + +The distribution of $\widetilde{T}$ , which is a mixture of chi-square variables, can be efficiently approximated by Davies' exact method [24]. This method is shown to work well in previous studies [1, 25] that have statistical tests based on a mixture of chi-square distributions. + +# 4 Experiments + +In this section, we conduct simulation studies and real data analysis to demonstrate the performance of our proposed test. + +# 4.1 Simulation studies + +# 4.1.1 Methods + +We consider a longitudinal data setting, where a set of exposure variables $X \in \mathbb{R}^p$ and a set of outcome variables $Y \in \mathbb{R}^q$ are measured on $m$ subjects at 3 time points. In other words, the observations $\{(X_j, Y_j)\}_{j=1}^n$ are grouped into $m$ clusters with cluster size $d = 3$ . To introduce correlation across different time points as well as across different variables, we use a Kronecker product-based covariance structure [7], which has often been used to model multivariate longitudinal data [11]. + +The general simulation setting is as following. For each cluster, let $x_{ij}$ denote the $i$ -th variable in $X$ measured at the $j$ -th time point, for $i = 1, \dots, p$ and $j = 1, 2, 3$ . Let $y_{ij}$ be defined similarly. Within each cluster, we let $(x_{11}, x_{12}, x_{13}, \dots, x_{p1}, x_{p2}, x_{p3})^T \sim \mathcal{N}(5 \times \mathbf{1}_{3p}, \boldsymbol{\Sigma}_X)$ , where $\boldsymbol{\Sigma}_X = \boldsymbol{R}_X \otimes \boldsymbol{R}_{cl}$ , with + +$$ +\boldsymbol {R} _ {X} = \left( \begin{array}{c c c c} 1 & \rho_ {X} & \dots & \rho_ {X} \\ \rho_ {X} & 1 & \dots & \rho_ {X} \\ \vdots & \vdots & \ddots & \vdots \\ \rho_ {X} & \rho_ {X} & \dots & 1 \end{array} \right) _ {p \times p}, \quad \boldsymbol {R} _ {c l} = \left( \begin{array}{c c c} 1 & \rho_ {c c c} & \rho_ {c c c} ^ {2} \\ \rho_ {c c c} & 1 & \rho_ {c c c} \\ \rho_ {c c c} ^ {2} & \rho_ {c c c} & 1 \end{array} \right). +$$ + +Here $\otimes$ is the Kronecker product. Marginally, we have imposed an exchangeable correlation structure $R_{X}$ across the $p$ variables in $X$ and an AR(1) correlation structure $R_{cl}$ across the three time points. The correlations between distinct variables at different time points are products of the marginal correlations: e.g., $\mathrm{Corr}(x_{11}, x_{22}) = \rho_{X} \rho_{c}$ . + +We simulate a situation where a single exposure (say, the $r$ -th variable in $X$ ) affects multiple outcomes, with different effect sizes on different outcomes. Within each cluster, we use the model: + +$$ +\begin{array}{l} \left(y _ {1 1}, y _ {1 2}, y _ {1 3}, \dots , y _ {q 1}, y _ {q 2}, y _ {q 3}\right) ^ {T} \\ = \left(\beta_ {1} f \left(x _ {r 1}\right), \beta_ {1} f \left(x _ {r 2}\right), \beta_ {1} f \left(x _ {r 3}\right), \dots , \beta_ {q} f \left(x _ {r 1}\right), \beta_ {q} f \left(x _ {r 2}\right), \beta_ {q} f \left(x _ {r 3}\right)\right) ^ {T} + \epsilon , \tag {3} \\ \end{array} +$$ + +where $\beta_{s}$ , with $s = 1, \dots, q$ , is the effect size of the chosen exposure on the $s$ -th outcome, and $\epsilon \sim \mathcal{N}(0, \Sigma_Y)$ , with $\Sigma_Y = R_Y \otimes R_{cl}$ . $R_Y$ is the correlation matrix for the $q$ variables in $Y$ . In simulations, we set $p = q = 20$ , $\rho_X = 0.5$ and consider various levels of within-cluster correlation: $\rho_c = 0.3, 0.5$ or 0.7. We also let $R_Y = R_X$ . + +Type I error simulation To evaluate the type I error rate (rejection rate under $H_0$ ), we let $\beta_{1} = \dots = \beta_{q} = 0$ , so that the null hypothesis $H_0: X \perp Y$ is true. We perform both the proposed HSIC test with proper accommodation for clustered correlation (HSIC $_{\mathrm{cl}}$ ), and the original HSIC test without any adjustment (HSIC $_{\mathrm{orig}}$ ) as in [22] and [1]. These two methods are applied to the data $\{(X_j, Y_j)\}_{j=1}^n$ at the observation level. We consider $m = 500$ , 1000 or 1500 clusters and calculate the empirical type I error rates in each setting based on 1000 simulated data sets. + +From Model (3), both $X$ and $Y$ have multivariate normal distributions under $H_0$ . While we focus on normal data here, additional Type I error simulations based on non-normal data are considered in Appendix F.1. + +Power simulation To evaluate the power (rejection rate under $H_{1}$ ), we randomly select one exposure variable from $X$ to be the causal exposure, and make the first $\eta$ proportion $(\eta = 10\%, 20\%, 30\%, 40\%)$ of outcomes in $Y$ depend on that exposure (with nonzero $\beta_{s}$ 's). We let the function $f(x)$ take two forms: $f(x) = x$ (Power Scenario 1) and $f(x) = \log ((x - 4)^{2})$ (Power + +Scenario 2). For $s = 1, \dots, \eta q$ , the effect sizes $\beta_{s}$ 's are generated from a Uniform $(0, \sqrt{25 / m})$ distribution under Power Scenario 1, and from Uniform $(0, \sqrt{10 / m})$ under Power Scenario 2. + +In the power simulation, we perform $\mathbf{HSIC}_{\mathrm{el}}$ and two other HSIC-based competing methods. The two competing methods analyze data at the cluster/subject level. In the first method $(\mathbf{HSIC}_{\mathrm{mean}})$ , for each cluster, we take an average of observations at different time points: We consider the new variables $X^{*} := \left(\frac{1}{3}\sum_{j=1}^{3}x_{1j}, \dots, \frac{1}{3}\sum_{j=1}^{3}x_{pj}\right)^{T}$ and $Y^{*} := \left(\frac{1}{3}\sum_{j=1}^{3}y_{1j}, \dots, \frac{1}{3}\sum_{j=1}^{3}y_{qj}\right)^{T}$ and then perform the original HSIC test based on $\{(X_i^*, Y_i^*)\}_{i=1}^m$ . In the second method $(\mathbf{HSIC}_{\mathrm{cat}})$ , we follow the strategy of Rudra et al. [19] and concatenate the observations at different time points for each cluster: We consider the new variables $X^{**} := (x_{11}, x_{12}, x_{13}, \dots, x_{p1}, x_{p2}, x_{p3})^T$ and $Y^{**} := (y_{11}, y_{12}, y_{13}, \dots, y_{q1}, y_{q2}, y_{q3})^T$ and then perform the original HSIC test based on $\{(X_i^{**}, Y_i^{**})\}_{i=1}^m$ . + +We consider $m = 500$ clusters and calculate the empirical power in each setting based on 1000 simulated data sets. + +Kernel choices For both $X$ and $Y$ , we consider two different kernels: the Gaussian kernel $k_{X}(z_{1},z_{2}) = k_{Y}(z_{1},z_{2}) = \exp (-\| z_{1} - z_{2}\|_{2}^{2} / \tau)$ and the linear kernel $k_{X}(z_{1},z_{2}) = k_{Y}(z_{1},z_{2}) = z_{1}^{T}z_{2}$ . For the Gaussian kernel, the shape parameter $\tau$ is chosen as the median of the Euclidean distance between each sample pair. While the Gaussian kernel is a characteristic kernel [21], the linear kernel is not characteristic and is designed to detect linear or close-to-linear relationships between $X$ and $Y$ . Nevertheless, linear kernels have been shown to be reasonably powerful in previous association studies [25, 2] and can be computationally efficient (see Appendix G.2). + +Additional simulation studies are provided in Appendix F. Additional implementation details including computation time and code availability are provided in Appendix G. + +# 4.1.2 Results + +Table 1 shows the empirical type I error rates of $\mathbf{HSIC}_{\mathrm{orig}}$ and $\mathbf{HSIC}_{\mathrm{cl}}$ for normal data. The type I error rate of $\mathbf{HSIC}_{\mathrm{orig}}$ is inflated in each setting, where the inflation becomes greater as the within-cluster correlation $(\rho_c)$ increases. In contrast, $\mathbf{HSIC}_{\mathrm{cl}}$ has a well-controlled type I error rate across all levels of within-cluster correlation. Using the linear kernel, $\mathbf{HSIC}_{\mathrm{cl}}$ has type I error rates close to the nominal $\alpha$ in all situations. Using the Gaussian kernel, $\mathbf{HSIC}_{\mathrm{cl}}$ is conservative when the number of clusters is moderate ( $m = 500$ ), but its type I error rate gets close to the nominal $\alpha$ at a larger sample size ( $m = 1500$ ). For non-normal data (Figure F1 in Appendix), the pattern is similar: $\mathbf{HSIC}_{\mathrm{cl}}$ is able to control the type I error rate, either with the Gaussian kernel or with the linear kernel. + +$\mathbf{HSIC}_{\mathrm{cl}}$ based on the Gaussian kernel is more conservative, likely because the Gaussian kernel is associated with a larger number of non-zero eigenvalues in finite samples than the linear kernel in our simulation setting. The null distribution for Gaussian-kernel-based $\mathbf{HSIC}_{\mathrm{cl}}$ thus involves more terms in the weighted sum of chi-square variables (as the weights depend on eigenvalues), which might aggregate more finite-sample errors and make the test statistic converge slower to the asymptotic distribution. + +Figure 1 shows the empirical power of $\mathbf{HSIC}_{\mathrm{cl}}$ and the two competing methods under Power Scenario 1. In all situations, $\mathbf{HSIC}_{\mathrm{cl}}$ has a higher power than both $\mathbf{HSIC}_{\mathrm{mean}}$ and $\mathbf{HSIC}_{\mathrm{cat}}$ , regardless of the level of within-cluster correlation or the kernel being used. In addition, the power of $\mathbf{HSIC}_{\mathrm{cl}}$ improves quickly as a higher proportion of variables in $Y$ is associated with $X$ . Since $X$ and $Y$ are linearly associated in Scenario 1, it is not surprising that the linear kernel is powerful in detecting this dependence. The Gaussian kernel has a comparable performance as the linear kernel. + +Figure 2 shows the empirical power under Power Scenario 2, where $X$ and $Y$ have a non-linear relationship. Similar to Power Scenario 1, for both the Gaussian kernel and the linear kernel, $\mathbf{HSIC}_{\mathrm{cl}}$ achieves a higher power than the competing methods under all levels of within-cluster correlation. When compared between kernels, $\mathbf{HSIC}_{\mathrm{cl}}$ based on the Gaussian kernel is more powerful than $\mathbf{HSIC}_{\mathrm{cl}}$ based on the linear kernel in each setting, showing the advantage of the Gaussian kernel as a characteristic kernel to detect general dependence patterns. + +Overall, both Power Scenario 1 and 2 show the considerable power gain of $\mathbf{HSIC}_{\mathbf{cl}}$ over analyzing data at the cluster level. We also note that, the power gain of $\mathbf{HSIC}_{\mathbf{cl}}$ decreases as the within-cluster correlation increases. This is expected since there will be less pronounced information loss in + +Table 1: Empirical type I error rate of $\mathbf{HSIC}_{\mathrm{orig}}$ and $\mathbf{HSIC}_{\mathrm{cl}}$ at nominal level $\alpha$ for normal data under simulation. + +
αmρcGaussian kernelLinear kernel
HSICorigHSICclHSICorigHSICcl
0.055000.30.1190.0240.0680.047
0.50.6030.0310.1410.044
0.71.0000.0300.3300.044
10000.30.1150.0290.0700.043
0.50.5910.0340.1660.054
0.71.0000.0340.3480.043
15000.30.1130.0470.0820.053
0.50.6080.0430.1450.053
0.71.0000.0440.3520.052
0.015000.30.0180.0050.0210.013
0.50.1900.0050.0350.011
0.70.9980.0090.1140.008
10000.30.0220.0060.0150.010
0.50.1800.0100.0500.008
0.70.9990.0100.1110.010
15000.30.0270.0070.0190.010
0.50.2090.0080.0470.010
0.70.9990.0080.1170.009
+ +averaging or concatenating the data at the cluster level if observations within a cluster are highly correlated. + +![](images/d66b248de5bd98b85a02d5c42d4a104c4fe3f611c25537d7f009b369b39f8fa1.jpg) +Figure 1: Empirical power of $\mathbf{HSIC}_{\mathrm{cl}}$ and competing methods at nominal level $\alpha = 0.05$ under Power Scenario 1. The x-axis represents the proportion of variables in $Y$ that are associated with $X$ . The top row shows results based on the Gaussian kernel, and the bottom row shows results based on the linear kernel. + +While the above results are based on a fixed cluster size, we have also investigated the effect of cluster size on the performance of $\mathbf{HSIC}_{\mathbf{cl}}$ (Appendix F.2). When the number of clusters $(m)$ and the level of within-cluster correlation $(\rho_{c})$ are fixed, type I error control is similar for different cluster sizes (Figure F2-F3), suggesting that the convergence speed of the test statistic under $H_0$ is likely not affected by cluster size. However, a larger cluster size tends to result in a higher statistical + +![](images/1ab2917d1d5190c9b9c911ba1f138055abf7c180bffd1376cda8b965aa95a9cd.jpg) +Figure 2: Empirical power of $\mathbf{HSIC_d}$ and competing methods at nominal level $\alpha = 0.05$ under Power Scenario 2. The x-axis represents the proportion of variables in $Y$ that are associated with $X$ . The top row shows results based on the Gaussian kernel, and the bottom row shows results based on the linear kernel. + +power (Figure F4), possibly due to an increase in the overall sample size, which allows for additional information gain. + +# 4.2 Application to real data + +The vaginal microbiota plays an important role in maintaining vaginal homeostasis. Common vaginal conditions, such as bacterial vaginosis, are characterized by shifts in vaginal microbiome composition and changes in vaginal metabolites [4, 26]. Studying the association between the microbiome and the metabolites helps us better understand how the vaginal microbiota contributes to the host metabolic environment, and identifies potential metabolic biomarkers for vaginal conditions [4]. Here we apply $\mathbf{HSIC}_{\mathrm{el}}$ and competing methods to test the dependence between the overall vaginal microbiome composition and different metabolic pathways, using data from the Menopause Strategies: Finding Lasting Answers for Symptoms and Health (MsFLASH) Vaginal Health Trial [27]. + +The MsFLASH trial was a 12-week randomized clinical trial to evaluate the treatment effect of vaginal estradiol vs. placebo on vaginal discomfort in postmenopausal women [27] (see Appendix H.1 for more details). As part of an effort to investigate the mechanism of postmenopausal vaginal discomfort, vaginal microbiota and vaginal fluid metabolites were characterized longitudinally and available in 141 participants at baseline, 4 and 12 weeks [28]. The vaginal microbiome profiles included abundance data of 381 taxa. The metabolome profiles included abundance data of 171 metabolites, which were grouped into 95 metabolic pathways. We apply $\mathbf{HSIC}_{\mathrm{cl}}$ , $\mathbf{HSIC}_{\mathrm{mean}}$ and $\mathbf{HSIC}_{\mathrm{cat}}$ to assess the dependence between the overall vaginal microbiome composition and the metabolites in each pathway, across all 95 pathways. In other words, for each test, we have $m = 141$ , $d = 3$ , $X \in \mathbb{R}^{381}$ and $Y \in \mathbb{R}^q$ , where $q$ is the number of metabolites in a pathway, ranging from 1 to 21 in this data set; 95 tests are performed in total. + +Table 2 shows the number of metabolic pathways identified to be associated with the vaginal microbiome composition, at a Bonferroni-corrected significance level $\alpha = 0.05 / 95 = 5.3 \times 10^{-4}$ . Due to the close relationship between vaginal microbiota and vaginal metabolites, all methods have identified a considerable number of significant metabolic pathways. Still, $\mathbf{HSIC}_{\mathbf{cl}}$ identifies a larger number of pathways than $\mathbf{HSIC}_{\mathbf{mean}}$ and $\mathbf{HSIC}_{\mathbf{cat}}$ , either with the Gaussian kernel or with the linear kernel. In particular, based on the Gaussian kernel, $\mathbf{HSIC}_{\mathbf{cl}}$ successfully identifies all the significant pathways discovered by $\mathbf{HSIC}_{\mathbf{mean}}$ and $\mathbf{HSIC}_{\mathbf{cat}}$ , and discovers 4 (7) additional pathways compared to $\mathbf{HSIC}_{\mathbf{cat}}$ ( $\mathbf{HSIC}_{\mathbf{mean}}$ ) (Figure H1). 67 out of 68 pathways discovered by $\mathbf{HSIC}_{\mathbf{cl}}$ using + +the linear kernel are also identified by $\mathbf{HSIC}_{\mathrm{cl}}$ using the Gaussian kernel (Figure H2). For this data set, the Gaussian kernel appears to be more powerful in detecting dependence than the linear kernel, indicating a possibly non-linear relationship between certain metabolites and microbial taxa abundances. + +Table 2: Number of metabolic pathways identified to be associated with the vaginal microbiome composition based on the MsFLASH data set $(\alpha = 5.3\times 10^{-4})$ + +
KernelHSICmeanHSICcatHSICcl
Gaussian687175
Linear646468
+ +We focus on some of the top pathways (with high statistical significance) identified using $\mathbf{HSIC}_{\mathrm{cl}}$ and highlight their biological relevance. The top pathways include multiple metabolic pathways for amino acids. The human vaginal microbiota is dominated by bacteria in the Lactobacillus genus [29], which are known to produce branched-chain amino acids including valine, leucine and isoleucine [30]. All these amino acids are present in our top pathways. In particular, one pathway related to leucine metabolism is only identified by $\mathbf{HSIC}_{\mathrm{cl}}$ but not by $\mathbf{HSIC}_{\mathrm{mean}}$ or $\mathbf{HSIC}_{\mathrm{cat}}$ . Therefore, our finding is consistent with previous studies on bacterial metabolism, confirming the power improvement in using $\mathbf{HSIC}_{\mathrm{cl}}$ for scientific discovery. + +# 5 Discussion + +We have introduced a novel kernel-based approach, $\mathbf{HSIC}_{\mathrm{cl}}$ , to evaluate the generalized dependence between two multivariate variables based on cluster-correlated data. Using the previously developed HSIC statistic as our test statistic, we have derived its asymptotic null distribution in the presence of clustered correlation and constructed a statistical test of independence accordingly. We have also established the consistency of the proposed test. Both simulation studies and application to real longitudinal data demonstrate the power gain in using our proposed test, compared to methods based on measurements averaged or concatenated at the cluster level. + +One limitation of our framework is that the proposed test only applies to balanced and complete clustered data, which might not be always available in practice. In longitudinal studies, for example, subjects might be followed at different time points from one another (resulting in unbalanced data), or become lost to follow-up (resulting in incomplete data). For incomplete data, one solution is to impute the missing data before applying $\mathbf{HSIC}_{\mathrm{cl}}$ . Further extension of the test for unbalanced or incomplete clustered data will be interesting for future study. + +Another limitation is that our proposed test relies on asymptotic results, and the null distribution might not be accurately approximated when the number of clusters is small, which is likely true of many family-based or longitudinal studies. Permutation-based approaches could be a surrogate for $\mathbf{HSIC}_{\mathrm{cl}}$ at small sample sizes (see Appendix F.3), although their computational burden is large compared to $\mathbf{HSIC}_{\mathrm{cl}}$ (see Table G1). Computationally efficient adaptations of $\mathbf{HSIC}_{\mathrm{cl}}$ to small sample sizes, such as those proposed by Lee et al. [31] and Zhan et al. [32], would be another useful extension. + +With the continuing emergence of high-dimensional data and the prevalence of cluster-correlated data in different scientific fields, our proposed test is a promising approach to discover novel associations and bring new scientific insights in these settings. Meanwhile, we need to be cautious about potential risks to society that might result from misuse or misinterpretation of our proposed test. For example, confounding is an important factor to consider in genetic and epidemiological studies. A confounder affects both the exposure and the outcome, and could lead to spurious associations between the two variables even if the variables themselves do not have causal relationships. Therefore, as one applies our proposed test to evaluate the association between two variables, it is important to consider the presence of potential confounders and be careful in interpreting the test results. Mistaking certain observed correlation for causation could lead to misinformation in the scientific community and would be especially concerning when the studies being conducted directly influence people's life. + +# Acknowledgments and Disclosure of Funding + +This work is supported by the National Institutes of Health grant R01-GM129512. The MsFLASH data were provided by the Fred Hutchinson Cancer Research Center (MsFLASH Network), which is supported by the National Institute on Aging grant 5R01-AG048209. We would like to thank the anonymous reviewers for their helpful feedback. + +The authors declare no competing interests. + +# References + +[1] K Alaine Broadaway, David J Cutler, Richard Duncan, Jacob L Moore, Erin B Ware, Min A Jhun, Lawrence F Bielak, Wei Zhao, Jennifer A Smith, Patricia A Peyser, et al. A statistical approach for testing cross-phenotype effects of rare variants. The American Journal of Human Genetics, 98(3):525–540, 2016. +[2] Xiang Zhan, Ni Zhao, Anna Plantinga, Timothy A Thornton, Karen N Conneely, Michael P Epstein, and Michael C Wu. Powerful genetic association analysis for common or rare variants with high-dimensional structured traits. Genetics, 206(4):1779-1790, 2017. +[3] Alessia Visconti, Caroline I Le Roy, Fabio Rosa, Niccolò Rossi, Tiphaine C Martin, Robert P Mohney, Weizhong Li, Emanuele de Rinaldis, Jordana T Bell, J Craig Venter, et al. Interplay between the human gut microbiome and host metabolism. Nature Communications, 10(1):1-10, 2019. +[4] Amy McMillan, Stephen Rulisa, Mark Sumarah, Jean M Macklaim, Justin Renaud, Jordan E Bisanz, Gregory B Gloor, and Gregor Reid. A multi-platform metabolomics approach identifies highly specific biomarkers of bacterial diversity in the vagina of pregnant and non-pregnant women. Scientific Reports, 5(1):1-14, 2015. +[5] Jurg Ott, Yoichiro Kamatani, and Mark Lathrop. Family-based designs for genome-wide association studies. Nature Reviews Genetics, 12(7):465-474, 2011. +[6] Jos WR Twisk. Applied longitudinal data analysis for epidemiology: a practical guide. Cambridge University Press, 2013. +[7] Andrzej T Galecki. General class of covariance structures for two or more repeated factors in longitudinal data analysis. Communications in Statistics-Theory and Methods, 23(11):3105-3119, 1994. +[8] Liam M O'Brien and Garrett M Fitzmaurice. Analysis of longitudinal multiple-source binary data using generalized estimating equations. Journal of the Royal Statistical Society: Series C (Applied Statistics), 53(1):177-193, 2004. +[9] Gregory Reinsel. Estimation and prediction in a multivariate random effects generalized linear model. Journal of the American Statistical Association, 79(386):406-414, 1984. +[10] Laurel A Beckett, Daniel J Tancredi, and RS Wilson. Multivariate longitudinal models for complex change processes. Statistics in Medicine, 23(2):231-239, 2004. +[11] Geert Verbeke, Steffen Fieuws, Geert Molenberghs, and Marie Davidian. The analysis of multivariate longitudinal data: a review. Statistical Methods in Medical Research, 23(1):42-59, 2014. +[12] Arthur Gretton, Olivier Bousquet, Alex Smola, and Bernhard Schölkopf. Measuring statistical dependence with hilbert-schmidt norms. In International Conference on Algorithmic Learning Theory, pages 63-77. Springer, 2005a. +[13] Bharath K Striperumbudur, Arthur Gretton, Kenji Fukumizu, Bernhard Schölkopf, and Gert RG Lanckriet. Hilbert space embeddings and metrics on probability measures. The Journal of Machine Learning Research, 11:1517-1561, 2010. + +[14] Arthur Gretton, Kenji Fukumizu, Choon Hui Teo, Le Song, Bernhard Scholkopf, Alexander J Smola, et al. A kernel statistical test of independence. In NIPS, volume 20, pages 585-592. Citeseer, 2007. +[15] Xinhua Zhang, Le Song, Arthur Gretton, Alexander J Smola, et al. Kernel measures of independence for non-iid data. In NIPS, volume 22, pages 1937-1944, 2008. +[16] Kacper Chwialkowski and Arthur Gretton. A kernel independence test for random processes. In International Conference on Machine Learning, pages 1422-1430. PMLR, 2014. +[17] Guochang Wang, Wai Keung Li, and Ke Zhu. New HSIC-based tests for independence between two stationary multivariate time series. arXiv preprint arXiv:1804.09866, 2018. +[18] Seth R Flaxman, Daniel B Neill, and Alexander J Smola. Gaussian processes for independence tests with non-id data in causal inference. ACM Transactions on Intelligent Systems and Technology (TIST), 7(2):1-23, 2015. +[19] Pratyaydipta Rudra, K Alaine Broadaway, Erin B Ware, Min A Jhun, Lawrence F Bielak, Wei Zhao, Jennifer A Smith, Patricia A Peyser, Sharon LR Kardia, Michael P Epstein, et al. Testing cross-phenotype effects of rare variants in longitudinal studies of complex traits. Genetic Epidemiology, 42(4):320–332, 2018. +[20] Arthur Gretton, Ralf Herbrich, Alexander Smola, Olivier Bousquet, Bernhard Scholkopf, et al. Kernel methods for measuring independence. The Journal of Machine Learning Research, 6:2075-2129, 2005b. +[21] Kenji Fukumizu, Arthur Gretton, Xiaohai Sun, and Bernhard Schölkopf. Kernel measures of conditional dependence. In NIPS, volume 20, pages 489-496, 2007. +[22] Kun Zhang, Jonas Peters, Dominik Janzing, and Bernhard Scholkopf. Kernel-based conditional independence test and application in causal discovery. In Proceedings of the Twenty-Seventh Conference on Uncertainty in Artificial Intelligence, UAI'11, page 804-813, Arlington, Virginia, USA, 2011. AUAI Press. +[23] Aad W Van der Vaart. Asymptotic statistics. Cambridge University Press, 1998. +[24] Robert B Davies. The distribution of a linear combination of $\chi^2$ random variables. Journal of the Royal Statistical Society: Series C (Applied Statistics), 29(3):323-333, 1980. +[25] Michael C Wu, Seunggeun Lee, Tianxi Cai, Yun Li, Michael Boehnke, and Xihong Lin. Rare-variant association testing for sequencing data with the sequence kernel association test. The American Journal of Human Genetics, 89(1):82–93, 2011. +[26] Sujatha Srinivasan, Martin T Morgan, Tina L Fiedler, Danijel Djukovic, Noah G Hoffman, Daniel Raftery, Jeanne M Marrazzo, and David N Fredricks. Metabolic signatures of bacterial vaginosis. MBio, 6(2), 2015. +[27] Caroline M Mitchell, Susan D Reed, Susan Diem, Joseph C Larson, Katherine M Newton, Kristine E Ensrud, Andrea Z LaCroix, Bette Caan, and Katherine A Guthrie. Efficacy of vaginal estradiol or vaginal moisturizer vs placebo for treating postmenopausal vulvovaginal symptoms: a randomized clinical trial. JAMA Internal Medicine, 178(5):681-690, 2018. +[28] Caroline M Mitchell, Nanxun Ma, Alissa J Mitchell, Michael C Wu, DJ Valint, Sean Proll, Susan D Reed, Katherine A Guthrie, Andrea Z Lacroix, Joseph C Larson, et al. Association between postmenopausal vulvovaginal discomfort, vaginal microbiota, and mucosal inflammation. American Journal of Obstetrics and Gynecology, 2021. +[29] Steven S Witkin and Iara M Linhares. Why do lactobacilli dominate the human vaginal microbiota? *BJOG: An International Journal of Obstetrics & Gynaecology*, 124(4):606-611, 2017. +[30] Camilla Ceccarani, Claudio Foschi, Carola Parolin, Antonietta D'Antuono, Valeria Gaspari, Clarissa Consolandi, Luca Laghi, Tania Camboni, Beatrice Vitali, Marco Severgnini, et al. Diversity of vaginal microbiome and metabolome during genital infections. Scientific Reports, 9(1):1-12, 2019. + +[31] Seunggeun Lee, Mary J Emond, Michael J Bamshad, Kathleen C Barnes, Mark J Rieder, Deborah A Nickerson, ESP Lung Project Team, David C Christiani, Mark M Wurfel, Xihong Lin, et al. Optimal unified approach for rare-variant association testing with application to small-sample case-control whole-exome sequencing studies. The American Journal of Human Genetics, 91(2):224–237, 2012. +[32] Xiang Zhan, Anna Plantinga, Ni Zhao, and Michael C Wu. A fast small-sample kernel independence test for microbiome community-level association analysis. Biometrics, 73(4):1453-1463, 2017. \ No newline at end of file diff --git a/akernelbasedtestofindependenceforclustercorrelateddata/images.zip b/akernelbasedtestofindependenceforclustercorrelateddata/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..49fe2507d9ef16f3141b4ed9950e8e50dabc6580 --- /dev/null +++ b/akernelbasedtestofindependenceforclustercorrelateddata/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:71969540519b5d90c475163d6add41de5b0d787b9f09fee7fe9ec19e21616672 +size 345551 diff --git a/akernelbasedtestofindependenceforclustercorrelateddata/layout.json b/akernelbasedtestofindependenceforclustercorrelateddata/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..371963c2b8bf154d3f1fd1fbf0af0de4b91dd2d8 --- /dev/null +++ b/akernelbasedtestofindependenceforclustercorrelateddata/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:daa78b9edefcc8c09fcf9176e6dd5a3b7b0e9892f98ffe27421dbf72bcb91bd3 +size 560930 diff --git a/alawofiteratedlogarithmformultiagentreinforcementlearning/4b4a60b3-d2b7-4f53-a8da-81243ce40f40_content_list.json b/alawofiteratedlogarithmformultiagentreinforcementlearning/4b4a60b3-d2b7-4f53-a8da-81243ce40f40_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..aa583002a54f9904ecd6527b0ac3bb1dd657fcb0 --- /dev/null +++ b/alawofiteratedlogarithmformultiagentreinforcementlearning/4b4a60b3-d2b7-4f53-a8da-81243ce40f40_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:00fcc42fadc806ae1aeaa49cb29cd2068aedcd2e41fdc78d44e7861d0c3def57 +size 86592 diff --git a/alawofiteratedlogarithmformultiagentreinforcementlearning/4b4a60b3-d2b7-4f53-a8da-81243ce40f40_model.json b/alawofiteratedlogarithmformultiagentreinforcementlearning/4b4a60b3-d2b7-4f53-a8da-81243ce40f40_model.json new file mode 100644 index 0000000000000000000000000000000000000000..8c925ca5cf1f650d3d5d008a41f078a908d743ad --- /dev/null +++ b/alawofiteratedlogarithmformultiagentreinforcementlearning/4b4a60b3-d2b7-4f53-a8da-81243ce40f40_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:377e7ef2a5e5f04dd261825e4f6103be8ae77439ae59725c3ade4cd2db7c534d +size 108232 diff --git a/alawofiteratedlogarithmformultiagentreinforcementlearning/4b4a60b3-d2b7-4f53-a8da-81243ce40f40_origin.pdf b/alawofiteratedlogarithmformultiagentreinforcementlearning/4b4a60b3-d2b7-4f53-a8da-81243ce40f40_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a3f4499dcbbb571b1a9856f9d304872accb5a8bb --- /dev/null +++ b/alawofiteratedlogarithmformultiagentreinforcementlearning/4b4a60b3-d2b7-4f53-a8da-81243ce40f40_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:29a2e92b5b40444946d3141a9b4b6655d65d3d0725aa91d90258ff1a407ff0dd +size 339850 diff --git a/alawofiteratedlogarithmformultiagentreinforcementlearning/full.md b/alawofiteratedlogarithmformultiagentreinforcementlearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..f9015e0e08a1e3f3574705b1096ed1dbb0080270 --- /dev/null +++ b/alawofiteratedlogarithmformultiagentreinforcementlearning/full.md @@ -0,0 +1,457 @@ +# A Law of Iterated Logarithm for Multi-Agent Reinforcement Learning + +Gugan Thoppe + +Computer Science and Automation + +Indian Institute of Science + +Bengaluru, Karnataka 560012, India + +gthoppe@iisc.ac.in + +Bhumesh Kumar + +Electrical and Computer Engineering + +University of Wisconsin at Madison + +Madison, WI 53706, USA + +bkumar@wisc.edu + +# Abstract + +In Multi-Agent Reinforcement Learning (MARL), multiple agents interact with a common environment, as also with each other, for solving a shared problem in sequential decision-making. It has wide-ranging applications in gaming, robotics, finance, etc. In this work, we derive a novel law of iterated logarithm for a family of distributed nonlinear stochastic approximation schemes that is useful in MARL. In particular, our result describes the convergence rate on almost every sample path where the algorithm converges. This result is the first of its kind in the distributed setup and provides deeper insights than the existing ones, which only discuss convergence rates in the expected or the CLT sense. Importantly, our result holds under significantly weaker assumptions: neither the gossip matrix needs to be doubly stochastic nor the stepsizes square summable. As an application, we show that, for the stepsize $n^{-\gamma}$ with $\gamma \in (0,1)$ , the distributed TD(0) algorithm with linear function approximation has a convergence rate of $\mathcal{O}(\sqrt{n^{-\gamma}\ln n})$ a.s.; for the $1/n$ type stepsize, the same is $\mathcal{O}(\sqrt{n^{-1}\ln\ln n})$ a.s. These decay rates do not depend on the graph depicting the interactions among the different agents. + +# 1 Introduction + +Can a machine train itself in the same way an infant learns to sit up, crawl, and walk? That is, can a device interact with the environment and figure out the action sequence required to complete a given task? The study of algorithms that enable such decision-making is what the field of Reinforcement Learning (RL) is all about [40]. In contrast, the mathematics needed to analyze such schemes is what forms the focus in Stochastic Approximation (SA) theory [2, 4]. More generally, SA refers to an iterative scheme that helps find zeroes or optimal points of a function, for which only noisy evaluations are possible. In this work, we analyze a family of Distributed Stochastic Approximation (DSA) algorithms [24] that is useful in Multi-Agent Reinforcement Learning (MARL) [22, 51]. + +In the MARL framework, we have multiple agents or learners that continually engage with a shared environment: the agents pick local actions, and the environment responds by transitioning to a new state and giving each agent a different local reward. Additionally, the agents also gossip about local computations with each other. The goal of the agents is to cooperatively find action policies that maximize the collective rewards obtained over time. Algorithms useful in this endeavor have found empirical success in domains as diverse as gaming [28], robotics [29], autonomous driving [35], communication networks [21], power grids [34], and economics [19]. However, theoretical analyses of such schemes are still very minimal, and this is what this paper aims to address. + +For the purpose of analysis, MARL methods are often viewed as special cases of DSA algorithms. The archetypical form of a DSA scheme with $m$ distributed nodes can be described as follows. Let $\mathcal{G}$ + +be a directed graph representing the connections between these nodes, and $W \equiv (W_{ij}) \in [0,1]^{m \times m}$ a matrix whose $ij$ -th entry denotes the strength of the edge $j \rightarrow i$ . It is assumed that $W$ is compatible with $\mathcal{G}$ , i.e., $W_{ij} > 0$ only if $j \rightarrow i \in \mathcal{G}$ . Then, at agent $i$ , the above scheme (written as row vectors) has the update rule + +$$ +x _ {n + 1} (i) = \sum_ {j \in \mathcal {N} _ {i}} W _ {i j} x _ {n} (j) + \alpha_ {n} \left[ h _ {i} \left(x _ {n}\right) + M _ {n + 1} (i) \right], \quad n \geq 0, \tag {1} +$$ + +where $x_{n}\in \mathbb{R}^{m\times d}$ is the joint estimate of the solution at time $n$ , its $j$ -th row, i.e., $x_{n}(j)$ denotes the estimate obtained at agent $j$ , $\mathcal{N}_i$ represents the set of in-neighbors of node $i$ in $\mathcal{G}$ , $\alpha_{n}$ is the stepsize, $h_i:\mathbb{R}^{m\times n}\to \mathbb{R}^d$ is the driving function at agent $i$ , and $M_{n + 1}(i)\in \mathbb{R}^d$ is the noise in its evaluation at time $n$ . This update rule has two parts: a weighted average of the estimates obtained by gossip and a refinement based on local computations. Clearly, the joint update rule of all the agents is + +$$ +x _ {n + 1} = W x _ {n} + \alpha_ {n} [ h (x _ {n}) + M _ {n + 1} ], \tag {2} +$$ + +where $M_{n+1}$ is the $m \times d$ matrix whose $i$ -th row is $M_{n+1}(i)$ , and $h$ is the function that maps $x \in \mathbb{R}^{m \times d}$ to the $m \times d$ matrix whose $i$ -th row is $h_i(x)$ . + +Two important points about the above framework are as follows: i.) we allow $h_i$ to be a function of all of $x_n$ and not just of $x_n(i)$ , as is commonly assumed, and ii.) the computations at different nodes in the above setup run synchronously on a common clock. + +Related Work: We now give a summary of relevant theoretical results from the DSA and MARL literature. For ease of discussion, we categorize them into i.) asymptotic and ii.) finite-time results. + +The asymptotic ones mainly concern almost sure (a.s.) convergence [42, 3, 26, 24, 15, 52, 50, 39, 18]. The first four papers here provide convergence guarantees for a broad family of nonlinear DSA algorithms. The other articles also do the same, but in context of specific MARL schemes such as distributed Q-learning, distributed actor-critic methods, distributed TD methods, and their off-policy variations. Two other kinds of asymptotic results also exist in the literature. The first is the CLT shown in [27] for the average of estimates obtained at different nodes in a generic DSA scheme. The other is the convergence in mean result obtained in [48] for a distributed policy gradient method. + +Finite-time literature, in contrast, majorly talks about expectation bounds. Assuming there exists a unique $x_{*}$ that solves $\sum_{i=1}^{m} h_{i}(x) = 0$ , these results describe the rate at which $\mathbb{E}\|x_{n}-x_{*}\|$ decays with $n$ . Notable contributions for DSA here are [49, 44]. Compared to ours, these look at a slightly different setup: the measurement noise at each node has a Markov component in place of a martingale difference term. In this new setup, [49] shows that, for any sufficiently small but constant stepsize $\epsilon$ , the expected error decreases linearly to a ball of radius $\mathcal{O}(\sqrt{\epsilon\ln(1/\epsilon)})$ . On the other hand, [44] deals with the case where $h$ is additionally non-convex and shows that $\mathbb{E}\|x_{n}-x_{*}\| = \mathcal{O}(n^{-1/4}\sqrt{\ln n})$ , which is comparable to the best known bound in the centralized setting. + +Expectation bounds in the MARL framework primarily concern policy evaluation methods [10, 11, 37, 5]. The first three papers here deal with the distributed TD(0) method. These show that a result similar to the one in [49] holds for this method under constant step sizes. In contrast, when $\alpha_{n}$ is of the $1 / n$ type, it is proven that $\mathbb{E}\| x_n - x_*\| = \mathcal{O}(1 / \sqrt{n})$ . Similar bounds have also been derived in [5] for two distributed variants of the TDC method. There are also some other works that derive finite-time bounds [45, 9, 46, 54, 13, 36, 33, 53], but we do not discuss them in this paper since the algorithms proposed there do not fit the update rule given in (2). + +The different finite-time results, as also the asymptotic CLT, do provide insights into the rate at which an iterative method converges. However, there are some significant issues with these studies. First, except [27], all others require the gossip matrix to be doubly stochastic, at least in the mean. While this assumption simplifies the analysis, it also severely restricts the communication protocol choices. In fact, as pointed out in [27], this condition even limits the use of a natural broadcast node, one that transmits its local estimate to all the neighbors without expecting all of them to respond. Second, these works only talk about convergence rates in the expected or the CLT sense. By their very nature, these results do not reveal much about the decay rates along different sample paths. Finally, all current results, including the ones on convergence, only apply to constant or square-summable step sizes. Nothing is known about the slowly-decaying non-square-summable + +ones, which are generally preferable since they give similar benefits as constant stepsizes and, often, also guarantee convergence. Note that such issues also plague much of the distributed stochastic optimization literature [47, 38, 20, 16, 32, 31]. + +Key Contributions: The highlights of this work are as follows. + +1. Law of Iterated Logarithm (LIL): We derive a novel law of iterated logarithm for the DSA scheme given in (2). That is, for a suitably defined $x_{*}$ , we show that $\lim \sup [\alpha_n\ln t_{n + 1}]^{-1 / 2}\| x_n - x_*\| \leq C$ a.s. on every sample path in the event + +$$ +\mathcal {E} \left(x _ {*}\right) := \left\{x _ {n} \rightarrow x _ {*} \right\}. \tag {3} +$$ + +Here, $C \geq 0$ is some constant $^2$ and $t_n = \sum_{k=0}^{n-1} \alpha_k$ . Also, the norm that we work is the operator norm. In particular, for any $x \in \mathbb{C}^{m \times d}$ , + +$$ +\| x \| := \sup _ {u \in \mathbb {C} ^ {m}, v \in \mathbb {C} ^ {d}} \left\{\left| u x v ^ {\prime} \right|: \| u \| = \| v \| = 1 \right\}. \tag {4} +$$ + +This result is the first of its kind in the distributed setup. Further, as discussed in Remark 2.3 later, it provides deeper insights about the asymptotic behavior of $(x_{n})_{n\geq 0}$ than other existing results, which only discuss convergence rates in the expected or the CLT sense. + +2. Analysis and Gossip Matrix: The above result is obtained via a new approach we develop here for analyzing DSA schemes. Let $\pi \in \mathbb{R}^m$ be such that $\pi W = \pi$ and let + +$$ +Q := \mathbb {I} - \mathbf {1} ^ {\prime} \pi , \tag {5} +$$ + +where $\mathbf{1} \in \mathbb{R}^m$ denotes the vector of all ones. Then an outline of our approach is that we express $x_{n} - x_{*}$ as a sum of $\mathbf{1}'\pi(x_{n} - x_{*})$ and $Qx_{n}$ and, thereafter, analyze each summand by treating its update rule as a separate SA scheme. This contrasts the usual approach (e.g., [27, 10, 11]) where the error is split into $(\mathbf{1}'\mathbf{1} / m)(x_{n} - x_{*})$ and $(\mathbb{I} - \mathbf{1}'\mathbf{1} / m)x_{n}$ . In fact, this is the main reason why, unlike other existing results, ours does not require that the gossip matrix be doubly stochastic. + +3. Concentration Inequality and Stepsizes: We also improve upon an existing concentration result ([12, Corollary 6.4.25]) for a sum of martingale differences; see Lemma 4.6. Specifically, by modifying the original proof from [12], we show that the result stated there actually holds under a broader set of conditions. The key benefit of this is that, unlike other related results, our LIL result does not require that the stepsize sequence be square-summable. +4. MARL Application: We use our theory to prove a law of iterated logarithm for the distributed TD(0) algorithm with linear function approximation. This is the first such result in MARL. + +Contents: The rest of the paper is structured as follows. In Section 2, we formally state our main result along with all the assumptions needed. We also pinpoint the new insights that our result provides. In Section 3, we give a demonstration of how our result can be applied in the MARL setup. In particular, there we talk about the distributed TD(0) algorithm with linear function approximation and prove that it indeed satisfies all the assumptions of our main result. Section 4 has two parts. In the first part, we state some key intermediate lemmas and then use the same to derive our main result. The latter part, in contrast, focuses on proofs of these intermediate results; note that we only sketch their proofs here and leave the details to the appendix. Finally, in Section 5, we conclude with a summary of our findings and discuss some interesting future directions. + +# 2 Assumptions and Main Result + +Throughout this work, we assume that the following four technical assumptions, i.e., $\mathcal{A}_1,\ldots ,\mathcal{A}_4$ hold for the DSA scheme in (2). + +$\mathcal{A}_1$ . Property of the Gossip Matrix: $W$ is an irreducible aperiodic row stochastic matrix. + +This condition implies there exists a unique vector $\pi \in \mathbb{R}^m$ such that + +$$ +\pi W = \pi . \tag {6} +$$ + +Accordingly, based on [24, Theorem 1], one would expect (2) to eventually converge to an invariant set of the $m$ -fold product of the $d$ -dimensional ODE + +$$ +\dot {y} (t) = \sum_ {i = 1} ^ {m} \pi_ {i} h _ {i} \left(\mathbf {1} ^ {\prime} y (t)\right) = \pi h \left(\mathbf {1} ^ {\prime} y (t)\right). \tag {7} +$$ + +By an $m$ -fold product, we refer to the dynamics in $\mathbb{R}^{m\times d}$ where each row individually satisfies (7). A natural invariant set of this dynamics is $\mathcal{S} \coloneqq \{\mathbf{1}'y : y \in \mathbb{R}^d\} \subset \mathbb{R}^{m\times d}$ . With this in mind, let + +$$ +x _ {*} = \mathbf {1} ^ {\prime} y _ {*} \in \mathcal {S}, \tag {8} +$$ + +where $y_{*} \in \mathbb{R}^{d}$ is an asymptotically stable equilibrium of (7). Notice that we don't assume $y_{*}$ to be the only attractor of this ODE. + +We remark that our main result concerns the behavior of the DSA scheme on the event $\mathcal{E}(x_{*})$ , where $x_{*}$ is as defined above and $\mathcal{E}(x_{*})$ is as defined in (3). + +$\mathcal{A}_2$ . Nature of $h$ near $x_*$ : There exists a neighbourhood $\mathcal{U}$ of $x_*$ such that, for $x \in \mathcal{U}$ , + +$$ +h (x) = - \mathbf {1} ^ {\prime} \pi \left(x - x _ {*}\right) A + \mathbf {1} ^ {\prime} \pi f _ {1} (x) + Q \left(B + f _ {2} (x)\right), \tag {9} +$$ + +where $A \in \mathbb{R}^{d \times d}$ is such that $yAy' > 0$ for all $y \neq 0$ , $B \in \mathbb{R}^{m \times d}$ is some constant matrix, $f_2: \mathcal{U} \to \mathbb{R}^{m \times d}$ is some arbitrary continuous function, while $f_1: \mathcal{U} \to \mathbb{R}^{m \times d}$ is another continuous function that additionally satisfies + +$$ +\left\| \boldsymbol {I} ^ {\prime} \pi f _ {1} (x) \right\| = \mathcal {O} \left(\left\| \boldsymbol {I} ^ {\prime} \pi \left(x - x _ {*}\right)\right\| ^ {a}\right), \quad a s x \rightarrow x _ {*}, \tag {10} +$$ + +for some $a > 1$ . + +Note that $\mathcal{A}_2$ is a generalization of Assumption (A1) in [30]. As in [30], this also is local in nature: it only prescribes a specific behavior for $h$ close to $x_*$ . Furthermore, this condition ensures that the driving function $\pi h(x)$ in (7) equals $-\pi (x - x_*)A + \pi f_1(x)$ ; the first term is the linear part while the second term represents the nonlinear portions. Separately, observe that $Qh(x) = Q(B + f_2(x))$ . This plays no role in (7); hence, conditions on $B$ and $f_2$ are minimal. We now construct a family of examples to show that $\mathcal{A}_2$ broadly holds. The simplest member in this family is $h(x) = B - xA$ , where $B$ and $A$ are as defined above3. Clearly, if $b(i)$ and $x(i)$ are the $i$ -th rows of $B$ and $x$ , respectively, then the $i$ -component function here is $h_i(x) = b(i) - x(i)A$ . The fact that the scaling matrix $A$ is the same for each $i$ is crucial for $\mathcal{A}_2$ to hold. Also, observe that this function does not depend on $\pi$ . The other members of the family are obtained by adding various $\pi$ -dependent nonlinear perturbations to this simple setup, i.e., by making different choices4 for $f_1$ and $f_2$ . + +$\mathcal{A}_3$ . Stepsize Behavior: There exists some decreasing positive function $\alpha$ defined on $[0, \infty)$ such that the stepsize $\alpha_n = \alpha(n)$ . Further, $\alpha$ is either of Type 1 or Type $\gamma$ . + +(a) Type 1: $\alpha (n) = \alpha_0 / n$ for some $\alpha_0 > 1 / (2\lambda_{\mathrm{min}})$ , where + +$$ +\lambda_ {\min } := \min \left\{\mathcal {R} (\lambda): \lambda \in \operatorname {s p e c t r u m} (A) \right\} \tag {11} +$$ + +with $\mathcal{R}(\lambda)$ denoting the real part of $\lambda$ ; + +(b) Type $\gamma$ : The function $\alpha$ is differentiable and its derivative varies regularly with exponent $-1 - \gamma$ , where $0 < \gamma < 1$ . + +The regularly varying condition above implies that $\left|\frac{\mathrm{d}\alpha(x)}{\mathrm{d}x}\right| = x^{-\gamma - 1}L(x)$ for some slowly varying function $L$ , e.g., $L(x) = C$ for some $C > 0$ , or $L(x) = (\ln x)^{\eta}$ for some $\eta \in \mathbb{R}$ . Thus, examples of $\alpha_{n}$ here include $C n^{-\gamma}$ and $n^{-\gamma}(\ln n)^{\eta}$ , which are non-square-summable for $\gamma \in (0, 1/2]$ . + +$\mathcal{A}_4$ . Noise Attributes: With $\mathcal{F}_n = \sigma (x_0,M_1,\ldots ,M_n)$ , and $\mathcal{E}(x_{*})$ , as in (3), the following hold. + +(a) $\mathbb{E}(M_{n + 1}|\mathcal{F}_n) = 0$ a.s. + +(b) There exists $C\geq 0$ such that $\| QM_{n + 1}\| \leq C\left(1 + \| Q(x_n - x_*)\|\right)$ a.s. on $\mathcal{E}(x_{*})$ +(c) There is a non-random symmetric positive semi-definite matrix $M\in \mathbb{R}^{d\times d}$ such that + +$$ +\lim _ {n \rightarrow \infty} \mathbb {E} \left(M _ {n + 1} ^ {\prime} \pi^ {\prime} \pi M _ {n + 1} \mid \mathcal {F} _ {n}\right) = M \quad a. s. o n \mathcal {E} \left(x _ {*}\right). \tag {12} +$$ + +(d) There exists $b > 2$ such that $\sup_{n\geq 0}\mathbb{E}(\| \pi M_{n + 1}\| ^b |\mathcal{F}_n) < \infty$ a.s. on $\mathcal{E}(x_{*})$ + +These noise conditions are extensions of the standard assumptions in the SA literature [30, 25, 4]. + +Our main result can now be stated as follows. This generalizes Theorem 1 from [30]. + +Theorem 2.1 (Main Result: Law of Iterated Logarithm). Suppose $\mathcal{A}_1, \ldots, \mathcal{A}_4$ hold and $\gamma > 2 / b$ if $\alpha$ is of Type $\gamma$ . Then, there exists some deterministic constant $C \geq 0$ such that + +$$ +\lim \sup [ \alpha_ {n} \ln t _ {n + 1} ] ^ {- 1 / 2} \| x _ {n} - x _ {*} \| \leq C \quad a. s. o n \mathcal {E} (x _ {*}). +$$ + +This result is called a law of iterated logarithm since its proof crucially relies on Lemma 4.6, which indeed is a law of iterated logarithm for a sum of scaled martingale differences. We end this section with some important comments about our main result. + +Remark 2.2. Our result shows that, a.s. on $\mathcal{E}(x_{*})$ , $\| x_{n} - x_{*}\|$ is $\mathcal{O}(\sqrt{n^{-1}\ln\ln n})$ in the Type 1 case, and $\mathcal{O}(\sqrt{n^{-\gamma}\ln n})$ in the Type $\gamma$ case. Note that, since we require $\gamma >2 / b$ , our result applies for smaller values of $\gamma$ , only if $\mathcal{A}_4$ . (d) holds for a sufficiently large $b$ . + +Remark 2.3. Our result provides deeper insights than the convergence rates that exist in the DSA/MARL literature. For this discussion, we suppose $\mathbb{P}\{\mathcal{E}(x_{*})\} = 1$ . As mentioned in Section 1, the existing results are of two kinds: finite-time expectation bounds and the CLT. Indeed a finite-time bound has several benefits and is not directly comparable to an asymptotic result. Nevertheless, an expectation bound only describes the average behavior, while ours characterizes the decay rate on almost every sample path. In fact, if we compare just the decay rate obtained in our result in the Type 1 case with that obtained in [10, 11], which show $\mathbb{E}\| x_n - x_*\| = \mathcal{O}(\sqrt{\ln n} /\sqrt{n})$ , then ours is tighter (it has $\ln \ln n$ in place of $\ln n$ ). Furthermore, while a CLT can at the best show that $\lim \sup \alpha_n^{-1 / 2}\| x_n - x_*\| = \infty$ a.s., our result is more precise in stating that the expression becomes bounded if it is divided by an additional $\sqrt{\ln t_{n + 1}}$ term. + +# 3 Application to Reinforcement Learning + +We apply our result here to a variant of the distributed TD(0) algorithm [10, 11] with linear function approximation. This method is useful for policy evaluation in MARL. The discussion here is divided into the following three parts: i.) setup, ii.) objective and algorithm, and iii.) analysis. + +Setup: We consider a distributed system of $m$ agents modeled by a Markov Decision Process. This can be characterized by the tuple $(\mathcal{S},\{\mathcal{U}_i\},\mathcal{P},\{\mathcal{R}_i\},\gamma ,\mathcal{G})$ . Here, $S = \{1,\dots ,L\}$ is the global state space, $\mathcal{U}_i$ and $\mathcal{R}_i$ are the set of actions and the reward function at agent $i$ , respectively, $\mathcal{P}$ describes the transition probabilities, $\gamma$ is the discount factor, and $\mathcal{G}\equiv (\mathcal{V},\mathcal{E})$ is a directed graph that represents the connectivity structure among the $m$ agents. + +Let $\mathcal{N}_i$ and $W$ be as in (1). We assume that this $W$ satisfies the conditions in $\mathcal{A}_1$ . Then, for this matrix, there is a unique vector $\pi \equiv (\pi_i)$ satisfying (6). + +Let $\mu_{i}$ be the stationary policy of agent $i$ and let $\mu \equiv (\mu_i)$ . Also, let $\mu (a|s) = \prod_{i}\mu_{i}(a_{i}|s)$ be the probability for choosing the joint action $a\equiv (a_i)\in \prod_i\mathcal{U}_i$ . This policy $\mu$ then induces a Markov chain on $\mathcal{S}$ , which we assume is aperiodic and irreducible. Therefore, it also has a unique stationary distribution and we denote the same by $\varphi \in \mathbb{R}^{L}$ . + +At each step, the above system evolves as follows. First, each agent $i$ sees the current state $s$ and applies an action $a_{i} \in \mathcal{U}_{i}$ sampled from $\mu_{i}(\cdot | s)$ . Based on the joint action $a$ , the system then moves to a new state $\tilde{s}$ . Equivalently, the joint action $a$ and the state $\tilde{s}$ can be seen as samples of $\mu (\cdot | s)$ and $\mathcal{P}(\cdot | s, a)$ , respectively. Finally, each agent $i$ receives an instantaneous reward $\mathcal{R}_i(s, a, \tilde{s})$ . + +Objective and Algorithm: The goal of the multi-agent system is to cooperatively estimate the value function $J^{\mu} \in \mathbb{R}^{L}$ corresponding to $\mu$ . This is defined as the solution to the Bellman equation + +$$ +J ^ {\mu} (s) = \mathbb {E} \bigg [ \sum_ {i} \pi_ {i} \mathcal {R} _ {i} (s, a, \tilde {s}) + \gamma J ^ {\mu} (\tilde {s}) \bigg ], \quad s \in \mathcal {S}, +$$ + +where the expectation is over $a \sim \mu(\cdot|s)$ and $\tilde{s} \sim \mathcal{P}(\cdot|s, a)$ . This expression differs from the ones in [10, 11], in that, the coefficients $\pi_i$ here is replaced by $1/m$ there. When $L$ is large, estimating $J^{\mu}$ directly is intractable. An alternative then is to make use of linear function approximation. That is, for some $d$ , choose a feature matrix $\Phi \in \mathbb{R}^{L \times d}$ with full column rank. And then, with $\phi(s)$ denoting the $s$ -th row of $\Phi$ , try and find a $\theta \in \mathbb{R}^d$ such that $J^{\mu}(s) \approx \phi(s)\theta'$ for all $s \in S$ . + +The distributed TD(0) algorithm is helpful in this latter context. Let $(s_n, a_n, \tilde{s}_n)$ , $n \geq 0$ , be IID5 samples of $(s, a, \tilde{s})$ , where $s \sim \varphi(\cdot)$ , $a \sim \mu(\cdot|s)$ , and $\tilde{s} \sim \mathcal{P}(\cdot|s, a)$ . Then, at agent $i$ , this distributed algorithm has the update rule: + +$$ +\theta_ {n + 1} (i) = \sum_ {j \in \mathcal {N} _ {i}} W _ {i j} \theta_ {n} (j) + \alpha_ {n} \left(b _ {n} (i) - \theta_ {n} (i) A _ {n}\right), \tag {13} +$$ + +where $b_{n}(i) = \mathcal{R}_{i}(s_{n},a_{n},\tilde{s}_{n})\phi (s_{n})\in \mathbb{R}^{d}$ and $A_{n} = \phi^{\prime}(s_{n})\phi (s_{n}) - \gamma \phi^{\prime}(\tilde{s}_{n})\phi (s_{n})\in \mathbb{R}^{d\times d}$ . + +Analysis: We first express the update rule given in (13) for different $i$ in the standard DSA form. Let $A = \mathbb{E}[A_n]$ and $B = \mathbb{E}[B_n]$ , where $B_n \in \mathbb{R}^{m \times d}$ is the matrix whose $i$ -th row is $b_n(i)$ . Both $A$ and $B$ do not depend on $n$ since $(s_n, a_n, \tilde{s}_n)$ , $n \geq 0$ , is IID. Next, for $n \geq 0$ , let $x_n \in \mathbb{R}^{m \times d}$ be the matrix whose $i$ -th row is $\theta_n(i)$ . Then, (13) for different $i$ can be jointly written as shown in (2) for + +$$ +h (x) = B - x A \quad \text {a n d} \quad M _ {n + 1} = \left(B _ {n} - B\right) - x _ {n} \left(A _ {n} - A\right). \tag {14} +$$ + +Next, we look at the limiting ODE given in (7). In our case, this has the form $\dot{y}(t) = \pi B - y(t)A$ . Now, $A$ is known to be positive definite [40], i.e., $\theta A\theta' > 0$ for all $\theta \neq 0$ . Hence, it is invertible and the real parts of all its eigenvalues are positive, i.e., $-A$ is Hurwitz stable. This then shows that $\theta_* = \pi BA^{-1}$ is the unique globally asymptotically stable equilibrium for the above ODE. + +We now verify the assumptions stated in Section 2. $\mathcal{A}_1$ trivially holds due to assumptions on $W$ . For $\mathcal{A}_2$ , let $f_1(x) = 0$ and $f_2(x) = -xA$ for $x \in \mathbb{R}^{m \times d}$ . Further, let $x_* = \mathbf{1}'\theta_*$ . Then, $h(x) = -\mathbf{1}\pi (x - x_*)A + (\mathbb{I} - \mathbf{1}\pi)(B + f_2(x))$ , as desired. In order to satisfy $\mathcal{A}_3$ , we simply choose a stepsize sequence that fulfills one of the criteria mentioned there. + +It now only remains to establish $\mathcal{A}_4$ . Let $\mathcal{F}_n$ be as defined there. Then, part (a) follows from the definitions of $A$ and $B$ and the fact that $(s_n, a_n, \tilde{s}_n)$ is independent of the past. On the other hand, part (b) can be shown by building upon the arguments used in the proof of [7, Lemma 5.1]. Next observe that, since $(s_n, a_n, \tilde{s}_n)$ is independent of the past, the only quantity that is random in $\mathbb{E}[M_{n+1}'\pi'\pi M_{n+1}|\mathcal{F}_n]$ is $x_n$ . Also, trivially, $\mathbb{E}[M_{n+1}'\pi'\pi M_{n+1}|\mathcal{F}_n]$ is a symmetric positive semi-definite matrix. Therefore, on the event $\mathcal{E}(x_*)$ , it is easy to see that part (c) holds as well. Finally, notice that $\| \pi M_{n+1}\| \leq C(1 + \| x_n - x_*\|)$ for some $C \geq 0$ ; this follows as in part (b) above. Hence, on $\mathcal{E}(x_*)$ , $\sup_{n \geq 0} \mathbb{E}[\| \pi M_{n+1}\|^b |\mathcal{F}_n] < \infty$ a.s. for any $b \geq 0$ . This verifies part (d). + +Thus, Theorem 2.1 holds for the distributed TD(0) algorithm with linear function approximation. + +# 4 Theoretical Analysis: Proof of the Main Result + +We now turn to the technical details of our analysis. With $Q$ as in (5) and $x_{*}$ as in (8), observe that $\mathbf{1}'\pi x_{*} = x_{*}$ and, hence, $x_{n} - x_{*} = \mathbf{1}'\pi (x_{n} - x_{*}) + Qx_{n}$ . We refer to the first term in this decomposition as the agreement component of the error and the second as the disagreement component. This decomposition differs from the standard approaches [10, 11, 27], wherein $x_{n} - x_{*}$ is split into $(\mathbf{1}'\mathbf{1} / m)(x_n - x_*)$ and $(\mathbb{I} - (\mathbf{1}'\mathbf{1} / m))x_n$ . In fact, the success of our approach strongly hinges on this novel error decomposition. + +The rest of the section is organized as follows. We first state our bounds for the two terms in our decomposition. Using these bounds, we then provide a formal proof for Theorem 2.1. Thereafter, we sketch the proofs of these intermediate bounds, leaving the details to the appendix. + +Lemma 4.1. (Agreement Error) Almost surely on $\mathcal{E}(x_{*})$ + +$$ +\lim _ {n \rightarrow \infty} \sup _ {\alpha_ {n} \ln t _ {n + 1}} \frac {\left\| I ^ {\prime} \pi \left(x _ {n} - x _ {*}\right)\right\|}{\sqrt {\alpha_ {n} \ln t _ {n + 1}}} \leq C, \tag {15} +$$ + +where $C\geq 0$ is some deterministic constant. + +Lemma 4.2. (Disagreement Error) Let $\delta >0$ . Then, + +$$ +\left\| Q x _ {n} \right\| = \mathcal {O} \left(\alpha_ {n} (\ln n) ^ {1 + \delta}\right) \quad \text {a . s . o n} \mathcal {E} \left(x _ {*}\right). \tag {16} +$$ + +Remark 4.3. Up to logarithmic factors, the rate at which the disagreement error decreases is the square of the rate at which the agreement error decreases. Thus, the overall convergence rate is essentially dictated by the agreement component of the error. + +With these two ingredients at hand, our main result is arrived at via the following short calculation. + +Proof of Theorem 2.1. Observe that + +$$ +\left\| x _ {n} - x _ {*} \right\| \leq \left\| \mathbf {1} ^ {\prime} \pi \left(x _ {n} - x _ {*}\right) \right\| + \left\| Q x _ {n} \right\|. +$$ + +Also, $\ln t_{n + 1}$ is $O(\ln n)$ and $O(\ln \ln n)$ in the Type $\gamma$ and Type 1 cases, respectively. The desired result is now easy to see from Lemmas 4.1 and 4.2. + +# 4.1 Bound on agreement error $\| \mathbf{1}'\pi (x_n - x_*)\|$ + +We first focus on the details of our analysis for the first ingredient, i.e., the agreement error. Let + +$$ +\psi_ {n + 1} := \sum_ {k = 0} ^ {n} \alpha_ {k} \mathbf {1} ^ {\prime} \pi M _ {k + 1} \mathrm {e} ^ {- \left(t _ {n + 1} - t _ {k + 1}\right) A}, \quad n \geq 0, \tag {17} +$$ + +and + +$$ +\Delta_ {n} := \mathbf {1} ^ {\prime} \pi \left(x _ {n} - x _ {*}\right) - \psi_ {n}, \quad n \geq 0. \tag {18} +$$ + +Clearly, to prove Lemma 4.1, it suffices to obtain bounds on the rate at which $\|\psi_n\|$ and $\|\Delta_n\|$ decay. These bounds are stated below. Note that these results are generalizations of Lemmas 1 and 3 from [30]. Specifically, the results there focused on one-timescale stochastic approximation, ours on the other hand handles the distributed case. Furthermore, the quantities of interest here, e.g., $\psi_n, \Delta_n$ , are matrix-valued, unlike the ones in [30] which were vector-valued. + +Lemma 4.4. Let $b$ be as in $\mathcal{A}_4$ . Suppose that either $\alpha$ is of Type 1 or that $\alpha$ is of Type $\gamma$ with $\gamma > 2 / b$ . Then, there exists some deterministic constant $C \geq 0$ such that + +$$ +\lim _ {n \rightarrow \infty} \sup _ {\alpha_ {n}} \left(\alpha_ {n} \ln t _ {n + 1}\right) ^ {- 1 / 2} \| \psi_ {n + 1} \| \leq C \quad a. s. o n \mathcal {E} (x _ {*}) \tag {19} +$$ + +Lemma 4.5. Suppose $\mathcal{A}_2, \mathcal{A}_3$ and $\mathcal{A}_4$ hold. Then, for any $\lambda \in (0, \lambda_{\min})$ , + +$$ +\left\| \Delta_ {n} \right\| = \mathcal {O} \left(\max \left\{e ^ {- \lambda \sum_ {k = 0} ^ {n} \alpha_ {k}}, \sum_ {j = 0} ^ {n} \alpha_ {j} e ^ {- \lambda \sum_ {k = j + 1} ^ {n} \alpha_ {k}} \left[ \alpha_ {j} \| \psi_ {j} \| + \| \psi_ {j} \| ^ {a} \right] \right\}\right) \tag {20} +$$ + +a.s. on $\mathcal{E}(x_{*})$ , where $a$ is as in (10). Furthermore, + +1. If $\alpha$ is of Type 1, then + +$$ +\left\| \Delta_ {n} \right\| = \mathcal {O} \left(\max \left\{n ^ {- \lambda \alpha_ {0}}; n ^ {- \frac {a}{2}}; n ^ {- 1. 5} \right\} (\ln n) ^ {\frac {a}{2} + 1}\right) \quad a. s. o n \mathcal {E} (x _ {*}). +$$ + +2. If $\alpha$ is of Type $\gamma$ with $2 / b < \gamma < 1$ , then + +$$ +\| \Delta_ {n} \| = \mathcal {O} \left(\alpha_ {n} \left(\alpha_ {n} \ln t _ {n + 1}\right) ^ {1 / 2} + \left(\alpha_ {n} \ln t _ {n + 1}\right) ^ {a / 2}\right) \quad a. s. o n \mathcal {E} (x _ {*}). +$$ + +We refer the reader to the Appendix for the proofs of Lemmas 4.4 and 4.5. However, there is one point which we would like to emphasize here. That is, $\psi_{n}$ is a sum of scaled (matrix-valued) martingale differences. And, to derive its decay rate, we use the following law of iterated logarithm. + +Let $\mathrm{LL}(x) = \ln \ln (x)$ + +Lemma 4.6. For $n \geq 0$ , let $U_{n+1} = \sum_{k=0}^{n} \phi_k \epsilon_{k+1}$ , where $\{\epsilon_n\}$ is a real-valued martingale difference sequence adapted to a filtration $\{\mathcal{F}_n\}$ , and $\{\phi_n\}$ is a sequence of real-valued scalars, again adapted to $\{\mathcal{F}_n\}$ . + +Let $\{T_n\}$ , also adapted to $\{\mathcal{F}_n\}$ , be such that, for $n \geq 0$ , $|\phi_n| \leq T_n$ a.s. and $\tau_n \coloneqq \sum_{k=0}^{n} T_k^2$ satisfies $\lim_{n \to \infty} \tau_n = \infty$ a.s. Further, assume $\sup_{n \geq 0} \mathbb{E}[\epsilon_{n+1}^2 | \mathcal{F}_n] \leq \sigma^2$ a.s. for some constant $\sigma^2$ . Also, let $\beta > 0$ be such that $\sum_{n} T_n^{2+2\beta} \tau_n^{-1-\beta} [\mathrm{LL}(\tau_n)]^\beta < \infty$ and $\sup_{n \geq 0} \mathbb{E}[|\epsilon_{n+1}|^{2+2\beta} | \mathcal{F}_n] < \infty$ a.s. Then, + +$$ +\lim \sup [ 2 \tau_ {n} \mathrm {L L} \tau_ {n} ] ^ {- 1 / 2} | U _ {n + 1} | \leq \sigma \quad a. s. \tag {21} +$$ + +Remark 4.7. The condition $\sum_{n}T_{n}^{2 + 2\beta}\tau_{n}^{-1 - \beta}[\mathrm{LL}(\tau_{n})]^{\beta} < \infty$ differs from the one in [12, Corollary 6.4.25]; in that, it includes the additional term $[\mathrm{LL}(\tau_n)]^\beta$ . The impact of this is that we no longer require $\beta$ to be in $(0,1)$ as was the case in [12, Corollary 6.4.25]. Instead, $\beta$ can now take any positive value. This is precisely what allows Theorem 2.1 to be applicable even when the stepsizes are non-square summable. + +Remark 4.8. The above result goes through even if we have $\lim \sup_{n\to \infty}\mathbb{E}[\epsilon_{n + 1}^2 |\mathcal{F}_n]\leq \sigma^2$ instead of $\sup_{n\geq 0}\mathbb{E}[\epsilon_{n + 1}^2 |\mathcal{F}_n]\leq \sigma^2$ cf. [30, Result 1]. + +We now present the proof of 4.1 which is a direct consequence of Lemmas 4.4 and 4.5. + +Proof of Lemma 4.1. From (18), observe that + +$$ +\left\| \mathbf {1} ^ {\prime} \pi \left(x _ {n} - x _ {*}\right) \right\| \leq \left\| \psi_ {n} \right\| + \left\| \Delta_ {n} \right\|. +$$ + +First consider the case where $\alpha$ is of Type $\gamma$ . From Lemmas 4.4 and 4.5, we have + +$$ +\limsup_{n\to \infty}\frac{\| \mathbf{1}^{\prime}\pi(x_{n} - x_{*})\|}{(\alpha_{n}\ln t_{n + 1})^{1 / 2}}\leq C + \limsup_{n\to \infty}\mathcal{O}\left(\alpha_{n} + (\alpha_{n}\ln t_{n + 1})^{(a - 1) / 2}\right) = C, +$$ + +where the last display holds because $\lim_{n\to \infty}\alpha_n = 0$ , $\lim_{n\to \infty}\alpha_n\ln t_{n + 1} = 0$ , and $a > 1$ . + +Next consider the case where $\alpha$ is of Type 1. Again, from Lemmas 4.4 and 4.5, we get + +$$ +\operatorname * {l i m s u p} _ {n \to \infty} \frac {\| \mathbf {1} ^ {\prime} \pi (x _ {n} - x _ {*}) \|}{(\alpha_ {n} \ln t _ {n + 1}) ^ {1 / 2}} \leq C + \operatorname * {l i m s u p} _ {n \to \infty} \mathcal {O} \left(\frac {\max (n ^ {- \lambda \alpha_ {0}} ; n ^ {- \frac {a}{2}} ; n ^ {- 1 . 5}) (\ln n) ^ {1 + a / 2}}{(n ^ {- 1} \ln n) ^ {1 / 2}}\right) = C, +$$ + +where the last display holds because $\lambda \alpha_0 > \frac{1}{2}$ and $a > 1$ . + +The desired result now follows. + +# 4.2 Bound on disagreement error $\| Qx_{n}\|$ + +We now turn to the detailed analysis of the disagreement component of the error. Let + +$$ +\chi_ {n + 1} := \sum_ {j = 0} ^ {n} \alpha_ {j} W ^ {n - j} Q M _ {j + 1} e ^ {- \left(t _ {n + 1} - t _ {j + 1}\right) A}, \quad n \geq - 1, \tag {22} +$$ + +and + +$$ +\Gamma_ {n} := Q x _ {n} - \chi_ {n}, \quad n \geq 0. \tag {23} +$$ + +Note that $\chi_{n}$ represents the cumulative noise in $Qx_{n}$ . It is also easy to see that + +$$ +\chi_ {n + 1} = W \chi_ {n} e ^ {- \alpha_ {n} A} + \alpha_ {n} Q M _ {n + 1}, \quad n \geq 0. \tag {24} +$$ + +We now state our bounds for $\| \chi_n\|$ and $\| \Gamma_{n}\|$ . Note that $\chi_{n}$ and $\Gamma_{n}$ are peculiar to the DSA setup and do not have analogues in the one-timescale analysis. + +Lemma 4.9. Let $\delta >0$ . Then, + +$$ +\left\| \chi_ {n + 1} \right\| = \mathcal {O} \left(\alpha_ {n} (\ln n) ^ {1 + \delta}\right) \quad a. s. o n \mathcal {E} \left(x _ {*}\right) \tag {25} +$$ + +Lemma 4.10. Almost surely on $\mathcal{E}(x_{*})$ + +$$ +\left\| \Gamma_ {n + 1} \right\| = \mathcal {O} (\alpha_ {n}). \tag {26} +$$ + +We refer readers to the Appendix for proofs of Lemma 4.9 and 4.10. The overall disagreement error can now be bounded as shown below. + +Proof of Lemma 4.2. Observe that + +$$ +\| Q x _ {n} \| \leq \| \Gamma_ {n} \| + \| \chi_ {n} \|. +$$ + +Using lemmas 4.9 and 4.10, we then have + +$$ +\left\| Q x _ {n} \right\| = \mathcal {O} \left(\alpha_ {n}\right) + \mathcal {O} \left(\alpha_ {n} (\ln n) ^ {1 + \delta}\right) = \mathcal {O} \left(\alpha_ {n} (\ln n) ^ {1 + \delta}\right), +$$ + +as desired. + +![](images/9d33820260c397c56d6e1dbfce62e5829f4a76c7264e1ecc3d00a98a403099d6.jpg) + +# 5 Discussion + +We derive a novel law of iterated logarithm for a family of nonlinear DSA algorithms that is useful in MARL. This law can also be seen as an asymptotic a.s. convergence rate result. It is the first of its kind in the distributed setup and holds under significantly weaker assumptions. Our proof uses a novel error decomposition and a novel law of iterated logarithm for a sum of martingale differences. + +While our DSA framework is fairly general, a key limitation is that the scaling matrix (i.e., $A$ ) in each component function $h_i$ needs to be the same. It would be interesting to see if our approach can be extended to cover the general case [48] where the scaling matrices also depend on $i$ . Another intriguing future direction is the setting with dynamic communication protocols, wherein the gossip matrix also evolves with time [10, 11]. A third direction is that of two-timescale DSA schemes [8, 6]. On the MARL side, important algorithms like distributed Q-learning [17] and its variants need more careful analysis and we believe our techniques would be instrumental for this as well. Finally, we would like to study the effect of momentum in MARL algorithms [1]. + +# Acknowledgments and Disclosure of Funding + +We would like to thank Prof. Vivek Borkar for suggesting this exciting problem. We would also like to thank the anonymous reviewers for providing helpful and constructive feedback on the paper. Research of Gugan Thoppe is supported by IISc's start up grants SG/MHRD-19-0054 and SR/MHRD-19-0040. + +# References + +[1] Konstantin Avrachenkov, Kishor Patil, and Gugan Thoppe. Online algorithms for estimating change rates of web pages. arXiv preprint arXiv:2009.08142, 2020. +[2] Michel Benaim. Dynamics of stochastic approximation algorithms. In *Seminaire de probabilités XXXIII*, pages 1-68. Springer, 1999. +[3] Pascal Bianchi, Gersende Fort, and Walid Hachem. Performance of a distributed stochastic approximation algorithm. IEEE Transactions on Information Theory, 59(11):7405-7418, 2013. +[4] Vivek S Borkar. Stochastic approximation: a dynamical systems viewpoint, volume 48. Springer, 2009. +[5] Ziyi Chen, Yi Zhou, and Rongrong Chen. Multi-agent off-policy td learning: Finite-time analysis with near-optimal sample complexity and communication complexity. arXiv preprint arXiv:2103.13147, 2021. +[6] Gal Dalal, Balazs Szorenyi, and Gugan Thoppe. A tale of two-timescale reinforcement learning with the tightest finite-time bound. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 34(04), pages 3701-3708, 2020. + +[7] Gal Dalal, Balázs Szörenyi, Gugan Thoppe, and Shie Mannor. Finite sample analyses for td (0) with function approximation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018. +[8] Gal Dalal, Gugan Thoppe, Balázs Szörenyi, and Shie Mannor. Finite sample analysis of two-timescale stochastic approximation with applications to reinforcement learning. In Conference On Learning Theory, pages 1199-1233. PMLR, 2018. +[9] Dongsheng Ding, Xiaohan Wei, Zhuoran Yang, Zhaoran Wang, and Mihailo R Jovanovic. Fast multi-agent temporal-difference learning via homotopy stochastic primal-dual method. In Optimization Foundations for Reinforcement Learning Workshop, 33rd Conference on Neural Information Processing Systems, 2019. +[10] Thinh Doan, Siva Maguluri, and Justin Romberg. Finite-time analysis of distributed td (0) with linear function approximation on multi-agent reinforcement learning. In International Conference on Machine Learning, pages 1626-1635, 2019. +[11] Thinh T Doan, Siva Theja Maguluri, and Justin Romberg. Finite-time performance of distributed temporal-difference learning with linear function approximation. SIAM Journal on Mathematics of Data Science, 3(1):298-320, 2021. +[12] Marie Duflo. *Random iterative models*, volume 34. Springer Science & Business Media, 2013. +[13] Paulo Heredia and Shaoshuai Mou. Finite-sample analysis of multi-agent policy evaluation with kernelized gradient temporal difference. In 2020 59th IEEE Conference on Decision and Control (CDC), pages 5647-5652. IEEE, 2020. +[14] Maxim Kaledin, Eric Moulines, Alexey Naumov, Vladislav Tadic, and Hoi-To Wai. Finite time analysis of linear two-timescale stochastic approximation with markovian noise. In Conference on Learning Theory, pages 2144–2203. PMLR, 2020. +[15] Soummya Kar, José MF Moura, and H Vincent Poor. QD-learning: A collaborative distributed strategy for multi-agent reinforcement learning through consensus + innovations. IEEE Transactions on Signal Processing, 61(7):1848-1862, 2013. +[16] Anastasia Koloskova, Nicolas Loizou, Sadra Boreiri, Martin Jaggi, and Sebastian Stich. A unified theory of decentralized sgd with changing topology and local updates. In International Conference on Machine Learning, pages 5381-5393. PMLR, 2020. +[17] Martin Lauer and Martin Riedmiller. An algorithm for distributed reinforcement learning in cooperative multi-agent systems. In In Proceedings of the Seventeenth International Conference on Machine Learning. CiteSeer, 2000. +[18] Donghwan Lee, Hyungjin Yoon, and Naira Hovakimyan. Primal-dual algorithm for distributed reinforcement learning: distributed gtd. In 2018 IEEE Conference on Decision and Control (CDC), pages 1967-1972. IEEE, 2018. +[19] Jae Won Lee and Byoung-Tak Zhang. Stock trading system using reinforcement learning with cooperative agents. In Proceedings of the Nineteenth International Conference on Machine Learning, pages 451-458, 2002. +[20] 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. arXiv preprint arXiv:1705.09056, 2017. +[21] Michael Littman and Justin Boyan. A distributed reinforcement learning scheme for network routing. In Proceedings of the international workshop on applications of neural networks to telecommunications, pages 55-61. Psychology Press, 2013. +[22] Michael L Littman. Markov games as a framework for multi-agent reinforcement learning. In Machine learning proceedings 1994, pages 157-163. Elsevier, 1994. +[23] Bo Liu, Ji Liu, Mohammad Ghavamzadeh, Sridhar Mahadevan, and Marek Petrik. Finite-sample analysis of proximal gradient td algorithms. In UAI, pages 504-513. CiteSeer, 2015. + +[24] Adwaitvedant S Mathkar and Vivek S Borkar. Nonlinear gossip. SIAM Journal on Control and Optimization, 54(3):1535-1557, 2016. +[25] Abdelkader Mokkadem and Mariane Pelletier. Convergence rate and averaging of nonlinear two-time-scale stochastic approximation algorithms. The Annals of Applied Probability, 16(3):1671-1702, 2006. +[26] Gemma Morral, Pascal Bianchi, and Gersende Fort. Success and failure of adaptation-diffusion algorithms for consensus in multi-agent networks. In 53rd IEEE Conference on Decision and Control, pages 1476-1481. IEEE, 2014. +[27] Gemma Morral, Pascal Bianchi, and Gersende Fort. Success and failure of adaptation-diffusion algorithms with decaying step size in multiagent networks. IEEE Transactions on Signal Processing, 65(11):2798-2813, 2017. +[28] Openai: Openai five. https://openai.com/blog/openai-five/, 2021. Accessed: 2021-05-24. +[29] Jun Ota. Multi-agent robot systems as distributed autonomous systems. Advanced engineering informatics, 20(1):59-70, 2006. +[30] Mariane Pelletier. On the almost sure asymptotic behaviour of stochastic algorithms. Stochastic processes and their applications, 78(2):217-244, 1998. +[31] Shi Pu and Angela Nedic. Distributed stochastic gradient tracking methods. Mathematical Programming, pages 1-49, 2020. +[32] Shi Pu, Alex Olshevsky, and Ioannis Ch Paschalidis. Asymptotic network independence in distributed stochastic optimization for machine learning: Examining distributed and centralized stochastic gradient descent. IEEE Signal Processing Magazine, 37(3):114-122, 2020. +[33] Jineng Ren, Jarvis Haupt, and Zehua Guo. Communication-efficient hierarchical distributed optimization for multi-agent policy evaluation. Journal of Computational Science, 49:101280, 2021. +[34] Martin Riedmiller, Andrew Moore, and Jeff Schneider. Reinforcement learning for cooperating and communicating reactive agents in electrical power grids. In Workshop on Balancing Reactivity and Social Deliberation in Multi-Agent Systems, pages 137-149. Springer, 2000. +[35] Shai Shalev-Shwartz, Shaked Shammah, and Amnon Shashua. Safe, multi-agent, reinforcement learning for autonomous driving. arXiv preprint arXiv:1610.03295, 2016. +[36] Miloš S Stanković, Marko Beko, and Srdjan S Stanković. Distributed gradient temporal difference off-policy learning with eligibility traces: Weak convergence. IFAC-PapersOnLine, 53(2):1563-1568, 2020. +[37] Jun Sun, Gang Wang, Georgios B Giannakis, Qinmin Yang, and Zaiyue Yang. Finite-time analysis of decentralized temporal-difference learning with linear function approximation. In International Conference on Artificial Intelligence and Statistics, pages 4485-4495. PMLR, 2020. +[38] Tao Sun, Tianyi Chen, Yuejiao Sun, Qing Liao, and Dongsheng Li. Decentralized markov chain gradient descent. arXiv preprint arXiv:1909.10238, 2019. +[39] Wesley Suttle, Zhuoran Yang, Kaiqing Zhang, Zhaoran Wang, Tamer Basar, and Ji Liu. A multi-agent off-policy actor-critic algorithm for distributed reinforcement learning. IFAC-PapersOnLine, 53(2):1549-1554, 2020. +[40] Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction. MIT press, 2018. +[41] Richard S Sutton, Csaba Szepesvári, and Hamid Reza Maei. A convergent o (n) temporal-difference algorithm for off-policy learning with linear function approximation. In NIPS, 2008. + +[42] John Tsitsiklis, Dimitri Bertsekas, and Michael Athans. Distributed asynchronous deterministic and stochastic gradient optimization algorithms. IEEE transactions on automatic control, 31(9):803-812, 1986. +[43] John N Tsitsiklis and Benjamin Van Roy. An analysis of temporal-difference learning with function approximation. IEEE transactions on automatic control, 42(5):674-690, 1997. +[44] Hoi-To Wai. On the convergence of consensus algorithms with markovian noise and gradient bias. In 2020 59th IEEE Conference on Decision and Control (CDC), pages 4897-4902. IEEE, 2020. +[45] Hoi To Wai, Zhuoran Yang, Mingyi Hong, and Zhaoran Wang. Multi-agent reinforcement learning via double averaging primal-dual optimization. Advances in Neural Information Processing Systems, 2018:9649-9660, 2018. +[46] Yue Xu, Zengde Deng, Mengdi Wang, Wenjun Xu, Anthony Man-Cho So, and Shuguang Cui. Voting-based multi-agent reinforcement learning for intelligent IoT. IEEE Internet of Things Journal, 2020. +[47] Kun Yuan, Qing Ling, and Wotao Yin. On the convergence of decentralized gradient descent. SIAM Journal on Optimization, 26(3):1835-1854, 2016. +[48] Sihan Zeng, Aqeel Anwar, Thinh Doan, Justin Romberg, and Arijit Raychowdhury. A decentralized policy gradient approach to multi-task reinforcement learning. arXiv preprint arXiv:2006.04338, 2020. +[49] Sihan Zeng, Thinh T Doan, and Justin Romberg. Finite-time analysis of decentralized stochastic approximation with applications in multi-agent and multi-task learning. arXiv preprint arXiv:2010.15088, 2020. +[50] Kaiqing Zhang, Zhuoran Yang, and Tamer Basar. Networked multi-agent reinforcement learning in continuous spaces. In 2018 IEEE Conference on Decision and Control (CDC), pages 2771-2776. IEEE, 2018. +[51] Kaiqing Zhang, Zhuoran Yang, and Tamer Başar. Multi-agent reinforcement learning: A selective overview of theories and algorithms. Handbook of Reinforcement Learning and Control, pages 321-384, 2021. +[52] Kaiqing Zhang, Zhuoran Yang, Han Liu, Tong Zhang, and Tamer Basar. Fully decentralized multi-agent reinforcement learning with networked agents. In International Conference on Machine Learning, pages 5872-5881. PMLR, 2018. +[53] Kaiqing Zhang, Zhuoran Yang, Han Liu, Tong Zhang, and Tamer Basar. Finite-sample analysis for decentralized batch multi-agent reinforcement learning with networked agents. IEEE Transactions on Automatic Control, 2021. +[54] Xiaoxiao Zhao, Peng Yi, and Li Li. Distributed policy evaluation via inexact admm in multi-agent reinforcement learning. Control Theory and Technology, 18(4):362-378, 2020. \ No newline at end of file diff --git a/alawofiteratedlogarithmformultiagentreinforcementlearning/images.zip b/alawofiteratedlogarithmformultiagentreinforcementlearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..439f61258b561ad366b61c4ac9c70b95349577ca --- /dev/null +++ b/alawofiteratedlogarithmformultiagentreinforcementlearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e8fb7667cce7b99959f066b3d5cda8212048c61b5c040fde7370955c37f9989 +size 212334 diff --git a/alawofiteratedlogarithmformultiagentreinforcementlearning/layout.json b/alawofiteratedlogarithmformultiagentreinforcementlearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ff6d9bf5f32118ca017c094d597bb7a8b3150964 --- /dev/null +++ b/alawofiteratedlogarithmformultiagentreinforcementlearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e719a6313f5696e2811d2e9150e59b0cdb1730d6108993bec8eda60ed493924a +size 665457 diff --git a/alittlerobustnessgoesalongwayleveragingrobustfeaturesfortargetedtransferattacks/b2af5495-3560-4764-998c-ba9feb742f6a_content_list.json b/alittlerobustnessgoesalongwayleveragingrobustfeaturesfortargetedtransferattacks/b2af5495-3560-4764-998c-ba9feb742f6a_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..aed25e831b2022bf2dc22e385d133a206d4a51ec --- /dev/null +++ b/alittlerobustnessgoesalongwayleveragingrobustfeaturesfortargetedtransferattacks/b2af5495-3560-4764-998c-ba9feb742f6a_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:047def08782e9e7493d027db2d3cb32f1ef23ceaf7048164212633de15eb66af +size 80086 diff --git a/alittlerobustnessgoesalongwayleveragingrobustfeaturesfortargetedtransferattacks/b2af5495-3560-4764-998c-ba9feb742f6a_model.json b/alittlerobustnessgoesalongwayleveragingrobustfeaturesfortargetedtransferattacks/b2af5495-3560-4764-998c-ba9feb742f6a_model.json new file mode 100644 index 0000000000000000000000000000000000000000..7a23f08439be9e05727e94d600192be746436f89 --- /dev/null +++ b/alittlerobustnessgoesalongwayleveragingrobustfeaturesfortargetedtransferattacks/b2af5495-3560-4764-998c-ba9feb742f6a_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:260db104d0e7cc6780435840adf1270b9c338faf6f0e772fa621ebb969b248a3 +size 106822 diff --git a/alittlerobustnessgoesalongwayleveragingrobustfeaturesfortargetedtransferattacks/b2af5495-3560-4764-998c-ba9feb742f6a_origin.pdf b/alittlerobustnessgoesalongwayleveragingrobustfeaturesfortargetedtransferattacks/b2af5495-3560-4764-998c-ba9feb742f6a_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f2cb842101e79964636e7bab95a4b9b4c1b3d592 --- /dev/null +++ b/alittlerobustnessgoesalongwayleveragingrobustfeaturesfortargetedtransferattacks/b2af5495-3560-4764-998c-ba9feb742f6a_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d9c11859bfd28b14cffbb8b4bef17b6a444d100292d7a0ee76f17a0a6b6c06f6 +size 3635320 diff --git a/alittlerobustnessgoesalongwayleveragingrobustfeaturesfortargetedtransferattacks/full.md b/alittlerobustnessgoesalongwayleveragingrobustfeaturesfortargetedtransferattacks/full.md new file mode 100644 index 0000000000000000000000000000000000000000..b9f249f9740cbeaae21971665a1bda76e2c7b450 --- /dev/null +++ b/alittlerobustnessgoesalongwayleveragingrobustfeaturesfortargetedtransferattacks/full.md @@ -0,0 +1,276 @@ +# A Little Robustness Goes a Long Way: Leveraging Robust Features for Targeted Transfer Attacks + +Jacob M. Springer + +Los Alamos National Laboratory + +Los Alamos, NM, 87545 + +jacmspringer@gmail.com + +Melanie Mitchell + +Santa Fe Institute + +Santa Fe, NM, 87501 + +mm@santafe.edu + +Garrett T. Kenyon + +Los Alamos National Laboratory + +Los Alamos, NM, 87545 + +gkenyon@lanl.gov + +# Abstract + +Adversarial examples for neural network image classifiers are known to be transferable: examples optimized to be misclassified by a source classifier are often misclassified as well by classifiers with different architectures. However, targeted adversarial examples—optimized to be classified as a chosen target class—tend to be less transferable between architectures. While prior research on constructing transferable targeted attacks has focused on improving the optimization procedure, in this work we examine the role of the source classifier. Here, we show that training the source classifier to be "slightly robust"—that is, robust to small-magnitude adversarial examples—substantially improves the transferability of class-targeted and representation-targeted adversarial attacks, even between architectures as different as convolutional neural networks and transformers. The results we present provide insight into the nature of adversarial examples as well as the mechanisms underlying so-called "robust" classifiers. + +# 1 Introduction + +Neural-network image classifiers are well-known to be susceptible to adversarial examples—images that are perturbed in a way that is largely imperceptable to humans but that cause the neural network to make misclassifications. Much research has gone into methods for constructing adversarial examples in order to understand the nature of neural-network vulnerabilities and to develop methods to make neural-network classifiers more robust to attacks [7, 11, 21, 45, 50, 55, 73]. + +Untargeted adversarial examples are designed to elicit an unspecified incorrect class, while targeted adversarial examples are designed to elicit a specific (incorrect) target class. A given adversarial perturbation is designed via optimization with respect to a given trained network; here we call this the source network. While untargeted adversarial examples are often transferable—examples designed to attack a source network also successfully attack other trained networks with different parameters and architectures [21, 73]—targeted adversarial examples tend to be less transferable [44]. + +Prior research on constructing transferable adversarial examples for image classifiers has focused primarily on improving optimization methods for generating successful image perturbations. In this paper, we take a different tack—focusing on the source neural network used in constructing adversarial examples. Specifically, we find that "slightly-robust" convolutional neural networks (CNNs)—ones that have been trained to be robust to small adversarial perturbations—can be leveraged to substantially improve the transferability of targeted adversarial examples to different architectures. Surprisingly, we show that targeted adversarial examples constructed with respect to a slightly robust CNN transfer successfully not only to different CNN architectures but also to transformer architectures such as ViT [16], LeViT [22], CCT [24], and even CLIP [57], which is trained on different objective than the source CNN. Such transfers are all "black box" attacks—while generating an adversarial example + +requires knowledge of the source network's architecture, no such knowledge is required for the black-box architectures that can also be attacked by the same example. + +The vulnerability of networks to both targeted and untargeted attacks has huge significance for security purposes, and thus understanding how to construct highly effective attacks can help motivate defenses. However, we believe that targeted attacks are especially important for understanding neural-network classifiers, as they provide a tool to compare the features of two models. When a targeted attack transfers from one network to another, it suggests that the two networks rely on similar information for classification, and that they use the information in the same way. In our work, we show that each individual slightly-robust neural network transfers features effectively to all tested non-robust networks, suggesting the surprising result that slightly-robust networks rely on features that overlap with every non-robust network, even though it is not the case that any particular non-robust network has features that substantially overlap with all other non-robust networks. + +In addition, we leverage the techniques of adversarial transferability to examine which features are learned by neural networks. In accordance with prior work [71], we find that, on the spectrum from non-robust (standard) to highly robust classifiers, those that are only slightly robust exhibit the most transferable representation-targeted adversarial examples, suggesting that the features of slightly-robust networks overlap substantially with every tested desination network. This can explain why slightly robust networks give rise to more transferable adversarial attacks and have better weight initializations for downstream transfer-learning tasks [43, 62, 76, 80]. + +The main contributions of this paper are the following: + +1. We demonstrate that adversarial examples generated with respect to slightly robust CNNs are more transferable than those generated with respect to standard (non-robust) networks. This transferability extends not only to other CNNs, but also to transformer architectures. +2. We find that, as the robustness of the source network increases, there is also a substantial increase in transferability of targeted adversarial examples to adversarily-defended networks. +3. We examine the role of the adversarial loss function in generating transferable adversarial examples. +4. We show, surprisingly, that non-robust neural networks do not exhibit substantial feature (representation) transferability, while slightly-robust neural networks do. This helps explain why slightly-robust neural networks enable superior transferability of targeted adversarial examples. + +# 2 Background + +Adversarial Examples. In this paper we are primarily concerned with properties of source networks that facilitate transferability of adversarial examples. Let $F: \mathcal{X} \to \mathcal{Y}$ denote a "white-box" network (i.e., one whose architecture and weights are known to the adversary) and let $G: \mathcal{X} \to \mathcal{Y}$ denote a "black-box" network (weights and architecture are unknown to the adversary). Let $(x, y) \in \mathcal{X} \times \mathcal{Y}$ be an (unperturbed) input-label pair, where $\mathcal{X}$ is the input-space and $\mathcal{Y}$ is the label-space. Given a maximum perturbation size $\varepsilon$ , we construct an adversarial example $x + \delta$ where $\| \delta \|_{\infty} \leq \varepsilon$ , such that $F(x + \delta) \neq y$ for the untargeted case, and $F(x + \delta) = t$ for some target class $t \in \mathcal{Y}$ for the targeted case. We then say that $x + \delta$ is transferable to black-box network $G$ if $G(x + \delta) \neq y$ for the untargeted case and $G(x + \delta) = t$ for the targeted case. + +Optimizers. Prior research has identified a number of methods for optimizing adversarial examples given a white-box classifier $F$ , many of which are based on the Iterative Fast Gradient Sign Method (I-FGSM) [21, 40], in which a perturbation $\delta_{i}$ is iteratively updated to maximize the loss of the network while obeying an $\ell_{\infty}$ norm constraint. + +We adopt the state-of-the-art method recently proposed by [91], which combines three variants of I-FGSM and optimizes over many steps: + +1. Diverse Input Iterative Fast Gradient Sign Method (DI²-FGSM), which applies a random affine transformation to the input at each step prior to computing the gradient [87], +2. Translation-Invariant Iterative Fast Gradient Sign Method (TI-FGSM), which convolves the gradient with a Gaussian filter [14], +3. Momentum Iterative Fast Gradient Sign Method (MI-FGSM), in which a momentum term is added to the gradient [13]. + +We follow the convention of Zhao et al. [91] and call the combination of these processes TMDI-FGSM. We describe the method in detail in the appendix. + +For targeted adversarial examples, the loss function $L$ should be maximized when the target label is predicted with high confidence. For untargeted adversarial examples, this occurs when the predicted label differs from the true label, and when the true label is given a low confidence. A number of adversarial loss functions have been proposed, including standard cross-entropy loss [73], CW loss [7], and feature-disruption loss [34]. We use the highly-effective logit loss, proposed by [91], which is maximized for targeted examples when the logit score for a target class (i.e., the value of the output neuron associated with the target class prior to the softmax operation) is maximized. Similarly, the untargeted version aims to minimize the logit score associated with the true class. + +Constructing Robust Source Networks. We construct robust source networks by performing adversarial training with projected gradient descent [21, 45]. Each source network is trained to be robust to adversarial examples with $\ell_2$ norm less than a specified $\varepsilon$ parameter, which we call the robustness parameter. For this paper, we rely on pre-trained robust ImageNet models [62], which have been released under the MIT License. These source networks, along with many of our experiments, are implemented in PyTorch [56]. + +Features. In this paper, we will refer to neural network features [32, 71, 78]. A feature $f: \mathcal{X} \to \mathbb{R}$ maps input to a real number to describe how "strongly" the feature appears in the image. Every neuron in a neural network computes a feature. However, we are primarily concerned with the representation-layer features, i.e., the features computed by the neurons in the penultimate layer [32]. When we are referring to the features of a specific neural network, we are referring to the features described by the neurons in the representation layer. When we say that the features of two different neural networks overlap, we mean that the patterns of the input that affect the features of one neural network also affect the features of the other neural network. When features are easily manipulated by small perturbations to the input, they are said to be non-robust; likewise when they are not easily manipulated in this way, they are said to be robust [32]. Robust networks, i.e., networks that are less vulnerable to adversarial perturbations, should rely primarily on robust features, though non-robust networks can rely on a mixture of non-robust and robust features [32, 71]. + +# 3 Transferability of Adversarial Examples + +In this section, we describe the methodology and results of our experiments on the transferability of adversarial examples as a function of the robustness of the source network. We evaluate the targeted and untargeted effectiveness of each constructed adversarial example on a collection of convolutional classifiers, Xception [9], VGG [68], ResNet [25, 26], Inception [74], MobileNet [29], DenseNet [30], NASNetLarge [93], and EfficientNet [75], as well as transformer-based classifiers, ViT [16], LeViT [22], CCT [24], and CLIP [57]. Here we use the term destination network to denote the networks on which we will evaluate transferability of adversarial examples that were generated with respect to a source network. For our ImageNet experiments, we rely on pre-trained models [10, 62]. + +Generating Adversarial Examples. We choose 1000 images randomly from the ImageNet validation dataset such that every image has a different class. We generate target classes randomly for each image such that each class is a target for exactly one image, and no image has a target that is the same as its true class. For each classifier (of different robustness), we generate targeted adversarial examples for each of the 1000 selected images, targeting the associated target class. To optimize each adversarial example, we run the TMDI-FGSM algorithm for 300 iterations. When the exact image input dimensions differ between the source and destination network, we rescale the adversarial example to fit the dimensions required by the destination network using bilinear interpolation. To generate adversarial examples, we use the Robustness library [17]. + +Transferability to Convolutional Network Classifiers. We find that across every destination convolutional network, using adversarial examples optimized with respect to a source network with small robustness parameter improves transfer success rate in both the targeted and untargeted setting compared to the success rate of the non-robust $(\varepsilon = 0)$ network (Figure 1). Our results on untargeted adversarial examples can be found in the Appendix. The success peak is approximately the same + +![](images/b7ab2ae4fcdaaaabb845297e8cb9dca7d8cf5cb5443b124c5871c6722810089c.jpg) +Figure 1: Targeted transfer attack success rate against ImageNet classifiers using adversarial examples optimized with respect to $\varepsilon$ -robust ResNet50 source models. Success rate is the fraction of adversarial examples classified as their adversarial target by the destination network. Higher is a more successful attack. Baseline refers the rate at which unperturbed images are classified as the target class. (Best viewed in color.) + +across every convolutional destination network $(\varepsilon = 0.1)$ , suggesting that there is an optimal source-network robustness parameter in order to maximize transferability to convolutional architectures trained on ImageNet. Note that our attacks do not exclude images that are already misclassified (untargeted case), and misclassified as the target class (targeted case) prior to adversarial perturbation. In Figure 1, we plot the baseline performance of the attacks, i.e., the performance of the attacks for unperturbed images. + +Interestingly, we observe a substantial drop in attack success as robustness increases past the optimal value. While not shown in Figure 1, this trend continues as $\varepsilon$ increases above 1 (see Appendix). We hypothesize that as the robustness of a source network increases beyond a certain point, the network begins to entirely ignore many of the non-robust features relied upon by the (non-robust) destination networks, and thus attacks do not modify these features, reducing attack success. This is consistent with prior literature [78]. We dedicate the second half of this paper to describing a possible mechanism to explain these results. + +Transformer-Based Classifiers. Few studies have addressed the robustness of transformer-based classifiers to transfer attacks [66]. To our knowledge, our paper is the first to address targeted transfer attacks against transformer architectures. Shao et al. [66] finds that transformer-based image classifiers are more robust to transfer attacks than convolutional classifiers, especially when the source model is convolutional. We find an even more striking result: with only minimal attack performance against transformer networks, previously published methods that use non-robust source networks are almost entirely ineffective at constructing targeted transferable adversarial examples using convolutional source models (Table 1). This suggests that the features learned by transformer-based models and non-robust convolutional models are largely different. + +However, we find that using a slightly-robust ResNet50 classifier as a source network dramatically improves the transferability of targeted adversarial examples to transformer-based classifiers. The optimal robustness parameter for the source network is different for destination transformer networks and destination convolutional networks, though we find that any amount of robustness in the source model (below a critical value) substantially improves transferability. Thus, in a real-world black-box attack setting—in which the destination network's architecture is entirely unknown—an adversary could find a balance between a source network robustness parameter that optimizes transfer performance for CNN classifiers and for transformer-based classifiers. + +Table 1: Direct comparison of targeted transfer attack success rate between our technique (slightly-robust source models, i.e., $\varepsilon >0$ ) and previously proposed strong baseline attacks (non-robust source models, i.e., $\varepsilon = 0$ ). We compare three different loss functions: cross-entropy, Poincaré distance combined with triplet loss, and logit loss. In addition, we report the success rate of FDA from the original paper (see text for discussion). We limit the $\ell_{\infty}$ norm of the adversarial examples to the standard value of $16 / 255$ . + +
XceptVGG16RN50v2IncV3MNv2DN121NNLENB4ViTCLIP
Xentε = 010.49.64.610.66.440.513.16.80.80.1
Po+Tripε = 020.815.210.023.011.659.331.214.21.30.3
Logitε = 045.940.015.343.622.977.960.339.63.90.4
FDA*ε = 0-43.5--22.957.9----
Xentε = 0.154.059.445.850.832.178.866.041.18.62.4
Po+Tripε = 0.159.157.953.056.539.278.472.645.111.43.3
Logitε = 0.177.278.864.573.152.584.081.668.933.411.2
Xentε = 160.469.366.658.246.769.961.356.929.919.9
Po+Tripε = 148.554.460.249.539.962.653.345.022.012.4
Logitε = 156.162.459.555.047.267.058.353.636.026.7
+ +CLIP. Radford et al. [57] describes CLIP, a transformer-based classifier based on the ViT architecture. CLIP is trained to simultaneously encode images and short textual descriptions of the images. CLIP can be used for highly effective zero-shot classification by determining which class label, encoded as text, has an encoding most similar to that of the input image. Despite the fact that CLIP has not been explicitly trained with ImageNet labels or to optimize for the classification task, we find that the transfer performance of targeted adversarial examples is improved substantially when the source network (ResNet50) is slightly robust (Table 1, rightmost column), again suggesting that slightly-robust neural networks rely on features which overlap with non-robust networks, even when the non-robust networks differ in architecture and training algorithm. + +For our experiments, we use ViT-B/32, the CLIP architecture based on ViT-B/32, CCT-14t/7x2, and LeViT-256. + +Improvements Upon Existing Attacks. We directly compare the targeted transfer attack success rate to previous state-of-the-art black-box attacks and find that our method substantially outperforms the previous methods under similar constraints (Table 1). In particular, we evaluate our method's attack performance with three different loss functions: standard cross-entropy loss (Xent), Poincaré distance with a triplet loss term (Po+Trip) [41], and logit loss. We include a comparison with the feature distribution attack (FDA) [33], however, FDA requires that we train multiple supplemental models for each individual target class, which would require thousands of supplemental models to attack all thousand classes of ImageNet. Thus, we do not perform a direct comparison and instead report the targeted transfer attack success rate that is reported in the original FDA paper [33]. + +Attacking Adversarily-Trained Models. Adversarial training has been shown to improve robustness to transfer attacks [45]. We evaluate the transferability of adversarial examples to adversially trained destination networks. Even though the adversarial perturbations which we use to attack each adversially-trained network are larger than the magnitude for which the destination networks are trained to be robust, the adversarial examples generated using non-robust networks do not transfer to the adversially trained networks. However, as shown in Figure 2, as the robustness of the source network increases, the attack success rate increases substantially. Similar to Figure 1, Figure 2 includes the baseline rate at which the destination network classifies unperturbed images as the (incorrect) target class. + +Extending Our Methods to CIFAR-10. We repeat many of our experiments for the CIFAR-10 dataset [39]. The results are consistent with our ImageNet results. We present and discuss these results in detail in the Appendix. + +Computational Limitations. Due to the computational requirement of training multiple robust ImageNet classifiers, we restrict our experiments to those we can compute using pre-trained robust + +![](images/8986ef7b8f267b44f8ca49079e5f6315d5a45b0b252d38572f8ff2c8d6f793ec.jpg) +Figure 2: Targeted transfer attack success rate against adversarially trained $(\varepsilon = 3)$ destination ImageNet classifiers, where examples are generated using $\varepsilon$ -robust ResNet50 source networks. Higher is a more successful attack. Baseline refers the rate at which unperturbed images are classified as the target class. (Best viewed in color.) + +networks. Thus, we test adversarial attacks only using the ResNet50 architecture as a source network, and we evaluate attacks only on destination networks which are easily available to us. Similarly, we do not compute ensemble attacks using slightly-robust source networks, although we expect this technique to improve the success of our attacks. + +# 4 Adversarial Transferability of Features + +We have shown that we can construct class-targeted adversarial examples that transfer a specific (incorrectly) predicted class to destination networks. In this section, we aim to address an important question to help us answer why class-targeted adversarial examples transfer: to what extent do class-targeted adversarial examples transfer the representation-layer features across networks? One could imagine that class-targeted transferability arises from the overlap of a small number of especially vulnerable features where manipulation of these features can change the model classification, or, alternatively, the overlap of many features. To answer this question, we will construct and evaluate representation-targeted adversarial examples. We refer to the degree to which adversarial examples of a source model can analogously affect the features that are computed by the representation layer of the destination model as the representation transferability from source to destination. By contrast, class transferability (what is commonly referred to as just transferability) refers to the degree to which adversarial examples can analogously affect the output of the destination network. + +Representation Transferability. Our goal is to study the representation transferability of source classifiers (with varying degrees of robustness) to non-robust models. We will show that slightly-robust networks exhibit a substantially higher degree of representation transferability than non-robust networks and more-robust networks. This can directly explain why class-targeted adversarial examples constructed using slightly-robust source networks are more transferable, as adversarial examples generated with slightly-robust networks will broadly transfer features, and will thus rely less on a small number of highly-vulnerable features that may not be present in every model. In this section, we show that representation-targeted adversarial examples generated with slightly-robust networks are highly transferable, even across a substantial difference in network architecture, such as the difference between CNNs and transformer networks. + +Measuring Representation Transferability. To measure representation transferability, we rely on a simple but powerful test to assess the similarity between the representations produced by two different networks. Let $x$ and $y$ be two inputs that produce identical (or very similar) patterns of activation in the source network's representation (penultimate) layer. If the source network has a high degree of representation transferability to the destination network, then the responses to $x$ and $y$ will be very similar in the destination network as well. By contrast, if $x$ and $y$ do not share similar representations in the destination network, then the source network has a low degree of representation transferability. + +This method allows us to test the representation transferability of a source network to a destination network by constructing images $x$ and $y$ with similar representations in a source network and + +![](images/c980128c78cac88e25d13ea8bb9e1e5ffc1797567f91bdb05025f9050df2829b.jpg) +Figure 3: t-SNE plots of destination-network representations of representation-targeted adversarial examples generated by using whitebox ResNet50 models of specified $\varepsilon$ -robustness. The 10 images at the bottom are the ones from ImageNet that we use as representation targets, as described in the text. (Best viewed in color and magnified.) + +Table 2: Cosine similarity between representations (in the destination network) of representation-targeted adversarial examples $y$ and the corresponding target image $x$ ,as a function of robustness parameter $\varepsilon$ of the source network. Each value is an average over the ${9900}\left( {x,y}\right)$ pairs of representation vectors. + +
Source network robustness parameter (ε)
Destination00.010.030.050.10.250.5135
Xception0.4620.5050.5310.5630.5940.5850.5720.5430.4490.404
VGG160.3330.4010.4170.4940.5280.5200.5200.4860.3830.333
ResNet50V20.2840.3480.3790.4320.4970.4960.5100.4840.3800.321
InceptionV30.5770.6120.6270.6440.6730.6620.6550.6360.5720.539
MobileNetV20.4310.4590.4600.4930.5170.5130.5130.5040.4550.425
DenseNet1210.6720.6890.6850.7130.7260.7140.7060.6790.6160.584
NasNetLarge0.3560.4220.4520.4880.5410.5130.4820.4370.3150.271
EfficientNetB40.0850.1110.1370.1440.2370.2200.2260.2020.1120.074
ViT0.0660.0870.1090.1290.1950.2060.2060.2030.1200.086
LeViT0.0510.0770.0960.1110.1650.1630.1760.1760.1070.07
CCT0.0480.0810.1090.1370.2020.2270.2480.2410.1440.093
CLIP0.5290.5410.5500.5630.5850.5990.6060.6130.5810.566
+ +measuring the similarity of the representations in the destination network. To construct these images, we select two images, $x$ and $y_0$ from the ImageNet testset. We construct a representation-targeted adversarial example $y = y_0 + \delta$ targeting the representation of $x$ . More precisely, we run the TMDI-FGSM algorithm to minimize the distance between the representations of $x$ and $y$ : + +$$ +\delta = \operatorname *{arg min}_{\| \delta \|_{\infty}\leq \varepsilon}\| F^{\mathrm{rep}}(x) - F^{\mathrm{rep}}(y_{0} + \delta)\|_{2} +$$ + +where $F^{\mathrm{rep}}$ represents the representation layer of the source network. Since we want to observe how well the representations transfer under the conditions of typical adversarial examples, we limit the perturbation to have an $\ell_{\infty}$ norm of $\varepsilon$ , which, for this paper, we set to be the standard 16/255. To limit the computational requirements of this experiment, we randomly select 10 images whose representations we use as targets $x$ and 990 images to use as initial images $y_0$ . Of these 1000 total images, no two share the same ImageNet class. For each source network, and for each initial image $y_0$ , we construct ten representation-targeted adversarial examples—one for each target $x$ —for a total of 9900 representation-targeted adversarial examples per source classifier. For each target $x$ , the 990 representation-targeted adversarial examples $y$ will have similar representations to $x$ in the source network. By measuring the similarity of the $(x,y)$ representations in the destination network, we can measure the representation transferability of the source network. + +Here we present two different similarity metrics for comparing representations of $x$ and $y$ . First, we plot the t-distributed stochastic neighbor embedding (t-SNE) of the representation vectors of each representation-targeted adversarial example $y$ in the destination network (Figure 3). Each color corresponds to one of the 10 target images $(x)$ . The 10 stars in each plot correspond to the t-SNE embedding of the destination-network representation of each target $x$ . If the destination-network representation of each $y$ associated with a particular color is near to its corresponding star, the representation transferability is high. When representation transferability is low, the destination-network representations of representation-targeted adversarial examples that target the same image will be dissimilar, and thus not appear grouped in Figure 3. By contrast, when representation-targeted adversarial examples transfer successfully, we observe clusters grouped by target image (in Figure 3, by color). The visual tightness of each cluster represents the similarity between the representations associated with each point and its neighbors. As a second similarity metric, we report the mean cosine similarity of the representations (in destination networks) between $(x,y)$ pairs, averaged over all 9900 such pairs for each source network (Table 2). The higher the mean cosine similarity, the higher degree of representation transferability from the source network to the corresponding destination network. + +Representation Transferability Is Poor in Non-Robust Networks. Our first surprising result is that representation-targeted adversarial examples generated with standard (i.e., non-robust) networks do not have substantial representation transferability to most tested destination networks ( $\varepsilon = 0$ columns of Figure 3 and Table 2). This suggests that even when the adversarial classification output + +is successfully transferred, the individual features of the destination networks are not substantially perturbed, suggesting that transferability from non-robust source networks arises from only a slight overlap in features, or the overlap of only a few highly vulnerable features. The result implies that the features of non-robust networks may not overlap substantially with each other. Interestingly, we observed some degree of representation transferability of adversarial examples generated with non-robust networks to DenseNet121, which may explain the high degree of class-transferability to DenseNet121 observed in Figure 1. + +Slightly-Robust Networks Exhibit Good Representation Transferability. We find that representation-targeted adversarial examples generated with slightly-robust networks (approximately $0.03 \leq \varepsilon \leq 1$ ) have a high degree of representation transferability (i.e., clusters are tight and cosine similarity is high for these values in Figure 3 and Table 2). This representation transferability appears to peak, for convolutional networks, approximately when $0.1 \leq \varepsilon \leq 0.5$ , which is coincident with the optimal source robustness for class-targeted transferability (Figure 1). For the transformer networks, including ViT and CLIP, representation transferability peaks when $0.5 \leq \varepsilon \leq 1$ , which, similarly, occurs close to the optimal robustness parameter for class-targeted transferability. Surprisingly, representation transferability from slightly-robust ResNet50 classifiers to CLIP was high, despite the fact that CLIP is not trained on the traditional classification problem and is instead trained to encode images and a corresponding textual description similarly. The high degree of representation transferability of slightly-robust networks likely explains the effectiveness of slightly-robust networks for generating class-targeted adversarial examples. More broadly, the high degree of representation transferability suggests that the features of slightly-robust networks overlap substantially with the features of every tested (non-robust) destination network, which is the claim of Springer et al. [71]. + +Representation Transferability in Very Robust Networks is Poor. Interestingly, when networks are adversarially-trained with a large $\varepsilon$ parameter, the degree to which the features they learn overlap with the features of non-robust networks diminishes as $\varepsilon$ increases. We speculate that certain non-robust features are ignored by robust neural networks with a sufficiently large $\varepsilon$ parameter, and thus as robustness increases past a point, many of the features of non-robust networks are ignored and representation transferability decreases. + +# 5 Related Work + +The vulnerability and defense of neural networks to adversarial examples have been studied extensively [1, 3, 5-8, 11, 18, 19, 21, 27, 37, 45, 49, 50, 55, 59, 63, 64, 72, 73, 79, 83]. + +First proposed by Goodfellow et al. [21], transferable adversarial examples are generally constructed by optimizing a perturbation to fool a white-box (source) network with hopes that it will transfer to black-box (destination) networks. Recent transferability research has focused on improving the optimizer to add generalization priors [40, 54, 88, 92]: researchers have added momentum to the gradient descent process [13], introduced transformations to the input [14, 67, 87], modified the adversarial loss functions [7, 41, 91], attacked intermediate feature representations [31, 33-35, 60, 92], linearizing the source network [23], and additional manipulations to the gradient computation [85]. Additionally, some research has examined the role of source classifier(s): many of the aforementioned papers test the difference between source classifier architectures and researchers have proposed using generative networks [70, 90], and ensemble attacks [44, 77]. + +Robust networks have been shown to have a number of valuable properties, including serving as a good starting point for transfer learning [43, 62, 76, 80] and gradient interpretability [18]. The vulnerable features learned by neural networks have been studied both empirically [4, 15, 20, 32, 36, 46, 47, 52, 69, 71, 82, 84, 89] and theoretically [1, 2, 12, 28, 51, 65, 81, 86]. Similarly, there has been some research related to the so-called "universality" hypothesis [38, 42, 53, 58], which speculates that under the right conditions, all neural networks may learn analogous features. + +In prior work, the similarity of the feature spaces of different neural networks has been compared via linear transformations; however, these techniques are either anecdotal or do not account for possible non-linear relationship between neural networks [38, 42, 53, 58]. + +Our research draws inspiration from recent work [71] that proposes that slightly-robust features exhibit the universality principle, and presents a limited experiment that slightly-robust networks + +can be used to increase transferability. By contrast, our work provides a comprehensive study demonstrating that the technique can be used to achieve state-of-the-art transferability across a wide variety of architectures. + +# 6 Conclusion + +We have demonstrated that slightly-robust networks learn features that can be exploited to construct highly transferable targeted adversarial examples. These adversarial examples, constructed with convolutional networks (ResNets), can attack other convolutional networks with state-of-the-art performance, as well as networks with substantially different architectures, such as the transformer-based networks including ViT, LeViT, and CCT, and with different learning objective, such as CLIP. In fact, this work is the first we are aware of that constructs targeted transferable attacks against transformer-based networks. We propose that the class-targeted transferability of adversarial examples generated with slightly-robust networks can be explained by the analogous representation-transferability of the networks. We find this to be true by showing that representation-targeted adversarial attacks generated with slightly-robust networks are highly transferable. Furthermore, since most previous transferable adversarial generation techniques rely on optimizing adversarial examples over a non-robust source network, our technique can be combined with virtually any previously existing optimization technique by replacing the non-robust source network with a slightly-robust network. + +As discussed, our paper is important to the field of adversarial machine learning, as we improve transfer attacks and study the mechanism of adversarial examples. More generally, our paper reveals a phenomenon that is significant for the broader field of deep learning: we find that different non-robust networks, even when trained with similar convolutional architectures, do not necessarily have many features that substantially overlap. This can have important implications for the reliability of neural networks; when different networks rely on different features, they are susceptible to different types of errors. In addition, we present an argument that, for a given task, there are features that are useful to every tested neural network, and that these features can be learned with small- $\varepsilon$ adversarial training, even when the source network architecture and learning objective are dissimilar to those of the destination network. Thus, by studying the features of a single slightly-robust network, we can empirically discover properties that will be applicable across all non-robust networks. We speculate that this phenomenon can explain why slightly-robust networks are successful at transfer-learning tasks [43, 62, 76, 80]. With applications across the field of machine learning, we expect that the contributions in this paper will provide an important stepping stone toward discovering a general understanding of the features learned by neural networks. + +Of course, our research has potential negative implications. Firstly, we propose a method to improve the generation of targeted transferable adversarial examples. While we hope that our research leads to the development of more robust and interpretable machine learning systems, in principle, an adversary could use our technique to attack existing systems. Secondly, we advocate for the use of adversarial training, which can be computationally intensive and could lead to excessive energy consumption. + +# Acknowledgments and Disclosure of Funding + +The authors would like to thank Rory Soiffer, Juston Moore, and Hadyn Jones for their helpful discussions and comments. + +Research presented in this article was supported by the Laboratory Directed Research and Development program of Los Alamos National Laboratory under project number 20210043DR. + +Melanie Mitchell's contributions were supported by the National Science Foundation under Grant No. 2020103. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author and do not necessarily reflect the views of the National Science Foundation. + +# References + +[1] Z. Allen-Zhu and Y. Li. Feature purification: How adversarial training performs robust deep learning. arXiv preprint arXiv:2005.10190, 2020. + +[2] D. Arpit, S. Jastrzebski, N. Ballas, D. Krueger, E. Bengio, M. S. Kanwal, T. Maharaj, A. Fischer, A. Courville, Y. Bengio, et al. A closer look at memorization in deep networks. arXiv preprint arXiv:1706.05394, 2017. +[3] A. Athalye, L. Engstrom, A. Ilyas, and K. Kwok. Synthesizing robust adversarial examples. In International conference on machine learning, pages 284–293. PMLR, 2018. +[4] M. Aubry and B. C. Russell. Understanding deep features with computer-generated imagery. In Proceedings of the IEEE International Conference on Computer Vision, pages 2875-2883, 2015. +[5] B. Biggio, I. Corona, D. Maiorca, B. Nelson, N. Šrndić, P. Laskov, G. Giacinto, and F. Roli. Evasion attacks against machine learning at test time. In Joint European conference on machine learning and knowledge discovery in databases, pages 387–402. Springer, 2013. +[6] N. Carlini and D. Wagner. Adversarial examples are not easily detected: Bypassing ten detection methods. In Proceedings of the 10th ACM Workshop on Artificial Intelligence and Security, pages 3-14, 2017. +[7] N. Carlini and D. Wagner. Towards evaluating the robustness of neural networks. In 2017 IEEE symposium on security and privacy (sp), pages 39-57. IEEE, 2017. +[8] N. Carlini, A. Athalye, N. Papernot, W. Brendel, J. Rauber, D. Tsipras, I. Goodfellow, A. Madry, and A. Kurakin. On evaluating adversarial robustness. arXiv preprint arXiv:1902.06705, 2019. +[9] F. Chollet. Xception: Deep learning with depthwise separable convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1251-1258, 2017. +[10] F. Chollet et al. Keras. https://keras.io, 2015. +[11] J. Cohen, E. Rosenfeld, and Z. Kolter. Certified adversarial robustness via randomized smoothing. In International Conference on Machine Learning, pages 1310-1320. PMLR, 2019. +[12] G. De Palma, B. Kiani, and S. Lloyd. Random deep neural networks are biased towards simple functions. In Advances in Neural Information Processing Systems, pages 1964–1976, 2019. +[13] Y. Dong, F. Liao, T. Pang, H. Su, J. Zhu, X. Hu, and J. Li. Boosting adversarial attacks with momentum. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 9185-9193, 2018. +[14] Y. Dong, T. Pang, H. Su, and J. Zhu. Evading defenses to transferable adversarial examples by translation-invariant attacks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4312-4321, 2019. +[15] A. Dosovitskiy and T. Brox. Inverting visual representations with convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4829-4837, 2016. +[16] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv preprint arXiv:2010.11929, 2020. +[17] L. Engstrom, A. Ilyas, H. Salman, S. Santurkar, and D. Tsipras. Robustness (python library), 2019. URL https://github.com/MadryLab/robustness. +[18] L. Engstrom, A. Ilyas, S. Santurkar, D. Tsipras, B. Tran, and A. Madry. Adversarial robustness as a prior for learned representations. arXiv preprint arXiv:1906.00945, 2019. +[19] R. Feinman, R. R. Curtin, S. Shintre, and A. B. Gardner. Detecting adversarial samples from artifacts. arXiv preprint arXiv:1703.00410, 2017. +[20] R. Geirhos, J.-H. Jacobsen, C. Michaelis, R. Zemel, W. Brendel, M. Bethge, and F. A. Wichmann. Shortcut learning in deep neural networks. arXiv preprint arXiv:2004.07780, 2020. + +[21] I. J. Goodfellow, J. Shlens, and C. Szegedy. Explaining and harnessing adversarial examples. arXiv preprint arXiv:1412.6572, 2014. +[22] B. Graham, A. El-Nouby, H. Touvron, P. Stock, A. Joulin, H. Jégou, and M. Douze. Levit: a vision transformer in convnet's clothing for faster inference. arXiv preprint arXiv:2104.01136, 2021. +[23] Y. Guo, Q. Li, and H. Chen. Backpropagating linearly improves transferability of adversarial examples. arXiv preprint arXiv:2012.03528, 2020. +[24] A. Hassani, S. Walton, N. Shah, A. Abuduweili, J. Li, and H. Shi. Escaping the big data paradigm with compact transformers. arXiv preprint arXiv:2104.05704, 2021. +[25] 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. +[26] K. He, X. Zhang, S. Ren, and J. Sun. Identity mappings in deep residual networks. In European conference on computer vision, pages 630-645. Springer, 2016. +[27] D. Hendrycks, K. Zhao, S. Basart, J. Steinhardt, and D. Song. Natural adversarial examples. arXiv preprint arXiv:1907.07174, 2019. +[28] K. Hermann, T. Chen, and S. Kornblith. The origins and prevalence of texture bias in convolutional neural networks. Advances in Neural Information Processing Systems, 33, 2020. +[29] A. G. Howard, M. Zhu, B. Chen, D. Kalenichenko, W. Wang, T. Weyand, M. Andreetto, and H. Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017. +[30] G. Huang, Z. Liu, L. Van Der Maaten, and K. Q. Weinberger. Densely connected convolutional networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4700-4708, 2017. +[31] Q. Huang, I. Katsman, H. He, Z. Gu, S. Belongie, and S.-N. Lim. Enhancing adversarial example transferability with an intermediate level attack. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 4733-4742, 2019. +[32] A. Ilyas, S. Santurkar, D. Tsipras, L. Engstrom, B. Tran, and A. Madry. Adversarial examples are not bugs, they are features. In Advances in Neural Information Processing Systems, pages 125-136, 2019. +[33] N. Inkawich, W. Wen, H. H. Li, and Y. Chen. Feature space perturbations yield more transferable adversarial examples. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7066-7074, 2019. +[34] N. Inkawich, K. J. Liang, L. Carin, and Y. Chen. Transferable perturbations of deep feature distributions. arXiv preprint arXiv:2004.12519, 2020. +[35] N. Inkawich, K. J. Liang, B. Wang, M. Inkawich, L. Carin, and Y. Chen. Perturbing across the feature hierarchy to improve standard and strict blackbox attack transferability. arXiv preprint arXiv:2004.14861, 2020. +[36] J. Jo and Y. Bengio. Measuring the tendency of cnns to learn surface statistical regularities. arXiv preprint arXiv:1711.11561, 2017. +[37] S. Kaur, J. Cohen, and Z. C. Lipton. Are perceptually-aligned gradients a general property of robust classifiers? arXiv preprint arXiv:1910.08640, 2019. +[38] S. Kornblith, M. Norouzi, H. Lee, and G. Hinton. Similarity of neural network representations revisited. In International Conference on Machine Learning, pages 3519-3529. PMLR, 2019. +[39] A. Krizhevsky, G. Hinton, et al. Learning multiple layers of features from tiny images. Master's thesis, Department of Computer Science, University of Toronto, 2009. + +[40] A. Kurakin, I. Goodfellow, and S. Bengio. Adversarial examples in the physical world. arXiv preprint arXiv:1607.02533, 2016. +[41] M. Li, C. Deng, T. Li, J. Yan, X. Gao, and H. Huang. Towards transferable targeted attack. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 641-649, 2020. +[42] Y. Li, J. Yosinski, J. Clune, H. Lipson, and J. E. Hopcroft. Convergent learning: Do different neural networks learn the same representations? In FE@ NIPS, pages 196-212, 2015. +[43] K. Liang, J. Y. Zhang, O. Koyejo, and B. Li. Does adversarial transferability indicate knowledge transferability? arXiv preprint arXiv:2006.14512, 2020. +[44] Y. Liu, X. Chen, C. Liu, and D. Song. Delving into transferable adversarial examples and black-box attacks. arXiv preprint arXiv:1611.02770, 2016. +[45] A. Madry, A. Makelov, L. Schmidt, D. Tsipras, and A. Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017. +[46] A. Mahendran and A. Vedaldi. Understanding deep image representations by inverting them. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 5188-5196, 2015. +[47] R. T. McCoy, E. Pavlick, and T. Linzen. Right for the wrong reasons: Diagnosing syntactic heuristics in natural language inference. arXiv preprint arXiv:1902.01007, 2019. +[48] L. Melas-Kyriazi. Vit pytorch. https://github.com/lukemelas/PyTorch-Pretrained-ViT, 2020. +[49] J. H. Metzen, T. Genewein, V. Fischer, and B. Bischoff. On detecting adversarial perturbations. arXiv preprint arXiv:1702.04267, 2017. +[50] S.-M. Moosavi-Dezfooli, A. Fawzi, and P. Frossard. Deepfool: a simple and accurate method to fool deep neural networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2574–2582, 2016. +[51] P. Nakkiran, D. Kalimeris, G. Kaplun, B. Edelman, T. Yang, B. Barak, and H. Zhang. Sgd on neural networks learns functions of increasing complexity. In Advances in Neural Information Processing Systems, pages 3496-3506, 2019. +[52] C. Olah, A. Mordvintsev, and L. Schubert. Feature visualization. Distill, 2(11):e7, 2017. +[53] C. Olah, N. Cammarata, L. Schubert, G. Goh, M. Petrov, and S. Carter. Zoom in: An introduction to circuits. Distill, 2020. doi: 10.23915/distill.00024.001. https://distill.pub/2020/circuits/zoom-in. +[54] N. Papernot, P. McDaniel, and I. Goodfellow. Transferability in machine learning: from phenomena to black-box attacks using adversarial samples. arXiv preprint arXiv:1605.07277, 2016. +[55] N. Papernot, P. McDaniel, S. Jha, M. Fredrikson, Z. B. Celik, and A. Swami. The limitations of deep learning in adversarial settings. In 2016 IEEE European symposium on security and privacy (EuroS&P), pages 372-387. IEEE, 2016. +[56] A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, T. Killeen, Z. Lin, N. Gimelshein, L. Antiga, A. Desmaison, A. Kopf, E. Yang, Z. DeVito, M. Raison, A. Tejani, S. Chilamkurthy, B. Steiner, L. Fang, J. Bai, and S. Chintala. Pytorch: An imperative style, high-performance deep learning library. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems 32, pages 8024-8035. Curran Associates, Inc., 2019. URL http://papers.neurips.cc/paper/9015-pytorch-an-imperative-style-high-performance-deep-learning-library.pdf. + +[57] A. Radford, J. W. Kim, C. Hallacy, A. Ramesh, G. Goh, S. Agarwal, G. Sastry, A. Askell, P. Mishkin, J. Clark, et al. Learning transferable visual models from natural language supervision. arXiv preprint arXiv:2103.00020, 2021. +[58] M. Raghu, J. Gilmer, J. Yosinski, and J. Sohl-Dickstein. Svcca: Singular vector canonical correlation analysis for deep learning dynamics and interpretability. arXiv preprint arXiv:1706.05806, 2017. +[59] A. Raghunathan, J. Steinhardt, and P. Liang. Certified defenses against adversarial examples. arXiv preprint arXiv:1801.09344, 2018. +[60] A. Rozsa, M. Günther, and T. E. Boult. Lots about attacking deep features. In 2017 IEEE International Joint Conference on Biometrics (IJCB), pages 168-176. IEEE, 2017. +[61] O. Russakovsky, J. Deng, H. Su, J. Krause, S. Satheesh, S. Ma, Z. Huang, A. Karpathy, A. Khosla, M. Bernstein, A. C. Berg, and L. Fei-Fei. ImageNet Large Scale Visual Recognition Challenge. International Journal of Computer Vision (IJCV), 115(3):211-252, 2015. doi: 10.1007/s11263-015-0816-y. +[62] H. Salman, A. Ilyas, L. Engstrom, A. Kapoor, and A. Madry. Do adversarially robust imagenet models transfer better? arXiv preprint arXiv:2007.08489, 2020. +[63] S. Santurkar, A. Ilyas, D. Tsipras, L. Engstrom, B. Tran, and A. Madry. Image synthesis with a single (robust) classifier. In Advances in Neural Information Processing Systems, pages 1262-1273, 2019. +[64] A. Shafahi, W. R. Huang, C. Studer, S. Feizi, and T. Goldstein. Are adversarial examples inevitable? arXiv preprint arXiv:1809.02104, 2018. +[65] H. Shah, K. Tamuly, A. Raghunathan, P. Jain, and P. Netrapalli. The pitfalls of simplicity bias in neural networks. arXiv preprint arXiv:2006.07710, 2020. +[66] R. Shao, Z. Shi, J. Yi, P.-Y. Chen, and C.-J. Hsieh. On the adversarial robustness of visual transformers. arXiv preprint arXiv:2103.15670, 2021. +[67] Y. Sharma, G. W. Ding, and M. Brubaker. On the effectiveness of low frequency perturbations. arXiv preprint arXiv:1903.00073, 2019. +[68] K. Simonyan and A. Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. +[69] K. Simonyan, A. Vedaldi, and A. Zisserman. Deep inside convolutional networks: Visualising image classification models and saliency maps. arXiv preprint arXiv:1312.6034, 2013. +[70] Y. Song, R. Shu, N. Kushman, and S. Ermon. Constructing unrestricted adversarial examples with generative models. arXiv preprint arXiv:1805.07894, 2018. +[71] J. M. Springer, M. Mitchell, and G. T. Kenyon. Adversarial perturbations are not so weird: Entanglement of robust and non-robust features in neural network classifiers. arXiv preprint arXiv:2102.05110, 2021. +[72] D. Stutz, M. Hein, and B. Schiele. Disentangling adversarial robustness and generalization. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6976-6987, 2019. +[73] C. Szegedy, W. Zaremba, I. Sutskever, J. Bruna, D. Erhan, I. Goodfellow, and R. Fergus. Intriguing properties of neural networks. In 2nd International Conference on Learning Representations, ICLR 2014, 2014. +[74] C. Szegedy, V. Vanhoucke, S. Ioffe, J. Shlens, and Z. Wojna. Rethinking the inception architecture for computer vision. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 2818-2826, 2016. +[75] M. Tan and Q. Le. Efficientnet: Rethinking model scaling for convolutional neural networks. In International Conference on Machine Learning, pages 6105-6114. PMLR, 2019. + +[76] M. Terzi, A. Achille, M. Maggipinto, and G. A. Susto. Adversarial training reduces information and improves transferability. arXiv preprint arXiv:2007.11259, 2020. +[77] F. Tramér, D. Boneh, A. Kurakin, I. Goodfellow, N. Papernot, and P. McDaniel. Ensemble adversarial training: Attacks and defenses. In 6th International Conference on Learning Representations, ICLR 2018-Conference Track Proceedings, 2018. +[78] D. Tsipras, S. Santurkar, L. Engstrom, A. Turner, and A. Madry. Robustness may be at odds with accuracy. In International Conference on Learning Representations, 2019. +[79] J. Uesato, B. O'donoghue, P. Kohli, and A. Oord. Adversarial risk and the dangers of evaluating against weak attacks. In International Conference on Machine Learning, pages 5025-5034. PMLR, 2018. +[80] F. Utrera, E. Kravitz, N. B. Erichson, R. Khanna, and M. W. Mahoney. Adversarily-trained deep nets transfer better. arXiv preprint arXiv:2007.05869, 2020. +[81] G. Valle-Pérez, C. Q. Camargo, and A. A. Louis. Deep learning generalizes because the parameter-function map is biased towards simple functions. arXiv preprint arXiv:1805.08522, 2018. +[82] H. Wang, X. Wu, Z. Huang, and E. P. Xing. High-frequency component helps explain the generalization of convolutional neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 8684-8694, 2020. +[83] D. Warde-Farley and I. Goodfellow. Adversarial perturbations of deep neural networks. *Perturbations, Optimization, and Statistics*, 311, 2016. +[84] K.-A. A. Wei. Understanding non-robust features in image classification. PhD thesis, Massachusetts Institute of Technology, 2020. +[85] D. Wu, Y. Wang, S.-T. Xia, J. Bailey, and X. Ma. Skip connections matter: On the transferability of adversarial examples generated with resnets. arXiv preprint arXiv:2002.05990, 2020. +[86] L. Wu, Z. Zhu, et al. Towards understanding generalization of deep learning: Perspective of loss landscapes. arXiv preprint arXiv:1706.10239, 2017. +[87] C. Xie, Z. Zhang, Y. Zhou, S. Bai, J. Wang, Z. Ren, and A. L. Yuille. Improving transferability of adversarial examples with input diversity. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2730-2739, 2019. +[88] Z. Yang, L. Li, X. Xu, S. Zuo, Q. Chen, B. Rubinstein, C. Zhang, and B. Li. Trs: Transferability reduced ensemble via encouraging gradient diversity and model smoothness. arXiv preprint arXiv:2104.00671, 2021. +[89] Q.-s. Zhang and S.-C. Zhu. Visual interpretability for deep learning: a survey. Frontiers of Information Technology & Electronic Engineering, 19(1):27-39, 2018. +[90] Z. Zhao, D. Dua, and S. Singh. Generating natural adversarial examples. arXiv preprint arXiv:1710.11342, 2017. +[91] Z. Zhao, Z. Liu, and M. Larson. On success and simplicity: A second look at transferable targeted attacks. arXiv preprint arXiv:2012.11207, 2020. +[92] W. Zhou, X. Hou, Y. Chen, M. Tang, X. Huang, X. Gan, and Y. Yang. Transferable adversarial perturbations. In Proceedings of the European Conference on Computer Vision (ECCV), pages 452-467, 2018. +[93] B. Zoph, V. Vasudevan, J. Shlens, and Q. V. Le. Learning transferable architectures for scalable image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 8697-8710, 2018. \ No newline at end of file diff --git a/alittlerobustnessgoesalongwayleveragingrobustfeaturesfortargetedtransferattacks/images.zip b/alittlerobustnessgoesalongwayleveragingrobustfeaturesfortargetedtransferattacks/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..2dfa87b0c02168b560b5f07f5eb00fe6cb5285be --- /dev/null +++ b/alittlerobustnessgoesalongwayleveragingrobustfeaturesfortargetedtransferattacks/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a536936dda945bd958b071608adc59b264cb5c628470c287085523b94b0460b +size 657838 diff --git a/alittlerobustnessgoesalongwayleveragingrobustfeaturesfortargetedtransferattacks/layout.json b/alittlerobustnessgoesalongwayleveragingrobustfeaturesfortargetedtransferattacks/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..820ad575f198a7a776564c33d7dcccc8def5c6a3 --- /dev/null +++ b/alittlerobustnessgoesalongwayleveragingrobustfeaturesfortargetedtransferattacks/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dcabba16be3f059219c133b9c376603e5cd3e0e9509d24ce307b13af1ac305f8 +size 391925 diff --git a/amathematicalframeworkforquantifyingtransferabilityinmultisourcetransferlearning/c58e9204-fb2f-4de6-a6ba-af06bb72cdc4_content_list.json b/amathematicalframeworkforquantifyingtransferabilityinmultisourcetransferlearning/c58e9204-fb2f-4de6-a6ba-af06bb72cdc4_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..d92ef4ea754a21b40cddaab605f1d67fbb86eda0 --- /dev/null +++ b/amathematicalframeworkforquantifyingtransferabilityinmultisourcetransferlearning/c58e9204-fb2f-4de6-a6ba-af06bb72cdc4_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85a29202bfbc3b49255c2db8195f9104c94603c08856fdbe658cef8cf5335020 +size 85299 diff --git a/amathematicalframeworkforquantifyingtransferabilityinmultisourcetransferlearning/c58e9204-fb2f-4de6-a6ba-af06bb72cdc4_model.json b/amathematicalframeworkforquantifyingtransferabilityinmultisourcetransferlearning/c58e9204-fb2f-4de6-a6ba-af06bb72cdc4_model.json new file mode 100644 index 0000000000000000000000000000000000000000..c3515483b591029198c73a0cf6fce7ec8df9ba88 --- /dev/null +++ b/amathematicalframeworkforquantifyingtransferabilityinmultisourcetransferlearning/c58e9204-fb2f-4de6-a6ba-af06bb72cdc4_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40b354fea72ee4fd899f2952fa4e320c04fd43045d31212f19ac138b75fb89da +size 109054 diff --git a/amathematicalframeworkforquantifyingtransferabilityinmultisourcetransferlearning/c58e9204-fb2f-4de6-a6ba-af06bb72cdc4_origin.pdf b/amathematicalframeworkforquantifyingtransferabilityinmultisourcetransferlearning/c58e9204-fb2f-4de6-a6ba-af06bb72cdc4_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7842d50d84bb1954d0ff663117a333adfc480e8f --- /dev/null +++ b/amathematicalframeworkforquantifyingtransferabilityinmultisourcetransferlearning/c58e9204-fb2f-4de6-a6ba-af06bb72cdc4_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e2e34dca76d6a33b72a013ec967c854a3bfac3e7b8492dc19c0fb131dd6740f1 +size 895192 diff --git a/amathematicalframeworkforquantifyingtransferabilityinmultisourcetransferlearning/full.md b/amathematicalframeworkforquantifyingtransferabilityinmultisourcetransferlearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..29ce9a2c216bb8ed6b04863c15c0f7e134176e9d --- /dev/null +++ b/amathematicalframeworkforquantifyingtransferabilityinmultisourcetransferlearning/full.md @@ -0,0 +1,421 @@ +# A Mathematical Framework for Quantifying Transferability in Multi-source Transfer Learning + +Xinyi Tong + +Tsinghua-Berkeley Shenzhen Institute + +Tsinghua University + +txy18@mails.tsinghua.edu.cn + +Shao-Lun Huang† + +Tsinghua-Berkeley Shenzhen Institute + +Tsinghua University + +shaolun.huang@sz.tsinghua.edu.cn + +Xiangxiang Xu* + +Massachusetts Institute of Technology + +xuxx@mit.edu + +Lizhong Zheng + +Massachusetts Institute of Technology + +lizhong@mit.edu + +# Abstract + +Current transfer learning algorithm designs mainly focus on the similarities between source and target tasks, while the impacts of the sample sizes of these tasks are often not sufficiently addressed. This paper proposes a mathematical framework for quantifying the transferability in multi-source transfer learning problems, with both the task similarities and the sample complexity of learning models taken into account. In particular, we consider the setup where the models learned from different tasks are linearly combined for learning the target task, and use the optimal combining coefficients to measure the transferability. Then, we demonstrate the analytical expression of this transferability measure, characterized by the sample sizes, model complexity, and the similarities between source and target tasks, which provides fundamental insights of the knowledge transferring mechanism and the guidance for algorithm designs. Furthermore, we apply our analyses for practical learning tasks, and establish a quantifiable transferability measure by exploiting a parameterized model. In addition, we develop an alternating iterative algorithm to implement our theoretical results for training deep neural networks in multi-source transfer learning tasks. Finally, experiments on image classification tasks show that our approach outperforms existing transfer learning algorithms in multi-source and few-shot scenarios. + +# 1 Introduction + +Transfer learning is nowadays an active research area in machine learning focusing on solving target learning tasks by the knowledge of learnable source tasks. The transferability between source and target tasks is the central topic in transfer learning for understanding the knowledge transferring mechanisms and the algorithm designs [1]. In general, the transferability can be affected by several factors, including: (i) the similarities between source tasks and the target task [2]; (ii) the sample sizes of the tasks; and (iii) the complexity or dimensionality of the machine learning model. Most of the existing transfer strategies are designed based on how similar the source and target tasks are [2, 3], without considering the impacts of the training sample sizes or the complexity of the models. + +In theoretical analyses [4, 5, 6], sample sizes and model complexity are often included in deriving upper bounds for the transferability or the performance of transfer learning algorithms. However, it is pointed out that such bounds derived under general learning settings are often relatively loose under numerical simulations [7], and hence the algorithms designed by directly applying theoretical results can hardly achieve satisfactory performance in practical applications. Thus, the gap between theory and practice opposes the fundamental understandings of transfer learning algorithms. + +In this paper, we propose a mathematical framework to investigate the transferability in multi-source transfer learning problem, and establish a quantifiable transferability measure for practical learning tasks. Specifically, for given source tasks, we learn the target task by a class of learning model which linearly combines the models learned from individual tasks by some designable coefficients. In addition, the performance of this combined model is measured by the empirical risk of only the testing data of the target task, considered as the testing loss. Then, we adopt the optimal combining coefficients that achieve the minimum testing loss as the transferability measure, which illustrates the contribution of each model in learning the target task, and effectively quantifies the knowledge transferable among different tasks. + +In our development, we establish an analytical solution of the transferability measure, which is jointly quantified by sample sizes, model complexity, and a similarity measure between source and target tasks. In particular, we demonstrate that the transferability of a particular source task is typically proportional to the number of samples and the measure of similarity to the target task, and is inversely proportional to the model complexity. This coincides with the intuition that when more training samples are available for a source task that is highly similar to the target task, more knowledge will be transferable from the source task to the target task. On the other hand, when the model is very complicated or high-dimensional, it is typically harder to train the model well, and less knowledge can be acquired and transferred. More importantly, our theoretical results can be applied for designing effective and efficient algorithms for real transfer learning problems, which are especially useful for multi-source transfer learning with a large number of source tasks that are generally difficult to deal with. + +The contribution of this paper can be summarized as follows: + +- We propose a mathematical framework for transfer learning analyses, and establish a transferability measure on discrete data, quantified by the number of samples, the complexity of the model, and the $\chi^2$ -distance between source and target tasks. +- We extend the transferability analyses to the continuous data, and establish a similar transferability measure that can be evaluated in practical tasks, by exploiting parameterized models. +- We apply our theoretical results to develop an iterative algorithm for training deep neural networks in general supervised transfer learning scenarios. Moreover, our algorithm can be practically applied for multi-source transfer learning. +- The experiments in real datasets validate our proposed algorithm, in which we show that our approach outperforms many existing transfer learning algorithms. + +Due to the space limitations, the proofs of theorems and propositions are presented in the supplemental material. + +# 2 Problem Formulation and Analysis + +Let $X$ and $Y$ be the random variables denoting the data and label with domains $\mathcal{X}$ and $\mathcal{Y}$ , respectively, and let $\mathcal{P}$ denote the set of all distributions on $\mathcal{X} \times \mathcal{Y}$ . For the convenience of illustration, here we assume $X$ to be discrete, and will extend our analyses to continuous cases later. Throughout our analyses, we will use $\mathcal{A}_k \triangleq \{(\alpha_0, \ldots, \alpha_k) : \sum_{i=0}^k \alpha_i = 1, \alpha_i \geq 0, i = 0, \ldots, k\}$ to denote the $k$ -dimensional simplex. + +# 2.1 Single-Source Transfer Learning + +To begin, we consider the transfer learning setting with one source task and one target task, denoted as task 1 and 0, respectively. Specifically, for each task $i = 0,1$ , we assume that $n_i$ training + +samples $\{(x_{\ell}^{(i)},y_{\ell}^{(i)})\}_{\ell = 1}^{n_i}$ are i.i.d. generated from some underlying joint distribution $P_{XY}^{(i)}\in \mathcal{P}$ with $P_{XY}^{(i)}(x,y) > 0$ , for all $x,y$ , and the empirical distributions $\hat{P}_{XY}^{(i)}\in \mathcal{P}$ of the samples are defined as + +$$ +\hat {P} _ {X Y} ^ {(i)} (x, y) \triangleq \frac {1}{n _ {i}} \sum_ {\ell = 1} ^ {n _ {i}} \mathbb {1} \left\{x _ {\ell} ^ {(i)} = x, y _ {\ell} ^ {(i)} = y \right\}, \tag {1} +$$ + +where $\mathbb{1}\{\cdot\}$ denotes the indicator function [8]. Then, the empirical distributions $\hat{P}_{XY}^{(0)}$ and $\hat{P}_{XY}^{(1)}$ can be regarded as the models learned from the target task and the source task, respectively, when all the entries of the mass functions are required to determine. + +To develop the transferability measure, our proposed framework focuses on a convex combination of both learned models4: + +$$ +Q _ {X Y} ^ {\left(\alpha_ {0}, \alpha_ {1}\right)} (x, y) \triangleq \alpha_ {0} \hat {P} _ {X Y} ^ {(0)} (x, y) + \alpha_ {1} \hat {P} _ {X Y} ^ {(1)} (x, y), \quad \text {f o r a l l} (x, y) \in \mathcal {X} \times \mathcal {Y}, \tag {2} +$$ + +where $(\alpha_0, \alpha_1) \in \mathcal{A}_1$ are parameters to be designed. Notice that these parameters characterize the knowledge transferred from the source task to target task, and the designing of these parameters will be affected by the sample sizes and the task similarities, which essentially leads to a transferability measure adjusted by the sample complexity. + +Then, the performance of the model $Q_{XY}^{(\alpha_0,\alpha_1)}$ is evaluated by the testing loss, measured by its empirical risk on the testing data of target task. Conventionally, such empirical risk is often computed by the logarithm loss. However, the logarithm risk can be ill-defined in our setting. Therefore, we alternatively apply the referenced $\chi^2$ -distance as the measure, defined as follows. + +Definition 1. Given a reference distribution $R_{XY}$ , for any distribution $P_{XY}$ and $Q_{XY}$ , the referenced $\chi^2$ -distance between them is defined as + +$$ +\chi_ {R _ {X Y}} ^ {2} \left(P _ {X Y}, Q _ {X Y}\right) \triangleq \sum_ {x \in \mathcal {X}, y \in \mathcal {Y}} \frac {\left(P _ {X Y} (x , y) - Q _ {X Y} (x , y)\right) ^ {2}}{R _ {X Y} (x , y)}. +$$ + +Specifically, we denote $\chi^2 (P_{XY},Q_{XY})\triangleq \chi_{P_{XY}}^2 (P_{XY},Q_{XY})$ , which corresponds to the Pearson $\chi^2$ -divergence. + +We choose the underlying target distribution $P_{XY}^{(0)}$ as the reference, and define the testing loss as the averaged Pearson $\chi^2$ -divergence + +$$ +L _ {\text {t e s t}} ^ {(\alpha_ {0}, \alpha_ {1})} \triangleq \mathbb {E} \left[ \chi^ {2} \left(P _ {X Y} ^ {(0)}, Q _ {X Y} ^ {(\alpha_ {0}, \alpha_ {1})}\right) \right], \tag {3} +$$ + +where the expectation is taken over all i.i.d. samples generated from the source and target distributions. Moreover, we define the optimal coefficients + +$$ +\left(\alpha_ {0} ^ {*}, \alpha_ {1} ^ {*}\right) \triangleq \underset {\left(\alpha_ {0}, \alpha_ {1}\right) \in \mathcal {A} _ {1}} {\arg \min } L _ {\text {t e s t}} ^ {\left(\alpha_ {0}, \alpha_ {1}\right)} \tag {4} +$$ + +as our transferability measure, which effectively quantifies the contributions of the source and target tasks in obtaining the optimal performance. + +Then, we have the following characterization. + +Theorem 2. The testing loss as defined in (3) is + +$$ +L _ {\text {t e s t}} ^ {(\alpha_ {0}, \alpha_ {1})} = \alpha_ {1} ^ {2} \chi^ {2} \left(P _ {X Y} ^ {(0)}, P _ {X Y} ^ {(1)}\right) + \frac {\alpha_ {0} ^ {2}}{n _ {0}} V ^ {(0)} + \frac {\alpha_ {1} ^ {2}}{n _ {1}} V ^ {(1)}, \tag {5} +$$ + +and the transferability measures as defined in (4) are + +$$ +\alpha_ {1} ^ {*} = \frac {\frac {1}{n _ {0}} V ^ {(0)}}{\chi^ {2} \left(P _ {X Y} ^ {(0)} , P _ {X Y} ^ {(1)}\right) + \frac {1}{n _ {0}} V ^ {(0)} + \frac {1}{n _ {1}} V ^ {(1)}}, \quad a n d \quad \alpha_ {0} ^ {*} = 1 - \alpha_ {1} ^ {*}, \tag {6} +$$ + +where, for each $i = 0,1$ , $V^{(i)}$ is defined as + +$$ +V ^ {(i)} \triangleq \sum_ {x \in \mathcal {X}, y \in \mathcal {Y}} \frac {P _ {X Y} ^ {(i)} (x , y) \left(1 - P _ {X Y} ^ {(i)} (x , y)\right)}{P _ {X Y} ^ {(0)} (x , y)}. \tag {7} +$$ + +From (6), and the fact that $V^{(0)} = |\mathcal{X}||\mathcal{Y}| - 1$ , the transferability is determined by three key factors: (i) the similarity between source and target tasks, measured by the $\chi^2$ -divergence $\chi^2(P_{XY}^{(0)}, P_{XY}^{(1)})$ ; (ii) the sample sizes $n_0$ and $n_1$ for source and target tasks; and (iii) the model complexity, characterized by the number of model parameters $(|\mathcal{X}||\mathcal{Y}| - 1)$ in $V^{(0)}$ .6 + +Current transfer learning algorithm designs often focus on the similarities between source and target tasks, while the sample sizes and model complexity are often not sufficiently addressed. In Theorem 2, we show that the transferability is in fact proportional to the number of model parameters, and is inversely proportional to the number of samples in source tasks and the similarity between source and target tasks. Therefore, for a source task with a complex model or few training samples, even though it is similar to the target task, the knowledge transferable from this source task can still be very limited. Such insight was not well captured in many existing transfer learning algorithms, and our result essentially provides the optimal characterization of the task transferability adjusted by the sample complexity in transfer learning. + +The established transferability measure is also related to the optimal bias-variance trade-off [9] of this transfer learning problem. Indeed, note that the bias-variance trade-off in testing loss (5) is tuned by $\alpha_0$ and $\alpha_{1}$ , as + +$$ +L _ {\text {t e s t}} ^ {\left(\alpha_ {0}, \alpha_ {1}\right)} = \underbrace {\alpha_ {1} ^ {2} \chi^ {2} \left(P _ {X Y} ^ {(0)} , P _ {X Y} ^ {(1)}\right)} _ {\text {b i a s t e r m}} + \underbrace {\frac {\alpha_ {0} ^ {2}}{n _ {0}} V ^ {(0)} + \frac {\alpha_ {1} ^ {2}}{n _ {1}} V ^ {(1)}} _ {\text {v a r i a n c e t e r m (s)}}, \tag {8} +$$ + +where the bias term does not decay with the sample sizes $n_0, n_1$ , while the variance terms vanish with sufficient samples. Then, the transferability measure corresponds to the coefficients $\alpha_0^*, \alpha_1^*$ that achieve the optimal bias-variance trade-off, such that the testing loss is minimized. + +# 2.2 Multi-source Transfer Learning + +Theorem 2 can be readily generalized to multi-source transfer learning problems. Specifically, suppose that there are $k$ source tasks, referred to as task $i$ , for $i = 1,\dots ,k$ , and a target task, referred to as task 0. Similarly, for each task $i = 0,\ldots ,k$ , we use $P_{XY}^{(i)},\{(x_{\ell}^{(i)},y_{\ell}^{(i)})\}_{\ell = 1}^{n_i}$ , and $\hat{P}_{XY}^{(i)}$ to denote the underlying distribution, $n_i$ i.i.d. samples generated from $P_{XY}^{(i)}$ , and the corresponding empirical distribution as defined in (1), respectively. + +Similar to (2), we consider the convex combination of the models learned from different tasks + +$$ +Q _ {X Y} ^ {(\boldsymbol {\alpha})} \triangleq \sum_ {i = 0} ^ {k} \alpha_ {i} \hat {P} _ {X Y} ^ {(i)}, \quad \boldsymbol {\alpha} \in \mathcal {A} _ {k}. \tag {9} +$$ + +Then, we define the testing loss $L_{\mathrm{test}}^{(\alpha)}$ and the corresponding transferability measure $\alpha^*$ , as [cf. (3), (4)]: + +$$ +L _ {\text {t e s t}} ^ {(\boldsymbol {\alpha})} \triangleq \mathbb {E} \left[ \chi^ {2} \left(P _ {X Y} ^ {(0)}, Q _ {X Y} ^ {(\boldsymbol {\alpha})}\right) \right] \quad \text {a n d} \quad \boldsymbol {\alpha} ^ {*} \triangleq \underset {\boldsymbol {\alpha} \in \mathcal {A} _ {k}} {\arg \min } L _ {\text {t e s t}} ^ {(\boldsymbol {\alpha})}. \tag {10} +$$ + +Similar to Theorem 2, we have the following result for multi-source transfer learning. + +![](images/ffddd48412c200599b5895a45e3b77892968e7520598fe1632dadd2f7873cb89.jpg) +Figure 1: A pre-trained neural network for classification can be divided into (a) a feature extractor which generates feature $\pmb{f}(x) = [f_1(x), \dots, f_d(x)]^{\mathrm{T}} \in \mathbb{R}^d$ , and (b) a classifier with the weights $\pmb{g}$ . With $\pmb{f}$ fixed, our framework optimizes the weights $\pmb{g}$ in the topmost layer for each task, to obtain the corresponding parameterized representation. + +Theorem 3. For the model (9), the testing loss under the target task is + +$$ +L _ {\text {t e s t}} ^ {(\boldsymbol {\alpha})} = \chi^ {2} \left(P _ {X Y} ^ {(0)}, \sum_ {i = 0} ^ {k} \alpha_ {i} P _ {X Y} ^ {(i)}\right) + \sum_ {i = 0} ^ {k} \frac {\alpha_ {i} ^ {2}}{n _ {i}} V ^ {(i)}, \tag {11} +$$ + +where $V^{(i)}$ 's are as defined in (7), for all i. + +From Theorem 3, the transferability measure $\alpha^{*}$ as defined in (10) can be computed by solving a non-negative quadratic programming problem [10]. Similar to the discussions in Section 2.1, such transferability measure quantifies the knowledge transferable from different source tasks to the target task with the sample complexity being considered. + +# 3 Parametric Models and Transfer Learning Algorithm + +# 3.1 Transferability Measure with Pre-trained Neural Network + +This section extends the analyses in the discrete data domain to continuous data in practical problems. In such cases, the previously adopted learning model (1) has infinite parameters due to the infinite cardinality $|\mathcal{X}|$ , and thus can not be effectively represented. In order to apply the previous analyzing framework, we first propose a parameterized representation for modeling features of the continuous data by exploiting a pre-trained model. + +As shown in Figure 1, a pre-trained network can be divided into two parts: (a) the previous layers for extracting $d$ -dimensional features $\pmb{f}(\boldsymbol{x}) = [f_1(\boldsymbol{x}), \dots, f_d(\boldsymbol{x})]^{\mathrm{T}}$ from the data variable $x$ , and (b) the topmost layer for linear classification, with weights $\pmb{g}(\boldsymbol{y}) = [g_1(\boldsymbol{y}), \dots, g_d(\boldsymbol{y})]^{\mathrm{T}}$ indexed by label $y$ . When the feature $\pmb{f}(\boldsymbol{x})$ is given and fixed, the models learned from different tasks can be effectively represented by a finite collection of parameters, i.e., $\pmb{g}(1), \dots, \pmb{g}(|\mathcal{Y}|)$ . + +In particular, our framework considers the discriminative model in the factorization form + +$$ +\tilde {P} _ {Y \mid X} ^ {\left(\boldsymbol {f}; \boldsymbol {g}\right)} (y | x) \triangleq P _ {Y} ^ {(0)} (y) \left(1 + \boldsymbol {f} ^ {\mathrm {T}} (x) \boldsymbol {g} (y)\right), \tag {12} +$$ + +which is similar to the ones introduced in factorization machines [11] and natural language processing applications [12]. Then, for each task $i = 0,\dots ,k$ , we learn corresponding weights $\hat{\pmb{g}}_i$ , such that the learned model $\tilde{P}_{Y|X}^{(f,\hat{\pmb{g}}_i)}$ fits the training samples7. The weight $\hat{\pmb{g}}_i$ can be formally defined as + +$$ +\hat {\boldsymbol {g}} _ {i} \triangleq \underset {\boldsymbol {g}} {\arg \min } \chi_ {R _ {X Y}} ^ {2} \left(\hat {P} _ {X Y} ^ {(i)}, P _ {X} ^ {(0)} \tilde {P} _ {Y | X} ^ {(\boldsymbol {f}, \boldsymbol {g})}\right), \tag {13} +$$ + +where the fitness is measured as the referenced $\chi^2$ -distance [cf. Definition 1] between the empirical distribution $\hat{P}_{XY}^{(i)}$ and the joint distribution $P_{X}^{(0)}\tilde{P}_{Y|X}^{(f,g)}$ . For convenience, we adopt a unified reference $R_{XY}\triangleq P_X^{(0)}P_Y^{(0)}$ in fitting different tasks. + +From (13), $P_X^{(0)} \tilde{P}_{Y|X}^{(\boldsymbol{f},\hat{\boldsymbol{g}}_i)}$ plays the role in the continuous case corresponding to $\hat{P}_{XY}^{(i)}$ in the discrete case. This allows us to apply previous analyses and focus on the discriminative model $\tilde{P}_{Y|X}^{(\boldsymbol{f},\hat{\boldsymbol{g}}_i)}$ 's. Analogous to (9), we consider the convex combination of these discriminative models + +$$ +Q _ {Y | X} ^ {(\boldsymbol {\alpha})} \triangleq \sum_ {i = 0} ^ {k} \alpha_ {i} \tilde {P} _ {Y | X} ^ {(\boldsymbol {f}, \hat {\boldsymbol {g}} _ {i})} = \tilde {P} _ {Y | X} ^ {(\boldsymbol {f}, \hat {\boldsymbol {g}})} \tag {14} +$$ + +with $\hat{\pmb{g}}\triangleq \sum_{i = 0}^{k}\alpha_{i}\hat{\pmb{g}}_{i}$ . Then, we define the testing loss and corresponding transferability measure as [cf. (10)] + +$$ +L _ {\text {t e s t}} ^ {(\boldsymbol {\alpha})} \triangleq \mathbb {E} \left[ \chi_ {R _ {X Y}} ^ {2} \left(P _ {X Y} ^ {(0)}, P _ {X} ^ {(0)} Q _ {Y | X} ^ {(\boldsymbol {\alpha})}\right) \right] \quad \text {a n d} \quad \boldsymbol {\alpha} ^ {*} \triangleq \underset {\boldsymbol {\alpha} \in \mathcal {A} _ {k}} {\arg \min } L _ {\text {t e s t}} ^ {(\boldsymbol {\alpha})}, \tag {15} +$$ + +for which we have the following characterization. + +Theorem 4. The testing loss (15) associated with the model (14) is + +$$ +L _ {\text {t e s t}} ^ {(\boldsymbol {\alpha})} = \chi_ {R _ {X Y}} ^ {2} \left(P _ {X} ^ {(0)} \tilde {P} _ {Y | X} ^ {(\boldsymbol {f}, \boldsymbol {g} _ {0})}, \sum_ {i = 0} ^ {k} \alpha_ {i} P _ {X} ^ {(0)} \tilde {P} _ {Y | X} ^ {(\boldsymbol {f}, \boldsymbol {g} _ {i})}\right) + \sum_ {i = 0} ^ {k} \frac {\alpha_ {i} ^ {2}}{n _ {i}} \tilde {V} ^ {(i)} + \chi_ {R _ {X Y}} ^ {2} \left(P _ {X Y} ^ {(0)}, P _ {X} ^ {(0)} \tilde {P} _ {Y | X} ^ {(\boldsymbol {f}, \boldsymbol {g} _ {0})}\right), \tag {16} +$$ + +where $\pmb{g}_i\triangleq \arg \min_{\pmb{g}}\chi_{R_{XY}}^2 (P_{XY}^{(i)},P_X^{(0)}\tilde{P}_{Y|X}^{(\pmb {f},\pmb {g})})$ , and where $\tilde{V}^{(i)}$ is a constant independent of $\alpha$ characterized in the supplementary material [cf. (32)]. + +Moreover, note that from the definition of $\pmb{g}_i$ , the joint distribution $P_X^{(0)}\tilde{P}_{Y|X}^{(\pmb{f},\pmb{g}_i)}$ can be interpreted as a projection of $P_{XY}^{(i)}$ onto the distribution family $\left\{P_X^{(0)}\tilde{P}_{Y|X}^{(\pmb{f},\pmb{g})}:\pmb{g}:\mathcal{Y}\to \mathbb{R}^d\right\}$ , with referenced $\chi^2$ -distance used as the distance measure. Therefore, the terms of (16) share similar interpretations as their counterparts in Theorem 2, with the distances measured in the projected space. Again, $\alpha^*$ can be efficiently computed by solving a non-negative quadratic programming problem. + +# 3.2 Multi-source Transfer Learning Algorithm + +With our theoretic analyses in Theorem 4, we develop a knowledge transfer algorithm for multisource transfer learning. Different from the previous analyses where $\pmb{f}$ is fixed, our algorithm jointly optimizes the extracted feature $\pmb{f}$ , the weights $\pmb{g}$ , together with the combining coefficients $\alpha$ to obtain better performance. + +To begin, for given $f, g$ , and $\alpha$ , we introduce the loss function + +$$ +L ^ {(\boldsymbol {\alpha}, \boldsymbol {f}, \boldsymbol {g})} \triangleq \sum_ {i = 0} ^ {k} \alpha_ {i} \chi_ {R _ {X Y}} ^ {2} \left(\hat {P} _ {X Y} ^ {(i)}, P _ {X} ^ {(0)} \tilde {P} _ {Y | X} ^ {(\boldsymbol {f}, \boldsymbol {g})}\right). \tag {17} +$$ + +The following result illustrates that, the $\hat{\pmb{g}}$ can be computed via directly minimizing this loss, without evaluating each $\hat{\pmb{g}}_i$ individually. + +Proposition 5. The $\hat{\pmb{g}}$ as defined in (14) satisfies + +$$ +\hat {\boldsymbol {g}} = \operatorname * {a r g m i n} _ {\boldsymbol {g} ^ {\prime}} L ^ {(\boldsymbol {\alpha}, \boldsymbol {f}, \boldsymbol {g} ^ {\prime})}. +$$ + +Table 1: Test accuracies $(\%)$ on the target task, with the network trained on samples from single source. All reported accuracies are averaged over 5 repeated experiments. + +
Source Task1234
Acc. on the target task66.559.756.277.1
+ +Table 2: Test accuracies (%) on the target task, compared with the combining coefficients $\alpha$ determined by 20 rounds of random searches (RS). + +
Target Sample Size620100
Acc. with only target samples70.974.481.5
Average acc. by 20 RS67.873.975.4
Highest acc. by 20 RS74.478.080.8
Acc. by Algorithm 178.981.283.7
+ +Then, with training samples from different tasks, our algorithm alternates between two different kinds of optimizations: (i) the optimization of $\alpha$ for given $(\pmb{f},\pmb{g})$ to minimize the testing loss $L_{\mathrm{test}}^{(\alpha)}$ as defined in (16), via solving a non-negative quadratic programming problem; and (ii) the optimization of $(\pmb{f},\pmb{g})$ for given $\alpha$ to minimize the loss $L^{(\alpha ,f,g)}$ as defined in (17) via training the neural network. We summarize the procedures as Algorithm 1. + +Specifically, it can be shown that both the testing loss $L_{\mathrm{test}}^{(\alpha)}$ and the loss $L^{(\alpha ,f,g)}$ can be represented by some expectations of features $f$ and $g$ . In computing these losses, these expectations are approximated by corresponding empirical means, with details provided in the supplementary material. + +Algorithm 1 Multi-Source Knowledge Transfer Algorithm +1: Input: target and source data samples $\{(x_l^{(i)},y_l^{(i)})\}_{l = 1}^{n_i}$ $(i = 0,\dots ,k)$ +2: Randomly initialize $\alpha^*$ +3: repeat +4: $(f^{*},g^{*})\gets \arg \min_{f,g}L^{(\alpha^{*},f,g)}$ +5: $\alpha^{*}\gets \arg \min_{\alpha \in \mathcal{A}_{k}}L_{\mathrm{test}}^{(\alpha)}$ +6: until $\alpha^{*}$ converges +7: $(f^{*},g^{*})\gets \arg \min_{f,g}L^{(\alpha^{*},f,g)}$ +8: return $f^{*},g^{*}$ + +With the $f^{*}$ and $g^{*}$ computed by the algorithm, for a newly observed target sample $x$ , the predicted label $\hat{y}$ is given by the MAP (maximum a posteriori) decision rule + +$$ +\hat {y} (x) = \underset {y \in \mathcal {Y}} {\arg \max } \tilde {P} _ {Y | X} ^ {\left(\boldsymbol {f} ^ {*}, \boldsymbol {g} ^ {*}\right)} (y | x) = \underset {y \in \mathcal {Y}} {\arg \max } P _ {Y} ^ {(0)} (y) \left(1 + \boldsymbol {f} ^ {* \mathrm {T}} (x) \boldsymbol {g} ^ {*} (y)\right). \tag {18} +$$ + +# 4 Experiments + +To validate the effectiveness of our algorithms in multi-source learning and few-shot transfer learning scenarios, we conduct a series of experiments on common datasets for image recognition, including CIFAR-10 [14], Office-31 and Office-Caltech [15]. In all experiments, the $g$ in the classifier is simply generated by an embedding layer. + +# 4.1 Multi-source Transfer Learning + +We conduct multi-source transfer learning experiments on CIFAR-10, which contains 50 000 training images and 10 000 testing images in 10 classes. To begin, we construct the source tasks and target task by dividing the original CIFAR-10 dataset into five disjoint subdatasets, each containing two classes of the original data, which corresponds to a binary classification task. Then, we choose one as our target task (task 0), and use the other four as source tasks for transferring knowledge, referred to as task 1, 2, 3, 4. + +Moreover, for each source task, 2000 images are used for training, with 1000 images per binary class, and we set target sample size $n_0$ to $n_0 = 6, 20, 100$ , respectively. Throughout this experiment, + +Table 3: Test accuracies for target tasks under different transfer settings (source $\rightarrow$ target) on Office-31 + +
MethodA→DA→WD→WD→AW→AW→D
SDT [20]86.182.795.766.265.097.6
DAMA [21]86.384.595.566.565.797.5
FADA [22]88.288.196.468.171.197.5
UDDA [23]89.088.296.471.872.197.6
Ours90.087.396.572.472.197.2
+ +Table 4: Test accuracies for target tasks under different transfer settings on Office-Caltech + +
MethodA→CW→CD→CC→AC→WC→D
GFK [15]68.468.464.583.878.774.6
TLDA [24]76.171.065.484.285.278.9
DTML [25]72.071.667.186.085.079.6
CPNN [26]78.573.568.086.386.280.1
Ours80.372.972.288.485.983.5
+ +the feature $\pmb{f}$ is of dimensionality $d = 10$ , generated by GoogLeNet [16], followed by two fully connected layers for further dimension reduction. + +Unlike common transfer learning settings where the labels for the source and target tasks are closely related, here the binary labels for these 5 sub-datasets are in general irrelevant. Therefore, we first establish the correspondences between labels as follows. For each given source task, we first train the network on its training samples, while the test accuracy is evaluated on the test samples from the target task. Then, we flip the original binary label for this source, if the test accuracy is less than $50\%$ . The resulting test accuracies on the target set are summarized in Table 1. + +In our implementation of Algorithm 1, we use the CVXPY [17, 18] package for solving the nonnegative quadratic programming in line 5. In addition, the alternating iteration is stopped when the element-wise differences for $\alpha^{*}$ computed in two successive iterations are at most 0.05. + +Then, the test accuracies of our algorithm on the target set are shown in Table 2, where we have compared our performance with random search (RS) strategy. Specifically, in the RS strategy, we generate the coefficients $\alpha$ from the log-uniform distribution [19] in $[0.001, 1]$ , for 20 rounds. The results indicate that our approach outperforms the random search method. Also, the difference in Table 2 and Table 1 also shows the performance gain of multi-source transfer learning over single-source. + +# 4.2 Few-shot Transfer Learning + +To validate the effectiveness of our algorithm for few-shot learning tasks, we conduct experiments on Caltech-31 and Office-Caltech datasets. These datasets provide typical transfer learning tasks with few available training samples, where the influence of sample complexity is shown. + +# 4.2.1 Caltech-31 + +Caltech-31 dataset contains images of 31 categories, which come from 3 sub-datasets: Amazon (2817 images), Dslr (498 images), and Webcam (795 images). Then, different transfer settings among these sub-datasets are denoted by the "source $\rightarrow$ target", as: A $\rightarrow$ D, A $\rightarrow$ W, D $\rightarrow$ W, D $\rightarrow$ A, W $\rightarrow$ A, and W $\rightarrow$ D. We adopt the few-shot transfer learning setting in [20], illustrated as follows. Specifically, 3 target samples per category are used for training, and the training sample size (per category) for source task is set to 20 or 8, depending on whether the source task is Amazon or not. Moreover, we also adopt five train-test splits introduced in [20]. + +In our experiment, the feature $\pmb{f}$ is a 64-dimensional vector, extracted by a VGG-16 [27] network pre-trained on the ImageNet, succeeded by two fully connected layers for dimension reduction. + +Table 3 summarizes test accuracies for target tasks under different transfer settings, where all reported accuracies are averaged over five train-test splits. The results indicate that our algorithm generally outperforms existing few-shot transfer learning methods. + +![](images/bd0c66bec3e882c04c91b8157b3addb0eeadda22bbc6cefa06e6c5ed56f7a5c0.jpg) +Figure 2: The combining coefficient $\alpha_{1}$ of the task A→D and test accuracies under testing samples of Dslr during iterations. + +In addition, we also investigate the convergence of the coefficient $\alpha^{*}$ in Algorithm 1. As an example, for the $\mathrm{A} \to \mathrm{D}$ task, the changes of the coefficient $\alpha_{1}$ (the coefficient of the source loss) and the accuracy on the Dslr test dataset during iterations are shown in Figure 2. From the figure, the value of $\alpha_{1}$ converges under our stopping criterion, where the optimal testing accuracy is obtained. + +# 4.2.2 Office-Caltech + +Office-Caltech dataset is composed of 10 common categories in Office-31 and Caltech-256, divided as four sub-datasets: Amazon (958 images), Caltech (1123 images), Webcam (295 images), and Dslr (157 images). We focus on the 6 transfer settings depending on C, i.e., $\mathrm{A} \rightarrow \mathrm{C}$ , $\mathrm{W} \rightarrow \mathrm{C}$ , $\mathrm{D} \rightarrow \mathrm{C}$ , $\mathrm{C} \rightarrow \mathrm{A}$ , $\mathrm{C} \rightarrow \mathrm{W}$ , and $\mathrm{C} \rightarrow \mathrm{D}$ , which have few common categories between source and target tasks. + +In addition, we follow the setting introduced in [15] for train-test split. The feature $\pmb{f}$ is of dimensionality $d = 10$ , based on the DeCAF feature [28, 29] with 2 fully connected layers for dimension reduction. + +Table 4 shows the performance for our algorithm, in comparison with several semi-supervised and few-shot domain adaptation algorithms. It is worth mentioning that, though our approach does not use the unlabeled data samples in training, it provides competitive performance as the semi-supervised algorithm CPNN [26], and can be better on specific tasks. + +# 5 Related Work + +Theoretical Analyses of Transfer Learning and Transferability. Most of the theoretical works about transfer learning focus on deriving upper bounds for the transferability or the performance of transfer learning. For example, the generalization error can be bounded by the VC-dimension of the hypothesis space [30], the total variance distance [4] or the mutual information between training samples and outputs [5], and the Jensen-Shannon distance between domains [6]. The choices of measures are determined mostly by the problem settings. Furthermore, some of these different measures and the $\chi^2$ -divergence used in our work are closely related, which are generalized as $f$ -divergence [31]. However, there can exist a significant gap between the theoretical bounds and the performance for real tasks [7]. + +There are also works concentrating on defining a transferability measurement in an empirical way. For instance, the empirical log-likelihood on the target data under the network trained by source samples can measure how much the source samples would help improve the target task [13, 32]. Compared with these works, we establish a transferability measure and provide an analytical expression, for guiding algorithm designs. + +Transfer Learning Algorithms. Transfer learning algorithms based on the insights from theoretical works intuitively measure the similarities between different domains. The similarity measures include the low-rank common information [33], K-L divergence [34, 35, 36, 37], $l_{2}$ -distance [38, 39, 40], and Wasserstein distance [41]. Additionally, transfer learning problems also share the similar framework with meta-learning, which concentrates on obtaining a generalized model for different + +tasks, especially when lacking enough samples for all categories [42]. In comparison with the above works, our algorithm takes the sample sizes and model complexity into consideration, and can be more applicable for general learning tasks, including the few-shot setting. + +Multi-source Domain Adaptation and Few-shot Domain Adaption. Multi-source domain adaptation considers the approaches of combining multiple tasks together. Conventional methods mainly include instance weighting [43] and domain weighting [44, 15], which re-weight samples or loss functions in training, respectively. Based on deep learning, cutting-edge algorithms attempt to maximize the domain confusion [45, 46] or learn the domain-invariant representations [47]. + +Semi-supervised and few-shot domain adaptation focus on transfer learning algorithms under few labeled target samples, which is one of our work's application scenarios. Compared with conventional domain adaptation, this field pays attention to embedding samples into an intrinsic low-dimensional subspace [15]. Common algorithms aim at learning domain-invariant representations, including simultaneous deep transfer (SDT) method [20] and semantic alignment method [22, 23]. + +Compared with these empirical studies, our characterization provides a practical learning algorithm under theoretical guarantees. + +# 6 Conclusion + +This paper introduces a mathematical framework for quantifying the transferability in multi-source transfer learning problems. Our characterization reveals the essential roles of sample sizes and model complexity in knowledge transferring, which demonstrates potentials in establishing a unified understanding of various transfer learning algorithms. In addition, we develop a multi-source transfer learning algorithm based on the theoretical analyses. Experiments on practical multi-source learning tasks show the effectiveness of our proposed algorithm. + +# Acknowledgements + +The research of Shao-Lun Huang is supported in part by the National Natural Science Foundation of China under Grant 61807021, and the Shenzhen Science and Technology Program under Grant KQTD20170810150821146. + +The research of Lizhong Zheng is supported in part by the National Science Foundation (NSF) under Award CNS-2002908 and the Office of Naval Research (ONR) under grant N00014-19-1-2621. + +# References + +[1] Sinno Jialin Pan and Qiang Yang. A survey on transfer learning. IEEE Transactions on knowledge and data engineering, 22(10):1345-1359, 2009. +[2] Chuanqi Tan, Fuchun Sun, Tao Kong, Wenchang Zhang, Chao Yang, and Chunfang Liu. A survey on deep transfer learning. In International conference on artificial neural networks, pages 270-279. Springer, 2018. +[3] Ian Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial nets. Advances in neural information processing systems, 27:2672-2680, 2014. +[4] Shai Ben-David, John Blitzer, Koby Crammer, Alex Kulesza, Fernando Pereira, and Jennifer Wortman Vaughan. A theory of learning from different domains. Machine Learning, 79(1):151-175, 2010. +[5] Y. Bu, S. Zou, and V. V. Veeravalli. Tightening mutual information based bounds on generalization error. In 2019 IEEE International Symposium on Information Theory (ISIT), pages 587-591, 2019. +[6] Han Zhao, Remi Tachet Des Combes, Kun Zhang, and Geoffrey Gordon. On learning invariant representations for domain adaptation. In International Conference on Machine Learning, pages 7523-7532. PMLR, 2019. + +[7] Xuetong Wu, Jonathan H. Manton, Uwe Aickelin, and Jingge Zhu. Information-theoretic analysis for transfer learning. 2020 IEEE International Symposium on Information Theory (ISIT), Jun 2020. +[8] William Feller. An introduction to probability theory and its applications, vol 2. John Wiley & Sons, 2008. +[9] Richard O Duda, Peter E Hart, et al. Pattern classification and scene analysis, volume 3. Wiley New York, 1973. +[10] Stephen Boyd, Stephen P Boyd, and Lieven Vandenberghe. Convex optimization. Cambridge university press, 2004. +[11] Steffen Rendle. Factorization machines. In 2010 IEEE International Conference on Data Mining, pages 995-1000. IEEE, 2010. +[12] Omer Levy and Yoav Goldberg. Neural word embedding as implicit matrix factorization. Advances in neural information processing systems, 27:2177-2185, 2014. +[13] Cuong Nguyen, Tal Hassner, Matthias Seeger, and Cedric Archambeau. Leep: A new measure to evaluate transferability of learned representations. In International Conference on Machine Learning, pages 7294-7305. PMLR, 2020. +[14] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. +[15] Boqing Gong, Yuan Shi, Fei Sha, and Kristen Grauman. Geodesic flow kernel for unsupervised domain adaptation. In 2012 IEEE Conference on Computer Vision and Pattern Recognition, pages 2066-2073. IEEE, 2012. +[16] Christian Szegedy, Wei Liu, Yangqing Jia, Pierre Sermanet, Scott Reed, Dragomir Anguelov, Dumitru Erhan, Vincent Vanhoucke, and Andrew Rabinovich. Going deeper with convolutions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1-9, 2015. +[17] Steven Diamond and Stephen Boyd. CVXPY: A Python-embedded modeling language for convex optimization. Journal of Machine Learning Research, 17(83):1-5, 2016. +[18] Akshay Agrawal, Robin Verschueren, Steven Diamond, and Stephen Boyd. A rewriting system for convex optimization problems. Journal of Control and Decision, 5(1):42-60, 2018. +[19] James Bergstra and Yoshua Bengio. Random search for hyper-parameter optimization. Journal of Machine Learning Research, 13(10):281-305, 2012. +[20] Eric Tzeng, Judy Hoffman, Trevor Darrell, and Kate Saenko. Simultaneous deep transfer across domains and tasks. In Proceedings of the IEEE International Conference on Computer Vision, pages 4068-4076, 2015. +[21] Piotr Koniusz, Yusuf Tas, and Fatih Porikli. Domain adaptation by mixture of alignments of second-order scatter tensors. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 4478-4487, 2017. +[22] Saeid Motiian, Quinn Jones, Seyed Iranmanesh, and Gianfranco Doretto. Few-shot adversarial domain adaptation. In Advances in neural information processing systems, pages 6670-6680, 2017. +[23] Saeid Motiian, Marco Piccirilli, Donald A Adjeroh, and Gianfranco Doretto. Unified deep supervised domain adaptation and generalization. In Proceedings of the IEEE International Conference on Computer Vision, pages 5715-5725, 2017. +[24] Junlin Hu, Jiwen Lu, and Yap-Peng Tan. Deep transfer metric learning. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 325-333, 2015. + +[25] Fuzhen Zhuang, Xiaohu Cheng, Ping Luo, Sinno Jialin Pan, and Qing He. Supervised representation learning: Transfer learning with deep autoencoders. In Twenty-Fourth International Joint Conference on Artificial Intelligence, 2015. +[26] Z. Ding, N. M. Nasrabadi, and Y. Fu. Semi-supervised deep domain adaptation via coupled neural networks. IEEE Transactions on Image Processing, 27(11):5214-5224, 2018. +[27] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014. +[28] Jeff Donahue, Yangqing Jia, Oriol Vinyals, Judy Hoffman, Ning Zhang, Eric Tzeng, and Trevor Darrell. Decaf: A deep convolutional activation feature for generic visual recognition. In International conference on machine learning, pages 647-655, 2014. +[29] Judy Hoffman, Erik Rodner, Jeff Donahue, Trevor Darrell, and Kate Saenko. Efficient learning of domain-invariant image representations. arXiv preprint arXiv:1301.3224, 2013. +[30] John Blitzer, Koby Crammer, Alex Kulesza, Fernando Pereira, and Jennifer Wortman. Learning bounds for domain adaptation. In Advances in neural information processing systems, pages 129-136, 2008. +[31] Peter Harremoës and Igor Vajda. On pairs of $f$ -divergences and their joint range. IEEE Transactions on Information Theory, 57(6):3230-3235, 2011. +[32] Anh T Tran, Cuong V Nguyen, and Tal Hassner. Transferability and hardness of supervised classification tasks. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 1395-1405, 2019. +[33] Kate Saenko, Brian Kulis, Mario Fritz, and Trevor Darrell. Adapting visual category models to new domains. In European conference on computer vision, pages 213-226. Springer, 2010. +[34] Eric Tzeng, Judy Hoffman, Ning Zhang, Kate Saenko, and Trevor Darrell. Deep domain confusion: Maximizing for domain invariance. arXiv preprint arXiv:1412.3474, 2014. +[35] Yaroslav Ganin and Victor Lempitsky. Unsupervised domain adaptation by backpropagation. In International conference on machine learning, pages 1180-1189. PMLR, 2015. +[36] Yaroslav Ganin, Evgeniya Ustinova, Hana Ajakan, Pascal Germain, Hugo Larochelle, François Laviolette, Mario March, and Victor Lempitsky. Domain-adversarial training of neural networks. Journal of Machine Learning Research, 17(59):1-35, 2016. +[37] Eric Tzeng, Judy Hoffman, Kate Saenko, and Trevor Darrell. Adversarial discriminative domain adaptation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7167-7176, 2017. +[38] Mingsheng Long, Jianmin Wang, Guiguang Ding, Jiaguang Sun, and Philip S Yu. Transfer joint matching for unsupervised domain adaptation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 1410-1417, 2014. +[39] Mingsheng Long, Yue Cao, Jianmin Wang, and Michael Jordan. Learning transferable features with deep adaptation networks. In International conference on machine learning, pages 97-105. PMLR, 2015. +[40] Mingsheng Long, Han Zhu, Jianmin Wang, and Michael I Jordan. Unsupervised domain adaptation with residual transfer networks. In Advances in neural information processing systems, pages 136-144, 2016. +[41] Jian Shen, Yanru Qu, Weinan Zhang, and Yong Yu. Wasserstein distance guided representation learning for domain adaptation. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 32, 2018. +[42] Ruohan Wang, Yiannis Demiris, and Carlo Ciliberto. Structured prediction for conditional meta-learning. In Advances in Neural Information Processing Systems, volume 33, pages 2587-2598, 2020. + +[43] Qian Sun, Rita Chattopadhyay, Sethuraman Panchanathan, and Jieping Ye. A two-stage weighting framework for multi-source domain adaptation. Advances in neural information processing systems, 24:505-513, 2011. +[44] Lixin Duan, Dong Xu, and Ivor Wai-Hung Tsang. Domain adaptation from multiple sources: A domain-dependent regularization approach. IEEE Transactions on neural networks and learning systems, 23(3):504-518, 2012. +[45] Ruijia Xu, Ziliang Chen, Wangmeng Zuo, Junjie Yan, and Liang Lin. Deep cocktail network: Multi-source unsupervised domain adaptation with category shift. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3964–3973, 2018. +[46] Han Zhao, Shanghang Zhang, Guanhang Wu, Geoffrey J Gordon, et al. Multiple source domain adaptation with adversarial learning. 2018. +[47] Yongchun Zhu, Fuzhen Zhuang, and Deqing Wang. Aligning domain-specific distribution and classifier for cross-domain classification from multiple sources. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 5989-5996, 2019. +[48] Xiangxiang Xu and Shao-Lun Huang. Maximal correlation regression. IEEE Access, 8:26591-26601, 2020. + +# Checklist + +1. For all authors... + +(a) Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope? [Yes] See Section 1. +(b) Did you describe the limitations of your work? [Yes] We clearly state the assumptions we use in Section 2. +(c) Did you discuss any potential negative societal impacts of your work? [No] We have done a theoretic work that has few societal impacts. +(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] + +2. If you are including theoretical results... + +(a) Did you state the full set of assumptions of all theoretical results? [Yes] See Section 2. +(b) Did you include complete proofs of all theoretical results? [Yes] See supplementary material. + +3. If you ran experiments... + +(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] See supplemental material. +(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 4. +(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] We think the error bars are not related to the core result of our experiments. +(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [No] We use few computation resources in our work. + +4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... + +(a) If your work uses existing assets, did you cite the creators? [Yes] See Section 4. +(b) Did you mention the license of the assets? [Yes] See Section 4. +(c) Did you include any new assets either in the supplemental material or as a URL? [No] We don't use new assets. +(d) Did you discuss whether and how consent was obtained from people whose data you're using/curating? [Yes] See Section 4. +(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] + +5. If you used crowdsourcing or conducted research with human subjects... + +(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] +(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] +(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] \ No newline at end of file diff --git a/amathematicalframeworkforquantifyingtransferabilityinmultisourcetransferlearning/images.zip b/amathematicalframeworkforquantifyingtransferabilityinmultisourcetransferlearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..8931b80c8b8b02536da2e7d7c8cd600d54ccdfb3 --- /dev/null +++ b/amathematicalframeworkforquantifyingtransferabilityinmultisourcetransferlearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:14956c48b20cada313b098a2f1bd56d88fec9feb07534849c209967c1c8c7dd5 +size 295927 diff --git a/amathematicalframeworkforquantifyingtransferabilityinmultisourcetransferlearning/layout.json b/amathematicalframeworkforquantifyingtransferabilityinmultisourcetransferlearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..34ae38a6e7fb392a1d33c6bed15ed5690db970f5 --- /dev/null +++ b/amathematicalframeworkforquantifyingtransferabilityinmultisourcetransferlearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:05e823c7d1ea397851b469d3766adb64f0a77ed35fbbb5763b163677c9973a36 +size 506743 diff --git a/amaxminentropyframeworkforreinforcementlearning/0c406aff-0b97-4cf1-aded-4c6d0da666a6_content_list.json b/amaxminentropyframeworkforreinforcementlearning/0c406aff-0b97-4cf1-aded-4c6d0da666a6_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..7debdd569ffb1c47f83e07343d4f174b210398e6 --- /dev/null +++ b/amaxminentropyframeworkforreinforcementlearning/0c406aff-0b97-4cf1-aded-4c6d0da666a6_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:150739811929cb0e8cd10ea9c828d8a0258d02dd3fb2e9ade778e47ab07cc2cf +size 86749 diff --git a/amaxminentropyframeworkforreinforcementlearning/0c406aff-0b97-4cf1-aded-4c6d0da666a6_model.json b/amaxminentropyframeworkforreinforcementlearning/0c406aff-0b97-4cf1-aded-4c6d0da666a6_model.json new file mode 100644 index 0000000000000000000000000000000000000000..920536820fe85c679111bc1f7423b395efbf53eb --- /dev/null +++ b/amaxminentropyframeworkforreinforcementlearning/0c406aff-0b97-4cf1-aded-4c6d0da666a6_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fff4ba14efc9fae376de23229048fe7d1d32ea8cebe616a1422c051779b86b7a +size 112141 diff --git a/amaxminentropyframeworkforreinforcementlearning/0c406aff-0b97-4cf1-aded-4c6d0da666a6_origin.pdf b/amaxminentropyframeworkforreinforcementlearning/0c406aff-0b97-4cf1-aded-4c6d0da666a6_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e052581e54a8606c9c864e7383266d63544e43f1 --- /dev/null +++ b/amaxminentropyframeworkforreinforcementlearning/0c406aff-0b97-4cf1-aded-4c6d0da666a6_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98940f7816b42e78afb89e1f38c05d82d5fec879fff22963decceb8cb29411d1 +size 2205123 diff --git a/amaxminentropyframeworkforreinforcementlearning/full.md b/amaxminentropyframeworkforreinforcementlearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..4e1f870c643279bed18c0ddf4b52efecbd6bc81c --- /dev/null +++ b/amaxminentropyframeworkforreinforcementlearning/full.md @@ -0,0 +1,356 @@ +# A Max-Min Entropy Framework for Reinforcement Learning + +Seungyul Han + +Graduate School of Artificial Intelligence + +UNIST + +Ulsan, South Korea 44919 + +syhan@unist.ac.kr + +Youngchul Sung† + +School of Electrical Engineering + +KAIST + +Daejeon, South Korea 34141 + +ycsung@kaist.ac.kr + +# Abstract + +In this paper, we propose a max-min entropy framework for reinforcement learning (RL) to overcome the limitation of the soft actor-critic (SAC) algorithm implementing the maximum entropy RL in model-free sample-based learning. Whereas the maximum entropy RL guides learning for policies to reach states with high entropy in the future, the proposed max-min entropy framework aims to learn to visit states with low entropy and maximize the entropy of these low-entropy states to promote better exploration. For general Markov decision processes (MDPs), an efficient algorithm is constructed under the proposed max-min entropy framework based on disentanglement of exploration and exploitation. Numerical results show that the proposed algorithm yields drastic performance improvement over the current state-of-the-art RL algorithms. + +# 1 Introduction + +The maximum entropy framework has been considered in various RL domains [22, 23, 30, 45, 51, 53, 58]. Maximum entropy RL adds the expected policy entropy to the return objective of standard RL in order to maximize both the return and the entropy of policy distribution. Maximum entropy RL encourages the policy to choose multiple actions probabilistically and yields a significant improvement in exploration and robustness and good final performance in various control tasks [15, 20, 21, 25, 26, 29, 50]. In particular, soft actor-critic (SAC) implements maximum entropy RL in an efficient iterative manner based on soft policy iteration and guarantees convergence to the optimal policy for finite MDPs, yielding significant performance improvement over various on-policy and off-policy recent RL algorithms in many continuous control tasks. However, we observe that such an iterative implementation of the maximum entropy strategy of optimizing for policies that aim to reach states with high entropy in the future does not necessarily result in the desired exploration behavior but may yield positive feedback hindering exploration in model-free sample-based learning with function approximation. In order to overcome such limitations associated with implementation of the maximum entropy RL, we propose a max-min entropy framework for RL, which aims to learn policies reaching states with low entropy and maximizing the entropy of these low-entropy states, whereas the conventional maximum entropy RL optimizes for policies that aim to visit states with high entropy and maximize the entropy of those high-entropy states for high entropy of the entire trajectory. We implemented the proposed max-min entropy framework into a practical iterative actor-critic algorithm based on policy iteration with disentangled exploration and exploitation. It is demonstrated that the proposed algorithm significantly enhances exploration capability due to the fairness across states induced by the max-min framework and yields drastic performance improvement over existing RL algorithms including maximum-entropy SAC on difficult control tasks. + +# 2 Related Works + +Maximum Entropy RL: The maximum entropy framework has been considered in various RL domains: inverse reinforcement learning [58], stochastic optimal control [45, 51, 53], guided policy search [30], and off-policy learning [22, 23]. There is a connection between value-based and policy-based RL under the policy entropy regularization [38], [42] combines them, and finally [46] proves that they are equivalent. Maximum entropy RL is also related to probabilistic inference [40, 45]. Recently, maximizing the entropy of state distribution instead of the policy distribution [26] and maximizing the entropy considering the previous sample action distribution [25] have been investigated for better exploration. + +Max-Min Optimization: Max-min optimization aims to maximize the minimum of the objective function [11]. Under the convex-concave assumption, there exist many algorithms to find the solution to a max-min problem by using optimistic mirror descent [44], Frank-Wolfe algorithm [17], and Primal-Dual method [24]. However, non-convex max-min problems are more challenging [37] and there are several recent studies to find (approximate) solutions to non-convex max-min optimization problems [6, 41, 43]. This framework has been used in various optimization/control domains: fair resource allocation [31], inference [4, 56], generative adversarial network (GAN) [2, 18], robust training [33], and reinforcement learning [54]. + +Exploration in RL: Exploration is one of the most important issues in model-free RL, as there is the key assumption that all state-action pairs must be visited infinitely often to guarantee the convergence of $Q$ -function [55]. In order to explore diverse state-action pairs in the joint state-action space, various methods have been considered in prior works: intrinsically-motivated reward based on curiosity [5, 10], model prediction error [1, 9], information gain [25, 27, 28], and counting states [32, 34]. These exploration techniques improve exploration and performance in challenging sparse-reward environments [3, 9, 12]. + +# 3 Background + +# 3.1 Basic RL Setup + +We consider an infinite-horizon MDP $(\mathcal{S},\mathcal{A},P,\gamma ,r)$ , where $\mathcal{S}$ is the state space, $\mathcal{A}$ is the action space, $P$ is the transition probability, $\gamma$ is the discount factor, and $r$ is the bounded reward function. We assume that each action dimension is bounded. The RL agent has a policy $\pi :S\times \mathcal{A}\to \mathbb{R}^{+}\in \Pi$ , which chooses an action $a_{t}$ for given state $s_t$ according to $a_{t}\sim \pi (\cdot |s_{t})$ at each time step $t$ , where $\Pi$ is the policy space. For action $a_{t}$ , the environment yields the reward $r_t\coloneqq r(s_t,a_t)$ and the next state $s_{t + 1}\sim P(s_{t + 1}|s_t,a_t)$ . Standard RL learns policy $\pi$ to maximize the discounted return $\mathbb{E}_{s_0\sim p_0,\tau_0\sim \pi}[\sum_{t = 0}^{\infty}\gamma^t r_t]$ , where $\tau_{t} = (s_{t},a_{t},s_{t + 1},a_{t + 1},\dots)$ is an episode trajectory. + +# 3.2 Maximum Entropy RL and Soft Actor-Critic + +Maximum entropy RL maximizes both the expected return and the expected policy entropy simultaneously to achieve an improvement in exploration and robustness. The entropy-augmented objective function of maximum entropy RL is given by + +$$ +J _ {\text {M a x E n t}} (\pi) = \mathbb {E} _ {s _ {0} \sim p _ {0}, \tau_ {0} \sim \pi} \left[ \sum_ {t = 0} ^ {\infty} \gamma^ {t} \left(r _ {t} + \alpha \mathcal {H} \left(\pi \left(\cdot \mid s _ {t}\right)\right)\right) \right], \tag {1} +$$ + +where $\mathcal{H}(\pi (\cdot |s)) = \mathbb{E}_{a\sim \pi (\cdot |s)}[-\log \pi (a|s)]$ is the entropy function and $\alpha >0$ is the entropy coefficient. A key point here is that the policy entropy is included in the reward not used as an external regularizer at each time step. Thus, this maximum entropy RL framework optimizes for policies that aim to reach states on which policies have high entropy in the future [21]. + +Soft actor-critic (SAC) is an efficient off-policy actor-critic algorithm to solve the maximum entropy RL problem [22]. SAC maximizes (1) based on soft policy iteration, which consists of soft policy evaluation and soft policy improvement. For this, the soft $Q$ -value of given $(s_t, a_t)$ is defined as + +$$ +Q ^ {\pi} \left(s _ {t}, a _ {t}\right) := r _ {t} + \mathbb {E} _ {\tau_ {t + 1} \sim \pi} \left[ \sum_ {l = t + 1} ^ {\infty} \gamma^ {l - t} \left(r _ {l} + \alpha \mathcal {H} \left(\pi \left(\cdot \mid s _ {l}\right)\right)\right) \right], \tag {2} +$$ + +which does not include the policy entropy of the current time step but includes the sum of all future policy entropy and the sum of all current and future rewards. For given $\pi$ , soft policy evaluation guarantees the convergence of soft $Q$ -function estimation, which estimates $Q^{\pi}$ by iteratively applying a modified Bellman operator $\mathcal{T}^{\pi}$ to a real-valued estimate function $Q: \mathcal{S} \times \mathcal{A} \to \mathbb{R}$ , given by + +$$ +\mathcal {T} ^ {\pi} Q \left(s _ {t}, a _ {t}\right) = r _ {t} + \gamma \mathbb {E} _ {s _ {t + 1} \sim P (\cdot | s _ {t}, a _ {t})} [ V (s _ {t + 1}) ], \quad \text {w h e r e} \tag {3} +$$ + +$$ +V (s _ {t}) = \mathbb {E} _ {a _ {t} \sim \pi (\cdot | s _ {t})} [ Q (s _ {t}, a _ {t}) - \alpha \log \pi (a _ {t} | s _ {t}) ] +$$ + +and $V(s_{t})$ is the soft state value function. Then, at each iteration, SAC updates the policy as + +$$ +\begin{array}{l} \pi_ {n e w} = \underset {\pi \in \Pi} {\arg \min } D _ {K L} \left(\pi (\cdot | s _ {t}) | | \frac {\exp \left(Q ^ {\pi_ {o l d}} \left(s _ {t} , a _ {t}\right) / \alpha\right)}{Z ^ {\pi_ {o l d}} \left(s _ {t}\right)}\right) (4) \\ = \underset {\pi \in \Pi} {\arg \max } \mathbb {E} _ {a _ {t} \sim \pi (\cdot | s _ {t})} [ Q ^ {\pi_ {o l d}} (s _ {t}, a _ {t}) - \alpha \log \pi (a _ {t} | s _ {t}) ] (5) \\ \end{array} +$$ + +where $Z^{\pi_{old}}(s_t)$ is the log partition function which is a function of $s_t$ only. Soft policy improvement guarantees $Q^{\pi_{new}}(s_t, a_t) \geq Q^{\pi_{old}}(s_t, a_t)$ for all $(s_t, a_t) \in S \times \mathcal{A}$ . Finally, soft policy evaluation and soft policy improvement are repeated. Then, any initial policy $\pi \in \Pi$ converges to the optimal policy $\pi^*$ , i.e., $Q^{\pi^*}(s_t, a_t) \geq Q^{\pi'}(s_t, a_t)$ for all $\pi' \in \Pi$ and all $(s_t, a_t) \in S \times \mathcal{A}$ , and $\pi^*$ maximizes $J_{MaxEnt}$ [22]. Proof of soft policy iteration assumes finite MDPs. SAC approximates the soft policy iteration by sample-based learning with function approximation in continuous-space cases. + +# 4 Motivation: Limitation of Maximum Entropy SAC in Pure Exploration + +In this section, we will consider only the maximum entropy SAC in a pure exploration setup without the reward function (the reward function $r = 0$ in MDPs). As seen in Sec. 3, SAC efficiently solves the maximum entropy RL problem to maximize (1) in an iterative manner based on judiciously-defined state and action value functions and the step-wise optimization cost (5). The well-defined value functions and the local cost function as such enable proof of soft policy improvement for finite MDPs in a similar way to the proof of the classical policy improvement theorem. Note that at each time step, SAC updates the policy to maximize the cost (5), composed of two terms: $\mathbb{E}_{a_t \sim \pi(\cdot | s_t)}[Q^{\pi_{old}}(s_t, a_t)]$ and $\alpha \mathbb{E}_{a_t \sim \pi(\cdot | s_t)}[-\log \pi(a_t | s_t)] = \alpha \mathcal{H}(\pi(a_t | s_t))$ . As aforementioned, the soft $Q$ -function contains the sum of current and future rewards and the sum of only future policy entropy. Since we consider only the entropy terms without rewards here, the first term $\mathbb{E}_{a_t \sim \pi(\cdot | s_t)}[Q^{\pi_{old}}(s_t, a_t)]$ is the current estimate of the sum of future entropy when action $a_t$ is taken from policy $\pi$ at state $s_t$ , whereas the second term $\alpha \mathcal{H}(\pi(a_t | s_t))$ is the entropy of the policy $\pi$ itself. Hence, at each time step, SAC tries to update the policy $\pi$ to yield the maximum sum of the estimated future entropy and the policy entropy itself. Here, the term $\mathbb{E}_{a_t \sim \pi(\cdot | s_t)}[Q^{\pi_{old}}(s_t, a_t)]$ plays the role of guiding the policy towards the direction of high future entropy. + +Saturation: In sample-based update with function approximation, however, the SAC iteration does not yield the desired result, contrary to the intention behind maximum entropy. To see this, let us consider a pure exploration task in which there is no reward. The considered task is a $100 \times 100$ continuous 4-room maze proposed in [25], modified from the continuous grid map available at https://github.com/huyaoyu/GridMap. Fig. 1(a) shows the maze environment, where state is the $(x,y)$ -position of the agent in the map, action is $(dx,dy)$ bounded by $[-1,1] \times [-1,1]$ , and the next state of the agent is $(x + dx,y + dy)$ . Starting from the left-lower corner (0.5, 0.5), the agent explores the maze without any external reward. First, note that for this pure exploration task, the optimal policy maximizing $J_{MaxEnt}(\pi)$ is given by the uniform policy that selects all actions in $\mathcal{A} = [-1,1] \times [-1,1]$ uniformly regardless of the value of $s_t$ . This is because the uniform distribution has maximum entropy for a bounded space [13]. Then, we compare the exploration behaviour of SAC and the uniform policy in the maze task. Fig. 1(b) shows the mean accumulated number of different visited states averaged over 30 random seeds as time goes, where the shaded region in the curve represents standard deviation $(1\sigma)$ from the mean and a different state is meant as a nonoverlapping quantized $1 \times 1$ square. As seen in Fig. 1(b), SAC explores more states than the uniform policy at the early stage of learning. As learning progresses, however, SAC fails to visit new states after $300k$ time steps, whereas the uniform policy continues visiting new states. As a result, SAC eventually visits fewer states than the uniform policy on average. The result shows that SAC fails to converge to the optimal uniform policy and its performance becomes saturated. + +![](images/2d501f37c215be7866fd78da9e0efd9e7077b015841e4c28517a35f54a36a0e6.jpg) +(a) Continuous 4-room maze + +![](images/f554feea2790e48c749b7bc18833be9d52925d0cfa52205be379fd5d3c8c75a9.jpg) +(b) Number of state visits + +![](images/8676702c6af6a472a6d6b9fb6c9bcc7c3747ad69dd071ffd26886911443b2f55.jpg) +(c) Gradient of $Q$ -function +Figure 1: Comparison of SAC and the uniform policy in the continuous 4-room maze + +![](images/566c7e2f1151ca52e4e84aec32fac472646d2716f3ed0c0d6402b2945d1c6e1c.jpg) +(d) State histogram over 50k time steps starting from 300k, 350k, 400k, and 450k time steps (from the left in order) + +Narrow Exploration Radius: To examine the saturation behavior of SAC in the above pure exploration task, we investigate the policy update of SAC in (5). Since the current $Q$ -function estimate (implemented by a neural network) replaces $Q^{\pi_{old}}$ in (5) in implementation with function approximation, the policy update is rewritten as + +$$ +\underset {\pi \in \Pi} {\arg \max } \left\{\mathbb {E} _ {a _ {t} \sim \pi (\cdot | s _ {t})} [ Q (s _ {t}, a _ {t}) ] + \alpha \mathcal {H} (\pi (\cdot | s _ {t})) \right\}. \tag {6} +$$ + +As mentioned already, the first term $\mathbb{E}_{a_t\sim \pi (\cdot |s_t)}[Q(s_t,a_t)]$ is the current estimate of the sum of future entropy in this pure exploration case when action $a_{t}$ is taken from policy $\pi$ at state $s_t$ , whereas the second term $\alpha \mathcal{H}(\pi (a_t|s_t))$ is the entropy of the policy $\pi$ itself. The first term $\mathbb{E}_{a_t\sim \pi (\cdot |s_t)}[Q(s_t,a_t)]$ intends to direct the policy towards the direction of high future entropy. Note that maximizing the second term already yields the uniform policy, but the $Q$ -function term affects the policy update. In order to see how the $Q$ -function term actually affects the policy update, we differentiate the entropy coefficient $\alpha$ in the policy update part (5) or (6) as the policy entropy coefficient $\alpha_{\pi}$ and that in the soft value function part (2) and (3) as the value entropy coefficient $\alpha_{Q}$ . We fix $\alpha_{\pi}$ as $\alpha_{\pi} = 1$ and change $\alpha_{Q}$ as 0, 0.1, and 1 (note that the case of $\alpha_{Q} = 1$ is original SAC). With this change of $\alpha_{Q}$ , we conducted the same pure exploration maze task. Fig. 1(c) shows the average norm of the gradient of $Q$ -function with respect to action, i.e., $\mathbb{E}_{s_t\sim \mathcal{D}}[||\nabla_aQ(s_t,a)|_{a = a_t}||]$ over time with $a_{t}\sim \pi (\cdot |s_{t})$ and $s_t$ from a mini-batch drawn from the replay buffer $\mathcal{D}$ of SAC update, where the $Q$ neural network weights were initialized randomly. Fig. 1(d) shows the histogram of states that the policy visits over 50k time steps starting from 300k, 350k, 400k, and 450k time steps. When $\alpha_{Q} = 0$ with no reward, the $Q$ -function update by the Bellman operator $\mathcal{T}^{\pi}$ in (3) is trivial as $Q(s,a)\gets \mathbb{E}_{s^{\prime}\sim P(\cdot |s,a),a^{\prime}\sim \pi (\cdot |s^{\prime})}[Q(s^{\prime},a^{\prime})]$ , i.e., replacement. When the initial $Q(s,a)$ is (nearly) flat over $S\times A$ by initial random weight assignment for the $Q$ -neural network, the flat $Q$ is maintained by this trivial update. Indeed, it is seen in Fig. 1(c) that $\mathbb{E}_{s_t\sim \mathcal{D}}[||\nabla_aQ(s_t,a)|_{a = a_t}||]$ with $a_{t}\sim \pi (\cdot |s_{t})$ is nearly zero across all time for $\alpha_{Q} = 0$ . With a flat function $Q(s_{t},\cdot)\approx c$ over the action space $\mathcal{A}$ , the first term $\mathbb{E}_{a_t\sim \pi (\cdot |s_t)}[Q(s_t,a_t)]$ in (6) does not affect the policy update, only the second term $\mathcal{H}(\pi (\cdot |s_t))$ works, and thus the policy update yields $\pi$ to converge to the uniform policy for every state maximizing the total entropy. Hence, the exploration radius in the case of $\alpha_{Q} = 0$ is almost the same as that of the uniform policy, as seen in Fig. 1(d). When $\alpha_{Q} > 0$ , on the other hand, the $Q$ -function starts to be updated nontrivially by the Bellman operator $\mathcal{T}^{\pi}$ in (3) due to the $-\log \pi (a_{t + 1}|s_{t + 1})$ term in $V(s_{t + 1})$ in (3), with $\pi$ given by the current policy. It is now seen in Fig. 1(c) that $\mathbb{E}_{s_t\sim \mathcal{D}}[||\nabla_aQ(s_t,a)|_{a = a_t}||]$ is not zero anymore and the gradient norm becomes larger as $\alpha_{Q}$ increases from 0.1 to 1.0. Non-zero $\mathbb{E}_{s_t\sim \mathcal{D}}[||\nabla_aQ(s_t,a)|_{a = a_t}||]$ means that $Q(s_{t},\cdot)$ as a function of action $a_{t}$ for given $s_t$ is not flat anymore and the first term in (6) affects the policy update so that the policy is updated for the direction of high $Q$ -value (with intention for high future entropy) as well + +![](images/af3fa473c93a956953b69472262cdeaad7c43cac39559f8da9773b695ea1a951.jpg) +(a) Number of state visits + +![](images/008ebe96b3f634f50f4d053659c523941e476150c6d69d022ab8dcb386896ea1.jpg) + +![](images/7249e59f6c52a63a6dbed7d76cd3f06ca9e31c0eeac0616dac77540b48020ec5.jpg) +(c) Empirical entropy + +![](images/312154fe99e747253e0e7d3e49f89da824b9d9f2718000c7d61567e2457fff41.jpg) +(b) $Q$ -value difference +(d) Cross-section of $Q$ -function and $\log \pi$ along the action line at square center +Figure 2: Analysis on sample trajectories of SAC in the continuous maze task + +as high policy entropy $\mathcal{H}(\pi)$ . As seen in Fig. 1(d), however, the exploration radius reduces as $\alpha_{Q}$ increases from 0 to 1. The iteration process does not evolve for wider exploration as intended. + +# 5 Methodology + +# 5.1 A Deeper Look at Pure Exploration + +In order to propose our new approach overcoming the limitation of SAC implementation of the maximum entropy framework, we first take a deeper look at how the $Q$ -function term in (6) hinders exploration, as SAC (with $\alpha_{\pi} = \alpha_{Q} = 1$ ) learns the maze task. For this, we consider four $2 \times 2$ squares centered at $(5,5)$ , $(10,10)$ , $(20,20)$ , and $(30,30)$ in the $100 \times 100$ maze, where every episode starts from $(0.5,0.5)$ . Fig. 2(a) shows the number of accumulated visits to each square as time elapses. Figs. 2(b) and 2(c) show the estimated $Q$ value and the average empirical entropy of each square, respectively, as time goes. For Fig. 2(b), every 1000 time steps, we sampled 1000 states uniformly from each square and an action from the current policy for each sampled state, and computed the $Q$ -value average over the 1000 state-action samples for each square. Then, we computed the mean value of the four average values of the four squares. Fig. 2(b) shows the average $Q$ value of each square relative to the four-square mean value as time goes. For Fig 2(c), every 1000 time steps, we sampled 1000 states uniformly from each square and computed the average empirical entropy $\mathbb{E}_{s_t}[\mathbb{E}_{a_t \sim \pi(\cdot|s_t)}[-\log \pi(a_t|s_t)]]$ of the current policy $\pi$ at time $t$ averaged over the 1000 sampled states $\{s_t\}$ from each square. The upper row of Fig. 2(d) shows the cross-section of the estimate $Q$ -function $Q(s,a)$ along the diagonal action line from $(-1,-1)$ to $(1,1)$ at the center state $s$ of each square, as time goes, where each curve is shifted in $y$ -axis so that the mean value averaged over samples along the action line is matched to zero in $y$ -axis. The lower row of Fig. 2(d) shows the value of $\log \pi(a|s)$ of the current policy $\pi$ at time step $t$ along the diagonal action line from $(-1,-1)$ to $(1,1)$ at the center state $s$ for each square as time goes, where the curve is shifted in $y$ -axis to match the mean value to zero in $y$ -axis. + +First, note from Fig. 2(a) that the farther a state is from the starting point $(0.5,0.5)$ , the less the agent visits the state, and the visitation difference is large. At the early stage of learning starting with random $Q$ -network weight initialization and random policy-network weight initialization, there is little $Q$ -value difference with respect to either state or action, as seen in Figs. 2(b) and 2(d), so the entropy term is dominant in the policy update (6) and the policy entropy increases with the policy distribution approaching the uniform distribution, as seen in Fig. 2(c). As time goes, learning of + +the $Q$ -function with the Bellman backup (3) progresses. Basically, the Bellman backup (3) with no reward adds $\Delta Q_{t} = \gamma \{\mathbb{E}_{a_{t + 1}\sim \pi (\cdot |s_{t + 1})}[Q(s_{t + 1},a_{t + 1})] + \alpha \mathcal{H}(\pi (\cdot |s_{t + 1}))\} -Q(s_{t},a_{t})$ to $Q(s_{t},a_{t})$ for every $(s_t,a_t)\in S\times A$ . However, this is approximated in practical RL. In sample-based off-policy learning with function approximation, RL typically stores visited state-action pairs in the replay buffer $\mathcal{D}$ and the above Bellman backup is approximated as updating the $Q$ -function by minimizing the loss $\mathbb{E}_{(s_t,a_t)\sim \mathcal{D}}[(Q(s_t,a_t) - Q^{target}(s_t,a_t))^2]$ based on a mini-batch uniformly drawn from the buffer. Under this off-policy learning with experience replay, when the initial $Q$ -function is roughly flat and small, $\Delta Q_{t}$ soon becomes positive (the policy update increases the entropy of the visited states and $\Delta Q_{t}$ soon becomes positive for the visited states), and hence the $Q$ -values of frequently-visited states are updated more and thus have higher $Q$ -values as seen in Fig.2(b). This is because these states are stored more into $\mathcal{D}$ and sampled more from $\mathcal{D}$ at mini-batch generation. Then, the initial $Q$ -value difference biases the policy to visit the states with high $Q$ -values more frequently than the states with low $Q$ -values because the policy is updated to choose actions that maximizes the expectation of $Q$ -value $\mathbb{E}_{a_t\sim \pi (\cdot |s_t)}[Q(s_t,a_t)]$ in the policy update (6). This is evident in the Fig. 2(d), which shows the estimate of $Q$ -function and the value of $\log \pi$ along the diagonal line. At the early stage of learning (10k time step in the figure), $Q$ -function is roughly flat and the policy is almost close to the uniform distribution for the action line. As the time steps go on, the $Q$ -values of actions close to $(-1, - 1)$ becomes higher than the $Q$ -value of actions near $(1,1)$ due to the off-policy learning with experience replay, as explained above. Then, the policy is updated to choose actions with high $Q$ -values more frequently to maximize the $Q$ -value expectation, so the probability of choosing action $(-1, - 1)$ towards the left-lower corner becomes higher than that of action $(1,1)$ for the opposite direction. As the policy distribution leans toward a certain action and becomes asymmetric away from uniformity, the policy entropy decreases further. As seen in Fig. 2(c), the speed of the policy entropy decrease varies depending on the $Q$ -value difference along the action line in Fig. 2(d), and the policy entropy difference deepens the $Q$ -value difference between states in Fig. 2(b) because the $Q$ -value estimates the policy entropy sum of future states. This positive feedback continues until saturation, as seen in Fig. 2(b), and it results in the narrow exploration radius in Fig. 1(d) because the policy will be forced to visit states with high $Q$ -values only. Note that this positive feedback reduces the policy entropy due to the $Q$ -value difference, contrary to the intention behind maximum entropy. + +# 5.2 Max-Min Entropy RL + +In order to break the unwanted positive feedback loop occurring when implementing the maximum entropy framework (i.e., max-max entropy framework) in the previous subsection, we must reduce the policy entropy difference between states to reduce the $Q$ -value difference between states in the feedback loop. For this, we aim to learn the $Q$ -function so that the policy visits states with low entropy, and the policy update increases the policy entropy of these low-entropy states. Under this principle, we propose a new max-min entropy (MME) framework that aims to learn the $Q$ -function to estimate the negative sum of policy entropy, while maintaining the policy entropy maximization term $\mathcal{H}(\pi (\cdot |s_t))$ in the policy update to increase the policy entropy of the visited states. Thus, we define the reversed soft $Q$ -function $Q_{R}^{\pi}(s_{t},a_{t})$ for MME as + +$$ +Q _ {R} ^ {\pi} \left(s _ {t}, a _ {t}\right) := r _ {t} + \mathbb {E} _ {\tau_ {t + 1} \sim \pi} \left[ \sum_ {l = t + 1} ^ {\infty} \gamma^ {l - t} \left(r _ {l} - \alpha_ {Q} \mathcal {H} \left(\pi \left(\cdot \mid s _ {l}\right)\right)\right) \right], \tag {7} +$$ + +whereas the original soft $Q$ -function of SAC in (2) is given by + +$$ +Q ^ {\pi} \left(s _ {t}, a _ {t}\right) := r _ {t} + \mathbb {E} _ {\tau_ {t + 1} \sim \pi} \left[ \sum_ {l = t + 1} ^ {\infty} \gamma^ {l - t} \left(r _ {l} + \alpha_ {\pi} \mathcal {H} \left(\pi (\cdot | s _ {l})\right)\right) \right]. +$$ + +Note that the original soft $Q$ -function $Q^{\pi}$ adds the policy entropy to the reward and drives the policy to visit states with high entropy. On the other hand, our reversed soft $Q$ -function subtracts the policy entropy from the reward and drives the policy to visit states with low entropy. In this sense, we call $Q_R$ as the "reversed" soft $Q$ -function because it desires the reverse behavior of soft $Q$ -function. + +Then, $Q_R^\pi$ is estimated by a real-valued function $Q_R: S \times \mathcal{A} \to \mathbb{R}$ based on a Bellman operator $T_R^\pi$ : + +$$ +\mathcal {T} _ {R} ^ {\pi} Q _ {R} \left(s _ {t}, a _ {t}\right) = r _ {t} + \gamma \mathbb {E} _ {s _ {t + 1} \sim P \left(\cdot \mid s _ {t}, a _ {t}\right)} \left[ V _ {R} \left(s _ {t + 1}\right) \right], \tag {8} +$$ + +where $V_{R}(s_{t}) = \mathbb{E}_{a_{t}\sim \pi (\cdot |s_{t})}[Q_{R}(s_{t},a_{t}) + \alpha_{Q}\log \pi (a_{t}|s_{t})]$ is the reversed soft state value function. At each iteration, the policy of MME is updated as + +$$ +\pi_ {n e w} = \underset {\pi \in \Pi} {\arg \max } \mathbb {E} _ {a _ {t} \sim \pi (\cdot | s _ {t})} \left[ Q _ {R} ^ {\pi_ {o l d}} \left(s _ {t}, a _ {t}\right) - \alpha_ {\pi} \log \pi \left(a _ {t} \mid s _ {t}\right) \right], \tag {9} +$$ + +where $Q_{R}^{\pi_{old}}$ is substituted by the estimate function $Q_{R}$ at the iteration. Then, in pure exploration with no reward $r_t = 0, \forall t$ , the policy of MME will visit the states with low entropy due to the first term $\mathbb{E}_{a_t \sim \pi(\cdot | s_t)}[Q_{R}^{\pi_{old}}(s_t, a_t)]$ , and the policy entropy of those states will increase by the second term $\mathbb{E}_{a_t \sim \pi(\cdot | s_t)}[-\log \pi(a_t | s_t)] = \mathcal{H}(\pi(\cdot | s_t))$ , as we intended. Note that the behaviour of the proposed method follows the max-min principle [11], so we expect that our MME fairly increase the policy entropy of all states based on the fairness perspective of max-min optimization, whereas SAC increases the policy entropy of states with high entropy only. The MME is expected to reduce the entropy difference and the $Q$ -value difference between states to reduce the unwanted feedback loop and solve the saturation problem. Furthermore, SAC considers the same entropy coefficient $\alpha_{\pi}$ for its policy update and the soft $Q$ -function $Q^{\pi}$ , but our MME distinguishes the policy entropy coefficient $\alpha_{\pi}$ in the policy update (9) and the value-entropy coefficient $\alpha_{Q}$ in the reversed soft $Q$ -function $Q_{R}^{\pi}$ in (7), as we experimented in Section 4. Changing $\alpha_{Q}$ and $\alpha_{\pi}$ allows for us to control the amount of the reversed $Q$ -function in the policy update, and it will determine the ratio between the exploration due to the policy entropy and the exploration due to the reversed soft $Q$ -function. + +In actual implementation, the negative entropy in (7) is plus-offsetted to make the $Q$ -update increase the $Q$ -value. The detailed implementation and algorithm of MME are provided in Appendix A. + +# 5.3 Disentangled Exploration and Exploitation for Rewarded Setup + +In the previous subsection, we considered the problem from a pure exploration perspective. However, the ultimate goal of RL is to maximize the sum of rewards in rewarded environments, and the goal of exploration is to receive higher rewards without falling into local optima. With non-zero reward in (7) - (9), the policy will not only visit states with low entropy but also states with higher return. In this case, the reward and the entropy are intertwined in the $Q$ -function and then it is difficult to expect the intended MME exploration behavior through the intertwined $Q$ -function. Therefore, we disentangle exploration from exploitation for rewarded setup, as considered in several previous works [7, 49], and propose disentangled MME (DE-MME) for rewarded setup. For this, we consider two policies: pure exploration policy $\pi_E$ that samples actions for pure exploration as described in Sec. 5.2, and target policy $\pi_T$ that actually interacts with the environment. We decompose the reversed soft $Q$ -function $Q_R^\pi$ in (7) into two terms $Q_R^\pi = Q_{R,R}^\pi + Q_{R,E}^\pi$ , where $Q_{R,R}^{\pi}$ is the expected current and future reward sum considered in standard RL and $Q_{R,E}^{\pi}$ is the expected sum of future entropy: + +$$ +Q _ {R, R} ^ {\pi} (s _ {t}, a _ {t}) = r _ {t} + \mathbb {E} _ {\tau_ {t + 1} \sim \pi} \left[ \sum_ {l = t + 1} ^ {\infty} \gamma^ {l - t} r _ {l} \right], Q _ {R, E} ^ {\pi} (s _ {t}, a _ {t}) = - \alpha_ {Q} \mathbb {E} _ {\tau_ {t + 1} \sim \pi} \left[ \sum_ {l = t + 1} ^ {\infty} \gamma^ {l - t} \mathcal {H} (\pi (\cdot | s _ {t})) \right]. +$$ + +Then, we update the policy $\pi_{E}$ for pure exploration as + +$$ +\pi_ {E, n e w} = \underset {\pi^ {\prime} \in \Pi} {\arg \max } \mathbb {E} _ {a _ {t} \sim \pi^ {\prime} (\cdot | s _ {t})} \left[ Q _ {R, E} ^ {\pi_ {E, o l d}} \left(s _ {t}, a _ {t}\right) - \alpha_ {\pi} \log \pi^ {\prime} \left(a _ {t} \mid s _ {t}\right) \right]. \tag {10} +$$ + +Note that increasing the expectation of $Q_{R,E}^{\pi_{E,old}}$ makes the policy visit states with low entropy of $\pi_E$ , as we intended in the pure exploration case in Sec. 5.2. Finally, we update the target policy $\pi_T$ by using $Q_{R,E}^{\pi_{E,old}}$ as + +$$ +\pi_ {T, n e w} = \underset {\pi^ {\prime} \in \Pi} {\arg \max } \mathbb {E} _ {a _ {t} \sim \pi^ {\prime} (\cdot | s _ {t})} \left[ Q _ {R, R} ^ {\pi_ {T, o l d}} (s _ {t}, a _ {t}) + Q _ {R, E} ^ {\pi_ {E, o l d}} (s _ {t}, a _ {t}) - \alpha_ {\pi} \log \pi^ {\prime} (a _ {t} | s _ {t}) \right]. \tag {11} +$$ + +For implementation, $Q_{R,R}^{\pi T,old}$ and $Q_{R,E}^{\pi E,old}$ are estimated by real-valued functions $Q_{R,R}$ and $Q_{R,E}$ based on their own Bellman operators (see Appendix A). Note that the policy update (9) in Sec. 5.2 can be expressed as maximizing $\mathbb{E}_{a_t\sim \pi '(\cdot |s_t)}[Q_R^{\pi_T,old}(s_t,a_t) - \alpha_\pi \log \pi '(a_t|s_t)]$ over the target policy, where $Q_{R}^{\pi_{T,old}} = Q_{R,R}^{\pi_{T,old}} + Q_{R,E}^{\pi_{T,old}}$ . Thus, we can view that the policy update in (11) replaces $Q_{R,E}^{\pi_{T,old}}$ in the previous policy update (9) with $Q_{R,E}^{\pi_{E,old}}$ to disentangle exploration from exploitation. In this way, the policy update (11) will simultaneously increase the expectation of $Q_{R,R}^{\pi T,old}$ to maximize the reward sum, the expectation of $Q_{R,E}^{\pi E,old}$ to visit states with low entropy, and the policy entropy for diverse action. The detailed implementation and algorithm for DE-MME are provided in Appendix A. + +# 6 Experiments + +We provide numerical results to show the performance of the proposed MME and DE-MME in pure exploration and various control tasks. We provide source code for the proposed method at + +![](images/97bf53d7132996a67072e3a6455775d0ecff73cf4277ec2e2809af285b259343.jpg) +(a) Number of visited states + +![](images/0d353b981b7611fa0bbfc28bc7e69eab68329edf5b2da22a6a7b94d099ebf01d.jpg) +(b) State histogram of every 50k steps after 300k steps +Figure 3: Comparison of MME (Proposed), SAC, and the uniform policy in the 4-room maze + +http://github.com/seungyulhan/mme/ that requires Python Tensorflow. For all plots, the solid line represents the mean over random seeds and the shaded region represents 1 standard deviation from the mean. + +# 6.1 Pure Exploration + +To see how the proposed method behaves in pure exploration, we considered the maze task described in Sec.4 again. We compared the exploration performance of MME in Sec.5.2, SAC, and the uniform policy. For MME, we considered several $\alpha_{Q} \in \{0.1, 0.2, 0.5, 1, 2, 5, 10\}$ with $\alpha_{\pi} = 1$ . Fig. 3(a) in the next page shows the mean number of accumulated quantized visited states averaged over 30 random seeds corresponding to Fig. 1(b), and Fig. 3(b) shows the + +![](images/37e99d0dcc3261d670d79e5ee67dd5ee54d221c0a22a0af1ddc59a0297141858.jpg) +(a) $Q$ -value difference +Figure 4: Performance of MME + +![](images/7532d69da6ab49ab18d03235320831833cb0949d229c3ee61849872b930edea8.jpg) +(b) Empirical entropy + +A histogram of visited states, of which setup is the same as Fig.1(d). As seen in Fig. 3(a), the proposed MME visits much more states than SAC or the uniform policy. In addition, we observe that MME continues discovering new states throughout the learning, while SAC rarely visits new states as learning progresses. As seen in Fig. 3(b), MME explores far and rare states as compared to SAC or the uniform policy, and this leads to a large enhancement in exploration performance, as intended in Sec. 5.2. Note that the larger $\alpha_{Q}$ in update (7) (9) with $r_t = 0$ , the stronger is the effect of the $Q$ -function term to visit states with low entropy and the weaker is the effect of the policy entropy term to explore widely in the action space, as we expected in Section 5.2. Hence, there is a trade-off between the two terms and $\alpha_{Q} = 0.5$ seems best in the maze task when $\alpha_{\pi} = 1.0$ , as seen in Fig. 3(a). Thus, the result clearly shows why we distinguish the policy entropy coefficient $\alpha_{\pi}$ and the value entropy coefficient $\alpha_{Q}$ for MME, whereas SAC uses the common entropy coefficient $\alpha = \alpha_{\pi} = \alpha_{Q}$ . We also plotted the $Q$ -value difference and the empirical entropy of the four squares centered at (5,5), (10,10), (20,20) and (30,30) for MME, as done in Figs. 2(b) and 2(c). The result is shown in Fig. 4. It is seen that the $Q$ -value difference and the entropy difference among the states are clearly reduced as compared to Figs. 2(b) and 2(c). It means that MME breaks the unwanted positive feedback loop and improves the policy entropy of diverse states more uniformly as compared to SAC in terms of fairness under our max-min framework. This leads to better exploration, as seen in Fig 3. + +# 6.2 Performance in Rewarded Environments + +As mentioned in Sec.5.3, the ultimate goal of RL is to maximize the reward sum in rewarded environments and exploration is one of the means to achieve this goal. Based on the enhanced + +![](images/8e04b1c82c1bcbc46d9585a4aec6f2e1d94c065f9e632f639c74de77a16200d0.jpg) +(a) SparseHopper-v1 + +![](images/efba42f4b5eb18340b68cc04e246cddca2a1c1fb4f700aedb458498ecb5c98b1.jpg) +(b) SparseHalfCheetah-v1 + +![](images/343d5262eae15d4e4d92cb28e09e21a171ddd259b7a6026c074af5482d8147d9.jpg) +(c) SparseWalker2d-v1 + +![](images/6c48ffe17b25f8f1b4ca6deb72c56abbe1bb3d97f1651050e6d67caa93528559.jpg) +(d) SparseAnt-v1 + +![](images/fa593bc8b7f581e825c3e948defa1a2f743081407c7ec2bf35ec8d686bc84a46.jpg) +Figure 5: Performance comparison on Sparse Mujoco tasks +(a) Del.Hopper-v1 + +![](images/243278ed03ff39f4a71f53ed08e92a760b52c34d650be2a40573dff71db54427.jpg) +(b) Del.HalfCheetah-v1 +Figure 6: Performance comparison on Delayed Mujoco tasks + +![](images/681b89d20204783da5ee5a87dc5981f62a9f378aaeaf3f56803406dc43f47801.jpg) +(c) Del.Walker2d-v1 + +![](images/02e149795901a32ec14bc791eec6c5cbeb1fc6a911673f7502c1eafc29e9eda5.jpg) +(d) Del.Ant-v1 + +exploration performance of MME, we expect MME/DE-MME to show good performance in rewarded environments too. In order to verify this, we considered three types of difficult control tasks for which current state-of-the-art RL algorithms do not show satisfactory performance: Two types of sparse-reward tasks (SparseMujoco tasks and DelayedMujoco tasks) and high dimensional Humanoid tasks. SparseMujoco [27, 35] is a sparse version of Mujoco [52] in OpenAI Gym [8], and the reward is 1 if the agent crosses the $x$ -axis threshold $\tau$ , otherwise 0. DelayedMujoco [19, 57] is a delayed version of Mujoco in which the reward is accumulated for $D$ time steps and the agent receives the accumulated reward sum once every $D$ time steps. During the accumulation time, the agent receives no reward. These sparse-reward environments have widely been considered as challenging environments for validating the performance of exploration in many previous works [9, 25, 27]. + +First, we compared the performance of MME algorithms to that of maximum entropy SAC in the sparse-reward tasks. For MME, we considered two versions: vanilla MME proposed in Sec.5.2, and disentangled MME (DE-MME) proposed in Sec.5.3. For MME/DE-MME, we fixed $\alpha_{\pi}$ of MME and DE-MME to be equal to $\alpha$ of SAC, and chose proper $\alpha_{Q}$ for each task. Detailed experimental setup is provided in Appendix B. Figs. 5 and 6 show the performance averaged over 10 random seeds on SparseMujoco tasks and 5 random seeds on DelayedMujoco tasks, respectively. It is seen that the proposed MME shows much higher performance than SAC in the considered environments with rewards. It is also seen that MME itself performs well enough in most environments but DE-MME indeed yields performance gain over vanilla MME and the gain is large in SparseWalker. Thus, disentanglement of exploration from exploitation is beneficial to MME for better reward performance in rewarded environments, as discussed in Sec.5.3. We provided the corresponding max average return tables in Appendix C and ablation study for further analysis in Appendix D. There, one of ablation study empirically shows that the performance enhancement by MME is caused by improved exploration of MME as we intended. + +Finally, we compared the performance of MME/DE-MME to that of popular general RL algorithms and recent exploration methods on the considered sparse-reward environments (SparseMujoco and DelayedMujoco tasks) and dense-reward high-dimensional Mujoco tasks (Humanoid, Humanoid-Standup). We considered several action-based exploration methods: SAC combined with divergence [27] (SAC-Div) and diversity actor-critic (DAC) [25], and state-based exploration methods with random network distillation (RND) [9] and MaxEnt (State) [26]. For general RL algorithms, we considered several on-policy RL algorithms: proximal policy optimization (PPO) [48] and trust-region policy optimization (TRPO) [47], and entropy-based off-policy RL algorithms: soft Q-learning (SQL) [21] and SAC [22]. We provided detailed explanation and implementation for each algorithm in Appendix C. Table 1 summarizes the max average return result. It is seen that MME/DE-MME have superior performance to other methods. + +
MMEDE-MMEDACSAC-DivRNDMaxEnt(State)
Sps.Hopper902.50±4.36893.30±6.72900.30±3.93817.40±253.54897.90±6.06879.50±30.96
Sps.HalfCheetah903.50±34.97924.90±39.57915.90±50.71394.70±405.53827.80±85.61924.70±24.44
Sps.Walker2d818.00±208.60886.60±25.77665.10±355.66278.50±398.23750.90±179.09705.30±274.88
Sps.Ant953.70±28.39973.60±12.55935.80±37.08870.70±121.14920.60±107.50940.70±43.84
Del.Hopper3421.32±88.293435.28±39.553428.18±69.082090.64±1383.832721.06±1199.203254.10±30.75
Del.HalfCheetah7299.28±1562.198451.20±1375.277594.70±1259.234080.67±3418.077429.94±1383.757907.98±535.41
Del.Walker2d5148.58±193.785274.89±186.354067.11±257.814048.11±290.484098.63±683.364430.61±347.02
Del.Ant4664.04±836.374851.64±830.884243.19±795.493978.34±1370.231361.36±704.691156.61±112.40
MMEDE-MMESACSQLPPOTRPO
Humanoid-267734.03250935.53167394.36138996.84160211.90153919.84
Standup±74302.99±49386.43±7291.99±33903.03±3268.37±1575.62
Humanoid9080.54±768.528607.75±570.616760.81±267.785010.72±248.596153.54±246.955730.74±455.90
+ +Table 1: Max average return of MME/DE-MME and other recent RL algorithms + +# 7 Conclusion + +In this paper, we have proposed a MME framework for RL to resolve the unwanted exploration behavior of maximum entropy RL in off-policy learning with function approximation. In pure exploration, to implement MME, we train the $Q$ -function to visit states with low entropy contrary to the maximum entropy strategy, while maintaining the policy entropy maximization term in the policy update. Then, we extended MME to rewarded environments. In rewarded environments we disentangle exploration from exploitation for MME to explore diverse states as in pure exploration as well as to achieve high return. Numerical results show that the proposed MME explores farther and wider in the state space than maximum entropy realization, alleviates possible positive feedback of off-policy maximum entropy learning, and yields a significant enhancement in exploration and final performance over existing RL methods in various difficult tasks. As for potential impacts, RL can be applied to sensitive areas that require control, such as drone control. However, it is only a risk that RL itself has, and it is not very relevant to the work that we are trying to address in this paper. + +# 8 Acknowledgement + +This work is supported by Center for Applied Research in Artificial Intelligence (CARAI) grant funded by Defense Acquisition Program Administration (DAPA) and Agency for Defense Development (ADD) (UD190031RD). Dr. Seungyul Han is currently with AI Graduate School of UNIST and his work is partly supported by Artificial Intelligence Graduate School support (UNIST), Institute of Information & Communications Technology Planning & Evaluation (IITP) grant funded by the Korea government (MSIT) (No.2020-0-01336). + +# References + +[1] Joshua Achiam and Shankar Sastry. Surprise-based intrinsic motivation for deep reinforcement learning. arXiv preprint arXiv:1703.01732, 2017. +[2] Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein generative adversarial networks. In International conference on machine learning, pages 214-223. PMLR, 2017. +[3] Adrià Puigdomènech Badia, Pablo Sprechmann, Alex Vitvitskyi, Daniel Guo, Bilal Piot, Steven Kapturowski, Olivier Tieleman, Martin Arjovsky, Alexander Pritzel, Andew Bolt, et al. Never give up: Learning directed exploration strategies. arXiv preprint arXiv:2002.06038, 2020. +[4] Sina Baharlouei, Maher Nouiehed, Ahmad Beirami, and Meisam Razaviyayn. R\`enyi fair inference. arXiv preprint arXiv:1906.12005, 2019. +[5] Gianluca Baldassarre and Marco Mirolli. Intrinsically motivated learning in natural and artificial systems. Springer, 2013. +[6] Babak Barazandeh and Meisam Razaviyayn. Solving non-convex non-differentiable min-max games using proximal gradient method. In ICASSP 2020-2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 3162-3166. IEEE, 2020. +[7] Lucas Beyer, Damien Vincent, Olivier Teboul, Sylvain Gelly, Matthieu Geist, and Olivier Pietquin. Mulex: Disentangling exploitation from exploration in deep rl. arXiv preprint arXiv:1907.00868, 2019. +[8] Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym. arXiv preprint arXiv:1606.01540, 2016. +[9] Yuri Burda, Harrison Edwards, Amos Storkey, and Oleg Klimov. Exploration by random network distillation. arXiv preprint arXiv:1810.12894, 2018. +[10] Nuttapong Chentanez, Andrew G Barto, and Satinder P Singh. Intrinsically motivated reinforcement learning. In Advances in neural information processing systems, pages 1281-1288, 2005. +[11] Altannar Chinchuluun, Panos M Pardalos, Athanasios Migdalas, and Leonidas Pitsoulis. Pareto optimality, game theory and equilibria. Springer, 2008. +[12] Jongwook Choi, Yijie Guo, Marcin Moczulski, Junhyuk Oh, Neal Wu, Mohammad Norouzi, and Honglak Lee. Contingency-aware exploration in reinforcement learning. arXiv preprint arXiv:1811.01483, 2018. +[13] Thomas M Cover. Elements of information theory. John Wiley & Sons, 1999. +[14] Prafulla Dhariwal, Christopher Hesse, Oleg Klimov, Alex Nichol, Matthias Plappert, Alec Radford, John Schulman, Szymon Sidor, Yuhuai Wu, and Peter Zhokhov. Openai baselines. https://github.com/openai/baselines, 2017. +[15] Benjamin Eysenbach and Sergey Levine. Maximum entropy rl (provably) solves some robust rl problems. arXiv preprint arXiv:2103.06257, 2021. +[16] Scott Fujimoto, Herke van Hoof, and Dave Meger. Addressing function approximation error in actor-critic methods. arXiv preprint arXiv:1802.09477, 2018. +[17] Gauthier Gidel, Tony Jebara, and Simon Lacoste-Julien. Frank-wolfe algorithms for saddle point problems. In Artificial Intelligence and Statistics, pages 362-371. PMLR, 2017. +[18] 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, pages 2672–2680, 2014. +[19] Yijie Guo, Junhyuk Oh, Satinder Singh, and Honglak Lee. Generative adversarial self-imitation learning. arXiv preprint arXiv:1812.00950, 2018. + +[20] Tuomas Haarnoja, Sehoon Ha, Aurick Zhou, Jie Tan, George Tucker, and Sergey Levine. Learning to walk via deep reinforcement learning. arXiv preprint arXiv:1812.11103, 2018. +[21] Tuomas Haarnoja, Haoran Tang, Pieter Abbeel, and Sergey Levine. Reinforcement learning with deep energy-based policies. arXiv preprint arXiv:1702.08165, 2017. +[22] Tuomas Haarnoja, Aurick Zhou, Pieter Abbeel, and Sergey Levine. Soft actor-critic: Off-policy maximum entropy deep reinforcement learning with a stochastic actor. arXiv preprint arXiv:1801.01290, 2018. +[23] Tuomas Haarnoja, Aurick Zhou, Kristian Hartikainen, George Tucker, Sehoon Ha, Jie Tan, Vikash Kumar, Henry Zhu, Abhishek Gupta, Pieter Abbeel, et al. Soft actor-critic algorithms and applications. arXiv preprint arXiv:1812.05905, 2018. +[24] E Yazdandoost Hamedani, A Jalilzadeh, NS Aybat, and UV Shanbhag. Iteration complexity of randomized primal-dual methods for convex-concave saddle point problems. arXiv preprint arXiv:1806.04118, 2018. +[25] Seungyul Han and Youngchul Sung. Diversity actor-critic: Sample-aware entropy regularization for sample-efficient exploration. arXiv preprint arXiv:2006.01419, 2020. +[26] Elad Hazan, Sham Kakade, Karan Singh, and Abby Van Soest. Provably efficient maximum entropy exploration. In International Conference on Machine Learning, pages 2681-2691. PMLR, 2019. +[27] Zhang-Wei Hong, Tzu-Yun Shann, Shih-Yang Su, Yi-Hsiang Chang, Tsu-Jui Fu, and Chun-Yi Lee. Diversity-driven exploration strategy for deep reinforcement learning. In Advances in Neural Information Processing Systems, pages 10489–10500, 2018. +[28] Rein Houthooft, Xi Chen, Yan Duan, John Schulman, Filip De Turck, and Pieter Abbeel. Vime: Variational information maximizing exploration. In Advances in Neural Information Processing Systems, pages 1109-1117, 2016. +[29] Shiyu Huang, Hang Su, Jun Zhu, and Ting Chen. Svqn: Sequential variational soft q-learning networks. In International Conference on Learning Representations, 2019. +[30] Sergey Levine and Vladlen Koltun. Guided policy search. In International Conference on Machine Learning, pages 1-9, 2013. +[31] Ya-Feng Liu, Yu-Hong Dai, and Zhi-Quan Luo. Max-min fairness linear transceiver design for a multi-user mimo interference channel. IEEE Transactions on Signal Processing, 61(9):2413-2423, 2013. +[32] Manuel Lopes, Tobias Lang, Marc Toussaint, and Pierre-Yves Oudeyer. Exploration in model-based reinforcement learning by empirically estimating learning progress. In Advances in neural information processing systems, pages 206-214, 2012. +[33] Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017. +[34] Jarryd Martin, Suraj Narayanan Sasikumar, Tom Everitt, and Marcus Hutter. Count-based exploration in feature space for reinforcement learning. arXiv preprint arXiv:1706.08090, 2017. +[35] Bogdan Mazoure, Thang Doan, Audrey Durand, R Devon Hjelm, and Joelle Pineau. Leveraging exploration in off-policy algorithms via normalizing flows. arXiv preprint arXiv:1905.06893, 2019. +[36] 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. +[37] Katta G Murty and Santosh N Kabadi. Some np-complete problems in quadratic and nonlinear programming. Technical report, 1985. + +[38] Ofir Nachum, Mohammad Norouzi, Kelvin Xu, and Dale Schuurmans. Bridging the gap between value and policy based reinforcement learning. In Advances in Neural Information Processing Systems, pages 2775-2785, 2017. +[39] Ofir Nachum, Mohammad Norouzi, Kelvin Xu, and Dale Schuurmans. Trust-pcl: An off-policy trust region method for continuous control. arXiv preprint arXiv:1707.01891, 2017. +[40] Gerhard Neumann et al. Variational inference for policy search in changing situations. In Proceedings of the 28th International Conference on Machine Learning, ICML 2011, pages 817-824, 2011. +[41] Maher Nouiehed, Maziar Sanjabi, Tianjian Huang, Jason D Lee, and Meisam Razaviyayn. Solving a class of non-convex min-max games using iterative first order methods. arXiv preprint arXiv:1902.08297, 2019. +[42] Brendan O'Donoghue, Remi Munos, Koray Kavukcuoglu, and Volodymyr Mnih. Combining policy gradient and q-learning. arXiv preprint arXiv:1611.01626, 2016. +[43] Hassan Rafique, Mingrui Liu, Qihang Lin, and Tianbao Yang. Non-convex min-max optimization: Provable algorithms and applications in machine learning. arXiv preprint arXiv:1810.02060, 2018. +[44] Alexander Rakhlin and Karthik Sridharan. Optimization, learning, and games with predictable sequences. arXiv preprint arXiv:1311.1869, 2013. +[45] Konrad Rawlik, Marc Toussaint, and Sethu Vijayakumar. On stochastic optimal control and reinforcement learning by approximate inference. In Twenty-Third International Joint Conference on Artificial Intelligence, 2013. +[46] John Schulman, Xi Chen, and Pieter Abbeel. Equivalence between policy gradients and soft q-learning. arXiv preprint arXiv:1704.06440, 2017. +[47] John Schulman, Sergey Levine, Pieter Abbeel, Michael Jordan, and Philipp Moritz. Trust region policy optimization. In Proceedings of the 32nd International Conference on Machine Learning (ICML-15), pages 1889–1897, 2015. +[48] John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017. +[49] Riley Simmons-Edler, Ben Eisner, Daniel Yang, Anthony Bisulco, Eric Mitchell, Sebastian Seung, and Daniel Lee. Qxplore: Q-learning exploration by maximizing temporal difference error. 2019. +[50] Avi Singh, Larry Yang, Kristian Hartikainen, Chelsea Finn, and Sergey Levine. End-to-end robotic reinforcement learning without reward engineering. arXiv preprint arXiv:1904.07854, 2019. +[51] Emanuel Todorov. General duality between optimal control and estimation. In 2008 47th IEEE Conference on Decision and Control, pages 4286-4292. IEEE, 2008. +[52] Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In Intelligent Robots and Systems (IROS), 2012 IEEE/RSJ International Conference on, pages 5026-5033. IEEE, 2012. +[53] Marc Toussaint. Robot trajectory optimization using approximate inference. In Proceedings of the 26th annual international conference on machine learning, pages 1049-1056. ACM, 2009. +[54] Hoi-To Wai, Mingyi Hong, Zhuoran Yang, Zhaoran Wang, and Kexin Tang. Variance reduced policy evaluation with smooth function approximation. Advances in Neural Information Processing Systems, 32:5784-5795, 2019. +[55] Christopher JCH Watkins and Peter Dayan. Q-learning. Machine Learning, 8(3):279-292, 1992. + +[56] Brian Hu Zhang, Blake Lemoine, and Margaret Mitchell. Mitigating unwanted biases with adversarial learning. In Proceedings of the 2018 AAAI/ACM Conference on AI, Ethics, and Society, pages 335-340, 2018. +[57] Zeyu Zheng, Junhyuk Oh, and Satinder Singh. On learning intrinsic rewards for policy gradient methods. In Advances in Neural Information Processing Systems, pages 4644-4654, 2018. +[58] Brian D Ziebart, Andrew Maas, J Andrew Bagnell, and Anind K Dey. Maximum entropy inverse reinforcement learning. 2008. + +# Checklist + +1. For all authors... + +(a) Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope? [Yes] The abstract and introduction reflect all contributions in the paper well. +(b) Did you describe the limitations of your work? [Yes] See Appendix E.1. +(c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 7. +(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] The paper conforms to the ethics review. + +2. If you are including theoretical results... + +(a) Did you state the full set of assumptions of all theoretical results? [N/A] The paper does not deal with theoretical results. +(b) Did you include complete proofs of all theoretical results? [N/A] The paper does not deal with theoretical results. + +3. If you ran experiments... + +(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] We provide the code in the supplemental material. +(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 6 and Appendix B. +(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] We plot the standard deviation with respect to the multiple random seeds. +(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] See Section 6 and Appendix B. + +4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... + +(a) If your work uses existing assets, did you cite the creators? [Yes] See Section 6. +(b) Did you mention the license of the assets? [Yes] See Section B. +(c) Did you include any new assets either in the supplemental material or as a URL? [N/A] The paper does not contain new assets. +(d) Did you discuss whether and how consent was obtained from people whose data you're using/curating? [Yes] See Section B. +(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes] See Section B. + +5. If you used crowdsourcing or conducted research with human subjects... + +(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] +(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] +(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] \ No newline at end of file diff --git a/amaxminentropyframeworkforreinforcementlearning/images.zip b/amaxminentropyframeworkforreinforcementlearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..da9665d926242a22cadf9122762329524340fc31 --- /dev/null +++ b/amaxminentropyframeworkforreinforcementlearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c80e2cdd943b1c2a587d1722443f24fc0210262df23ee0d21593a344052d3a0f +size 490139 diff --git a/amaxminentropyframeworkforreinforcementlearning/layout.json b/amaxminentropyframeworkforreinforcementlearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..3cc31c0d760f2a67935bbdd1746786bb300a67bf --- /dev/null +++ b/amaxminentropyframeworkforreinforcementlearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4b754c6c908a3ed4f929e1fa5f0ea250deaa0099e54451ee2591de05c0c1e1f7 +size 603624 diff --git a/amechanisticmultiarearecurrentnetworkmodelofdecisionmaking/1b4757ed-62a8-40a9-87cc-caae9e41b3f6_content_list.json b/amechanisticmultiarearecurrentnetworkmodelofdecisionmaking/1b4757ed-62a8-40a9-87cc-caae9e41b3f6_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..64b135c501b3063435049c2722d1db844f639654 --- /dev/null +++ b/amechanisticmultiarearecurrentnetworkmodelofdecisionmaking/1b4757ed-62a8-40a9-87cc-caae9e41b3f6_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c81f8cc0c1550c5b55332fc8178b72a0d890aee3403a8755d30223b116ca7812 +size 79750 diff --git a/amechanisticmultiarearecurrentnetworkmodelofdecisionmaking/1b4757ed-62a8-40a9-87cc-caae9e41b3f6_model.json b/amechanisticmultiarearecurrentnetworkmodelofdecisionmaking/1b4757ed-62a8-40a9-87cc-caae9e41b3f6_model.json new file mode 100644 index 0000000000000000000000000000000000000000..f3abd54dd7ce3fcdd45efcdb0a081008f208a0ea --- /dev/null +++ b/amechanisticmultiarearecurrentnetworkmodelofdecisionmaking/1b4757ed-62a8-40a9-87cc-caae9e41b3f6_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2421695769a0c20a409a85269c5d034c1f516dcc3ec1d09b5977a1da56469127 +size 96169 diff --git a/amechanisticmultiarearecurrentnetworkmodelofdecisionmaking/1b4757ed-62a8-40a9-87cc-caae9e41b3f6_origin.pdf b/amechanisticmultiarearecurrentnetworkmodelofdecisionmaking/1b4757ed-62a8-40a9-87cc-caae9e41b3f6_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fc8f73f276623ca0be52b5b7b228602bcecebcc5 --- /dev/null +++ b/amechanisticmultiarearecurrentnetworkmodelofdecisionmaking/1b4757ed-62a8-40a9-87cc-caae9e41b3f6_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a34df522d3c6798e8bf38e100e325393a233630f30325d1c3db4cc26680b81e +size 6768117 diff --git a/amechanisticmultiarearecurrentnetworkmodelofdecisionmaking/full.md b/amechanisticmultiarearecurrentnetworkmodelofdecisionmaking/full.md new file mode 100644 index 0000000000000000000000000000000000000000..c1df2f0e77c8732f9f9e40aa4c04c76ac18d4612 --- /dev/null +++ b/amechanisticmultiarearecurrentnetworkmodelofdecisionmaking/full.md @@ -0,0 +1,296 @@ +# A mechanistic multi-area recurrent network model of decision-making + +Michael Kleinman $^{1}$ Chandramouli Chandrasekaran $^{2*}$ Jonathan C. Kao $^{1*}$ + +1University of California, Los Angeles 2Boston University +michael.kleinman@ucla.edu cchandr1@bu.edu kao@seas.ucla.edu + +# Abstract + +Recurrent neural networks (RNNs) trained on neuroscience-based tasks have been widely used as models for cortical areas performing analogous tasks. However, very few tasks involve a single cortical area, and instead require the coordination of multiple brain areas. Despite the importance of multi-area computation, there is a limited understanding of the principles underlying such computation. We propose to use multi-area RNNs with neuroscience-inspired architecture constraints to derive key features of multi-area computation. In particular, we show that incorporating multiple areas and Dale's Law is critical for biasing the networks to learn biologically plausible solutions. Additionally, we leverage the full observability of the RNNs to show that output-relevant information is preferentially propagated between areas. These results suggest that cortex uses modular computation to generate minimal sufficient representations of task information. More broadly, our results suggest that constrained multi-area RNNs can produce experimentally testable hypotheses for computations that occur within and across multiple brain areas, enabling new insights into distributed computation in neural systems. + +# 1 Introduction + +Decision-making, multisensory integration, attention, motor control, and timing emerge from the coordination of multiple interconnected brain areas [1-9]. While neural activity in a particular area can contain behaviorally relevant signals, such as choices or percepts, it is often unclear if these signals originate within the area or are inherited from upstream brain areas [6]. Understanding the neural bases of these behaviors necessitates an understanding of the intra- and inter-area dynamics, that is, how neural activity evolves within and between brain areas. However, we currently lack clear hypotheses for how distinct brain-area dynamics and connectivity relate to computation. To address this gap, we use multi-area recurrent neural networks (RNNs) to model, probe, and gain insight into how behaviorally relevant computations emerge within and across multiple brain areas. + +Optimized feedforward and recurrent neural networks have been used for machine learning but are also emerging tools to model computations associated with visual [10, 11], cognitive [12], timing [3, 13], navigation [14], and motor tasks [15, 16]. RNNs transform experimenter-designed task inputs into behavior-related outputs through recurrent dynamics. Its artificial units often exhibit heterogeneous responses and population dynamics observed in brain areas implicated in cognitive and motor tasks [12, 15, 17-20]. If artificial units resemble cortical neurons, RNNs are subsequently analyzed to propose hypotheses for how a local computation occurs in a brain area [3, 12, 18, 21]. In comparison to direct experimental recordings, an important advantage of RNNs is that the activity + +![](images/97c35ccdd535faf05c8f0be3324ca591f38597ed8829cfe1e26b4eb6f8635292.jpg) +Figure 1: Task. RNN configuration. The RNN receives 4 inputs. Two inputs indicate the identity of the left and right targets, which can be red or green. These inputs are noiseless. The other two inputs indicate the value of the signed color coherence (proportional to amount of red in checkerboard) and negative signed color coherence (proportional to amount of green in checkerboard). We added independent Gaussian noise to these signals (see Appendix A.2). The network outputs two analog decision variables, each of which indicates evidence towards the right target (solid line) or left target (dashed line). A decision is made in the direction of whichever decision variable passes a preset threshold (0.6) first. The time at which the input passes the threshold is defined to be the reaction time. + +of all artificial units and their recurrent connectivity are fully observed. It is therefore possible to engineer [22] and reverse engineer [23] RNNs by analyzing their activity and recurrent connectivity, providing mechanistic insight into cortical computation [3, 12, 21]. + +Traditionally, RNNs have provided insight into local computations, and there has been limited insight into multi-area computation [7, 19]. To study multi-area computation, we explicitly constrained RNNs to have multiple recurrent areas, which we refer to as multi-area RNNs. We used these multi-area RNNs to study decision-making, a cognitive process known to involve multiple areas including the prefrontal, parietal, and premotor cortex [7, 9, 12, 24-28]. Multi-area RNNs enable us to investigate several questions. Most broadly, what are the roles of within-area dynamics and inter-area connections in mediating distributed computations? How does the dimensionality and dynamics of neural computation differ across areas? What role do inter-area feedforward and feedback connections play in propagating information and rejecting noise? How do intra-area dynamics and inter-area connections coordinate to solve a task? + +We use multi-area RNNs to study these questions in a decision-making task where premotor cortex and upstream areas are known to perform distinct computations. We trained multi-area RNNs to perform a perceptual decision-making task (Checkerboard Task) and compared their activity to monkey neuron recordings from the dorsal premotor cortex (PMd). We found that, when incorporating Dale's law and anatomically-informed levels of feedforward inhibition into training, PMd-resembling dynamics emerged in multi-area RNNs. Specifically, the multi-area RNN's output area (1) resembled PMd in single unit statistics and neural population activity, and (2) only retained the "output relevant" signals. Inter-area connections preferentially propagated these output relevant signals while attenuating output irrelevant signals. Our models and analyses provide a framework for studying distributed computations involving multiple areas in neural systems. + +# 2 Motivation: Decision-making involves multiple brain areas + +# 2.1 Checkerboard Task + +In the "Checkerboard Task" [24, 26], shown in Fig. 1 a monkey was first shown left and right targets whose color (red and green) was random on each trial. The monkey was subsequently shown a central static checkerboard composed of red and green squares. The monkey was trained to discriminate the dominant color of the static checkerboard and reach to the target matching the dominant color. Since the target colors were random on each trial, this task separates the reach direction decision from the color decision [29]. This task enables studying how information related to the selection of the color of the target and information related to the direction of the reach is represented. + +# 2.2 PMd Data during Checkerboard Task + +We analyzed the activity of neurons from the dorsal premotor cortex (PMd), an area associated with somatomotor decisions, in monkeys performing the Checkerboard Task [30]. Neural activity + +# PMd data + +![](images/16d6eaf70a19b11d4846366e003613e256a2b15ff0a21f10730f436fe58c5dc8.jpg) + +![](images/d47833678375aad5b64928c658b6aedcd05a117eea09fa95df45bc1b1513e66b.jpg) + +![](images/b72f84797d20f571d7793724604868ddeaeb10bceec9a826a73b25a545b0f0ef.jpg) + +![](images/171238cf725e44dde12fa455b9bebfa0c5f8866ff24cb153ed95858f00dd1786.jpg) + +# RNN data + +![](images/14132120496def7e503d3209b69fdec04375981f07448a24deadeba5aacf53bf.jpg) + +![](images/4f17ce517be4840019ecec214313ee46c555aa1c9cb04c0cd8227664ad08613f.jpg) + +![](images/036f061f762da4864efa46c6687274b5177dff84335ad8642bf5908f861b40d0.jpg) + +![](images/b06652f515714a7f9560376f9e3fb4b229d6371e0889cd392deb17a7a403b102.jpg) +g +i + +![](images/037e3064de433b6d2a955ed75e1f1de243d59f58f01841e6bee2ee20cecfd323.jpg) + +![](images/76dbfae601ea62e1da54efceebdd872eaec46b5d943023bd6392fdd70c300dc0.jpg) + +![](images/de7865028d7ce7c0e2ad614e7956c705e58ac0234858c788703cbb9b2237e975.jpg) + +![](images/e6770b4f8f5de6f6b8bada0177d0b5d6baa6eaabd1e0186990035d8b0923bf10.jpg) + +![](images/0e4fdaa11a81a00b97b143d9cbfc6765d4263ffda38713922b9787b2770cc84e.jpg) + +![](images/92d844ecf8eab6fe9fcd5fe6e05bab9fe7a6c2eacffd12b67b8ec0c90650171e.jpg) + +![](images/2c3aa0d61cd65d47604c3a5fa7ea0015c213c9e059c960cf861c26bb4cf0b12a.jpg) + +![](images/93cc4229e50780523170fea30a1f53f22df3118824e420cee7ca2d18e16428f4.jpg) +Figure 2: PMd-resembling dynamics emerge in neuroscience constrained RNNs. (a) PMd neural trajectories in the top 3 PCs. Color reflects signed color coherence, with darker shades of red (green) indicating more red (green) checkerboards. Right (left) reaches are denoted by solid (dotted) lines. (b) (Top) Variance captured by dPCA axes for the color decision, target configuration (context), and direction decision. (Bottom) Decode accuracy of the direction decision, color decision, and context in PMd sessions with U-probes and multiple neurons. (c) Representative PMd PSTHs aligned to checkerboard onset. (d) Direction and color choice probability (CP) for all recorded PMd units. (e) Neural trajectories in the top 2 principal components for each RNN area. (f) Variance captured by dPCA axes for color, context, and direction. (g) Non-linear tSNE embedding of peri-movement activity in each area. Each dot is a trial, with red or green denoting the color decision and ’’ or ’x’ denoting the direction decision. Unlike Areas 1 and 2, Area 3 only had two clusters separated based on the direction decision. (h) Decode accuracy of direction, color, and context in all three areas. (i) Example PSTHs in each area. (j) Choice probabilities for units in all areas (pooled over 8 RNNs). + +in PMd principally reflects the direction decision (left or right) and has minimal representations associated with the dominant color of the checkerboard (red or green) [26, 30, 31]. To summarize this phenomenon, we show the principal components (PCs) of the PMd neural population activity in Fig. 2a. These PC trajectories separate based on the eventual reach direction (right reaches in solid, left in dotted), but not the color (red and green largely overlapping). We identified principal axes via demixed PCA (dPCA [32]) that maximized variance related to the target configuration + +(context), color decision, and direction decision (see Appendix B.4). The direction axes captured significant variance $(26.7\%)$ while the color and context axes captured minimal variance $(0.7\%, 0.5\%,$ respectively), as shown in Fig. 2e. It is possible, however, that there is direction-dependent color variance that is averaged away during marginalization when computing the dPCA variance [32]. Given simultaneously recorded data, a more appropriate measure of representation is the decode accuracy of direction, color and context. Across sessions where we analyzed multiple simultaneously recorded units from U-probes, the direction decision could be decoded from PMd activity significantly above chance (accuracy: $0.89$ , $p < 0.01$ , bootstrap), but the color decision and context decode accuracy were not significantly above chance in any session (overall accuracies: 0.52 and 0.52, respectively, Fig. 2b, bottom). + +Single neurons also had minimal color separation in individual PSTHs (e.g., Fig. 2c). To summarize this effect in single neurons, we computed the choice probabilities (CPs) reflecting how well the direction decision (direction CP) and color decision (color CP) could be decoded. PMd units generally had near chance color CP (0.5), but moderate to high direction CP, as shown in Fig. 2d. Together, these results demonstrate that PMd largely represents direction-related signals, but not the color decision or target configuration context. Since PMd activity minimally represents the color of the checkerboard or the target configuration, we reasoned that checkerboard and target inputs are transformed into a direction signal upstream of PMd and that multiple brain areas are necessary for solving this task. Brain areas, including the dorsolateral prefrontal cortex (DLPFC), and the ventrolateral prefrontal cortex (VLPFC), have been implicated in related sensorimotor transformations [4, 9, 33-35]. + +# 3 Multi-Area RNN Training Details + +We trained RNNs of the form + +$$ +\tau \dot {\mathbf {x}} (t) = - \mathbf {x} (t) + \mathbf {W} _ {\text {r e c}} \mathbf {r} (t) + \mathbf {W} _ {\text {i n}} \mathbf {u} (t) + \mathbf {b} _ {\text {r e c}} + \epsilon_ {t}, \tag {1} +$$ + +where $\mathbf{r}(t) = \mathrm{relu}(\mathbf{x}(t))$ , $\tau$ is a time-constant of the network, $\mathbf{W}_{\mathrm{rec}} \in \mathbb{R}^{N \times N}$ defines how the artificial neurons are recurrently connected, $\mathbf{b}_{\mathrm{rec}} \in \mathbb{R}^N$ defines a constant bias, $\mathbf{W}_{\mathrm{in}} \in \mathbb{R}^{N \times N_{in}}$ maps the RNN's inputs onto each artificial neuron, and $\epsilon_t$ is the recurrent noise. The output of the network is given by a linear readout of the network rates, i.e., + +$$ +\mathbf {z} (t) = \mathbf {W} _ {\text {o u t}} \mathbf {r} (t), \tag {2} +$$ + +where $\mathbf{W}_{\mathrm{out}} \in \mathbb{R}^{N_{\mathrm{out}} \times N}$ maps the network rates onto the network outputs. For a 3-area RNN, $\mathbf{W}_{\mathrm{rec}}$ is defined through the following block matrix + +$$ +\mathbf {W} _ {\mathrm {r e c}} = \left( \begin{array}{c c c} \mathbf {W} _ {1 1} & \mathbf {W} _ {2 1} & 0 \\ \mathbf {W} _ {1 2} & \mathbf {W} _ {2 2} & \mathbf {W} _ {3 2} \\ 0 & \mathbf {W} _ {2 3} & \mathbf {W} _ {3 3} \end{array} \right), +$$ + +where $\mathbf{W}_{ii}$ refer to the recurrent connections of area $i$ , and we use the convention that $\mathbf{W}_{i,i+1}$ refer to feedforward connections, and $\mathbf{W}_{i,i-1}$ refer to the feedback connections. Feedforward and feedback connections were only allowed between adjacent areas. Task inputs were defined to project onto the first area, and outputs were read out from the final area. In the rest of the text, we primarily focus on a 3-area RNN that had approximately $10\%$ feedforward and $5\%$ feedback connections between areas, based on projections between prefrontal and premotor cortex in a macaque atlas [36]. The network was also constrained to follow Dale's law, as in Song et al. [37]. The RNN processed the target context and checkerboard inputs to output decision variables reflecting accumulated evidence for a left and right decision (Fig. I). Further details are discussed in Appendix A.2. + +# 4 Results + +Because the Checkerboard Task involves multiple brain areas, we reasoned that a single-area RNN would not resemble PMd recordings. We first trained traditional single-area RNNs to perform the Checkerboard Task. We found that these RNN representations mixed color and direction information, as summarized in Appendix Fig. 8 and therefore did not resemble PMd activity. This led us to study multi-area RNN models performing the Checkerboard Task, which turn out to accurately model PMd activity. + +![](images/fb1915bdae42e8958439994d1c43df814f18ca70510ed91eb38dc5ae296b7b44.jpg) +Figure 3: PMd-resembling dynamics emerge in neuroscience constrained RNNs. (a) We trained 3-area RNNs without explicit excitatory (E) or inhibitory (I) neurons. Inputs projected onto Area 1, and outputs were read out from Area 3. We varied the percentage of feedforward connections and computed the color and direction accuracy in Area 3. At $1\%$ feedforward connections, color could still be significantly decoded above chance. Dots are the mean across networks and error bars are s.e.m. For significance, $*$ is $p < 0.05$ , $*\*$ is $p < 0.01$ , and $*\*\*$ is $p < 0.001$ (with appropriate correction for multiple comparisons). We incorporated Dale's law with $80\%$ E, $20\%$ I neurons into subsequent sweeps, (b) We varied the percentage of feedforward E-to-I connections. Minimal representations with chance color decode accuracy emerged when the percentage of feedforward E to I connections was $2\%$ or less (feedforward E to E was fixed at $10\%$ ). (c-d) Color information was relatively robust to feedforward E-E connections and feedback connections. (e) At least 3 areas were required for the RNN's last area to resemble PMd dynamics. (f) 3-area RNNs with neurophysiological constraints had minimal representations that were generally robust to machine learning hyperparameters. The only exceptions were when the number of units was relatively small, or the learning rate was relatively large. + +![](images/0364eae3bdb86d06bf372b2bd28762b2cffc9eceab157d4bb3975f844f0d48e4.jpg) + +![](images/73c550e0853b05650934e831641cf0b2b0298ccdbc92cfa2f98ead9b3b34e603.jpg) + +![](images/c37a0076953fe28354c0b32c9b298067d1ea98014ecdb7d200874ca6ab747104.jpg) + +![](images/32fc1faabd10a4b7636e15483eca4076f0d5f5e6425929755743f9e5abc89294.jpg) + +![](images/0a5dc6fdce051e8fd9b973f3b326c8cd5549a2854aa5f8b1fe7ea2e84f95ed43.jpg) + +![](images/c5ed40eba5cb4281c4ac1a98ac5c76cc07888229f05b05b7ba368355211bc0a2.jpg) + +![](images/782b6773d534b21c567218b730f5c4f38701e13caa5d6b381e5592ec7667e99d.jpg) + +# 4.1 PMd-like representations emerge in optimized multi-area RNNs with neuroscience constraints + +Given the anatomical and physiological evidence suggesting that multiple brain areas are implicated in the CB task, we hypothesized that the last area of an optimized multi-area RNN would more closely resemble PMd, receiving transformed direction signals computed using the checkerboard coherence and target configuration from upstream areas. We trained multi-area RNNs to perform the Checkerboard Task as described in Section 3 + +The 3-area RNN had qualitatively different population trajectories across areas, shown in Fig.2e. Area 1 had four distinct trajectory motifs corresponding to the four possible task outcomes (combinations of left vs right and red vs green decisions). $\mathrm{PC}_1$ primarily varied with direction, while $\mathrm{PC}_2$ varied with both the target context and red versus green checkerboards. In contrast, Area 2 and Area 3 population trajectories primarily separated on direction, not color, like in PMd. Area 3 trajectories most strongly resembled PMd trajectories (canonical correlations, $r = 0.38$ , 0.55, 0.73 for Areas 1, 2, and 3; see Appendix B.7). + +We quantified the variance captured by dPCA principal axes for the context, color, and direction axis. We found that color axis variance decreased in later areas (Area 1: $5.6\%$ , Area 2: $0.13\%$ , Area 3: $0.07\%$ , Fig. 2f). In contrast, Area 3 had the largest direction axis variance (Area 1: $30.9\%$ , Area 2: $18.2\%$ , Area 3: $48.5\%$ , Fig. 2f). An important assumption of dPCA is that the neural activity can be decomposed as a sum of terms that depend solely on particular task variables [38]. The color variance found by dPCA indicate that color, on its own, did not account for a large fraction of the overall neural variance. However, it is possible there is significant color variance within a reach direction that dPCA, a linear dimensionality reduction technique, does not capture. + +As we are interested in whether the color information is contained in the representation, a more appealing measure is decode accuracy. If the color of the target can be decoded from the representation of neural activity, then color information is present in the representation. We performed nonlinear dimensionality reduction via t-distributed stochastic neighbor embedding (tSNE) [39], shown in Fig. 2g. These results suggest that Areas 1 and 2 contain color information, but Area 3 does not (color decisions overlap). We decoded the color decision and context (target configuration) from RNN units in each area (Fig. 2h, Area 1, 2, and 3 color accuracy: 0.93, 0.76, 0.51, and Area 1, 2, and 3 context accuracy: 0.99, 0.87, 0.54). Area 1 and 2 had above chance context and color decode + +accuracies ( $p < 0.01/9$ , 1-tailed t-test with Bonferroni correction), while Area 3 color and context decode accuracies were near chance, and most similar to PMd (Fig. 2h, color: $p = 0.05$ , context: $p = 0.024$ ). The direction decision could be decoded significantly above chance in all areas (Fig. 2h, $p < 0.01/9$ ). We also observed that Area 3 unit PSTHs more closely resembled PMd neuron PSTHs (e.g., Fig. 2i), and color CP progressively decreased in later areas (Fig. 2j). Area 3, like PMd, had many neurons with moderate to high direction CP, but low color CP. + +We tested how robust these results were to architecture and hyperparameter selection. In particular, we quantified how well color could be decoded in the multi-area RNN's last area across several hyperparameter settings. We found that architecture impacted whether optimized multi-area RNNs had PMd-like minimal representations. In particular, we found that PMd-like representations emerged when we incorporated anatomical and neurophysiological constraints: Dale's law, empirical levels of feedforward inhibition, and at least 3 areas (Fig. 3a-e). When we varied machine learning hyperparameters, we found that our results were generally robust: multi-area RNNs had PMd-like representations in their last area over a wide range of hyperparameter settings (Fig. 3f). Together, this constellation of results shows that Area 3 of the multi-area RNN recapitulates key features of PMd activity, making this RNN a candidate model of multi-area decision-making in the Checkerboard Task. + +In the next sections, we leverage the full observability of this biologically-plausible multi-area RNN to understand the mechanisms in different areas of the network and also how the network filters color information while propagating direction information. + +# 4.2 Separation of the color and direction decision in Area 1 + +What are the key computational features of how the multi-area RNN represents color and direction information in the Checkerboard task? We first focused our analysis on Area 1, which uniquely has substantial variance for both color and direction decisions (Fig. 2h), implying a central role in computing the direction choice. We performed dPCA to identify demixed principal components related to the RNN inputs (coherence and context) and decisions (color and direction) [32]. We found demixed components that separated information related to coherence, context, the color choice, and the direction choice (Fig. 4b), consistent with these quantities being decodable from activity (Fig. 2h). We subsequently identified the context, color, and direction axes as the dPCA principal axes (unit norm, analogous to PCA eigenvectors), which combine the demixed components (analogous to PCA scores) to reconstruct neural activity [32]. + +We projected RNN activity and input representations onto the principal axes for context, color, and direction (Fig. 4a). We found that the context and color axis both responded to context and color inputs, and overall trajectories represented both context and color information. This suggests that color and context information are mixed in Area 1. In contrast, the direction axis strongly represented the direction choice, but did not strongly represent context or color (Fig. 4a, right). Strikingly, context and color inputs had nearly zero projection on the direction axis (Fig. 4a, right, opaque traces at 0). Consistent with these observations, we found the color and context axes were highly overlapping (dot product: 0.93), indicating that context and checkerboard variance are mixed in Area 1 activity. In contrast, the direction axes was closer to orthogonal to the context and color axes (overlap with color and context: 0.14 and 0.09, respectively). + +These conclusions were upheld when we performed targeted dimensionality reduction (TDR), where we found (1) a direction axis separating left and right choices, with negligible input projections, and (2) that color and context representations were mixed (Appendix Fig. [14]). Further, this structure was unique for PMd-like 3-area RNNs. In single-area RNNs, dPCA identified nearly orthogonal context, color, and direction axes, with trajectories that separated almost exclusively based on context, color, and direction, respectively (Appendix Fig. [13a]). + +This Area 1 representation has an important property: the direction choice is represented robustly on a nearly orthogonal axis that has close to zero context and color input projections, (Fig. 4a). This is not trivial: as counter-examples, single-area RNNs use direction axes that have context and color input projections (Fig. 3a), while the direction axis of an unconstrained 3-area RNN (without anatomical + +![](images/6ccab6696ed06204b16fc4a5da56a8cbec60dca137da8a700afba82d3a57ca1c.jpg) + +![](images/298179c3ee36fbfb5a9f8d7c432ced56399b37e8423db73896c6a1fb1768781b.jpg) + +![](images/674101e241247ceb896c9b8a163eb82d079286f6b9158712252afeb40ca83590.jpg) + +![](images/c81cf9af73d945028c1ab1e79c97670e6a5c27e5a1f46b3c6852183ec1811ffa.jpg) +Figure 4: Separation of direction and color in Area 1. (a) The context, color, and direction axis correspond to the dPCA principal axes, which are not constrained to be orthogonal. Trajectories for different contexts and colors were separable on both the context and color axis. In contrast, the direction axis separated primarily on chosen direction. The RNN input representation had strong projections on the context and color axes, but not the direction axis. (b) Top 2 PCs of Area 1 activity, which capture $97.7\%$ of the Area 1 variance. In the targets on epoch, the trajectories separate to two regions corresponding to the two potential target configurations (Target config 1 in blue, and Target config 2 in purple). The trajectories separate upon checkerboard color input, leading to four total trajectory motifs: right green, left red, right red, and left green. (c) Projection of the dPCA principal axes onto the PCs. (d) Projection of the context and color inputs onto the PCs. Context inputs are shown in pink, a green checkerboard input in green, and a red checkerboard input in red. Green (red) checkerboards lead to an increase (decrease) in $\mathrm{PC}_2$ and the color axis, and differ in magnitude depending on the location of the trajectory in PC space. Trajectories are reduced in opacity to better visualize inputs. + +![](images/161aff45128fe09645d49c01f70149ebf0233eef35050b2feaa94e0d2ce2bf13.jpg) + +![](images/f304bccfefb5a9491dc279d7c5ccea251ea38be8f1ba82c3d952f63b6b455c04.jpg) + +connectivity constraints that did not resemble PMd) has context and color information, and also receives context and color inputs (Fig. 13b). We show the axes overlapped with the PCs in Fig.4 as well as the effect of the checkerboard and target inputs, which qualitatively shows that the inputs do not project onto the direction axis. + +# 4.3 Inter-area connections preferentially propagate output-relevant direction information + +The differentiating aspect of multi-area computation is that the different areas are separated. A natural question to ask is how then does information propagate between areas? As defined in Section 3, we denote the feedforward connections from Area 1 to 2 as $\mathbf{W}_{12}$ , and from Area 2 to 3 as $\mathbf{W}_{23}$ . We present results for feedforward connections from excitatory connections to excitatory units. Based on the hypothesis that the brain uses null and potent spaces to selectively filter information [40], we evaluated the effective potent and null spaces of $\mathbf{W}_{12}$ and $\mathbf{W}_{23}$ . We defined the effective potent space to be the right singular vectors corresponding to the largest singular values (see Appendix B.9). The effective null space corresponded to the singular vectors with the smallest singular values. + +We quantified how the color and direction axis were aligned with these potent and null spaces (see Appendix B.9). The projections onto the potent space are shown in Fig. 5a,b for $\mathbf{W}_{12}$ and $\mathbf{W}_{23}$ , respectively. The null projection magnitudes are equal to one minus the potent projection. We found the direction axis was more aligned with the potent space and the color axis was more aligned with the null space. In fact, the direction axis (computed using the activity in Area 1) was consistently + +![](images/9c027856aa94e3592138a6ad47635110ed68fcd3fb5343428c1f88e973a89c54.jpg) +Figure 5: (a) Projections onto the potent space between Areas 1 and 2 for the color and direction axis, and a random vector as a function of effective rank for the input area to the middle area. Regardless of the dimension of the potent space, the direction axis is preferentially aligned with the potent space, indicating the information along this axis propagates, while the color axis is approximately randomly aligned. Shading indicates s.e.m. (b) Same as (a) but for projections between Areas 2 and 3. (c) Illustration depicting how the orientation of the axes affect the information that propagates. + +![](images/559ba4c3f2fa0a6755fbb6bbfbdba7c35b82d15eeac7f73866cadc08dd842d34.jpg) + +![](images/8dfa42b71fc3b6967b1ab891225e5c6aa74aea1446d81d79feece2458b39b7d5.jpg) + +most aligned with the top singular vector (governed by the parameters of the feedforward matrix; which do not affect the activity in Area 1). In contrast, the color axis was similarly aligned to a random vector. This alignment was robust to the dimension of the effective potent space, and was consistent across networks with varying feedforward connectivity percentages (10%, 20%, 30%, 50%, 100%). This suggests that learning in the multi-area recurrent network involved aligning the relevant information (in the activations) with the top singular vector (governed by the learned parameters of the feedforward matrix). These results indicate that direction information is preferentially propagated to subsequent areas, while color information is not. This phenomena is schematized in Fig. 5c. To better understand the propagation and filtering of information in networks that had color information in the output area, we performed the same analyses on networks trained without Dale's law and 2 area networks, and found that these networks had significantly reduced alignment of the direction axis with the top singular vectors (Appendix Fig. 17). + +These results also have implications on how inter-area connections relay information between areas. Color activity has significant representation in Area 1 (see Fig. 2). Therefore, the inter-area connections must not merely propagate the highest variance dimensions of a preceding area [41]. Consistent with this reasoning, we found that while the top 2 PCs capture $97.7\%$ excitatory unit variance, the top 2 readout dimensions of $\mathbf{W}_{12}$ only captured $40.0\%$ of Area 1's excitatory unit neural variance (Appendix Fig. 16). Hence, inter-area connections are not aligned with the most variable dimensions, but are rather aligned to preferentially propagate certain types of information — a result consistent with a recent study analyzing links between activity in V1 and V2 [41]. + +# 4.4 Area 3, modeling PMd dynamics, is primarily input driven and implements bistable dynamics + +We showed previously that Area 3 most closely resembled PMd's dynamics (Fig. 2). Our results suggest that a direction signal has been computed before Area 3 and is selectively propagated through the RNN's inter-area connections. We found that the input to Area 3 (through $\mathbf{W}_{23}$ ) is a graded direction signal that provides a directional evidence signal for left or right reaches (Fig. 6a). This activity must be transformed into eventual DV outputs, which are the accumulated evidence for a left or right reach. This is illustrated in Fig. 6a, where we plot $\mathbf{W}_{23}\mathbf{r}_t^2$ ( $\mathbf{r}_t^2$ are the unit activations of Area 2), and $\mathbf{r}_t^3$ . + +To analyze Area 3's dynamics, we first observed that $\mathbf{W}_{\mathrm{out}}$ 's coefficients were sparse, with 44 out of 80 output weights being identically zero. We found that the readout led to two separate clusters of artificial units: units with non-zero coefficients for the left DV (orange) and those with non-zero coefficients for the right DV (blue). Artificial units projected either to the left or right DV outputs, but not both, suggesting that there are two clusters mediating left and right choices. + +Based on this clustering, we sorted and visualized the connections of excitatory units of Area 3, which upon first glance generally has no discernible structure (Fig. $\boxed{6}$ c, left panel). After sorting, we found that two self-excitatory pools of units emerged in $\mathbf{W}_{\mathrm{rec}}$ , the first pool in Fig. $\boxed{6}$ c (right) + +![](images/42e365b3d6c22c3b3f1d0e99d048e6244399e05881ded98417ca168b31b82a89.jpg) +a +b + +![](images/22d7b5bb9abc46cdf80d57101c3f9955e982bc465df5f4e4b59d9927a611ecb9.jpg) + +![](images/f07096597644bafa06e2f98bcfd62037d052f94102c8f2f5c91171219f9c26f3.jpg) +C + +![](images/198294f871178664e17015e5c0f6de093ce77fd238f305e04fcca436065cc67c.jpg) +d + +![](images/fe56f1ee7c8d8ecb37ae853a3cae5218e8f3d1a3f6659f474c3dca3e75515134.jpg) +e +f +Figure 6: Area 3 mechanism. (a) Projection of input and overall activity onto the direction axis identified through dPCA. The conventions are the same as in Fig.4. (b) Readout weights in $\mathbf{W}_{\mathrm{out}}$ are sparse, with many zero entries, and selective weights for a left or right reach. (c) The unsorted connectivity matrix for the nonzero readout units (left panel), and the sorted connectivity matrix when the matrix was reordered based on the readout weight pools (right). (d) Average PSTHs from units for a leftward reach and (inset) rightwards reach. When one pool increases activity, the other pool decreases activity. (e) Averaged recurrent connectivity matrix. (f) Schematic of output area. (g) Psychometric curve after perturbation experiment, where $10\%$ of inhibitory weights to the left pool (orange) and right pool (blue) were increased (doubled). Directional evidence is computed by using the signed coherence and using target configuration to identify the strength of evidence for a left reach and strength of evidence for a right reach. Increasing inhibition to the left excitatory pool leads to more right choices and vice versa. + +![](images/32b45d93b0407720e1060fe641b05d3a71cbbb6fed64f401de9011d7868f9c0b.jpg) +g + +![](images/ae6f25094ca2eb3cab796426d5d7d2f0d7ae4bfab8fab23fb5d2101a0abf79aa.jpg) + +corresponding to the left DV and the second pool corresponding to the right DV. In addition to these two pools, we identified a pool of randomly connected excitatory units and a pool of inhibitory units with strong projections from and to the two pools. The full Area 3 connectivity matrix is shown in Appendix Fig. [18]. This structure is consistent with a winner-take-all network, where increasing activity in one pool inhibits activity in the other pool through a separate inhibition pool (Fig. [6d]). By taking the averaged connectivity matrix, similar to [42], we confirmed that there were two excitatory pools that received similar projections from the random excitatory pool and inhibitory pool (Fig. [6e]). We summarize the behavior with a schematic of the area in Fig. [6f]. + +We subsequently applied selective perturbations to $\mathbf{W}_{\mathrm{rec}}$ to determine how behavioral performance was biased. We increased inhibition to either the right or the left pool by doubling the weights of $10\%$ of the inhibitory neurons associated with each pool. We found that this biased the network towards more left or right reaches, respectively, shown in Fig. 6g. When inhibition was increased to the right excitatory pool, the network was more likely to respond left. Conversely, when inhibition was increased to the left excitatory pool, the network was more likely to respond right. + +Together, these results show that the output area, modeling PMd, robustly transforms separable direction inputs to a decision variable through a winner-take-all mechanism. + +# 5 Discussion + +Even though behavior and cognition arise from the coordinated computations of multiple brain areas, there is limited understanding of how interacting brain areas coordinate to produce cognitive behavior [41, 43]. In this study, we used multi-area RNNs to gain mechanistic insight into how the brain computes a perceptual decision in the Checkerboard Task and transmits only the direction decision to PMd. These results propose hypotheses for computations that occur upstream of PMd, particularly how neural population activity representing context, color, and direction are structured, and what + +information is propagated between areas. We found that inter-area connections were preferentially aligned to the direction axis, not axes of maximal variance, leading to selective propagation of direction activity and attenuation of color activity. This role for inter-area connections is consistent with null and potent spaces for filtering and propagating information between areas [40, 44] and communication subspaces, which are aligned with lower variance dimensions [41]. + +Our results suggest that cortex and multi-area RNNs may share a more general principle of multi-area information processing: if information becomes irrelevant for later computations, it is reduced or discarded. In the Checkerboard Task, color information is necessary to compute the direction decision, but does not need to be represented after the direction decision is computed, as in PMd [4, 26, 30, 31, 45]. In deep neural networks, it is believed that minimal representations simplify the role of the output classifier [46, 47]. This idea is consistent with (1) the multi-area RNN developing a minimal (little color information) but sufficient (robust direction information) representation of task inputs, and (2) Area 3, the output area, using a simple winner-take-all readout, forming two pools of neurons representing right and left decisions (Fig. 6). + +Our analysis of the multi-area RNN leads to testable hypotheses for future experiments. First, we expect that neurons in cortical areas upstream of PMd should exhibit mixed selectivity for color and direction information, consistent with studies of dorsolateral prefrontal cortex (DLPFC) and ventrolateral prefrontal cortex (VLPFC) in cognitive tasks [48-50]. More specifically, our model predicts the following organization of population dynamics in these areas: neural population dynamics should diverge to two regions with slow dynamics based on target configuration, with largely overlapping context and color axes, but an orthogonal direction axis. Second, due to alignment of inter-area connections, direction axis activity in DLPFC/VLPFC should be more predictive of activity in downstream regions such as PMdr and PMd than activity in the top PCs. + +# Acknowledgments and Disclosure of Funding + +We thank Laura Driscoll for helpful comments on the manuscript as well as Krishna V. Shenoy and William T. Newsome for helpful discussions on earlier versions of these results. We also thank Krishna V. Shenoy for kindly allowing us to use the data collected by Dr. Chandrasekaran when he was a postdoc in the Shenoy Lab. MK was supported by the National Sciences and Engineering Research Council (NSERC). CC was supported by a NIH/NINDS R00 award R00NS092972 and R01 award NS122969, the Moorman-Simon Interdisciplinary Career Development Professorship from Boston University, the Whitehall foundation, and the Young Investigator Award from the Brain and Behavior Research Foundation. JCK was supported by NSF CAREER 1943467, NIH DP2NS122037, the Hellman Foundation, and a UCLA Computational Medicine AWS grant. We gratefully acknowledge the support of NVIDIA Corporation with the donation of the Titan Xp GPU used for this research. + +# References + +[1] S. M. Szczepanski, C. S. Konen, and S. Kastner, “Mechanisms of spatial attention control in frontal and parietal cortex,” Journal of Neuroscience, vol. 30, no. 1, pp. 148–160, 2010. [Online]. Available: https://www.jneurosci.org/content/30/1/148 +[2] J. Kalaska and D. Crammond, “Cerebral cortical mechanisms of reaching movements,” Science, vol. 255, no. 5051, pp. 1517–1523, 1992. [Online]. Available: https://science.sciencemag.org/content/255/5051/1517 +[3] E. D. Remington, D. Narain, E. A. Hosseini, and M. Jazayeri, “Flexible sensorimotor computations through rapid reconfiguration of cortical dynamics,” *Neuron*, vol. 98, no. 5, pp. 1005–1019.e5, Jun. 2018. +[4] T. Yamagata, Y. Nakayama, J. Tanji, and E. Hoshi, "Distinct information representation and processing for goal-directed behavior in the dorsolateral and ventrolateral prefrontal cortex and the dorsal premotor cortex," Journal of Neuroscience, vol. 32, no. 37, pp. 12934-12949, 2012. +[5] J. M. Yau, G. C. DeAngelis, and D. E. Angelaki, “Dissecting neural circuits for multisensory integration and crossmodal processing,” Philosophical Transactions of the Royal Society B: Biological Sciences, vol. 370, no. 1677, p. 20140203, 2015. [Online]. Available: https://royalsocietypublishing.org/doi/abs/10.1098/rstb.2014.0203 +[6] P. Cisek, "Making decisions through a distributed consensus," Current opinion in neurobiology, vol. 22, no. 6, pp. 927-936, 2012. +[7] L. Pinto, K. Rajan, B. DePasquale, S. Y. Thiberge, D. W. Tank, and C. D. Brody, "Task-dependent changes in the large-scale dynamics and necessity of cortical regions," Neuron, vol. 104, no. 4, pp. 810-824, 2019. +[8] M. Siegel, T. J. Buschman, and E. K. Miller, "Cortical information flow during flexible sensorimotor decisions," Science, vol. 348, no. 6241, pp. 1352-1355, 2015. +[9] D. J. Freedman and J. A. Assad, "Neuronal mechanisms of visual categorization: an abstract view on decision making," Annual review of neuroscience, vol. 39, pp. 129-147, 2016. +[10] D. L. K. Yamins, H. Hong, C. F. Cadieu, E. A. Solomon, D. Seibert, and J. J. DiCarlo, "Performance-optimized hierarchical models predict neural responses in higher visual cortex," Proc. Natl. Acad. Sci. U. S. A., vol. 111, no. 23, pp. 8619–8624, Jun. 2014. +[11] D. L. K. Yamins and J. J. DiCarlo, "Using goal-driven deep learning models to understand sensory cortex," Nat. Neurosci., vol. 19, no. 3, pp. 356-365, Mar. 2016. +[12] V. Mante, D. Sussillo, K. V. Shenoy, and W. T. Newsome, "Context-dependent computation by recurrent dynamics in prefrontal cortex," Nature, vol. 503, no. 7474, pp. 78-84, Nov. 2013. +[13] R. Laje and D. V. Buonomano, "Robust timing and motor patterns by taming chaos in recurrent neural networks," Nature neuroscience, vol. 16, no. 7, p. 925, 2013. + +[14] A. Banino, C. Barry, B. Uria, C. Blundell, T. Lillicrap, P. Mirowski, A. Pritzel, M. J. Chadwick, T. Degris, J. Modayil et al., "Vector-based navigation using grid-like representations in artificial agents," Nature, vol. 557, no. 7705, pp. 429-433, 2018. +[15] G. Hennequin, T. P. Vogels, and W. Gerstner, "Optimal control of transient dynamics in balanced networks supports generation of complex movements," Neuron, vol. 82, no. 6, pp. 1394-1406, Jun. 2014. +[16] J. P. Stroud, M. A. Porter, G. Hennequin, and T. P. Vogels, "Motor primitives in space and time via targeted gain modulation in cortical networks," Nature neuroscience, vol. 21, no. 12, p. 1774, 2018. +[17] O. Barak, "Recurrent neural networks as versatile tools of neuroscience research," Current Opinion in Neurobiology, vol. 46, pp. 1-6, 2017, computational Neuroscience. [Online]. Available: http://www.sciencedirect.com/science/article/pii/S0959438817300429 +[18] D. Sussillo, M. M. Churchland, M. T. Kaufman, and K. V. Shenoy, “A neural network that finds a naturalistic solution for the production of muscle activity,” Nat. Neurosci., vol. 18, no. 7, pp. 1025–1033, 2015. +[19] H. F. Song, G. R. Yang, and X. J. Wang, "Training excitatory-inhibitory recurrent neural networks for cognitive tasks: a simple and flexible framework," PLoS Comput. Biol., vol. 12, no. 2, pp. 1-30, 2016. +[20] H. F. Song, G. R. Yang, and X.-J. Wang, “Reward-based training of recurrent neural networks for cognitive and value-based tasks,” *Elife*, vol. 6, Jan. 2017. +[21] W. Chaisangmongkon, S. K. Swaminathan, D. J. Freedman, and X. J. Wang, "Computing by robust transience: how the fronto-parietal network performs sequential, category-based decisions," Neuron, vol. 93, no. 6, pp. 1504-1517.e4, 2017. +[22] F. Mastrogiuseppe and S. Ostojic, "Linking connectivity, dynamics, and computations in low-rank recurrent neural networks," Neuron, vol. 99, no. 3, pp. 609 - 623.e29, 2018. [Online]. Available: http://www.sciencedirect.com/science/article/pii/S0896627318305439 +[23] D. Sussillo and O. Barak, “Opening the black box: low-dimensional dynamics in high-dimensional recurrent neural networks,” Neural Comput., vol. 25, no. 3, pp. 626–649, 2013. +[24] C. Chandrasekaran, D. Peixoto, W. T. Newsome, and K. V. Shenoy, "Laminar differences in decision-related neural activity in dorsal premotor cortex," Nat. Commun., vol. 8, no. 1, p. 614, Sep. 2017. +[25] M. T. Kaufman, M. M. Churchland, S. I. Ryu, and K. V. Shenoy, "Vacillation, indecision and hesitation in moment-by-moment decoding of monkey motor cortex," *Elife*, vol. 4, pp. 1–21, 2015. +[26] É. Coallier, T. Michelet, and J. F. Kalaska, "Dorsal premotor cortex: neural correlates of reach target decisions based on a color-location matching rule and conflicting sensory evidence," Journal of neurophysiology, vol. 113, no. 10, pp. 3543-3573, 2015. +[27] J. I. Gold and M. N. Shadlen, “The neural basis of decision making,” Annual review of neuroscience, vol. 30, 2007. +[28] R. Romo and V. de Lafuente, “Conversion of sensory signals into perceptual decisions,” Progress in Neurobiology, vol. 103, pp. 41 - 75, 2013, conversion of Sensory Signals into Perceptions, Memories and Decisions. [Online]. Available: http://www.sciencedirect.com/science/article/pii/S0301008212000391 +[29] D. J. Freedman and J. A. Assad, “A proposed common neural mechanism for categorization and perceptual decisions,” Nature neuroscience, vol. 14, no. 2, p. 143, 2011. +[30] C. Chandrasekaran, D. Peixoto, W. T. Newsome, and K. V. Shenoy, "Laminar differences in decision-related neural activity in dorsal premotor cortex," Nature Communications, vol. 8, no. 1, p. 614, 2017. + +[31] M. Wang, C. Montanède, C. Chandrasekaran, D. Peixoto, K. V. Shenoy, and J. F. Kalaska, "Macaque dorsal premotor cortex exhibits decision-related activity only when specific stimulus-response associations are known," Nature Communications, vol. 10, no. 1, p. 1793, 2019. [Online]. Available: https://doi.org/10.1038/s41467-019-09460-y +[32] D. Kobak, W. Brendel, C. Constantinidis, C. E. Feierstein, A. Kepecs, Z. F. Mainen, X.-L. Qi, R. Romo, N. Uchida, and C. K. Machens, “Demixed principal component analysis of neural population data,” *Elife*, vol. 5, Apr. 2016. +[33] S. P. Wise and E. A. Murray, “Arbitrary associations between antecedents and actions,” Trends in Neurosciences, vol. 23, no. 6, pp. 271 - 276, 2000. [Online]. Available: http://www.sciencedirect.com/science/article/pii/S0166223600015708 +[34] E. Hoshi, "Cortico-basal ganglia networks subserving goal-directed behavior mediated by conditional visuo-goal association," Front. Neural Circuits, vol. 7, no. October, p. 158, 2013. +[35] D. Badre, J. Hoffman, J. W. Cooney, and M. D'esposito, "Hierarchical cognitive control deficits following damage to the human frontal lobe," Nature neuroscience, vol. 12, no. 4, p. 515, 2009. +[36] N. T. Markov, M. M. Ercsey-Ravasz, A. R. Ribeiro Gomes, C. Lamy, L. Magrou, J. Vezoli, P. Misery, A. Falchier, R. Quilodran, M. A. Ganiel, J. Sallet, R. Gamanut, C. Huissoud, S. Clavagnier, P. Giroud, D. Sappey-Marinier, P. Barone, C. Dehay, Z. Toroczkai, K. Knblauch, D. C. Van Essen, and H. Kennedy, "A weighted and directed interareal connectivity matrix for macaque cerebral cortex," Cereb. Cortex, vol. 24, no. 1, pp. 17-36, Jan. 2014. +[37] H. F. Song, G. R. Yang, and X. J. Wang, “Training excitatory-inhibitory recurrent neural networks for cognitive tasks: a simple and flexible framework,” PLoS Comput. Biol., vol. 12, no. 2, pp. 1-30, 2016. +[38] K. W. Latimer, "Nonlinear demixed component analysis for neural population data as a low-rank kernel regression problem," Neurons, Behavior, Data Analysis, & Theory, pp. 1-24, 2019. +[39] L. v. d. Maaten and G. Hinton, "Visualizing data using t-sne," Journal of machine learning research, vol. 9, no. Nov. pp. 2579-2605, 2008. +[40] M. T. Kaufman, M. M. Churchland, S. I. Ryu, and K. V. Shenoy, “Cortical activity in the null space: permitting preparation without movement,” Nat. Neurosci., vol. 17, no. 3, pp. 440–448, Mar. 2014. +[41] J. D. Semedo, A. Zandvakili, C. K. Machens, B. M. Yu, and A. Kohn, “Cortical Areas Interact through a Communication Subspace,” Neuron, vol. 102, no. 1, pp. 249–259.e4, apr 2019. [Online]. Available: https://doi.org/10.1016/j.neuron.2019.01.026 +[42] G. R. Yang, M. R. Joglekar, H. F. Song, W. T. Newsome, and X.-J. Wang, "Task representations in neural networks trained to perform many cognitive tasks," Nature neuroscience, vol. 22, no. 2, pp. 297-306, 2019. +[43] A. Kohn, A. I. Jasper, J. D. Semedo, E. Gokcen, C. K. Machens, and B. M. Yu, “Principles of corticocortical communication: Proposed schemes and design considerations,” Trends in Neurosciences, vol. 43, no. 9, pp. 725–737, 2020/10/12 2020. +[44] S. D. Stavisky, J. C. Kao, S. I. Ryu, and K. V. Shenoy, "Motor cortical visuomotor feedback activity is initially isolated from downstream targets in Output-Null neural state space dimensions," Neuron, vol. 95, no. 1, pp. 195–208.e9, Jul. 2017. +[45] P. Cisek and J. F. Kalaska, "Neural correlates of reaching decisions in dorsal premotor cortex: Specification of multiple direction choices and final selection of action," Neuron, vol. 45, no. 5, pp. 801-814, 2005. +[46] A. Achille and S. Soatto, “Emergence of invariance and disentanglement in deep representations,” Journal of Machine Learning Research, vol. 19, no. 50, pp. 1–34, 2018. [Online]. Available: http://jmlr.org/papers/v19/17-646.html + +[47] S. Soatto and A. Chiuso, "Visual representations: Defining properties and deep approximation," in Proceedings of the International Conference on Learning Representations (ICLR), June 2016. +[48] M. Rigotti, O. Barak, M. R. Warden, X.-J. Wang, N. D. Daw, E. K. Miller, and S. Fusi, “The importance of mixed selectivity in complex cognitive tasks,” Nature, vol. 497, no. 7451, pp. 585–590, May 2013. +[49] V. Mante, D. Sussillo, K. V. Shenoy, and W. T. Newsome, "Context-dependent computation by recurrent dynamics in prefrontal cortex," Nature, vol. 503, no. 7474, pp. 78-84, Nov. 2013. +[50] S. Fusi, E. K. Miller, and M. Rigotti, “Why neurons mix: high dimensionality for higher cognition,” Current opinion in neurobiology, vol. 37, pp. 66–74, 2016. +[51] I. Goodfellow, Y. Bengio, and A. Courville, Deep Learning. MIT Press, Nov. 2016. +[52] R. Pascanu, T. Mikolov, and Y. Bengio, "On the difficulty of training recurrent neural networks," in International Conference on Machine Learning, Feb. 2013, pp. 1310-1318. +[53] D. P. Kingma and J. Ba, “Adam: A method for stochastic optimization,” arXiv preprint arXiv:1412.6980, Dec. 2014. +[54] B. W. Brunton, M. M. Botvinick, and C. D. Brody, "Rats and humans can optimally accumulate evidence for decision-making," Science, vol. 340, no. 6128, pp. 95-98, 2013. +[55] R. Ratcliff, “A theory of memory retrieval.” *Psychological review*, vol. 85, no. 2, p. 59, 1978. +[56] D. Sussillo, M. M. Churchland, M. T. Kaufman, and K. V. Shenoy, “A neural network that finds a naturalistic solution for the production of muscle activity,” Nat. Neurosci., vol. 18, no. 7, pp. 1025–1033, 2015. +[57] D. Barber and F. Agakov, “The im algorithm: A variational approach to information maximization,” in Proceedings of the 16th International Conference on Neural Information Processing Systems, ser. NIPS'03. Cambridge, MA, USA: MIT Press, 2003, p. 201–208. +[58] B. Poole, S. Ozair, A. Van Den Oord, A. Alemi, and G. Tucker, “On variational bounds of mutual information,” in Proceedings of the 36th International Conference on Machine Learning, ser. Proceedings of Machine Learning Research, K. Chaudhuri and R. Salakhutdinov, Eds., vol. 97. Long Beach, California, USA: PMLR, 09-15 Jun 2019, pp. 5171-5180. [Online]. Available: http://proceedings.mlr.press/v97/poole19a.html +[59] M. Kleinman, A. Achille, D. Idnani, and J. Kao, "Usable information and evolution of optimal representations during training," in International Conference on Learning Representations, 2021. [Online]. Available: https://openreview.net/forum?id=p8agn6bmTbr \ No newline at end of file diff --git a/amechanisticmultiarearecurrentnetworkmodelofdecisionmaking/images.zip b/amechanisticmultiarearecurrentnetworkmodelofdecisionmaking/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..22a87e14950c86762163119cdebe11fb0cea830d --- /dev/null +++ b/amechanisticmultiarearecurrentnetworkmodelofdecisionmaking/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ee569ce3188def35cbafd51c03f37f1112150933045ed9f667c06bd6ec0f71b4 +size 424036 diff --git a/amechanisticmultiarearecurrentnetworkmodelofdecisionmaking/layout.json b/amechanisticmultiarearecurrentnetworkmodelofdecisionmaking/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..8a6bea54fdc608c20280a8f84b9f09002e5405b4 --- /dev/null +++ b/amechanisticmultiarearecurrentnetworkmodelofdecisionmaking/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6362969946bf6d618e4aa4a6eead817cb1772af27c695fd45c9c78d60444f3a4 +size 385377 diff --git a/aminimalistapproachtoofflinereinforcementlearning/d2a56b62-7746-457c-9ab0-24a279462c76_content_list.json b/aminimalistapproachtoofflinereinforcementlearning/d2a56b62-7746-457c-9ab0-24a279462c76_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..8e6c395924244fdc79b4e51f009b2171ce3e08a0 --- /dev/null +++ b/aminimalistapproachtoofflinereinforcementlearning/d2a56b62-7746-457c-9ab0-24a279462c76_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f175e8e9bc35832ef33b0402f7b84620d7109ca19ee7d457f65a295f491e707 +size 73829 diff --git a/aminimalistapproachtoofflinereinforcementlearning/d2a56b62-7746-457c-9ab0-24a279462c76_model.json b/aminimalistapproachtoofflinereinforcementlearning/d2a56b62-7746-457c-9ab0-24a279462c76_model.json new file mode 100644 index 0000000000000000000000000000000000000000..ebe337adb0ec970c812613e037b77b480592205d --- /dev/null +++ b/aminimalistapproachtoofflinereinforcementlearning/d2a56b62-7746-457c-9ab0-24a279462c76_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:721e8f6ad9b35cba602a57dd706ccf17b12ff36914b34daaa7e304db8e4dd2e4 +size 96271 diff --git a/aminimalistapproachtoofflinereinforcementlearning/d2a56b62-7746-457c-9ab0-24a279462c76_origin.pdf b/aminimalistapproachtoofflinereinforcementlearning/d2a56b62-7746-457c-9ab0-24a279462c76_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c749e56f916309610258df43cb638e443dfbb9ba --- /dev/null +++ b/aminimalistapproachtoofflinereinforcementlearning/d2a56b62-7746-457c-9ab0-24a279462c76_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:57d82d3ecae767424e8bb7c37f1ee97fbcc6b2515bb8ea81d309de0461c2f9fa +size 742702 diff --git a/aminimalistapproachtoofflinereinforcementlearning/full.md b/aminimalistapproachtoofflinereinforcementlearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2a5fc2a3c93d1d169bd82e42639521aaecdf3da7 --- /dev/null +++ b/aminimalistapproachtoofflinereinforcementlearning/full.md @@ -0,0 +1,282 @@ +# A Minimalist Approach to Offline Reinforcement Learning + +Scott Fujimoto1,2 Shixiang Shane Gu2 + +$^{1}$ Mila, McGill University + +$^{2}$ Google Research, Brain Team + +scott.fujimoto@mail.mcgill.ca + +# Abstract + +Offline reinforcement learning (RL) defines the task of learning from a fixed batch of data. Due to errors in value estimation from out-of-distribution actions, most offline RL algorithms take the approach of constraining or regularizing the policy with the actions contained in the dataset. Built on pre-existing RL algorithms, modifications to make an RL algorithm work offline comes at the cost of additional complexity. Offline RL algorithms introduce new hyperparameters and often leverage secondary components such as generative models, while adjusting the underlying RL algorithm. In this paper we aim to make a deep RL algorithm work while making minimal changes. We find that we can match the performance of state-of-the-art offline RL algorithms by simply adding a behavior cloning term to the policy update of an online RL algorithm and normalizing the data. The resulting algorithm is a simple to implement and tune baseline, while more than halving the overall run time by removing the additional computational overheads of previous methods. + +# 1 Introduction + +Traditionally, reinforcement learning (RL) is thought of as a paradigm for online learning, where the interaction between the RL agent and its environment is of fundamental concern for how the agent learns. In offline RL (historically known as batch RL), the agent learns from a fixed-sized dataset, collected by some arbitrary and possibly unknown process [Lange et al., 2012]. Eliminating the need to interact with the environment is noteworthy as data collection can often be expensive, risky, or otherwise challenging, particularly in real-world applications. Consequently, offline RL enables the use of previously logged data or leveraging an expert, such as a human operator, without any of the risk associated with an untrained RL agent. + +Unfortunately, the main benefit of offline RL, the lack of environment interaction, is also what makes it a challenging task. While most off-policy RL algorithms are applicable in the offline setting, they tend to under-perform due to "extrapolation error": an error in policy evaluation, where agents tend to poorly estimate the value of state-action pairs not contained in the dataset. This in turn affects policy improvement, where agents learn to prefer out-of-distribution actions whose value has been overestimated, resulting in poor performance [Fujimoto et al., 2019b]. The solution class for this problem revolves around the idea that the learned policy should be kept close to the data-generating process (or behavior policy), and has been given a variety of names (such as batch-constrained [Fujimoto et al., 2019b], KL-control [Jaques et al., 2019], behavior-regularized [Wu et al., 2019], or policy constraint [Levine et al., 2020]) depending on how this "closeness" is chosen to be implemented. + +While there are many proposed approaches to offline RL, we remark that few are truly "simple", and even the algorithms which claim to work with minor additions to an underlying online RL + +algorithm make a significant number of implementation-level adjustments. In other cases, there are unmentioned hyperparameters, or secondary components, such as generative models, which make offline RL algorithms difficult to reproduce, and even more challenging to tune. Additionally, such mixture of details slow down the run times of the algorithms, and make causal attributions of performance gains and transfers of techniques across algorithms difficult, as in the case for many online RL algorithms [Henderson et al., 2017, Tucker et al., 2018, Engstrom et al., 2020, Andrychowicz et al., 2021, Furuta et al., 2021]. This motivates the need for more minimalist approaches in offline RL. + +In this paper, we ask: can we make a deep RL algorithm work offline with minimal changes? We find that we can match the performance of state-of-the-art offline RL algorithms with a single adjustment to the policy update step of the TD3 algorithm [Fujimoto et al., 2018]. TD3's policy $\pi$ is updated with the deterministic policy gradient [Silver et al., 2014]: + +$$ +\pi = \underset {\pi} {\operatorname {a r g m a x}} \mathbb {E} _ {(s, a) \sim \mathcal {D}} [ Q (s, \pi (s)) ]. \tag {1} +$$ + +Our proposed change, TD3+BC, is to simply add a behavior cloning term to regularize the policy: + +$$ +\pi = \underset {\pi} {\operatorname {a r g m a x}} \mathbb {E} _ {(s, a) \sim \mathcal {D}} \left[ \lambda Q (s, \pi (s)) - (\pi (s) - a) ^ {2} \right], \tag {2} +$$ + +with a single hyperparameter $\lambda$ to control the strength of the regularizer. This modification can be made by adjusting only a single line of code. Additionally, we remark that normalizing the states over the dataset, such that they have mean 0 and standard deviation 1, improves the stability of the learned policy. Importantly, these are the only changes made to the underlying deep RL algorithm. To accommodate reproducibility, all of our code is open-sourced1. + +We evaluate our minimal changes to the TD3 algorithm on the D4RL benchmark of continuous control tasks [Fu et al., 2020]. We find that our algorithm compares favorably against many offline RL algorithms, while being significantly easier to implement and more than halving the required computation cost. The surprising effectiveness of our minimalist approach suggests that in the context of offline RL, simpler approaches have been left underexplored in favor of more elaborate algorithmic contributions. + +# 2 Related Work + +Although to the best of our knowledge, we are the first to use TD3 with behavior cloning (BC) for the purpose of offline RL, we remark that combining RL with BC, and other imitation learning approaches, has been previously considered by many authors. + +$\mathbf{RL} + \mathbf{BC}$ . With the aim of accelerating reinforcement learning from examples (known as learning from demonstrations [Atkeson and Schaal, 1997]), BC has been used as a regularization for policy optimization with DDPG [Lillicrap et al., 2015, Nair et al., 2018, Goecks et al., 2020] and the natural policy gradient [Kakade, 2001, Rajeswaran et al., 2017], but with additional sophistication through modified replay buffers and pre-training. The most similar work to our own is a SAC+BC baseline [Haarnoja et al., 2018] from Nair et al. [2020] and an unpublished course project [Booher] combining PPO [Schulman et al., 2017] with BC. + +RL + Imitation. Other than directly using BC with RL, imitation learning has been combined with RL in a variety of manners, such as mixed with adversarial methods [Zhu et al., 2018, Kang et al., 2018], used for pre-training [Pfeiffer et al., 2018], modifying the replay buffer [Večerík et al., 2017, Gulcehre et al., 2020], adjusting the value function [Kim et al., 2013, Hester et al., 2017], or reward shaping [Judah et al., 2014, Wu et al., 2021]. In all cases, these methods use demonstrations as a method for overcoming challenges in exploration or improving the learning speed of the RL agent. + +Offline RL. As aforementioned, offline RL methods generally rely on some approach for "staying close" to the data. This may be implemented using an estimate of the behavior policy and then defining an explicit policy parameterization [Fujimoto et al., 2019b, Ghasemipour et al., 2020] or by using divergence regularization [Jaques et al., 2019, Kumar et al., 2019, Wu et al., 2019, Siegel et al., 2020, Guo et al., 2021, Kostrikov et al., 2021]. Other approaches use a weighted version of BC to favor high advantage actions [Wang et al., 2018, Peng et al., 2019, Siegel et al., 2020, Wang et al., + +2020, Nair et al., 2020] or perform BC over an explicit subset of the data [Chen et al., 2020]. Some methods have modified the set of valid actions based on counts [Laroche et al., 2019] or the learned behavior policy [Fujimoto et al., 2019a]. Another direction is to implement divergence regularization as a form of pessimism into the value estimate [Nachum et al., 2019, Kumar et al., 2020, Buckman et al., 2020]. + +Meta Analyses of RL Algorithms. There are a substantial amount of meta analysis works on online RL algorithms. While some focus on inadequacies in the experimental protocols [Henderson et al., 2017, Osband et al., 2019], others study the roles of subtle implementation details in algorithms [Tucker et al., 2018, Engstrom et al., 2020, Andrychowicz et al., 2021, Furuta et al., 2021]. For example, Tucker et al. [2018], Engstrom et al. [2020] identified that superior performances of certain algorithms were more dependent on, or even accidentally due to, minor implementation rather than algorithmic differences. Furuta et al. [2021] study two broad families of off-policy algorithms, which most offline algorithms are based on, and find that a few subtle implementation details are strongly co-adapted and critical to specific algorithms, making attributions of performance gains difficult. Recent offline research also follows a similar trend, where a number of implementation modifications are necessary for high algorithmic performances (see Table 1). In contrast, we derive our algorithm by modifying the existing TD3 with only a few lines of codes. Our results suggest the community could also learn from careful explorations of simpler alternatives, besides emphasizing algorithmic novelties and complexities. + +# 3 Background + +RL. Reinforcement learning (RL) is a framework aimed to deal with tasks of sequential nature. Typically, the problem is defined by a Markov decision process (MDP) $(S, \mathcal{A}, \mathcal{R}, p, \gamma)$ , with state space $S$ , action space $\mathcal{A}$ , scalar reward function $\mathcal{R}$ , transition dynamics $p$ , and discount factor $\gamma$ [Sutton and Barto, 1998]. The behavior of an RL agent is determined by a policy $\pi$ which maps states to actions (deterministic policy), or states to a probability distribution over actions (stochastic policy). The objective of an RL agent is to maximize the expected discounted return $\mathbb{E}_{\pi}[\sum_{t=0}^{\infty} \gamma^{t} r_{t+1}]$ , which is the expected cumulative sum of rewards when following the policy in the MDP, where the importance of the horizon is determined by the discount factor. We measure this objective by a value function, which measures the expected discounted return after taking the action $a$ in state $s$ : $Q^{\pi}(s, a) = \mathbb{E}_{\pi}[\sum_{t=0}^{\infty} \gamma^{t} r_{t+1} | s_{0} = s, a_{0} = a]$ . + +BC. Another approach for training policies is through imitation of an expert or behavior policy. Behavior cloning (BC) is an approach for imitation learning [Pomerleau, 1991], where the policy is trained with supervised learning to directly imitate the actions of a provided dataset. Unlike RL, this process is highly dependent on the performance of the data-collecting process. + +Offline RL. Offline RL breaks the assumption that the agent can interact with the environment. Instead, the agent is provided a fixed dataset which has been collected by some unknown data-generating process (such as a collection of behavior policies). This setting may be considered more challenging as the agent loses the opportunity to explore the MDP according to its current beliefs, and instead from infer good behavior from only the provided data. + +One challenge for offline RL is the problem of extrapolation error [Fujimoto et al., 2019b], which is generalization error in the approximate value function, induced by selecting actions not contained in the dataset. Simply put, it is difficult to evaluate the expected value of a policy which is sufficiently different from the behavior policy. Consequently, algorithms have taken the approach of constraining or regularizing the policy to stay near to the actions in the dataset [Levine et al., 2020]. + +# 4 Challenges in Offline RL + +In this section, we identify key open challenges in offline RL through analyzing and evaluating prior algorithms. We believe these challenges highlight the importance of minimalist approaches, where performance can be easily attributed to algorithmic contributions, rather than entangled with the specifics of implementation. + +Implementation and Tuning Complexities. RL algorithms are notoriously difficult to implement and tune [Henderson et al., 2017, Engstrom et al., 2020, Furuta et al., 2021], where minor code-level + +
CQL +[Kumar et al., 2020]Fisher-BRC +[Kostrikov et al., 2021]TD3+BC +(Ours)
Algorithmic AdjustmentsAdd regularizer to critic† +Approximate logsumexp with sampling‡Train a generative model†‡ +Replace critic with offset function +Gradient penalty on offset function†Add a BC term†
Implementation AdjustmentsArchitecture†‡ +Actor learning rate† +Pre-training actor +Remove SAC entropy term +Max over sampled actions‡Architecture†‡ +Reward bonus† +Remove SAC entropy termNormalize states
+ +Table 1: Implementation changes offline RL algorithms make to the underlying base RL algorithm. † corresponds to details that add additional hyperparameter(s), and ‡ corresponds to ones that add a computational cost. + +![](images/0b132dbd349f9b963b063c372fb23b0b83b72efdcc534db01464cd83791c07e7.jpg) +Figure 1: Percent difference of performance of offline RL algorithms and their simplified versions which remove implementation adjustments to their underlying algorithm. HC = HalfCheetah, Hop = Hopper, W = Walker, r = random, m = medium, mr = medium-replay, me = medium-expert, e = expert. Huge drops in performances show that the implementation complexities are crucial for achieving the best results in these prior algorithms. + +optimizations and hyperparameters can have non-trivial impact of performance and stability. This problem may be additionally amplified in the context of offline RL, where evaluating changes to implementation and hyperparameters is counter-intuitive to the nature of offline RL, which explicitly aims to eliminate environment interactions [Paine et al., 2020, Yang et al., 2020]. + +Most offline RL algorithms are built explicitly on top of an existing off-policy deep RL algorithm, such as TD3 [Fujimoto et al., 2018] or SAC [Haarnoja et al., 2018], but then further modify the underlying algorithm with "non-algorithmic" implementation changes, such as modifications to network architecture, learning rates, or pre-training the actor network. We remark that a desirable property of an offline RL algorithm would be to minimally modify the underlying algorithm, so as to reduce the space of possible adjustments required to achieve a strong performance. + +In Table 1 we examine the particular modifications made by two recent offline RL algorithms, CQL [Kumar et al., 2020] and Fisher-BRC [Kostrikov et al., 2021]. On top of algorithmic changes, CQL also adds a pre-training phase where the actor is only trained with imitation learning and selects the max action over a sampled set of actions from the policy during evaluation. Fisher-BRC adds a constant reward bonus to every transition. Both methods modify SAC by removing the entropy term in the target update and modify the default network architecture. These changes add supplementary hyperparameters which may need to be tuned or increase computational costs. + +In the online setting, these changes are relatively inconsequential and could be validated with some simple experimentation. However, in the offline setting, where we cannot interact with the environment, making additional adjustments to the underlying algorithm should be considered as more costly as validating their effectiveness is no longer a trivial additional step. This is also problematic because unlike the algorithmic changes proposed by these papers, these implementation details are not well justified, meaning there is much less intuition as to when to include these details, or how to adjust them with minimal experimentation. In the case of the D4RL benchmark on MuJoCo tasks [Todorov et al., 2012, Fu et al., 2020], we have a strong prior that our base deep RL algorithm performs well, as SAC/TD3 are considered state-of-the-art (or nearly) in these domains. If additional changes are necessary, then it suggests the algorithmic contributions alone are insufficient. + +![](images/28f6c1040ea47ab68c8b8eeb1f7ccdd04ef5be6bb6009154634523e940bc922f.jpg) +Figure 2: Percent difference of the worst episode during the 10 evaluation episodes at the last evaluation. This measures the deviations in performance at single point in time. HC = HalfCheetah, Hop = Hopper, W = Walker, r = random, m = medium, mr = medium-replay, me = medium-expert, e = expert. While online algorithms (TD3) typically have small episode variances per trained policy (as they should at convergence), all offline algorithms have surprisingly high episodic variances for trained policies. + +![](images/e369017bccb85fd7b8fcfb629095d52d8c3225022a17ecc43b578758a942aa58.jpg) +Figure 3: Percent difference of the worst evaluation during the last 10 evaluations. This measures the deviations in performance over a period of time. HC = HalfCheetah, Hop = Hopper, W = Walker, r = random, m = medium, mr = medium-replay, me = medium-expert, e = expert. Similarly to the result in Figure 2, all offline-trained policies have significant variances near the final stage of training that are absent in the online setting. + +In Figure 1 we examine the percent difference in performance when removing the implementation changes in CQL and Fisher-BRC. There is a significant drop in performance in many of the tasks. This is not necessarily a death knell to these algorithms, as it is certainly possible these changes could be kept without tuning when attempting new datasets and domains. However, since neither paper make mention of a training/validation split, we can only assume these changes were made with their evaluation datasets in mind (D4RL, in this instance), and remark there is insufficient evidence that these changes may be universal. Ultimately, we make this point not to suggest a fundamental flaw with pre-existing algorithms, but to suggest that there should be a preference for making minimal adjustments to the underlying RL algorithm, to reduce the need for hyperparameter tuning. + +Extra Computation Requirement. A secondary motivating factor for minimalism is avoiding the additional computational costs associated with modifying the underlying algorithm (in particular architecture) and more complex algorithmic ideas. In Table 3 (contained later in Section 6), we examine the run time of offline RL algorithms, as well as the change in cost over the underlying algorithm, and find their is a significant computational cost associated with these modifications. On top of the architecture changes, for CQL this is largely due to the costs of logsumexp over multiple sampled actions, and for Fisher-BRC, the costs associated with training the independent generative model. Since an objective of offline RL is to take advantage of existing, potentially large, datasets, there should be a preference for scalable and efficient solutions. Of course, run time should not come at the cost of performance, but as we will later demonstrate, there exists a simple, and computationally-free, approach for offline RL which matches the performance of current state-of-the-art algorithms. + +Instability of Trained Policies. In analyzing the final trained policies of prior offline algorithms, we learned of a tangential, and open, challenge in the form of instability. In online RL, if the current policy is unsatisfactory, we can use checkpoints of previous iterations of the policy, or to simply continue training. However, in offline RL, the evaluation should only occur once by definition, greatly increasing the importance of the single policy at evaluation time. We highlight two versions of instability in offline RL. Figure 2 shows that in contrast to the online-trained policy, which converges to a robust low-variance policy, the offline-trained policy exhibits huge variances in performance + +during a single evaluation. Therefore, even if the average performance is reasonable, the agent may still perform poorly on some episodes. Figure 3 shows instability over the set of evaluations, which means the performance of the agent may be dependent on the specific stopping point chosen for evaluation. This questions the empirical effectiveness of offline RL for safety-critical real-world use cases [Mandel et al., 2014, Gottesman et al., 2018, Gauci et al., 2018, Jaques et al., 2019, Matsushima et al., 2020] as well as the current trend of reporting only the mean-value of the final policy in offline benchmarking [Fu et al., 2020]. + +Such variances are not likely caused by high policy entropies (e.g. TD3+BC trains a deterministic policy), but rather our hypothesis is that such a problem is due to distributional shifts issues and poor generalizations across unobserved states caused by offline nature of training [Ross et al., 2011], where the optimized policy is never allowed to execute in the environment, similarly as in BC. This trait of offline RL algorithms appears to be consistent across all offline algorithms we evaluated, even for our minimalistic TD3+BC that is only a few lines change from TD3. While we could not solve this challenge sufficiently within the scope of this work, the fact that this is reproducible even in the minimalistic variant proves that this a fundamental problem shared by all offline training settings, and is a critical problem for the community to study in the future. + +# 5 A Minimalist Offline RL Algorithm + +A key problem in offline RL, extrapolation error, can be summarized as the inability to properly evaluate out-of-distribution actions. Consequently, there has been a variety of different approaches to limiting, or regularizing, action selection such that the learned policy is easier to evaluate with the given dataset. We remark that while minimizing say, KL divergence, is a both logical and valid approach for reducing extrapolation error, there is no fundamental argument why minimizing one divergence or distance metric should be better than another. Thus, rather than derive an entirely new approach, we focus on simplicity, and present an offline RL algorithm which requires minimal modifications to a pre-existing deep RL algorithm. As discussed in Section 4 a minimalist approach has a variety of benefits, such as reducing the number of hyperparameters to tune, increasing scalability by reducing computational costs, and providing an avenue for analyzing problems by disentangling algorithmic contributions from implementation details. + +We now describe such an approach to offline RL. Our algorithm builds on top of TD3 [Fujimoto et al., 2018], making only two straightforward changes. Firstly, we add a behavior cloning regularization term to the standard policy update step of TD3, to push the policy towards favoring actions contained in the dataset $\mathcal{D}$ : + +$$ +\pi = \underset {\pi} {\operatorname {a r g m a x}} \mathbb {E} _ {s \sim \mathcal {D}} [ Q (s, \pi (s)) ] \rightarrow \pi = \underset {\pi} {\operatorname {a r g m a x}} \mathbb {E} _ {(s, a) \sim \mathcal {D}} \left[ \lambda Q (s, \pi (s)) - \left(\pi (s) - a\right) ^ {2} \right]. \tag {3} +$$ + +Secondly, we normalize the features of every state in the provided dataset. Let $s_i$ be the $i$ th feature of the state $s$ , let $\mu_i \sigma_i$ be the mean and standard deviation, respectively, of the $i$ th feature across the dataset: + +$$ +s _ {i} = \frac {s _ {i} - \mu_ {i}}{\sigma_ {i} + \epsilon}, \tag {4} +$$ + +where $\epsilon$ is a small normalization constant (we use $10^{-3}$ ). While we remark this is a commonly used implementation detail in many deep RL algorithms [Raffin et al., 2019], we highlight it as (1) we want complete transparency about all implementation changes and (2) normalizing provides a non-trivial performance benefit in offline RL, where it is particularly well-suited as the dataset remains fixed. + +While the choice of $\lambda$ in Equation (3) is ultimately just a hyperparameter, we observe that the balance between RL (in maximizing $Q$ ) and imitation (in minimizing the BC term), is highly susceptible to the scale of $Q$ . If we assume an action range of $[-1, 1]$ , the BC term is at most 4, however the range of $Q$ will be a function of the scale of the reward. Consequently, we can add a normalization term into $\lambda$ . Given the dataset of $N$ transitions $(s_i, a_i)$ , we define the scalar $\lambda$ as: + +$$ +\lambda = \frac {\alpha}{\frac {1}{N} \sum_ {\left(s _ {i} , a _ {i}\right)} \left| Q \left(s _ {i} , a _ {i}\right) \right|}. \tag {5} +$$ + +This is simply a normalization term based on the average absolute value of $Q$ . In practice, we estimate this mean term over mini-batches, rather than the entire dataset. Although this term includes $Q$ , it is + +
BCBRAC-pAWACCQLFisher-BRCTD3+BC
RandomHalfCheetah2.0 ±0.123.52.221.7 ±0.932.2 ±2.210.2 ±1.3
Hopper9.5 ±0.111.19.610.7 ±0.111.4 ±0.211.0 ±0.1
Walker2d1.2 ±0.20.85.12.7 ±1.20.6 ±0.61.4 ±1.6
MediumHalfCheetah36.6 ±0.644.037.437.2 ±0.341.3 ±0.542.8 ±0.3
Hopper30.0 ±0.531.272.044.2 ±10.899.4 ±0.499.5 ±1.0
Walker2d11.4 ±6.372.730.157.5 ±8.379.5 ±1.079.7 ±1.8
Medium ReplayHalfCheetah34.7 ±1.845.6-41.9 ±1.143.3 ±0.943.3 ±0.5
Hopper19.7 ±5.90.7-28.6 ±0.935.6 ±2.531.4 ±3.0
Walker2d8.3 ±1.5-0.3-15.8 ±2.642.6 ±7.025.2 ±5.1
Medium ExpertHalfCheetah67.6 ±13.243.836.827.1 ±3.996.1 ±9.597.9 ±4.4
Hopper89.6 ±27.61.180.9111.4 ±1.290.6 ±43.3112.2 ±0.2
Walker2d12.0 ±5.8-0.342.768.1 ±13.1103.6 ±4.6101.1 ±9.3
ExpertHalfCheetah105.2 ±1.73.878.582.4 ±7.4106.8 ±3.0105.7 ±1.9
Hopper111.5 ±1.36.685.2111.2 ±2.1112.3 ±0.2112.2 ±0.2
Walker2d56.0 ±24.9-0.257.0103.8 ±7.679.9 ±32.4105.7 ±2.7
Total595.3 ±91.5284.1-764.3 ±61.5974.6 ±108.3979.3 ±33.4
+ +Table 2: Average normalized score over the final 10 evaluations and 5 seeds. The highest performing scores are highlighted. CQL and Fisher-BRC are re-run using author-provided implementations to ensure an identical evaluation process, while BRAC and AWAC use previously reported results. $\pm$ captures the standard deviation over seeds. TD3+BC achieves effectively the same performances as the state-of-the-art Fisher-BRC, despite being much simpler to implement and tune and more than halving the computation cost. + +not differentiated over, and is simply used to scale the loss. This formulation has the added benefit of normalizing the learning rate across tasks, as the gradient $\nabla_{a}Q(s,a)$ will also be dependent on the scale of $Q$ . We use $\alpha = 2.5$ in our experiments. + +This completes the description of TD3+BC. The Equations (3), (4), and (5) summarize the entirety of our changes to TD3, and can be implemented by modifying only a handful of lines in most codebases. + +# 6 Experiments + +We evaluate our proposed approach on the D4RL benchmark of OpenAI gym MuJoCo tasks [Todorov et al., 2012, Brockman et al., 2016, Fu et al., 2020], which encompasses a variety of dataset settings and domains. Our offline RL baselines include two state-of-the-art algorithms, CQL [Kumar et al., 2020] and Fisher-BRC [Kostrikov et al., 2021], as well as BRAC [Wu et al., 2019] and AWAC [Nair et al., 2020] due to their algorithmic simplicity. + +To ensure a fair and identical experimental evaluation across algorithms, we re-run the state-of-the-art algorithms CQL and Fisher-BRC using the author-provided implementations $^{23}$ . We train each algorithm for 1 million time steps and evaluate every 5000 time steps. Each evaluation consists of 10 episodes. Results for BRAC are obtained from the D4RL benchmark and from the CQL paper, while the AWAC results are obtained directly from the paper. BC results were obtained using our own implementation. + +D4RL. We report the final performance results in Table 2 and display the learning curves in Figure 4. Although our method is very simplistic in nature, it surpasses, or matches, the performance of the current state-of-the-art offline RL algorithms in most tasks. Only Fisher-BRC exhibits a comparable + +![](images/14f4a3ca52d40f01d9a3c3c4fadee9aa480bb2e66e0affaa8bfb1aa78be82b53.jpg) +Figure 4: Learning curves comparing the performance of TD3+BC against offline RL baselines in the D4RL datasets. Curves are averaged over 5 seeds, with the shaded area representing the standard deviation across seeds. TD3+BC exhibits a similar learning speed and final performance as the state-of-the-art Fisher-BRC, without the need of pre-training a generative model. + +![](images/2e16eed713d168409f9882e0520c20e28362e25338cb2a54ceb659793bc0817d.jpg) +Table 3: Run time comparison of training each offline RL algorithm (does not include evaluation costs). (Left) Breakdown of the cost of the added implementation details (mainly architecture changes) and the algorithmic details by each method. (Right) Total training time of each algorithm. While CQL and Fisher-BRC have significantly increased computational costs over their base online RL algorithm due to various added complexities (e.g. see Table 1), TD3+BC has effectively no increase. This results in less than half of the computational cost of these prior state-of-the-art algorithms. + +performance4. Examining the learning curves, we can see that our approach achieves a similar learning speed and stability, without requiring any pre-training phase. + +Run time. We evaluate run time of training each of the offline RL algorithms for 1 million time steps, using the author-provided implementations. Additionally, for fair comparison, we re-implement Fisher-BRC, allowing each method to be compared in the same framework (PyTorch [Paszke et al., 2019]). The results are reported in Table 3. Unsurprisingly, we find our approach compares favorably against previous methods in terms of wall-clock training time, effectively adding no cost to the underlying TD3 algorithm. All run time experiments were run with a single GeForce GTX 1080 GPU and an Intel Core i7-6700K CPU at $4.00\mathrm{GHz}$ . + +Ablation. In Figure 5, we perform an ablation study over the components in our method. As noted in previous work [Fujimoto et al., 2019b], without behavior cloning regularization, the RL algorithm alone is insufficient to achieve a high performance (except on some of the random data sets). We + +![](images/d46befcdeab76c90390afff7e29ac9f8791a09bfa6505ba7cfde62063d26335c.jpg) +Figure 5: Percent difference of the performance of an ablation of our proposed approach, compared to the full algorithm. TD3+λ+BC+Norm refers to the complete algorithm, where Norm refers to the state feature normalization. HC = HalfCheetah, Hop = Hopper, W = Walker, r = random, m = medium, mr = medium-replay, me = medium-expert, e = expert. As expected, both BC and TD3 are necessary components to achieve a strong performance. While removing state normalization is not devastating to the performance of the algorithm, we remark it provides a boost in performance across many tasks, while being a straightforward addition. + +![](images/6109813d5a1960e53503bf3073953da2bd1576853a62a94cc89832fb91cb358b.jpg) +Figure 6: Percent difference of the performance of an ablation over $\alpha$ , compared to the full algorithm. Recall the form of the sole hyperparameter $\lambda = \frac{\alpha}{\sum|Q(s,\alpha)|}$ , where $\lambda$ weights the $Q$ function during the policy update. $\alpha = 2.5$ is used by default. HC = HalfCheetah, Hop = Hopper, W = Walker, r = random, m = medium, mr = medium-replay, me = medium-expert, e = expert. While there is effectively no performance difference between $\alpha = 2$ and $\alpha = 3$ , we remark that performance begins to degrade on select tasks as the algorithm begins to approach more RL ( $\alpha = 4$ ) or imitation ( $\alpha = 1$ ). + +also note that our algorithm never underperforms vanilla behavior cloning, even on the expert tasks. Predictably, the removal of state normalization has the least significant impact, but it still provides some benefit across a range of tasks while being a minor adjustment. In Figure 6, we evaluate the sensitivity of the algorithm to the hyperparameter $\alpha$ , where the weighting $\lambda = \frac{\alpha}{\sum_{(s,a)}|Q(s,a)|}$ on the value function is determined by $\alpha$ . On many tasks, our approach is robust to this weighting factor, but note the performance on a subset of tasks begins to decrease as $\alpha$ begins to more heavily favor imitation ( $\alpha = 1$ ) or RL ( $\alpha = 4$ ). + +# 7 Conclusion + +Most recent advances in offline RL center around the idea of regularizing policy actions to be close to the support within batch data, and yet many state-of-the-art algorithms have significant complexities and additional modifications beyond base algorithms that lead to not only much slower run time, but also intractable attributions for sources of performance gains. Instead of complexity we optimize for simplicity, and introduce a minimalistic algorithm that achieves a state-of-the-art performance but is only a few lines of changes from the base TD3 algorithm, uses less than half of the computation time of competing algorithms, and has only one additional hyperparameter. + +Additionally, we highlight existing open challenges in offline RL research, including not only the extra implementation, computation, and hyperparameter-tuning complexities that we successfully address in this work, but also call attention to the neglected problem of high episodic variance in offline-trained policies compared to online-trained (see Figures 2 and 3) that we as the community should address in future works and benchmarking. Finally, we believe the sheer simplicity of our approach highlights a possible overemphasis on algorithmic complexity made by the community, and we hope to inspire future work to revisit simpler alternatives which may have been overlooked. + +# References + +Marcin Andrychowicz, Anton Raichuk, Piotr Stanczyk, Manu Orsini, Sertan Girgin, Raphael Marinier, Leonard Hussenot, Matthieu Geist, Olivier Pietquin, Marcin Michalski, Sylvain Gelly, and Olivier Bachem. What matters for on-policy deep actor-critic methods? a large-scale study. In International Conference on Learning Representations, 2021. +Christopher G Atkeson and Stefan Schaal. Robot learning from demonstration. In Proceedings of the Fourteenth International Conference on Machine Learning, pages 12-20, 1997. +Jonathan Booher. Bc+rl: Imitation learning from non-optimal demonstrations. URL https://web.stanford.edu/~jaustinb/papers/CS234.pdf. +Greg Brockman, Vicki Cheung, Ludwig Pettersson, Jonas Schneider, John Schulman, Jie Tang, and Wojciech Zaremba. Openai gym, 2016. +Jacob Buckman, Carles Gelada, and Marc G Bellemare. The importance of pessimism in fixed-dataset policy optimization. arXiv preprint arXiv:2009.06799, 2020. +Xinyue Chen, Zijian Zhou, Zheng Wang, Che Wang, Yanqiu Wu, and Keith Ross. Bail: Best-action imitation learning for batch deep reinforcement learning. Advances in Neural Information Processing Systems, 33, 2020. +Logan Engstrom, Andrew Ilyas, Shibani Santurkar, Dimitris Tsipras, Firdaus Janoos, Larry Rudolph, and Aleksander Madry. Implementation matters in deep rl: A case study on ppo and trpo. In International Conference on Learning Representations, 2020. +Justin Fu, Aviral Kumar, Ofir Nachum, George Tucker, and Sergey Levine. D4rl: Datasets for deep data-driven reinforcement learning. 2020. +Scott Fujimoto, Herke van Hoof, and David Meger. Addressing function approximation error in actor-critic methods. In International Conference on Machine Learning, volume 80, pages 1587-1596. PMLR, 2018. +Scott Fujimoto, Edoardo Conti, Mohammad Ghavamzadeh, and Joelle Pineau. Benchmarking batch deep reinforcement learning algorithms. arXiv preprint arXiv:1910.01708, 2019a. +Scott Fujimoto, David Meger, and Doina Precup. Off-policy deep reinforcement learning without exploration. In International Conference on Machine Learning, pages 2052-2062, 2019b. +Hiroki Furuta, Tadashi Kozuno, Tatsuya Matsushima, Yutaka Matsuo, and Shixiang Shane Gu. Identifying co-adaptation of algorithmic and implementational innovations in deep reinforcement learning: A taxonomy and case study of inference-based algorithms. arXiv preprint arXiv:2103.17258, 2021. +Jason Gauci, Edoardo Conti, Yitao Liang, Kittipat Virochsiri, Yuchen He, Zachary Kaden, Vivek Narayanan, Xiaohui Ye, Zhengxing Chen, and Scott Fujimoto. Horizon: Facebook's open source applied reinforcement learning platform. arXiv preprint arXiv:1811.00260, 2018. +Seyed Kamyar Seyed Ghasemipour, Dale Schuurmans, and Shixiang Shane Gu. Emaq: Expected-max q-learning operator for simple yet effective offline and online rl. arXiv preprint arXiv:2007.11091, 2020. +Vinicius G Goecks, Gregory M Greillion, Vernon J Lawhern, John Valasek, and Nicholas R Waytowich. Integrating behavior cloning and reinforcement learning for improved performance in dense and sparse reward environments. In Proceedings of the 19th International Conference on Autonomous Agents and MultiAgent Systems, pages 465-473, 2020. +Omer Gottesman, Fredrik Johansson, Joshua Meier, Jack Dent, Donghun Lee, Srivatsan Srinivasan, Linying Zhang, Yi Ding, David Wihl, Xuefeng Peng, et al. Evaluating reinforcement learning algorithms in observational health settings. arXiv preprint arXiv:1805.12298, 2018. + +Caglar Gulcehre, Tom Le Paine, Bobak Shahriari, Misha Denil, Matt Hoffman, Hubert Soyer, Richard Tanburn, Steven Kapturowski, Neil Rabinowitz, Duncan Williams, Gabriel Barth-Maron, Ziyu Wang, Nando de Freitas, and Worlds Team. Making efficient use of demonstrations to solve hard exploration problems. In International Conference on Learning Representations, 2020. +Yijie Guo, Shengyu Feng, Nicolas Le Roux, Ed Chi, Honglak Lee, and Minmin Chen. Batch reinforcement learning through continuation method. In International Conference on Learning Representations, 2021. +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, volume 80, pages 1861-1870. PMLR, 2018. +Peter Henderson, Riashat Islam, Philip Bachman, Joelle Pineau, Doina Precup, and David Meger. Deep reinforcement learning that matters. In AAAI Conference on Artificial Intelligence, 2017. +Todd Hester, Matej Vecerik, Olivier Pietquin, Marc Lanctot, Tom Schaul, Bilal Piot, Dan Horgan, John Quan, Andrew Sendonaris, Gabriel Dulac-Arnold, et al. Deep q-learning from demonstrations. arXiv preprint arXiv:1704.03732, 2017. +Natasha Jaques, Asma Ghandeharioun, Judy Hanwen Shen, Craig Ferguson, Agata Lapedriza, Noah Jones, Shixiang Gu, and Rosalind Picard. Way off-policy batch deep reinforcement learning of implicit human preferences in dialog. arXiv preprint arXiv:1907.00456, 2019. +Kshitij Judah, Alan Fern, Prasad Tadepalli, and Robby Goetschalckx. Imitation learning with demonstrations and shaping rewards. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 28, 2014. +Sham Kakade. A natural policy gradient. In Proceedings of the 14th International Conference on Neural Information Processing Systems: Natural and Synthetic, pages 1531-1538, 2001. +Bingyi Kang, Zequn Jie, and Jiashi Feng. Policy optimization with demonstrations. In International Conference on Machine Learning, pages 2469-2478. PMLR, 2018. +Beomjoon Kim, Amir-massoud Farahmand, Joelle Pineau, and Doina Precup. Learning from limited demonstrations. In Advances in Neural Information Processing Systems, pages 2859-2867, 2013. +Ilya Kostrikov, Jonathan Thompson, Rob Fergus, and Ofir Nachum. Offline reinforcement learning with fisher divergence: critical regularization. arXiv preprint arXiv:2103.08050, 2021. +Aviral Kumar, Justin Fu, Matthew Soh, George Tucker, and Sergey Levine. Stabilizing off-policy q-learning via bootstrapping error reduction. In Advances in Neural Information Processing Systems, pages 11784-11794, 2019. +Aviral Kumar, Aurick Zhou, George Tucker, and Sergey Levine. Conservative q-learning for offline reinforcement learning. arXiv preprint arXiv:2006.04779, 2020. +Sascha Lange, Thomas Gabel, and Martin Riedmiller. Batch reinforcement learning. In Reinforcement learning, pages 45-73. Springer, 2012. +Romain Laroche, Paul Trichelair, and Remi Tachet Des Combes. Safe policy improvement with baseline bootstrapping. In International Conference on Machine Learning, pages 3652-3661. PMLR, 2019. +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. arXiv preprint arXiv:1509.02971, 2015. +Travis Mandel, Yun-En Liu, Sergey Levine, Emma Brunskill, and Zoran Popovic. Offline policy evaluation across representations with applications to educational games. In International Conference on Autonomous Agents and Multiagent Systems, 2014. + +Tatsuya Matsushima, Hiroki Furuta, Yutaka Matsuo, Ofir Nachum, and Shixiang Gu. Deployment-efficient reinforcement learning via model-based offline optimization. arXiv preprint arXiv:2006.03647, 2020. +Ofir Nachum, Bo Dai, Ilya Kostrikov, Yinlam Chow, Lihong Li, and Dale Schuurmans. Algaedice: Policy gradient from arbitrary experience. arXiv preprint arXiv:1912.02074, 2019. +Ashvin Nair, Bob McGrew, Marcin Andrychowicz, Wojciech Zaremba, and Pieter Abbeel. Overcoming exploration in reinforcement learning with demonstrations. In 2018 IEEE International Conference on Robotics and Automation (ICRA), pages 6292-6299. IEEE, 2018. +Ashvin Nair, Murtaza Dalal, Abhishek Gupta, and Sergey Levine. Accelerating online reinforcement learning with offline datasets. arXiv preprint arXiv:2006.09359, 2020. +Ian Osband, Yotam Doron, Matteo Hessel, John Aslanides, Eren Sezener, Andre Saraiva, Katrina McKinney, Tor Lattimore, Csaba Szepesvari, Satinder Singh, et al. Behaviour suite for reinforcement learning. arXiv preprint arXiv:1908.03568, 2019. +Tom Le Paine, Cosmin Paduraru, Andrea Michi, Caglar Gulcehre, Konrad Zolna, Alexander Novikov, Ziyu Wang, and Nando de Freitas. Hyperparameter selection for offline reinforcement learning. arXiv preprint arXiv:2007.09055, 2020. +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. In Advances in Neural Information Processing Systems, pages 8024-8035, 2019. +Xue Bin Peng, Aviral Kumar, Grace Zhang, and Sergey Levine. Advantage-weighted regression: Simple and scalable off-policy reinforcement learning. arXiv preprint arXiv:1910.00177, 2019. +Mark Pfeiffer, Samarth Shukla, Matteo Turchetta, Cesar Cadena, Andreas Krause, Roland Siegwart, and Juan Nieto. Reinforced imitation: Sample efficient deep reinforcement learning for mapless navigation by leveraging prior demonstrations. IEEE Robotics and Automation Letters, 3(4): 4423-4430, 2018. +Dean A Pomerleau. Efficient training of artificial neural networks for autonomous navigation. Neural computation, 3(1):88-97, 1991. +Antonin Raffin, Ashley Hill, Maximilian Ernestus, Adam Gleave, Anssi Kanervisto, and Noah Dormann. Stable baselines3. https://github.com/DLR-RM/stable-baselines3, 2019. +Aravind Rajeswaran, Vikash Kumar, Abhishek Gupta, Giulia Vezzani, John Schulman, Emanuel Todorov, and Sergey Levine. Learning complex dexterous manipulation with deep reinforcement learning and demonstrations. arXiv preprint arXiv:1709.10087, 2017. +Stéphane Ross, Geoffrey Gordon, and Drew Bagnell. A reduction of imitation learning and structured prediction to no-regret online learning. In Proceedings of the fourteenth international conference on artificial intelligence and statistics, pages 627-635. JMLR Workshop and Conference Proceedings, 2011. +John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017. +Noah Siegel, Jost Tobias Springenberg, Felix Berkenkamp, Abbas Abdelmaleki, Michael Neunert, Thomas Lampe, Roland Hafner, Nicolas Heess, and Martin Riedmiller. Keep doing what worked: Behavior modelling priors for offline reinforcement learning. In International Conference on Learning Representations, 2020. +David Silver, Guy Lever, Nicolas Heess, Thomas Degris, Daan Wierstra, and Martin Riedmiller. Deterministic policy gradient algorithms. In International Conference on Machine Learning, pages 387-395, 2014. +Richard S Sutton and Andrew G Barto. Reinforcement learning: An introduction, volume 1. MIT press Cambridge, 1998. + +Emanuel Todorov, Tom Erez, and Yuval Tassa. Mujoco: A physics engine for model-based control. In IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS), pages 5026-5033. IEEE, 2012. +George Tucker, Surya Bhupatiraju, Shixiang Gu, Richard Turner, Zoubin Ghahramani, and Sergey Levine. The mirage of action-dependent baselines in reinforcement learning. In International Conference on Machine Learning, 2018. +Matej Večerík, Todd Hester, Jonathan Scholz, Fumin Wang, Olivier Pietquin, Bilal Piot, Nicolas Heess, Thomas Rothörl, Thomas Lampe, and Martin Riedmiller. Leveraging demonstrations for deep reinforcement learning on robotics problems with sparse rewards. arXiv preprint arXiv:1707.08817, 2017. +Qing Wang, Jiechao Xiong, Lei Han, Peng Sun, Han Liu, and Tong Zhang. Exponentially weighted imitation learning for batched historical data. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, pages 6291-6300, 2018. +Ziyu Wang, Alexander Novikov, Konrad Zolna, Josh S Merel, Jost Tobias Springenberg, Scott E Reed, Bobak Shahriari, Noah Siegel, Caglar Gulcehre, Nicolas Heess, et al. Critic regularized regression. Advances in Neural Information Processing Systems, 33, 2020. +Yifan Wu, George Tucker, and Ofir Nachum. Behavior regularized offline reinforcement learning. arXiv preprint arXiv:1911.11361, 2019. +Yuchen Wu, Melissa Mozifian, and Florian Shkurti. Shaping rewards for reinforcement learning with imperfect demonstrations using generative models. In 2021 IEEE International Conference on Robotics and Automation (ICRA), pages 6628-6634. IEEE, 2021. +Mengjiao Yang, Bo Dai, Ofir Nachum, George Tucker, and Dale Schuurmans. Offline policy selection under uncertainty. arXiv preprint arXiv:2012.06919, 2020. +Yuke Zhu, Ziyu Wang, Josh Merel, Andrei Rusu, Tom Erez, Serkan Cabi, Saran Tunyasuvunakool, János Kramár, Raia Hadsell, Nando de Freitas, et al. Reinforcement and imitation learning for diverse visuomotor skills. arXiv preprint arXiv:1802.09564, 2018. + +# Checklist + +1. For all authors... + +(a) Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope? [Yes] +(b) Did you describe the limitations of your work? [Yes] See the discussion on instability in Section 4. +(c) Did you discuss any potential negative societal impacts of your work? [Yes] In the supplementary material. +(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] + +2. If you are including theoretical results... + +(a) Did you state the full set of assumptions of all theoretical results? [N/A] +(b) Did you include complete proofs of all theoretical results? [N/A] + +3. If you ran experiments... + +(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] Included with the supplementary material. +(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] In the supplementary material. +(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] See Figure 4. +(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [No] Partially. Run time experiments include compute description in Section 5. + +4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... + +(a) If your work uses existing assets, did you cite the creators? [Yes] +(b) Did you mention the license of the assets? [Yes] In the supplementary material. +(c) Did you include any new assets either in the supplemental material or as a URL? [N/A] + +(d) Did you discuss whether and how consent was obtained from people whose data you're using/curating? [N/A] +(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] + +5. If you used crowdsourcing or conducted research with human subjects... + +(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] +(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] +(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] \ No newline at end of file diff --git a/aminimalistapproachtoofflinereinforcementlearning/images.zip b/aminimalistapproachtoofflinereinforcementlearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..26e8c1c73d8bb66409de55089a726260b23188b6 --- /dev/null +++ b/aminimalistapproachtoofflinereinforcementlearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7a232b6ac108b7a45ad0f792cae3ef5ca9c8336933d540c633cd41e12030c603 +size 506429 diff --git a/aminimalistapproachtoofflinereinforcementlearning/layout.json b/aminimalistapproachtoofflinereinforcementlearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d1a91841d7100dc430a4706b6ad2ad079173825e --- /dev/null +++ b/aminimalistapproachtoofflinereinforcementlearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eedad3fe6b7eb1b423a669779c1cf04cf5a1904ca32a865458dfaeb52768dde8 +size 347646 diff --git a/amultiimplicitneuralrepresentationforfonts/de51bb51-e8fe-4115-be2b-db6264a87dc4_content_list.json b/amultiimplicitneuralrepresentationforfonts/de51bb51-e8fe-4115-be2b-db6264a87dc4_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..6cafa303120f312cd62c4805dd9b650b3e862aa4 --- /dev/null +++ b/amultiimplicitneuralrepresentationforfonts/de51bb51-e8fe-4115-be2b-db6264a87dc4_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:856a5ec231f54551ccff658a18a4408443d64c0bd17a3b457ca34dd58694782d +size 61426 diff --git a/amultiimplicitneuralrepresentationforfonts/de51bb51-e8fe-4115-be2b-db6264a87dc4_model.json b/amultiimplicitneuralrepresentationforfonts/de51bb51-e8fe-4115-be2b-db6264a87dc4_model.json new file mode 100644 index 0000000000000000000000000000000000000000..dd455b62f128c0d801497318a622f3592bea86ec --- /dev/null +++ b/amultiimplicitneuralrepresentationforfonts/de51bb51-e8fe-4115-be2b-db6264a87dc4_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a811c9b782a44585458493018ae9475358c6c90c3d67b288c84cc2023a0a88ef +size 72800 diff --git a/amultiimplicitneuralrepresentationforfonts/de51bb51-e8fe-4115-be2b-db6264a87dc4_origin.pdf b/amultiimplicitneuralrepresentationforfonts/de51bb51-e8fe-4115-be2b-db6264a87dc4_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6006981267f4d4d645662cabb15ae80ccd161867 --- /dev/null +++ b/amultiimplicitneuralrepresentationforfonts/de51bb51-e8fe-4115-be2b-db6264a87dc4_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5453578a4618e320e85b73dca1ea0fff3a9da282da3e6b448de1d1a6265ced7f +size 13690137 diff --git a/amultiimplicitneuralrepresentationforfonts/full.md b/amultiimplicitneuralrepresentationforfonts/full.md new file mode 100644 index 0000000000000000000000000000000000000000..8de3e95b15642ff81e73e0f345c4fb5085e86fa0 --- /dev/null +++ b/amultiimplicitneuralrepresentationforfonts/full.md @@ -0,0 +1,250 @@ +# A Multi-Implicit Neural Representation for Fonts + +Pradyumna Reddy + +Zhaowen Wang + +Matthew Fisher + +Zhifei Zhang + +Hailin Jin + +Niloy J. Mitra1,2 + +1University College London + +$^{2}$ Adobe Research + +# Abstract + +Fonts are ubiquitous across documents and come in a variety of styles. They are either represented in a native vector format or rasterized to produce fixed resolution images. In the first case, the non-standard representation prevents benefiting from latest network architectures for neural representations; while, in the latter case, the rasterized representation, when encoded via networks, results in loss of data fidelity, as font-specific discontinuities like edges and corners are difficult to represent using neural networks. Based on the observation that complex fonts can be represented by a superposition of a set of simpler occupancy functions, we introduce multi-implicit to represent fonts as a permutation-invariant set of learned implicit functions, without losing features (e.g., edges and corners). However, while multi-implicit locally preserve font features, obtaining supervision in the form of ground truth multi-channel signals is a problem in itself. Instead, we propose how to train such a representation with only local supervision, while the proposed neural architecture directly finds globally consistent multi-implicit for font families. We extensively evaluate the proposed representation for various tasks including reconstruction, interpolation, and synthesis to demonstrate clear advantages with existing alternatives. Additionally, the representation naturally enables glyph completion, wherein a single characteristic font is used to synthesize a whole font family in the target style. + +# 1 Introduction + +Fonts constitute the vast majority of documents. They come in a variety of styles spanning a range of topologies representing a mixture of smooth curves and sharp features. Although fonts vary significantly across families, they remain stylistic coherent across the different alphabets/symbols inside any chosen font family. + +Fonts are most commonly stored in a vector form (e.g., a collection of spline curves) that is compact, efficient, and can be resampled at arbitrary resolutions without loss of features. This specialized representation, however, prevents the adaptation of many deep learning setups optimized for regular structures (e.g., image grids). In order to avoid this problem, custom deep learning architectures have been developed for directly producing vector output but they typically require access to ground truth vector data for training. This is problematic: first, collecting sufficient volume of vector data for training is non trivial; and second, vector representations are not canonical (i.e., same fonts can be represented by different sequence of vectors), which in turn requires hand-coded network parameters to account for varying number of vector instructions. + +An alternate approach is to rasterize vectorized fonts and simply treat them as images. While this readily allows using image-based deep learning methods, the approach inherits problems of discretized + +![](images/4ae30913a2c42015b90eb236ebfe45fada6372ec1c9c639019aa2a055c6eb586.jpg) +Figure 1: Multi-implicit neural representation for high fidelity font reconstruction and generation. Note that while ours perform similar to ImageVAE at lower/training resolution, the advantage of ours becomes clear when we test at higher resolution (e.g., how corners continue to be preserved). + +representations leading to aliasing artifacts and loss of sharp features. Further, the resultant images are optimized for particular resolutions and cannot be resampled without introducing additional artifacts. + +Recently, implicit representation has emerged as an attractive representation for deep learning as, once trained, they can resampled at different resolutions without introducing artifacts. Unfortunately, implicit representations (e.g., signed distance fields) for fonts are often too complex to be represented accurately by neural networks. As a result, although deep implicits work for simple fonts, they can fail to retain characteristic features (i.e., edges and corners) for complex fonts. + +Drawing inspiration from multi-channel SDFs [4], we observe that complex fonts can be expressed as a composition of multiple simple regions. For example, a local corner can be represented as a suitable composition of two half-planes, each of which can easily be individually encoded as deep implicit functions. We build on this idea by hypothesizing that complex fonts can also be encoded as suitable composition of global implicit functions. We call such a representation to be a multi-implicit neural representation, as each (global) implicit function is neurally encoded. + +Thus, multi-implicits provide a simple representation that is amenable for processing by neural networks and the output fidelity remains comparable, even under resampling, to vector representations without losing edge or corner features. A remaining challenge is how to supervise such a network as there is no dataset with reference multi-implicits that be directly used. In this paper, we present a network structure and training procedure that allow multi-implicits to be trained using only local supervision. We describe how to extract necessary local supervision from vector input and to adaptively obtain training information for the + +![](images/fb58a49428d639804009073a092bc810ad02fe0704f6b49bcc769cb5bb3aeb47.jpg) +Figure 2: Corner preserving capability of different sampling methods. + +We extensively evaluated the proposed multi-implicitly representation for various tasks including reconstruction, interpolation, and synthesis to demonstrate clear advantages over several existing state-of-the-art alternatives. Additionally, the representation naturally enables glyph completion, wherein a single characteristic font glyph is used to synthesize a whole font family in consistent style. + +# 2 Related Work + +Raster-based representation. One of the most intuitive representation of shapes is raster, i.e., representing a 2D shape by pixels or a 3D shape by voxels, which provides the grid-format data that is perfectly compatible with (regular) CNN models. Hence it has acted as a catalyst for many deep learning based methods for semantic editing of raster-based shapes. A general idea is to learn an encoding-decoding model and then manipulate the shape in the latent space. Sharing a similar spirit, many generative models [21, 5, 15] engaged in the raster-based generation and attribute transfer. [1, 25] narrowed down the scope to fonts specifically, which focus more on the shape instead of texture. While the raster-based representation has shown strong semantic editability as incorporated + +with deep models, it is still limited by its intrinsic resolution. Since image super-resolution is an ill-posed problem, details cannot be fully recovered after upscaling. + +Deep learning based vector graphs. Vector graphics (e.g., SVG) have been widely adopted as a scalable representation. Typically, it is constructed by sequences of Bézier curves, which are difficult to be modeled by traditional CNN models since the diverse sequence length across different shapes, as well as diverse types and numbers of Bézier curves for the similar or even the same shape. Therefore, RNN-based models (e.g., LSTM) are commonly adopted in recent works [17, 2] to learn the dynamic sequence of curves. Although the sequential modeling could achieve semantic editing and/or interpolation between shapes, it is still lagging behind CNN-based models (raster-based methods) in terms of reconstruction accuracy because it has to model much longer temporal dependency. Also, there is no specific attention given to features like edges and corners. + +Transformation from raster to vector. Instead of directly modeling raster or vector, an idea of achieving both scalability and editability is to model the transfer from raster to vector [20] (we will not consider vectorization methods that purely transfer images to vectors). Such an approach inherits the advantages of raster-based methods and supports easy editability. In addition, they output scalable vectors directly. However, this method would be still limited by the raster resolution, i.e., the output vector graph cannot capture enough details since the corresponding raster input may have already lost those finer details. Another challenge for such methods is the high complexity of the shape, e.g., interpolation between shapes with different topologies leads to undesirable intermediate shapes. + +Deep implicit representation. Deep implicit functions [10, 3, 8, 22, 18, 23] have achieved great success in shape representation. They take advantage of deep learning techniques to fit an implicit function, which provides a continuous representation breaking the grid limitation of a raster domain. In addition, deep implicit functions model shapes spatially instead of modeling sequentially as aforementioned in deep learning based vector graphs. Therefore, deep implicit functions could preserve the editability like raster-based representation and potentially achieves scalable representation like vectors. Unfortunately, existing works seldom explore the scalability and fidelity of shapes in their representations, especially during editing, interpolation, and upscaling. For instance, sharp corners always suffer from editing and scaling. This is particularly problematic in the domain of fonts, and our work addresses this limitation via the proposed multi-implicit representations. + +# 3 Methods + +We represent fonts as the composition of multiple global implicit functions. An implicit representation has two key advantages: it allows for rendering at arbitrary resolution; it can be locally supervised in characteristic areas such as sharp edges and corners. Unlike a single implicit function, our multi-implicit representation can faithfully reconstruct sharp features with low reconstruction error (Figure 2). + +We train a generative neural network, as shown in the inset, that models fonts using this representation. Instead of directly learning the inside-outside status of the font image [3], we predict a set of distance fields of 2D shapes. Their com + +![](images/1552131e75832944b4d214600bf617116a3d127f34789c2301345a7d7253c07f.jpg) + +position is then fed into a differentiable rasterizer to produce the final image. We will show in Section 4 how this generative model enables a diverse set of font reconstruction and editing operations. Section 3.1 details differentiable rasterization of 2D distance fields, and corresponding corner preservation is discussed in Section 3.2. Finally, training losses and details are given in Section 3.3. + +# 3.1 Differentiable Rasterization of Distance Field + +As aforementioned, we use the signed distance field (SDF) to model 2D shapes. The common supervisions for SDF are SDF labels from the ground truth curves or distance transform on the silhouette [14]. Figure 3 compares the results between training with SDF and training with raster, + +![](images/e4541dc75cd408a4cc94e9814c66abf56b39dc38ad083e9ab36b348a8ee7a7ae.jpg) +Figure 3: Reconstruction with different training signals. Training using SDF (2nd column) does not ensure good reconstruction in raster domain, while training with both SDF and rasterized image (3rd column) and only rasterized SDF (ours) yields smoother boundary. + +where training only on the ground truth SDF does not always result in a good raster image in terms of boundary smoothness. In contrast, training with the supervision of raster yields smoother boundary. Therefore, we will draw supervision on rasterized SDF to achieve better shape. + +Sharing the spirit from vector graphics rasterization works [7, 11, 16, 19, 24], we simplify general vector graphics rendering by analytically approximating the point to curve distance as, + +$$ +I (x, y) = K \left(\min _ {i \in \mathcal {F}} d _ {i} (x, y)\right) g (x, y), \tag {1} +$$ + +$$ +K (d) = \left\{ \begin{array}{l l} 1 & \text {i f} d > \gamma , \\ k \left(\frac {d}{\gamma}\right) = \frac {1}{2} + \frac {1}{4} \left(\left(\frac {d}{\gamma}\right) ^ {3} - 3 \left(\frac {d}{\gamma}\right)\right) & \text {i f} - \gamma \leq d \leq \gamma , \\ 0 & \text {i f} d < - \gamma , \end{array} \right. \tag {2} +$$ + +where $d_{i}(x,y)$ indicates an SDF of distance from pixel $(x,y)$ center to the closest point on the $i$ -th curve corresponding the font $\mathcal{F}$ , and $K$ denotes a function that approximates the opacity based on the distance value. There are many works for estimating $d_{i}(x,y)$ from scene parameters but most of them are constrained by the choice of the parameterization. In this paper, we model each $d_{i}(x,y)$ using an implicit neural network. The function $g$ models the spatially-varying texture of the shape. For solid fonts, we set $g = 1$ . In the supplemental we show examples of textured fonts where we make use of spatially varying $g$ . In the function $K$ , $\gamma$ is the anti-alias range, and the kernel $k$ is a radially symmetric continuous filter that satisfies the constraint $k(1) = 0$ and $k(-1) = 1$ . In our work, we approximate $k(\cdot)$ using a parabolic kernel similar to [19, 13]. Note that the rasterization function $I(x,y)$ has non-zero gradients only if $(x,y)$ falls inside of the anti-aliasing range. We use a progressively decreasing anti-aliasing range strategy for better convergence and fidelity (see Sec. 3.3). + +# 3.2 Multi-Curve Representation for Sharp Corners + +We will lose details like sharp corners when upscaling bitmaps or sign distance functions. Resampling an implicit model that encodes the pixel values or signed distance values of a shape similarly suffers from blurry corners. An brute force solution is to train the implicit model with extremely high-resolution images, but this would drastically increase the burden of training, and still limited by the training resolution. Rather than + +![](images/8b7f91bcfb74358a2ba46052d984c32b6eeb227cc6360259ec62246a5ef5dd9d.jpg) +(a) Possible corner preserving shapes represented with $n = 2$ . + +![](images/c2249a4e3481227c512ab06a6421c96de8cb7ae9ac7d004b9e726d88994dd862.jpg) +Figure 4: Intersection of two curves to encode concave and convex corners. + +![](images/178f29a90f12a4bc1ce8d50baa0f5437fe1c3b78eb0e71fd33d843a77d35fcff.jpg) +(b) Corner template. + +![](images/c74ed28a10d2f437a61fe002cc6c1412764bd9d134ae4a8897e9ea370ebb788d.jpg) + +directly modeling corners, we represent corners as the intersection of multiple curves (e.g., lines or parabolas), drawing inspiration from traditional representations [9]. Note that even though these individual sub-curves may be smoothed after encoded by a deep model, the sharpness of their intersection will be preserved. With this insight, we construct sharp corners from multiple smooth curves + +predicted by the implicit model. More specifically, the implicit model is designed to predict multiple SDFs (and rasterization of distance fields), each of which carries smooth curves/shapes decoupled from corners and edges as illustrated in Figure 4a. + +Assume a shape $\mathcal{F}$ is represented by a set of curves $\mathcal{C} = \{C_1, C_2, \dots, C_n\}$ , where $C_n$ is a binary map indicating whether a pixel is inside (i.e., 1) or outside (i.e., 0) the $n$ -th curve, like the example in Figure 4a. In our scenario, $C_n = K(d_n)$ , where $d_n$ is the $n$ -th SDF channel estimated by the implicit model. Then, a function over all curves $F(\mathcal{C})$ will fuse those curves to reconstruct the shape, preserving sharp corners. As illustrated in Figure 4a, two curves can sufficiently represent a corner, either convex or concave by adopting maximum or minimum as the function $F$ . To represent a shape with arbitrary corners, however, it requires three curves at least. For example, $F(\mathcal{C}) = \min \left(\max \left(C_1, C_2\right), C_3\right)$ can model all corners in a shape. Therefore, we set $n = 3$ , i.e., $\mathcal{C} = \{C_1, C_2, C_3\}$ . Since deep models are sensitive to the permutation of guidance signals during training, we use the median function as $F$ , which achieves sharp corners and permutational invariance to the order of these curves. Thus, a corner-related loss on $F(\mathcal{C})$ could be robust to the ordering ambiguity. + +Based on $F(\mathcal{C})$ (median function on three curves), a typical corner $O$ is presented in Figure 4b, where intersection of two curves divides its local space into four quadrants, i.e., from $Q_{1}$ to $Q_{4}$ . There are always two opposite quadrants that one is inside area (i.e., $Q_{1}$ ) where corresponding values from $F(\mathcal{C})$ are 1, and the other is outside area (i.e., $Q_{4}$ ) where corresponding values from $F(\mathcal{C})$ are 0. The rest two opposite quadrants (i.e., $Q_{2}$ and $Q_{3}$ ) are equal on $F(\mathcal{C})$ but different on $\mathcal{C}$ . For example, the values on $\{C_{1}, C_{2}, C_{3}\}$ corresponding to the $Q_{2}$ area is $(1, 0, 0)$ , so $F(\mathcal{C})$ on $Q_{2}$ is 0. Then, $F(\mathcal{C})$ on $Q_{3}$ should be 0 as well. However, the values on $\{C_{1}, C_{2}, C_{3}\}$ corresponding to the $Q_{3}$ region must be different from $(1, 0, 0)$ , i.e., could be $(0, 1, 0)$ or $(0, 0, 1)$ . If $F(\mathcal{C})$ on $Q_{2}$ and $Q_{3}$ is 1, $O$ is a concave corner. Otherwise, $O$ is a convex corner. Such distribution of $\mathcal{C}$ along the four quadrants around a corner $O$ is referred to as corner template. + +The shapes are encoded as the multi-curve representation through an implicit model. The implicit model takes sample $(x,y,l)$ (i.e., 2D spatial location $(x,y)$ and glyph label $l$ ), as well as embedding $z$ that indicates the font style, and outputs three channels of SDF $\{d_1,d_2,d_3\}$ . Then, the rasterization approach discussed in Differentiable Rasterization of Distance Field converts each $d_{i}$ to $C_i$ ( $i = 1,2,3$ ). Finally, the median function $F(\mathcal{C})$ renders the final shape. We optimize the global shape using the final render output and (locally) supervise each corner to be locally represented as an intersection of two curves. One could use the output of [4] to train a network. However, the edge coloring approach presented in [4] has no canonical form, which prevents a neural network from learning a continuous latent space between shapes. Please note that since we focus on corner supervision to ensure sharp corners at higher resolution resampling, it is unnecessary to constraint the model by multi-channel supervision globally. + +In the optimization of rendered global shape, the median operation $F(\mathcal{C})$ would route the gradients to the correspondingly active value only, i.e., only update a single channel at each location of $\mathcal{C}$ . However, at least two of the three channels of $\mathcal{C}$ at a certain location need to be updated to approaching the ground truth because of the nature of the median operator. Therefore, in the training stage, we use an approximation $\hat{F} (\mathcal{C})$ defined as the average of the median and the closest value to the median, thus two channels will be updated. + +# 3.3 Training Details + +We use three losses on the shape of glyph: (i) a global shape loss that captures glyph shapes globally, (ii) corner template loss that supervises intersection of curves locally to make the shape robust against resampling and editing; and (iii) Eikonal loss to adhere to true SDFs. + +For global shape training, since gradients are non-zero only at the anti-aliasing range, i.e., edges of the shape, we sample the edges of the rasterized glyph to train the implicit model. We shape $3 \times 3$ neighborhoods around the anti-alias pixel, where we have a sample of one value outside the shape (i.e., 0), one value inside the shape (i.e., 1), and everything in between. Meanwhile, we sample from homogeneous areas inside and outside of the glyph, such that the model does not fit a degenerate solution. The edge/corner-aware sampling is referred to as + +![](images/b0e0f9dd61f12ef38c5c38d85ecc93e749bc21509285cef960e27d8aac87cb5b.jpg) + +importance sampling (see inset). Such non-standard sampling further motivates the use of implicit models, and importance sampling would significantly reduce the computational complexity for training on higher resolution shapes as compared to the traditional training on grid images. + +We measure global shape loss between the final rendering from $F(\mathcal{C})$ and rasterized glyph $I$ . We use a differential approximation $\hat{F}(\mathcal{C})$ at training time. All the edges, area, and corner samples from the raster image are used to train the implicit model via mean square error as, + +$$ +\mathcal {L} _ {\text {g l o b a l}} = \mathbb {E} \left(\hat {F} (\mathcal {C}) - I\right) ^ {2}. \tag {3} +$$ + +For local corner template loss, we first perform corner detection. A corner is defined as a local where two curves intersect at an angle less than a threshold (the threshold is 3rad or $171^{\circ}$ in our experiments). For each corner, we generate the corner template as discussed in section 3.2. The template size is $7 \times 7$ corresponding to the image size of $128 \times 128$ . The size of the corner template is scaled based on the size of the image, but the size of the sampling neighborhood for the global shape training remains the same. We densely sample the edges and corners, and sparsely sample the homogeneous areas. + +To represent glyph corners as the intersection of two curves, we supervise the corner samples by the corresponding corner templates. Since the render function $F(\mathcal{C})$ is invariant to the order of the SDF/raster channels, the corner template loss inherits the permutation invariance to the channel order and, in order to avoid unnecessarily constraining the network, we only supervise $Q_{2}$ and $Q_{3}$ of the template using the loss, + +$$ +\mathcal {L} _ {\text {l o c a l}} = \mathbb {E} _ {O \in \text {c o r n e r s a m p l e s}} \sum_ {i = 2} ^ {n} \min _ {j \in \{2, \dots , n \}} \left(C _ {i} ^ {O} - T _ {j} (O)\right) ^ {2}, \tag {4} +$$ + +where $O$ indicates a corner sample from ground truth, and $n$ is the number of channels (i.e., $n = 3$ in our setting). The correspondingly predicted curves of the corner $O$ are denoted by $C_i^O$ , and the corresponding corner template is $T(O)$ that has $n$ channels indexed by $j$ . + +The gradient loss aims to constraint the output of the implicit network to resemble a distance field this is so that the implicit re-sampling is more well behaved and resembles a closed continuous shape. A special case of Eikonal partial differential equations [6] posits that the solution to $d(x,y;\theta)$ must satisfy $\mathbb{E}||\nabla d(x,y;\theta)|| = 1$ , where $d(x,y;\theta)$ denotes a simplified implicit model parameterized by $\theta$ . Since satisfying this constraint is not completely necessary for our desired solution, we loosen it to be greater than or equal to 1 as Eq. 5, which intuitively encourages the function to be monotonic. + +$$ +\mathcal {L} _ {g r a d} = \left\{ \begin{array}{l l} \mathbb {E} | 1 - \| \nabla d (x, y; \theta) \| _ {2} | & \text {i f} \| \nabla d (x, y; \theta) \| _ {2} < 1, \\ 0 & \text {i f} \| \nabla d (x, y; \theta) \| _ {2} \geq 1, \end{array} \right. \tag {5} +$$ + +where $\| \cdot \|_2$ represents the $\ell_2$ -norm, and $|\cdot|$ calculates the absolute values. Finally, the total loss is + +$$ +\mathcal {L} = \mathcal {L} _ {\text {g l o b a l}} + \alpha \mathcal {L} _ {\text {l o c a l}} + \beta \mathcal {L} _ {\text {g r a d}} + \gamma \| z \| _ {2}, \tag {6} +$$ + +where $\alpha, \beta,$ and $\gamma$ are weights to balance these terms during the training. + +Training Warm-up. Since the gradients mainly fall into the anti-aliasing range, network initialization would significantly affect the convergence. To this perspective, we set the initial anti-aliasing range to be the whole image range and slowly shrink it to $k \cdot w^{-1}$ during the training, where $w$ is image width, and $k = 4$ in our experiments. Such warm-up helps the model converge more consistently, and the estimated SDF is more well behaved. Comparison of SDF with and without warm-up is conducted in the supplementary. + +# 4 Experiments + +We evaluate our method against the tasks of reconstruction, interpolation, and generation. In reconstruction and interpolation, we compare our method to ImageVAE [12], DeepSVG [2], and Im2Vec [20], while we compare to DeepSVG and Attr2Font [25] in the generation task. The metrics for evaluating the rendered glyphs are mean squared error (MSE) and soft IoU (s-IoU), which is defined as + +$$ +\mathrm {s - I o U} \left(I _ {1}, I _ {2}\right) = \| I _ {1} I _ {2} \| _ {1} / \| \left(I _ {1} + I _ {2}\right) _ {| 0, 1 |} \| _ {1}, \tag {7} +$$ + +Table 1: Comparison with baselines on reconstructing training samples at different resolutions. In training, we use resolution of $64 \times 64$ . In testing, to achieve target resolution, we bilinearly upsample ImageVAE output from 64, rasterize vector from DeepSVG and Im2Vec, and directly query ours. + +
MSE ↓s-IoU ↑
Methods12825651210241282565121024
ImageVAE.0072.0120.0160.0186.8252.8416.8482.8494
DeepSVG.1022.1081.1108.1121.3073.3124.3162.3164
Im2Vec.0435.0518.0557.0571.7279.7293.7294.7294
Ours.0118.0170.0201.0218.8750.8978.9035.9049
+ +where $I_{1}$ and $I_{2}$ are the images to compare, $\| \cdot \| _1$ denotes the $\ell_1$ -norm, and $|0,1|$ clips the values to the interval of [0,1]. To evaluate the fidelity of glyph rendering in larger scales, glyphs are rendered at the resolution of 128, 256, 512, and 1024 from each method without changing the training resolution $(64\times 64)$ . + +![](images/32ea6f3ea8becff8fad02a654d0132192211815d9a97c4e4e470f6d153514fdb.jpg) +Figure 5: Reconstruction examples (baseline vs. ours) with zoom-in box highlighting corners. We have vectorized the zero-level-set of the SDF output in a piece-wise linear way. Please use digital-zoom to take a closer look at the difference in reconstruction quality. + +Reconstruction and Interpolation. We compute MSE and s-IoU over the training dataset at different resolutions to quantify how different algorithms capture the input training dataset. For a fair comparison, we train all the algorithms on the same dataset used by Im2Vec [20], which consists of 12,505 images. Table 1 displays MSE and s-IoU metrics on the training set. For ImageVAE, we perform bilinear interpolation to obtain higher resolution outputs. Our method outperforms the others on s-IoU, indicating better reconstruction of the glyph shapes. ImageVAE gets higher scores on MSE because its training objective aligns with the MSE metric. However, ImageVAE would show blurry shapes in interpolation and editing as demonstrated in Figure 6a, where we achieve more continuous interpolation/latent space. Even in reconstruction, as visualized in Figure. 5, ImageVAE cannot preserve sharp boundary and corners as compared to the other methods. Since DeepSVG and Im2Vec directly output vectors, they can always render shapes with clear boundaries, but they are limited in capturing the global shapes as compared to our method. Another advantage of our method over DeepSVG and Im2Vec is that we learn a smoother latent space, achieving better performance on interpolation as demonstrated in Table 2. Even interpolating between complex shapes, as shown in Figure 6b, our method performs better than the state-of-the-art Im2Vec. In Table 2 we present the MSE and s-IOU calculated between a random interpolated glyph and its nearest neighbour in the training dataset. This helps quantify similarity between training versus generation distribution. + +We have also experimented with Fourier features, Sine activation and Sawtooth activation function with a feed forward network, due to the high frequency nature of these functions the latent space learned by such a network is not continuous. Since learning a continuous latent space is essential for applications like interpolation and font family generation from a complete or partial glyph, we resorted to using a LeakyReLU based activation function. However if the users main requirement is only faithful reconstruction of the input dataset, single channel fitting with fourier features trained + +using our differential rasterization function should yield similar results as multi channel fitting with LeakyReLU activation. + +Table 2: Comparison with baselines on interpolation at different resolutions. + +
MSE ↓s-IoU ↑
Methods12825651210241282565121024
ImageVAE.0181.0183.0185.0185.7715.7721.7731.7734
DeepSVG.0544.0556.0569.0575.6337.6347.6365.6372
Im2Vec.0434.0445.0463.0473.7213.7218.7232.7238
Ours.0279.0297.0316.0343.8181.8184.8222.8234
+ +![](images/466d4bd4288808309950f905bfb83cc1ececdc083de174db3f36e9bacdbbc0c5.jpg) +(a) Comparison of all methods. + +![](images/09b9ab7cb04d67b3baece1cac3ba8ca9aa477cba2059693935fbf42d0b813d23.jpg) +(b) A challenging example where baselines fail. +Figure 6: Comparison of interpolation between two random font styles. We color different curves in the vector output to highlight details. + +Generation. To generate new fonts and the corresponding glyphs, first the auto-decoder implicit model is trained with latent vector $z$ and glyph label (i.e., one-hot encoding) concatenated to spatial locations as the input. We train on 1,000 font families, i.e., 52,000 images, and test on 100 font families. In the inference stage, given an unseen glyph, we first find the optimal latent vector (i.e., font style) that makes the rendered glyph closest to the given glyph. More specifically, fixing the glyph label based on the given glyph, its font latent vector $\hat{z}$ can be obtained by minimizing the distance between the raster of the given glyph and the predicted glyph using gradient descent. With the optimal $\hat{z}$ , all the other glyphs with the same font style can be generated by iterating the glyph label. Figure 7 compares the font completion results between the baselines and ours, where a glyph "A" is given with unseen font style. Our results outperform the others in terms of global shape and sharpness of boundaries and corners. In general, raster-based methods (e.g., Attr2Font) tend to generate better shape but get blurry at corners. By contrast, vector-based methods (e.g., DeepSVG) eliminate the blurry effect while difficult to achieve good global shapes. It is a dilemma of generating better global shapes or better local corners in recent works. Our method is achieving both good shapes and corners. Table 3 provides statistical results that further demonstrates the superior generation capacity of our method. + +We conduct a more challenging task, i.e., glyph completion, to explore the potential generation capacity of our method. As illustrated in Figure 8, given a partial glyph, it can still recover the whole glyph, as well as other glyphs with the same font style. In addition, sharp corners are still preserved. + +Table 3: Comparison with baselines on font generation task at different resolutions. + +
MSE ↓s-IoU ↑
Methods12825651210241282565121024
DeepSVG.2597.2768.2854.2911.3584.3613.3651.3672
Attr2Font.2004.2231.2481.2563.6204.6451.6523.6560
Ours.0946.1027.1065.1083.8429.8462.8469.8471
+ +![](images/e37ef72a723f0b5c6cdd3750a321f6a08892be32a8665f63041d64c13adb4da0.jpg) +Figure 7: Font completion examples (baseline vs. ours) with zoom-in boxes highlighting the corners. + +Input(D) + +![](images/d341700066c01eedb9b40a5a519031f905f0a220653866acf1b12a9ee733737e.jpg) + +# ABCDEFGHIJKLMN + +![](images/5471ff2d9449467e16a73bb4c18646687404d11a6f3f76e056d8081381f4a685.jpg) + +# opr qstuvwxz + +![](images/e535cf44331a177723d3b9f2e8fbcfcc4104d8b67d0ba0da61d087aa6348eace.jpg) +Figure 8: Glyph completion example. Given a partial glyph unseen in the training set, our method can complete the given glyph and other glyphs with the same font style. The zoom-in boxes highlight the corners. The mask region in the input is ignored during optimizing the latent vector $\hat{z}$ . + +# 5 Conclusion + +We have presented multi-implicit - a new vector representation that is easy to process with neural networks and maintains 2D shape fidelity under arbitrary resampling. The representation is learned in a locally supervised manner allowing high precision recovery of corners and curves. The proposed multi-implicit representation is extensively evaluated in various font applications, including high-resolution reconstruction, font style interpolation, font family completion, and glyph completion, and demonstrates clear advantages over prior image based and curve based approaches. + +Broader Impact The proposed representation has the potential to be applied to other 2D vector objects, such as icons and animations, which can empower artists' creativity and productivity. If trained on a handwriting dataset such a method could possibly be used for emulating a person's handwriting for forgery. + +# References + +[1] S. Azadi, M. Fisher, V. G. Kim, Z. Wang, E. Shechtman, and T. Darrell. Multi-content gan for few-shot font style transfer. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7564-7573, 2018. +[2] A. Carlier, M. Danelljan, A. Alahi, and R. Timofte. Deepsvg: A hierarchical generative network for vector graphics animation. arXiv preprint arXiv:2007.11301, 2020. +[3] Z. Chen and H. Zhang. Learning implicit fields for generative shape modeling. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 5939-5948, 2019. +[4] V. Chlumsky, J. Sloup, and I. Šimeček. Improved corners with multi-channel signed distance fields. In Computer Graphics Forum, volume 37, pages 273–287. Wiley Online Library, 2018. +[5] Y. Choi, M. Choi, M. Kim, J.-W. Ha, S. Kim, and J. Choo. Stargan: Unified generative adversarial networks for multi-domain image-to-image translation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 8789-8797, 2018. +[6] M. G. Crandall and P.-L. Lions. Viscosity solutions of hamilton-jacobi equations. Transactions of the American mathematical society, 277(1):1-42, 1983. +[7] A. E. Fabris and A. R. Forrest. Antialiasing of curves by discrete pre-filtering. In Proceedings of the 24th annual conference on Computer graphics and interactive techniques, pages 317-326, 1997. +[8] K. Genova, F. Cole, A. Sud, A. Sarna, and T. Funkhouser. Local deep implicit functions for 3d shape. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4857-4866, 2020. +[9] C. Green. Improved alpha-tested magnification for vector textures and special effects. In ACM SIGGRAPH 2007 courses, pages 9-18. 2007. +[10] T. Groueix, M. Fisher, V. G. Kim, B. C. Russell, and M. Aubry. A papier-mâché approach to learning 3d surface generation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 216-224, 2018. +[11] S. Gupta and R. F. Sproull. Filtering edges for gray-scale displays. ACM SIGGRAPH Computer Graphics, 15(3):1-5, 1981. +[12] D. P. Kingma and M. Welling. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013. +[13] T.-M. Li, M. Lukáč, G. Michael, and J. Ragan-Kelley. Differentiable vector graphics rasterization for editing and learning. ACM Trans. Graph. (Proc. SIGGRAPH Asia), 39(6):193:1-193:15, 2020. +[14] C.-H. Lin, C. Wang, and S. Lucey. Sdf-srn: Learning signed distance 3d object reconstruction from static images. In Advances in Neural Information Processing Systems (NeurIPS), 2020. +[15] M. Liu, Y. Ding, M. Xia, X. Liu, E. Ding, W. Zuo, and S. Wen. Stgan: A unified selective transfer network for arbitrary image attribute editing. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3673-3682, 2019. +[16] C. Loop and J. Blinn. Resolution independent curve rendering using programmable graphics hardware. In ACM SIGGRAPH 2005 Papers, pages 1000-1009. 2005. +[17] R. G. Lopes, D. Ha, D. Eck, and J. Schlens. A learned representation for scalable vector graphics. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 7930-7939, 2019. +[18] B. Mildenhall, P. P. Srinivasan, M. Tancik, J. T. Barron, R. Ramamoorthi, and R. Ng. Nerf: Representing scenes as neural radiance fields for view synthesis. In European Conference on Computer Vision, pages 405-421. Springer, 2020. +[19] D. Nehab and H. Hoppe. Random-access rendering of general vector graphics. ACM Transactions on Graphics (TOG), 27(5):1-10, 2008. +[20] P. Reddy, M. Gharbi, M. Lukac, and N. J. Mitra. Im2vec: Synthesizing vector graphics without vector supervision. arXiv preprint arXiv:2102.02798, 2021. +[21] A. Sinha, A. Unmesh, Q. Huang, and K. Ramani. Surfnet: Generating 3d shape surfaces using deep residual networks. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 6040-6049, 2017. + +[22] V. Sitzmann, J. Martel, A. Bergman, D. Lindell, and G. Wetzstein. Implicit neural representations with periodic activation functions. Advances in Neural Information Processing Systems, 33, 2020. +[23] T. Takikawa, J. Litalien, K. Yin, K. Kreis, C. Loop, D. Nowrouzezahrai, A. Jacobson, M. McGuire, and S. Fidler. Neural geometric level of detail: Real-time rendering with implicit 3D shapes. 2021. +[24] K. Turkowski. Anti-aliasing through the use of coordinate transformations. ACM Transactions on Graphics (TOG), 1(3):215-234, 1982. +[25] Z. L. Yizhi Wang*, Yue Gao*. Attribute2font: Creating fonts you want from attributes. ACM Trans. Graph., 2020. \ No newline at end of file diff --git a/amultiimplicitneuralrepresentationforfonts/images.zip b/amultiimplicitneuralrepresentationforfonts/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..b8fbb62a679507ebf0e9444d484445e33ef53567 --- /dev/null +++ b/amultiimplicitneuralrepresentationforfonts/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6080baef487f3514f294e18253958a8646d78a1801f719ca13685df16fe721fd +size 529484 diff --git a/amultiimplicitneuralrepresentationforfonts/layout.json b/amultiimplicitneuralrepresentationforfonts/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..536d1020a2c00ad4b1179f505a0cb902aa399319 --- /dev/null +++ b/amultiimplicitneuralrepresentationforfonts/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5ec44547710208572dba5735bf3ffb38bb4c072c19948b8a44a9ea406893ecee +size 336550 diff --git a/anearoptimalalgorithmfordebiasingtrainedmachinelearningmodels/b8ed5e2e-adb6-40e7-8f0d-e12540ba40eb_content_list.json b/anearoptimalalgorithmfordebiasingtrainedmachinelearningmodels/b8ed5e2e-adb6-40e7-8f0d-e12540ba40eb_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..586cd33953217f481611b9adc022f70483462782 --- /dev/null +++ b/anearoptimalalgorithmfordebiasingtrainedmachinelearningmodels/b8ed5e2e-adb6-40e7-8f0d-e12540ba40eb_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4ec233eb9f8e8a58398380312e1a89ae9a46dd25251a9f581d9d63ed824c618a +size 84718 diff --git a/anearoptimalalgorithmfordebiasingtrainedmachinelearningmodels/b8ed5e2e-adb6-40e7-8f0d-e12540ba40eb_model.json b/anearoptimalalgorithmfordebiasingtrainedmachinelearningmodels/b8ed5e2e-adb6-40e7-8f0d-e12540ba40eb_model.json new file mode 100644 index 0000000000000000000000000000000000000000..18048b6321b517a383e8ac9329eba2f1910cf3c9 --- /dev/null +++ b/anearoptimalalgorithmfordebiasingtrainedmachinelearningmodels/b8ed5e2e-adb6-40e7-8f0d-e12540ba40eb_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:046cab273d425514ef2b8127074e1324d9d99438d7a9f246d623fcfa348bd643 +size 103675 diff --git a/anearoptimalalgorithmfordebiasingtrainedmachinelearningmodels/b8ed5e2e-adb6-40e7-8f0d-e12540ba40eb_origin.pdf b/anearoptimalalgorithmfordebiasingtrainedmachinelearningmodels/b8ed5e2e-adb6-40e7-8f0d-e12540ba40eb_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4f63512d71f95429c975c4623197dd99e7aef1ec --- /dev/null +++ b/anearoptimalalgorithmfordebiasingtrainedmachinelearningmodels/b8ed5e2e-adb6-40e7-8f0d-e12540ba40eb_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aeb36c791e6dc6da62a6777bf3bf6eda968783c909c0eb926b0ac7dcacd7fb53 +size 593410 diff --git a/anearoptimalalgorithmfordebiasingtrainedmachinelearningmodels/full.md b/anearoptimalalgorithmfordebiasingtrainedmachinelearningmodels/full.md new file mode 100644 index 0000000000000000000000000000000000000000..06cd563770495282b51f594734faa3b25fe66d80 --- /dev/null +++ b/anearoptimalalgorithmfordebiasingtrainedmachinelearningmodels/full.md @@ -0,0 +1,377 @@ +# A Near-Optimal Algorithm for Debiasing Trained Machine Learning Models + +Ibrahim Alabdulmohsin + +Google Research, Brain Team + +Zürich, Switzerland + +ibomohsin@google.com + +Mario Lucic + +Google Research, Brain Team + +Zürich, Switzerland + +lucic@google.com + +# Abstract + +We present a scalable post-processing algorithm for debiasing trained models, including deep neural networks (DNNs), which we prove to be near-optimal by bounding its excess Bayes risk. We empirically validate its advantages on standard benchmark datasets across both classical algorithms as well as modern DNN architectures and demonstrate that it outperforms previous post-processing methods while performing on par with in-processing. In addition, we show that the proposed algorithm is particularly effective for models trained at scale where post-processing is a natural and practical choice. + +# 1 Introduction + +Background. Machine learning is increasingly applied to critical decisions which can have a lasting impact on individual lives, such as for credit lending [Bruckner, 2018], medical applications [Deo, 2015], and criminal justice [Brennan et al., 2009]. Consequently, it is imperative to understand and improve the degree of bias of such automated decision-making. + +Unfortunately, despite the fact that bias (or "fairness") is a central concept in our society today, it is difficult to define it in precise terms. In fact, as people perceive ethical matters differently depending on a plethora of factors including geographical location or culture [Awad et al., 2018], no universally-agreed upon definition for bias exists. Moreover, bias may depend on the application and might even be ignored in favor of accuracy when the stakes are high, such as in medical diagnosis [Kleinberg et al., 2016]. As such, it is not surprising that several measures of bias have been introduced, such as statistical parity [Dwork et al., 2012, Zafar et al., 2017a], equality of opportunity [Hardt et al., 2016], and equalized odds [Hardt et al., 2016, Kleinberg et al., 2016], and these are not generally mutually compatible [Chouldechova, 2017, Kleinberg et al., 2016]. + +Let $\mathcal{X}$ be an instance space and let $\mathcal{Y} = \{0,1\}$ be the target set in a binary classification problem. In the fair classification setting, we may further assume the existence of a sensitive attribute $s:\mathcal{X}\rightarrow$ $\{1,\ldots ,K\}$ , where $s(x) = k$ if and only if $x\in X_{k}$ for some total partition $\mathcal{X} = \cup_{k}X_{k}$ . For example, $\mathcal{X}$ might correspond to the set of job applicants while $s$ indicates their sex. Then, a commonly used criterion for fairness is to require similar mean outcomes across the sensitive attribute (a.k.a. statistical parity) [Dwork et al., 2012, Zafar et al., 2017a, Mehrabi et al., 2019]: + +Definition 1 (Statistical Parity). Let $\mathcal{X}$ be an instance space and $\mathcal{X} = \cup_{k} X_{k}$ be a total partition of $\mathcal{X}$ . A predictor $h: \mathcal{X} \to [0,1]$ satisfies $\epsilon$ statistical parity across all groups $X_{1}, \ldots, X_{K}$ if: + +$$ +\max _ {k \in [ K ]} \mathbb {E} _ {\boldsymbol {x}} [ h (\boldsymbol {x}) | \boldsymbol {x} \in X _ {k} ] - \min _ {k \in [ K ]} \mathbb {E} _ {\boldsymbol {x}} [ h (\boldsymbol {x}) | \boldsymbol {x} \in X _ {k} ] \leq \epsilon , +$$ + +where $[K]$ denotes the set $\{1,\dots ,K\}$ . + +Our main contribution is to derive a near-optimal recipe for debiasing models, including deep neural networks, according to Definition 1. Specifically, we formulate the task of debiasing learned models + +as a regularized optimization problem that is solved efficiently using the projected SGD method. We show how the algorithm produces thresholding rules with randomization near the thresholds, where the width of randomization is controlled by a regularization hyperparameter. We also prove that randomization near the threshold is, in general, necessary for Bayes risk consistency. In Appendix D, we show how the proposed algorithm can be modified to handle a weaker notion of bias as well. We refer to the proposed algorithm as Randomized Threshold Optimizer (RTO). + +Besides the theoretical guarantees, we empirically validate RTO on benchmark datasets across both classical algorithms as well as modern DNN architectures. Our experiments demonstrate that the proposed algorithm significantly outperforms previous post-processing methods and performs competitively with in-processing (Section 5). While we focus on binary sensitive attributes in the experiments, our algorithm and its guarantees continue to hold for non-binary attributes as well. + +In addition, we show that RTO is particularly effective for models trained at scale where post-processing is a natural and practical choice. Qualitatively speaking, for a fixed downstream task $D$ , such as predicting facial attributes in the CelebA dataset [Liu et al., 2015], we say that the model is "trained at scale" if it is both: (1) heavily overparameterized, and (2) pretrained on large datasets before fine-tuning on the downstream task $D$ . We show that the impact of debiasing models on their performance using the proposed algorithm can be improved with scale. + +Remark. Because "bias" is a societal concept that cannot be reduced to metrics such as statistical parity [Chouldechova, 2017, Dixon et al., 2018, Selfst et al., 2019], our conclusions do not necessarily pertain to "fairness" in its broader sense. Rather, they hold for the narrow technical definition of statistical parity. Similarly, we conduct experiments on standard benchmark datasets, such as CelebA [Liu et al., 2015] and COCO [Lin et al., 2014], which are commonly used in the literature, as a way of validating the technical claims of this paper. Our experiments are, hence, not to be interpreted as an endorsement of those visions tasks, such as predicting facial attributes. + +# 2 Related Work + +Algorithms for fair machine learning can be broadly classified into three groups: (1) pre-processing methods, (2) in-processing methods, and (3) post-processing methods [Zafar et al., 2019]. + +Preprocessing algorithms transform the data into a different representation such that any classifier trained on it will not exhibit bias. This includes methods for learning a fair representation [Zemel et al., 2013, Lum and Johndrow, 2016, Bolukbasi et al., 2016, Calmon et al., 2017, Madras et al., 2018, Kamiran and Calders, 2012], label manipulation [Kamiran and Calders, 2009], data augmentation [Dixon et al., 2018], or disentanglement [Locatello et al., 2019]. + +On the other hand, in-processing methods constrain the behavior of learning algorithms in order to control bias. This includes methods based on adversarial training [Zhang et al., 2018] and constraint-based classification, such as by incorporating constraints on the decision margin [Zafar et al., 2019] or features [Grgic-Hlaca et al., 2018]. Agarwal et al. [2018] showed that the task of learning an unbiased classifier could be reduced to a sequence of cost-sensitive classification problems, which could be applied to any black-box classifier. One caveat of the latter approach is that it requires solving a linear program (LP) and retraining classifiers, such as neural networks, many times before convergence. + +The algorithm we propose in this paper is a post-processing method, which can be justified theoretically [Corbett-Davies et al., 2017, Hardt et al., 2016, Menon and Williamson, 2018, Celis et al., 2019]. Fish et al. [2016] and Woodworth et al. [2017] fall under this category. However, the former only provides generalization guarantees without consistency results while the latter proposes a two-stage approach that requires changes to the original training algorithm. Kamiran et al. [2012] also proposes a post-processing algorithm, called Reject Option Classifier (ROC), without any theoretical guarantees. In contrast, our algorithm is Bayes consistent and does not alter the original classification method. In Celis et al. [2019] and Menon and Williamson [2018], instance-dependent thresholding rules are also learned. However, our algorithm also learns to randomize around the threshold (Figure 1(a)) and this randomization is key to our algorithm both theoretically as well as experimentally (Appendix B and Section 5). Hardt et al. [2016] learns a randomized post-processing rule but our proposed algorithm outperforms it in all of our experiments (Section 5). Also, [Wei et al., 2019] is a post-processing method but it requires solving a non-linear optimization problem (for the dual variables) via ADMM and provides guarantees for approximate fairness only. + +Woodworth et al. [2017] showed that the post-processing approach can be suboptimal. Nevertheless, the latter result does not contradict the statement that our post-processing rule is near-optimal because we assume that the original classifier outputs a score (i.e. a monotone transformation of an approximation to the posterior $p(\mathbf{y} = 1 \mid \mathbf{x})$ such as margin or softmax output) whereas Woodworth et al. [2017] assumed that the post-processing rule had access to the binary predictions only. + +We argue that the proposed algorithm has distinct advantages, particularly for deep neural networks (DNNs). First, stochastic convex optimization methods can scale well to massive amounts of data [Bottou, 2010], which is often the case in deep learning today. Second, the guarantees provided by our algorithm hold w.r.t. the binary predictions instead of using a proxy, such as the margin as in some previous works [Zafar et al., 2017b, 2019]. Third, unlike previous reduction methods that would require retraining a deep neural network several times until convergence [Agarwal et al., 2018], which can be prohibitively expensive, our algorithm does not require retraining. Also, post-processing can be the only available option, such as when using machine learning as a service with out-of-the-box predictive models or due to various other constraints in data and computation [Yang et al., 2020b]. + +# 3 Near-Optimal Algorithm for Statistical Parity + +Notation. We reserve boldface letters for random variables (e.g. $\mathbf{x}$ ), small letters for instances (e.g. $x$ ), capital letters for sets (e.g. $X$ ), and calligraphic typeface for universal sets (e.g. the instance space $\mathcal{X}$ ). Given a set $S$ , $1_S(x) \in \{0, 1\}$ is its characteristic function. Also, we denote $[N] = \{1, \dots, N\}$ and $[x]^+ = \max \{0, x\}$ . We reserve $\eta(x)$ for the Bayes regressor: $\eta(x) = p(\mathbf{y} = 1 | \mathbf{x} = x)$ . + +Algorithm. Given a classifier outputting a probability score $\hat{p} (\mathbf{y} = 1|\mathbf{x} = x)$ , let $f(x) = 2\hat{p} (\mathbf{y} = 1|\mathbf{x} = x) - 1$ . We refer to $f(x)\in [-1, + 1]$ as the classifier's output. Our goal is to post-process the predictions made by the classifier to control statistical parity with respect to a sensitive attribute $s:\mathcal{X}\to [K]$ according to Definition 1. To this end, instead of learning a deterministic rule, we consider randomized prediction rules $h(\mathbf{x})$ , where $h(\mathbf{x})$ is the probability of predicting the positive class given $f(\mathbf{x})$ and $s(\mathbf{x})$ . Note that we have the Markov chain: $\mathbf{x}\rightarrow (s(\mathbf{x}),f(\mathbf{x}))\rightarrow h(\mathbf{x})$ . + +A simple approach of achieving $\epsilon$ statistical parity is to output a constant prediction in each subpopulation, which is clearly suboptimal in general. As such, there is a tradeoff between accuracy and fairness. The approach we take in this work is to modify the original classifier such that the original predictions are matched as much as possible while satisfying the fairness constraints. Minimizing the probability of altering the binary predictions of the original classifier can be achieved by maximizing the inner product $\mathbb{E}_{\mathbf{x}}[h(\mathbf{x})\cdot f(\mathbf{x})]$ (cf. Appendix B). However, maximizing this objective alone leads to deterministic thresholding rules which have a major drawback as illustrated in the following example. + +Example 1 (Randomization is necessary). Suppose that $\mathcal{X} = \{-1,0,1\}$ where $p(\boldsymbol{x} = -1) = 1/2$ , $p(\boldsymbol{x} = 0) = 1/3$ and $p(\boldsymbol{x} = 1) = 1/6$ . Let $\eta(-1) = 0$ , $\eta(0) = 1/2$ and $\eta(1) = 1$ . In addition, let $\boldsymbol{s} \in \{0,1\}$ be a sensitive attribute, where $p(\boldsymbol{s} = 1|\boldsymbol{x} = -1) = 1/2$ , $p(\boldsymbol{s} = 1|\boldsymbol{x} = 0) = 1$ , and $p(\boldsymbol{s} = 1|\boldsymbol{x} = 1) = 0$ . Then, the Bayes optimal prediction rule $h^{\star}(x)$ subject to statistical parity ( $\epsilon = 0$ ) satisfies: $p(h^{\star}(\boldsymbol{x}) = 1|\boldsymbol{x} = -1) = 0$ , $p(h^{\star}(\boldsymbol{x}) = 1|\boldsymbol{x} = 0) = 7/10$ and $p(h^{\star}(\boldsymbol{x}) = 1|\boldsymbol{x} = 1) = 1$ . + +As a result, randomization close to the threshold is necessary in the general case to achieve Bayes risk consistency. This conclusion in Example 1 remains true with approximate fairness $(\epsilon < 12 / 70)$ . In this work, we propose to achieve this by minimizing the following regularized objective for some hyperparameter $\gamma > 0$ : + +$$ +(\gamma / 2) \mathbb {E} _ {\mathbf {x}} [ h (\mathbf {x}) ^ {2} ] - \mathbb {E} _ {\mathbf {x}} [ h (\mathbf {x}) \cdot f (\mathbf {x}) ]. \tag {4} +$$ + +We prove in Appendix A that this regularization term leads to randomization around the threshold, which is critical, both theoretically (Section 4 and Appendix B) and experimentally (Section 5). Informally, $\gamma$ controls the width of randomization as illustrated in Figure 1. + +Let $\mathcal{X} = \cup_{k} X_{k}$ be a total partition of the instance space according to the sensitive attribute $s: \mathcal{X} \to [K]$ . Denote a finite training sample by $\mathcal{S} = \{(x_{1}, y_{1}), \ldots, (x_{N}, y_{N})\}$ and write $S_{k} = \mathcal{S} \cap X_{k}$ . For each group $S_{k}$ , the fairness constraint in Definition 1 over the training sample can be written as: + +$$ +\frac {1}{| S _ {k} |} \left| \sum_ {x _ {i} \in S _ {k}} (h \left(x _ {i}\right) - \rho) \right| \leq \frac {\epsilon}{2}, \tag {5} +$$ + +for some hyper-parameter $\rho \in [0,1]$ . Precisely, if the optimization variables $h(x_{i})$ satisfy the constraint (5), then Definition 1 holds over the training sample by the triangle inequality. Conversely, + +# Algorithm 1: Pseudocode of the Randomized Threshold Optimizer (RTO). + +Input: $\gamma > 0$ ; $\rho \in [0,1]$ ; $\epsilon \geq 0$ ; $f:\mathcal{X}\to [-1,1];s:\mathcal{X}\to [K]$ + +Output: Prediction rule: $h_{\gamma}(x)$ + +Training: Initialize $(\lambda_1,\mu_1),\dots ,(\lambda_K,\mu_K)$ to zeros. Then, repeat until convergence: + +1. Sample an instance $\mathbf{x} \sim p(x)$ +2. Perform the updates: + +$$ +\lambda_ {s (\mathbf {x})} \leftarrow \left[ \lambda_ {s (\mathbf {x})} - \eta g _ {\lambda_ {s (\mathbf {x})}} \right] ^ {+}, \quad \mu_ {s (\mathbf {x})} \leftarrow \left[ \mu_ {s (\mathbf {x})} - \eta g _ {\mu_ {s (\mathbf {x})}} \right] ^ {+} \tag {1} +$$ + +where: + +$$ +g _ {\lambda_ {s (\mathbf {x})}} = \frac {\epsilon}{2} + \rho + \frac {\partial}{\partial \lambda_ {s (\mathbf {x})}} \xi_ {\gamma} \big (f (\mathbf {x}) - \left(\lambda_ {s (\mathbf {x})} - \mu_ {s (\mathbf {x})}\right) \big) +$$ + +$$ +g _ {\mu_ {s (\mathbf {x})}} = \frac {\epsilon}{2} - \rho + \frac {\partial}{\partial \mu_ {s (\mathbf {x})}} \xi_ {\gamma} \big (f (\mathbf {x}) - (\lambda_ {s (\mathbf {x})} - \mu_ {s (\mathbf {x})}) \big). +$$ + +and: + +$$ +\xi_ {\gamma} (w) = \frac {w ^ {2}}{2 \gamma} \cdot \mathbb {I} \{0 \leq w \leq \gamma \} + \left(w - \frac {\gamma}{2}\right) \cdot \mathbb {I} \{w > \gamma \} \tag {2} +$$ + +Prediction: Given an instance $x$ in the group $X_{k}$ , predict the label $+1$ with probability $h_{\gamma}(x)$ , where: + +$$ +h _ {\gamma} (x) = \left[ \min \{1, \left(f (x) - \lambda_ {k} + \mu_ {k}\right) / \gamma \right] ^ {+} \tag {3} +$$ + +if Definition 1 holds, then the constraint (5) also holds where: + +$$ +2 \rho = \max _ {k \in [ K ]} \mathbb {E} _ {\mathbf {x}} [ h (\mathbf {x}) \mid \mathbf {x} \in S _ {k} ] + \min _ {k \in [ K ]} \mathbb {E} _ {\mathbf {x}} [ h (\mathbf {x}) \mid \mathbf {x} \in S _ {k} ]. +$$ + +Therefore, to learn the post-processing rule $h(x)$ , we solve the optimization problem: + +$$ +\min_{\substack{0\leq h(x_{i})\leq 1}} +$$ + +$$ +\sum_ {x _ {i} \in \mathcal {S}} (\gamma / 2) h (x _ {i}) ^ {2} - f (x _ {i}) h (x _ {i}) +$$ + +s.t. + +$$ +\forall k \in [ K ]: \left| \sum_ {x _ {i} \in S _ {k}} (h \left(x _ {i}\right) - \rho) \right| \leq \epsilon_ {k}, \tag {6} +$$ + +in which $\epsilon_{k} = |S_{k}|\epsilon /2$ for all $k\in [K]$ . Using Lagrange duality we show in Appendix A that solving the above optimization problem is equivalent to Algorithm 1. In Appendix D, we show that if $\epsilon = 0$ , an alternative formulation can be used to minimize the same objective while satisfying the fairness constraint but without introducing a hyperparameter $\rho$ . To reiterate, $\rho \in [0,1]$ is tuned via a validation dataset and $\gamma >0$ is a hyperparameter that controls randomization. + +# 4 Theoretical Analysis + +Our first theoretical result is to show that RTO satisfies the desired fairness guarantees. + +Theorem 1 (Correctness). Let $h_{\gamma} : \mathcal{X} \to [0,1]$ be the randomized predictor in Equation 3 learned by applying the update rules in Equation 1 on a fresh sample of size $N$ until convergence with learning rates satisfying the Robbins and Monro condition [Robbins and Monro, 1951]. Then, $h_{\gamma}$ satisfies $\epsilon$ statistical parity on the training sample. Moreover, with a probability of at least $1 - \delta$ , the following bound on bias holds w.r.t. the underlying distribution: + +$$ +\max _ {k \in [ K ]} \mathbb {E} [ h (\boldsymbol {x}) \mid \boldsymbol {x} \in X _ {k} ] - \min _ {k \in [ K ]} \mathbb {E} [ h (\boldsymbol {x}) \mid \boldsymbol {x} \in X _ {k} ] \leq \epsilon + 8 \sqrt {\frac {2 \log \frac {e N}{2}}{N}} + 2 \sqrt {\frac {\log \frac {2 K}{\delta}}{N}}. \tag {7} +$$ + +Proof. The proof is in Appendix A. We make use of strong duality, which holds by Slater's condition [Boyd and Vandenberghe, 2004]. The update rules correspond to the projected SGD method on the dual problem. This establishes the guarantee on the training sample. For the underlying distribution, we bound the Rademacher complexity [Bousquet et al., 2003] of the function class $\mathcal{H}_{\gamma}$ of Figure 1(a) by that of 0-1 thresholding rules over $\mathbb{R}$ , from which a generalization bound is derived. + +![](images/d342dc8d67fb78178d6c6c6bc8fc6622bab9daa4e75be4ac5db2c4fd0c3ffb17.jpg) +(a) Decision rule + +![](images/4206fe9972d3110171d7298453a3613e80fcbcffea82c3ac42424072d0aaaa30.jpg) +(b) Convergence +Figure 1: (a) The learned post-processing rule $h_{\gamma}(x)$ in Equation 3 as a function of the classifier's score $f(x)$ over one subpopulation. Randomization is applied when $h_{\gamma}(x) \in (0,1)$ . (b) The value of $\lambda_0 - u_0$ is plotted against the number of epochs in projected SGD applied to the random forests classifier. The classifier is trained on the Adult dataset to implement statistical parity with respect to the sex attribute (cf. Section 5). We observe fast convergence in agreement with Proposition 1. + +The following guarantee shows that the randomized prediction rule converges to the Bayes optimal unbiased classifier if the original classifier is Bayes consistent. + +Theorem 2. Let $h^{\star} = \arg \min_{h\in \mathcal{H}_{\epsilon}}\mathbb{E}[h(\pmb {x})\neq \pmb {y}]$ , where $\mathcal{H}_{\epsilon}$ is the set of binary predictors on $\mathcal{X}$ that satisfy fairness on the training sample according to Definition 1 for $\epsilon \geq 0$ . Let $h_\gamma : \mathcal{X} \to [0,1]$ be the randomized rule in Algorithm 1. If $h_\gamma$ is trained on a fresh data of size $N$ , then there exists a value of $\rho \in [0,1]$ independent of $N$ such that the following holds with a probability of at least $1 - \delta$ : + +$$ +\mathbb {E} [ \mathbb {I} \{h _ {\gamma} (\boldsymbol {x}) \neq \boldsymbol {y} \} ] \leq \mathbb {E} [ \mathbb {I} \{h ^ {\star} (\boldsymbol {x}) \neq \boldsymbol {y} \} ] + 2 \gamma + \frac {8 (2 + \frac {1}{\gamma})}{N ^ {\frac {1}{3}}} + \mathbb {E} | 2 \eta (\boldsymbol {x}) - 1 - f (\boldsymbol {x}) | + 4 \sqrt {\frac {2 K + 2 \log \frac {2}{\delta}}{N}}, +$$ + +where $\eta (x) = p(\mathbf{y} = 1|\mathbf{x} = x)$ is the Bayes regressor and $K$ is the number of groups $X_{k}$ . + +Proof. The full proof is in Appendix B. First, we show that minimizing the probability of error can be achieved by maximizing $\mathbb{E}[f(\mathbf{x})\cdot (2\eta (\mathbf{x}) - 1)]$ . We use the regularized loss instead, which is strongly convex. Using Lipschitz continuity of the decision rule when $\gamma >0$ (cf. Figure 1(a)), and the robustness framework of Xu and Mannor [2012], we prove a generalization bound and proceed with a series of inequalities to establish the main theorem. + +Thus, if the original classifier is Bayes consistent, namely $\mathbb{E}|2\eta (\mathbf{x}) - 1 - f(\mathbf{x})|\to 0$ as the sample size goes to infinity, and if $N\rightarrow \infty$ , $\gamma \rightarrow 0^{+}$ and $\gamma N^{\frac{1}{3}}\rightarrow \infty$ , then $\mathbb{E}[h_{\gamma}(\mathbf{x})\neq \mathbf{y}] \xrightarrow{P} \mathbb{E}[h^{\star}(\mathbf{x})\neq \mathbf{y}]$ . Hence, Algorithm 1 converges to the optimal prediction rule subject to the fairness constraints. + +Convergence Rate. As we show in Appendix A, the update rules in Equation 1 perform a projected stochastic gradient descent on the following optimization problem: + +$$ +\min _ {\mu , \lambda \geq 0} F = \mathbb {E} _ {\mathbf {x}} \left[ \epsilon \left(\lambda_ {s (\mathbf {x})} + \mu_ {s (\mathbf {x})}\right) + \rho \left(\lambda_ {s (\mathbf {x})} - \mu_ {s (\mathbf {x})}\right) + \xi_ {\gamma} \left(f (\mathbf {x}) - \left(\lambda_ {s (\mathbf {x})} - \mu_ {s (\mathbf {x})}\right)\right) \right], \tag {8} +$$ + +where $\xi_{\gamma}$ is given by Equation 2. The following proposition shows that the post-processing rule can be efficiently computed. In practice, we observe fast convergence as demonstrated in Figure 1(b). + +Proposition 1. Let $\mu^{(0)} = \lambda^{(0)} = 0$ and write $\mu^{(t)},\lambda^{(t)}\in \mathbb{R}^K$ for the value of the optimization variables after $t$ updates defined in Equation 1 for some fixed learning rate $\alpha_{t} = \alpha$ . Let $\bar{\mu} = (1 / T)\sum_{t = 1}^{T}\mu^{(t)}(x)$ and $\bar{\lambda} = (1 / T)\sum_{t = 1}^{T}\lambda^{(t)}(x)$ . Then, + +$$ +\mathbb {E} [ \bar {F} ] - F ^ {\star} \leq (1 + \rho + \epsilon) ^ {2} \alpha + \frac {| | \mu^ {\star} | | _ {2} ^ {2} + | | \lambda^ {\star} | | _ {2} ^ {2}}{2 T \alpha}, \tag {9} +$$ + +where $\bar{F}:\mathbb{R}^K\times \mathbb{R}^K\to \mathbb{R}$ is the objective function in (8) using the averaged solution $\bar{\mu}$ and $\bar{\lambda}$ while $F^{\star}$ is its optimal value. In particular, $\mathbb{E}[\bar{F}] - F^{\star} = \mathcal{O}(\sqrt{K / T})$ when $\alpha = \mathcal{O}(\sqrt{K / T})$ . + +The proof of Proposition 1 is in Appendix C. As shown in Figure 1(a), the hyperparameter $\gamma$ controls the width of randomization around the thresholds. A large value of $\gamma$ may reduce the accuracy of the classifier. On the other hand, $\gamma$ cannot be zero because randomization around the threshold is, in general, necessary for Bayes risk consistency as shown earlier in Example 1. + +# 5 Experiments + +Baselines and Experimental Setup. We compare against three post-processing methods: (1) the algorithm of Hardt et al. [2016] (2) the shift inference method, first introduced in Saerens et al. [2002] and used more recently in Wang et al. [2020b], and (3) the Reject Option Classifier (ROC) [Kamiran et al., 2012]. We also include the reduction approach of Agarwal et al. [2018] to compare the performance against in-processing rules. We briefly review each of these methods next. + +The post-processing method of Hardt et al. [2016] is a randomized post-processing rule. It was originally developed for equalized odds and equality of opportunity. Nevertheless, it can be modified to accommodate other criteria, such as statistical parity [Agarwal et al., 2018, Dudik et al., 2020]. + +The shift inference rule, on the other hand, is a post-hoc correction that views bias as a shift in distribution, hence the name. It is based on the identity $r(\mathbf{y}|\mathbf{s},\mathbf{x}) \propto q(\mathbf{y}|\mathbf{s},\mathbf{x}) \cdot r(\mathbf{y},\mathbf{s}) / q(\mathbf{y},\mathbf{s})$ , which holds for any two distributions $r$ and $q$ on the product space of labels $\mathbf{y}$ , sensitive attributes $\mathbf{s}$ , and instances $\mathbf{x}$ if they share the same marginal $r(\mathbf{x}) = q(\mathbf{x})$ [Wang et al., 2020b]. By equating, $q(\mathbf{y}|\mathbf{s},\mathbf{x})$ with the classifier's output based on the biased distribution and $r(\mathbf{y}|\mathbf{s},\mathbf{x})$ with the unbiased classifier, the predictions of the classifier $q(\mathbf{y}|\mathbf{s},\mathbf{x})$ can be post-hoc corrected for bias by multiplying its probability score with the ratio $p(\mathbf{y})p(\mathbf{s}) / p(\mathbf{y},\mathbf{s})$ . + +The reject option classifier (ROC) proposed by Kamiran et al. [2012] is a deterministic thresholding rule. It enumerates all possible values of some tunable parameter $\theta$ up to a given precision, where $\theta = 0$ corresponds to the original classifier. Candidate thresholds are then tested on the data. + +Finally, the reduction approach of Agarwal et al. [2018] is an in-processing method that can be applied to black-box classifiers but it requires retraining the model several times. More precisely, let $h$ be a hypothesis in the space $\mathcal{H}$ and $M$ be a matrix, Agarwal et al. [2018] showed that minimizing the error of $h$ subject to constraints of the form $M\mu (h)\leq c$ , where $\mu (h)$ is a vector of conditional moments on $h$ of a particular form, can be reduced (with some relaxation) to a sequence of cost-sensitive classification tasks for which many algorithms can be employed. + +We use the implementations of Hardt et al. [2016] and Agarwal et al. [2018] in the FairLearn software package [Dudik et al., 2020]. The training data used for the post-processing methods is always a fresh sample, i.e. different from the data used to train the original classifiers. Specifically, we split the data that was not used in the original classifier into three subsets of equal size: (1) training data for the post-processing rules, (2) validation for hyperparameter selection, and (3) test data. The value of the hyper-parameter $\theta$ of the ROC algorithm is chosen in the grid $\{0.01, 0.02, \dots, 1.0\}$ . In the proposed algorithm, the parameter $\gamma$ is chosen in the grid $\{0.01, 0.02, 0.05, 0.1, 0.2\}$ while $\rho$ is chosen in the gird $\mathbb{E}[\mathbf{y}] \pm \{0, 0.05, 0.1\}$ . All hyper-parameters are selected based on a separate validation dataset. For the in-processing approach, we used the Exponentiated Gradient method as proposed by Agarwal et al. [2018] with its default settings in the FairLearn package (e.g. max iterations of 50). + +Tabular Data. We evaluate performance on two real-world datasets, namely the Adult income dataset [Kohavi, 1996] and the Default of Credit Card Clients (DCCC) dataset [Yeh and Lien, 2009], both from the UCI Machine Learning Repository [Blake and Merz, 1998]. The Adult dataset contains 48,842 records with 14 attributes each and the goal is to predict if the income of an individual exceeds $50K per year. The DCCC dataset contains 30,000 records with 24 attributes, and the goal is to predict if a client will default on their credit card payment. We set sex as a sensitive attribute. In DCCC, we introduce bias to the training set to study the case in which bias shows up in the training data only (e.g. due to the data curation process) but the test data remains unbiased (cf. [Torralba and Efros, 2011] and [de Vries et al., 2019] who discuss similar observations in common benchmark datasets). Specifically, if $s(\mathbf{x}) = y(\mathbf{x})$ we keep the instance and otherwise drop it with probability 0.5. + +We train four classifiers: (1) random forests with depth 10, (2) $k$ -NN with $k = 10$ , (3) a two-layer neural network with 128 hidden nodes, and (4) logistic regression whose parameter $C$ is fine-tuned from a grid of values in a logarithmic scale between $10^{-4}$ and $10^{4}$ using 10-fold cross validation. The learning rate in our algorithm is fixed to $10^{-1}(K / T)^{1/2}$ , where $T$ is the number of steps, and $\epsilon = 0$ . + +Table 1 (Top and Middle) shows the bias on test data after applying each post-processing method. The column marked as "original" corresponds to the original classifier without alteration. As shown in the table, the shift-inference method does not succeed at controlling statistical parity while ROC can fail when the original classifier's output is concentrated on a few points because it does not randomize. + +Table 1: A comparison of four post-processing methods and the reduction approach of Agarwal et al. [2018] on 3 datasets. The classifiers are random forests (RF), $k$ -NN, MLP, logistic regression (LR), ResNet50 trained from scratch (R50/S), ResNet50 pretrained on ImageNet (R50/I), MobileNet trained from scratch (MN/S) and MobileNet pretrained on ImageNet (MN/I). Values in bold correspond to cases where debiasing fails. ROC may fail in $k$ -NN and in neural networks because debiasing them can require randomization. Original bias in the dataset is provided in the leftmost column. + +
Bias
DatasetClassifierOriginalRTOHardt, 2016Shift InferenceROCReduction
ADULT (Bias = .19)RF.38.01.01.16.02.01
kNN.24.02.01.08.08.01
MLP.29.01.02.10.02.01
LR.39.01.02.10.01.01
DCCC (Bias = .21)RF.07.01.01.09.02.01
kNN.10.01.01.18.02.01
MLP.13.01.01.12.02.01
LR.12.01.01.13.01.01
CELEBA (Bias = .33)R50/S.43.01.01.38.08
R50/I.400.02.01.35.15
MN/S.35.01.01.24.01
MN/I.38.002.002.34.10
+ +CelebA Dataset. Our second set of experiments builds on the task of predicting the "attractiveness" attribute in the CelebA dataset [Liu et al., 2015]. We reiterate that we do not endorse the usage of vision models for such tasks, and that we report these results because they exhibit sex-related bias. CelebA contains 202,599 images of celebrities annotated with 40 binary attributes, including sex. We use two standard architectures: ResNet50 [He et al., 2016] and MobileNet [Howard et al., 2017], trained from scratch or pretrained on ImageNet ILSVRC2012 [Deng et al., 2009]. We resize images to $224 \times 224$ and train with a fixed learning rate of 0.001 until the validation error converges. We present the bias results in Table 1 (bottom). We observe that randomization is indeed necessary: ROC and Shift Inference both fail at debiasing the neural networks because they do not learn to randomize when most scores produced by neural networks are concentrated around the set $\{-1, +1\}$ . + +Impact on Test Accuracy. As shown in Table 2, the proposed algorithm has a much lower impact on the test accuracy compared to Hardt et al. [2016] and even improves the test accuracy in DCCC because bias was introduced in DCCC to the training data only as discussed earlier. The tradeoff curves between accuracy and bias for both the proposed algorithm and Hardt et al. [2016] are shown in Figure 2 (LEFT). Also, for a comparison with in-processing rules, we observe that the post-processing algorithm performs competitively with the reduction approach of Agarwal et al. [2018]. + +Impact of Scale. Models trained at scale transfer better and enjoy improved out-of-distribution robustness [Djolonga et al., 2021]. As these models are now often used in practice, we assess to which extent can these models be debiased while retaining high accuracy. We conduct 768 experiments on 16 deep neural networks architectures, pretrained on either ILSVRC2012, ImageNet-21k (a superset of ILSVRC2012 that contains 21k classes [Deng et al., 2009]), or JFT-300M (a proprietary dataset with 300M examples and 18k classes [Sun et al., 2017]). The 16 architectures are listed in Appendix E and include MobileNet [Howard et al., 2017], DenseNet [Huang et al., 2017], Big Trasnfer (BiT) models [Kolesnikov et al., 2020], and NASNetMobile [Zoph et al., 2018]. The classification tasks contain seven attribute prediction tasks in CelebA [Liu et al., 2015] as well as five classification tasks based on the COCO dataset [Lin et al., 2014]. We describe how the tasks were selected in Appendix E. The sensitive attribute is always sex in our experiments and all classification tasks are binary. Unless explicitly stated, we use $\epsilon = 0$ . Moreover, in the COCO dataset, we follow the procedure of [Wang et al., 2020a] in inferring the sensitive attribute based on the image caption: we use images that contain either the word "woman" or the word "man" in their captions but not both. + +In every task, we build a linear classifier on top of the pretrained features. Inspired by the HyperRule in [Kolesnikov et al., 2020], we train for 50 epochs with an initial learning rate of 0.003, which is dropped by factor of 10 after 20, 30, and 40 epochs. All images are resized to $224 \times 224$ . For augmentation, we use random horizontal flipping and cropping, where we increase the dimension of the image to $248 \times 248$ before cropping an image of size $224 \times 224$ at random. + +Table 2: A comparison of the test accuracy of the proposed algorithm against the algorithms of Hardt et al. [2016] and the reduction approach of Agarwal et al. [2018]. Both Shift Inference and ROC failed at debiasing all models (Table 1) so they are excluded from the comparison here. + +
Test Accuracy
OriginalRTOHardt, 2016Reduction
ADULTRF85.7 ± .1%84.4 ± .1%81.0 ± .2%83.9±.1%
kNN86.8 ± .1%81.3 ± .2%78.7 ± .2%80.2±.1%
MLP85.5 ± .2%83.5 ± .3%79.7 ± .2%83.5±.1%
LR84.9 ± .2%83.0 ± .1%79.4 ± .2%83.3±.2%
DCCCRF81.2 ± .2%81.8 ± .1%80.6 ± .2%81.4±.3%
kNN79.6 ± .2%80.4 ± .2%78.7 ± .1%79.5±.1%
MLP80.5 ± .1%81.3 ± .2%78.8 ± .2%81.3±.2%
LR80.6 ± .2%81.7 ± .1%78.3 ± .1%80.5±.3%
CELEBAR-S77.8%71.3%65.9%
R-I79.7%71.7%67.5%
M-S76.9%71.8%66.4%
M-I79.3%72.8%67.5%
+ +![](images/79dc052337c7e1a8c4a6f7eda14ba8b8619d1d828588cfb224c33151a737df0d.jpg) + +![](images/ef378161c6401bf483c94b5a459cac9f4cc61fc17c1675f76967af3325255ca6.jpg) + +![](images/1abad65924bf09bb58885318a9124b2cf8a56c25e8d521117cda1c828aad6331.jpg) + +![](images/bdcd0eaeeae9ef63787854a97e73b88b3e3b65d81d5eb8161d48d24faf649a68.jpg) + +![](images/6d32bafdff7fc7af50990acaab9ccb53ed337211b31346efb09a1c0317b06bc1.jpg) + +![](images/9c849ecb8ab6dc0aa4bb5a2588cfc3ab643f6958a4e4332f62b563e8a01a214b.jpg) + +![](images/772ded6998d83fc5f1164a9fe7e7ef49db4141faf36e0ef6b2530c95e19840f2.jpg) + +![](images/82684b3d2ab21355c6c30f1ad415eab8ba27a668af47f11686d250bad1c794b1.jpg) + +![](images/2c0a99507c3482b1ac3ad199bd5b175a1322b0fb08ae5d72e003d47c4cb4491a.jpg) +Figure 2: LEFT: The tradeoff curves are displayed for each classification problem, where blue curves are for the proposed RTO algorithm and amber curves are for Hardt et al. [2016]. The $x$ -axis is bias (Definition 1) while the $y$ -axis is test accuracy. RIGHT: The distribution of the scores produced by ResNet50 trained from scratch are shown for both subpopulations. The curves correspond to $p(\mathbf{y} = 1|\mathbf{x})$ of Hardt et al. [2016] and the proposed algorithm when $\gamma = 0.1$ and $\rho = \mathbb{E}[\mathbf{y}]$ . + +![](images/5b41ea8b7f6e0e4d573a9e5271cddb984e349617bc74a138fba62f94dbcca052.jpg) + +![](images/b6068ede8263d116281747f505bb7d7dcade9d5440c9b515aa7ca6bdb3560865.jpg) + +![](images/93b0362f440001acae57c73f6e5571b7f6a6e96bb849d3e9a9704cbbcffd8cd5.jpg) + +![](images/6f5ef44a51c086fa33cfba86acca77b7506ffa51d998d4949b19fedc5479c787.jpg) + +![](images/377549865310ad8a4af7d816927321a45ec60b9d6be2a28a1264d6b4b4083127.jpg) + +Scaling up the Model Size. First, we examine the impact of over-parameterization in pretrained models on the effectiveness of the proposed post-processing algorithm. We fix the upstream dataset to ILSVRC2012 (8 models in total, cf. Appendix E) and aggregate the test error rates across tasks by placing them on a common scale using soft ranking. Specifically, we rescale all error rates in a given task linearly, so that the best error achieved is zero while the largest error is one. After that, we average the performance of each model across all tasks. Aggregated results are given in Figure 3. The impact of the proposed algorithm on test errors improves by scaling up the size of pretrained models. + +Scaling up the Data. Second, we look into the impact of the size of the upstream data. We take the four BiT models ResNet50x1, ResNet50x3, ResNet101x1 and ResNet101x3, each is pretrained on either ILSVRC2012, ImageNet-21k, or JFT-300K [Kolesnikov et al., 2020]. For each model and every downstream task, we rank the upstream datasets according to the test error on the downstream task and report the average ranking. Figure 4 shows that pretraining each model on JFT-300M yields the best test accuracy when it is debiased using the proposed algorithm. To ensure that the improvement is not solely due to the data collection process, we pretrain ResNet50 on subsets of ImageNet-21k before fine-tuning on the 12 downstream tasks. Figure 5 shows, again, that the impact of the proposed post-processing rule on test errors improve when pretraining on large datasets. + +![](images/62594f67bd8104a25371b4f5bb82c5dba299953c5c10e370f18c2e46915f4428.jpg) +Figure 3: Aggregated performance of debiased DNN models pretrained on ILSVRC2012 across 12 classification tasks in CelebA and COCO (see Appendix E). The $x$ -axis is the number of model parameters while the $y$ -axis is the aggregated error rate across all tasks after normalization (see Section 5). Figures from left to right use $10\%$ , $20\%$ , $50\%$ , & $100\%$ of downstream data, respectively. + +![](images/813f8cdd7519b6462516a38f5c71bc28e32541dab9546b82b8160ce532dad053.jpg) + +![](images/a025b71368c6e6f0486c77c952139fb77baf884bb9bcbdc48ce6d9a1cc737d56.jpg) + +![](images/d3db411fd4cb62debcc88402a521f2005886d7622b2b220fd1777ffdcc669a00.jpg) + +![](images/52aa9a14f1267e666f7b80de895609e725a1953328158e1550000af27aef260e.jpg) +Figure 4: Aggregated performance of debiased Big Transfer (BiT) models pretrained on ILSVRC2012 (blue), ImageNet-21k (orange), or JFT-300M (green). The y-axis is the average ranking of each upstream dataset (lower is better) according to the test error rate on each of the 12 downstream classification tasks in Appendix E. Figures from left to right use $10\%$ , $20\%$ , $50\%$ , & $100\%$ of downstream data, respectively. In all models, pretraining on JFT-300K yields the best performance. + +![](images/9b983b91b5d0c4a19243fc7c90d9aed58fdd554303ee31a98f776b539e88f1bf.jpg) + +![](images/40b6125b6cb2574faa349ebdcc189322b1dc3067c28a7e6dc65b06a8764dc26b.jpg) + +![](images/0a17f29c8d8930c1121576d6520e9456df3c06955ed2a3a857f847653a619c0d.jpg) + +![](images/db26cab96958722b98df0d9d812b271977959c295f1617eecaf0f5bc304419f4.jpg) +Figure 5: Aggregated performance of debiasing ResNet50 when pretrained on subsets of ImageNet-21k across 12 classification tasks in CelebA and COCO (see Appendix E). The $x$ -axis is the fraction of ImageNet-21k used during pretraining while the $y$ -axis follows the approach in Figure 3. Figures from left to right use $10\%$ , $20\%$ , $50\%$ , & $100\%$ of downstream data, respectively. The impact of the proposed post-processing algorithm on test errors improves when pretraining on large datasets. + +![](images/94dc1117d8d16f3bf92d0d7b5d702416d822b0ef458aa71ef7f105e15d16210e.jpg) + +![](images/1e7b337ca39c821c87ef96728c5ac291e43b4cef9091678752831c9756f704e5.jpg) + +![](images/c66f9885c127cfb8aa2b8e672645fe21c59c16290c78ae48d66c6eeec0793643.jpg) + +# 6 Conclusion + +The post-processing approach in fair classification enjoys many advantages. It can be applied to any classification algorithm and does not require retraining. In addition, it is sometimes the only option available, such as when using machine learning as a service with out-of-the-box predictive models [Obermeyer et al., 2019] or due to other constraints in data and computation [Yang et al., 2020a]. + +In this paper, we propose a near-optimal scalable post-processing algorithm for debiasing trained models according to statistical parity. In addition to its strong theoretical guarantees, we show that it outperforms previous post-processing methods on standard benchmark datasets across classical and modern machine learning models, and performs favorably with even in-processing methods. Finally, we show that the algorithm is particularly effective for models trained at scale, in which heavily overparameterized models are pretrained on large datasets before fine-tuning on the downstream task. + +# Acknowledgement + +The authors are grateful to Lucas Dixon, Daniel Keysers, Ben Zevenbergen, Philippe Gervais, Mike Mozer and Olivier Bousquet for the valuable comments and discussions. + +# Funding Disclosure + +This work was performed at and funded by Google. The authors declare that there is no conflict of interest. + +# References + +A. Agarwal, A. Beygelzimer, M. Dudik, J. Langford, and H. Wallach. A reductions approach to fair classification. In International Conference on Machine Learning, 2018. +E. Awad, S. Dsouza, R. Kim, J. Schulz, J. Henrich, A. Shariff, J.-F. Bonnefon, and I. Rahwan. The moral machine experiment. Nature, 2018. +C. L. Blake and C. J. Merz. UCI repository of machine learning databases, 1998. +T. Bolukbasi, K.-W. Chang, J. Y. Zou, V. Saligrama, and A. T. Kalai. Man is to computer programmer as woman is to homemaker? debiasing word embeddings. In Advances in Neural Information Processing Systems, 2016. +L. Bottou. Large-scale machine learning with stochastic gradient descent. In International Conference on Computational Statistics. 2010. +O. Bousquet, S. Boucheron, and G. Lugosi. Introduction to statistical learning theory. Springer, 2003. +S. Boyd and A. Mutapcic. Stochastic subgradient methods. 2008. URL https://see.stanford.edu/materials/lsocoee364b/04-stoch_subgrad_notes.pdf. +S. Boyd and L. Vandenberghe. Convex optimization. Cambridge University Press, 2004. +T. Brennan, W. Dieterich, and B. Ehret. Evaluating the predictive validity of the COMPAS risk and needs assessment system. Criminal Justice and Behavior, 2009. +M. A. Bruckner. The promise and perils of algorithmic lenders' use of big data. *Chi.-Kent L. Rev.*, 2018. +F. Calmon, D. Wei, B. Vinzamuri, K. N. Ramamurthy, and K. R. Varshney. Optimized pre-processing for discrimination prevention. In Advances in Neural Information Processing Systems, 2017. +L. E. Celis, L. Huang, V. Keswani, and N. K. Vishnoi. Classification with fairness constraints: A meta-algorithm with provable guarantees. In Conference on Fairness, Accountability, and Transparency, 2019. +A. Chouldechova. Fair prediction with disparate impact: A study of bias in recidivism prediction instruments. *Big data*, 5(2), 2017. +S. Corbett-Davies, E. Pierson, A. Feller, S. Goel, and A. Huq. Algorithmic decision making and the cost of fairness. In International Conference on Knowledge Discovery and Data Mining, 2017. +T. de Vries, I. Misra, C. Wang, and L. van der Maaten. Does object recognition work for everyone? In Conference on Computer Vision and Pattern Recognition Workshops, 2019. +J. Deng, W. Dong, R. Socher, L.-J. Li, K. Li, and L. Fei-Fei. Imagenet: A large-scale hierarchical image database. In Conference on Computer Vision and Pattern Recognition, 2009. +R.C.Deo.Machine learning in medicine.Circulation,2015. +L. Dixon, J. Li, J. Sorensen, N. Thain, and L. Vasserman. Measuring and mitigating unintended bias in text classification. In Conference on AI, Ethics, and Society, 2018. + +J. Djolonga, J. Yung, M. Tschannen, R. Romijnders, L. Beyer, A. Kolesnikov, J. Puigcerver, M. Minderer, A. D'Amour, D. Moldovan, S. Gelly, N. Houlsby, X. Zhai, and M. Lucic. On robustness and transferability of convolutional neural networks. In Conference on Computer Vision and Pattern Recognition, 2021. +M. Dudik, R. Edgar, B. Horn, and R. Lutz. fairlearn 0.4.6. 2020. URL https://pypi.org/project/fairlearn/. +C. Dwork, M. Hardt, T. Pitassi, O. Reingold, and R. Zemel. Fairness through awareness. In Innovations in Theoretical Computer Science, 2012. +B. Fish, J. Kun, and Á. D. Lelkes. A confidence-based approach for balancing fairness and accuracy. In International Conference on Data Mining, 2016. +N. Grgic-Hlača, M. B. Zafar, K. P. Gummadi, and A. Weller. Beyond distributive fairness in algorithmic decision making: Feature selection for procedurally fair learning. In AAAI Conference on Artificial Intelligence, 2018. +C. Guo, G. Pleiss, Y. Sun, and K. Q. Weinberger. On calibration of modern neural networks. In International Conference on Machine Learning, 2017. +M. Hardt, E. Price, N. Srebro, et al. Equality of opportunity in supervised learning. In Advances in Neural Information Processing Systems, 2016. +K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Conference on Computer Vision and Pattern Recognition, 2016. +A. G. Howard, M. Zhu, B. Chen, D. Kalenichenko, W. Wang, T. Weyand, M. Andreetto, and H. Adam. Mobilenets: Efficient convolutional neural networks for mobile vision applications. arXiv preprint arXiv:1704.04861, 2017. +G. Huang, Z. Liu, L. Van Der Maaten, and K. Q. Weinberger. Densely connected convolutional networks. In Conference on Computer Vision and Pattern Recognition, 2017. +F. Kamiran and T. Calders. Classifying without discriminating. In International Conference on Computer, Control and Communication, 2009. +F. Kamiran and T. Calders. Data preprocessing techniques for classification without discrimination. Knowledge and Information Systems, 2012. +F. Kamiran, A. Karim, and X. Zhang. Decision theory for discrimination-aware classification. In International Conference on Data Mining, 2012. +J. Kleinberg, S. Mullainathan, and M. Raghavan. Inherent trade-offs in the fair determination of risk scores. arXiv preprint arXiv:1609.05807, 2016. +R. Kohavi. Scaling up the accuracy of naive-Bayes classifiers: A decision-tree hybrid. In International Conference on Knowledge Discovery and Data Mining, 1996. +A. Kolesnikov, L. Beyer, X. Zhai, J. Puigcerver, J. Yung, S. Gelly, and N. Houlsby. Big transfer (BiT): General visual representation learning. In European Conference on Computer Vision, 2020. +T. Lin, M. Maire, S. J. Belongie, L. D. Bourdev, R. B. Girshick, J. Hays, P. Perona, D. Ramanan, P. Doll'a r, and C. L. Zitnick. Microsoft COCO: common objects in context. CoRR, abs/1405.0312, 2014. URL http://arxiv.org/abs/1405.0312. +Z. Liu, P. Luo, X. Wang, and X. Tang. Deep learning face attributes in the wild. In International Conference on Computer Vision, 2015. +F. Locatello, G. Abbati, T. Rainforth, S. Bauer, B. Scholkopf, and O. Bachem. On the fairness of disentangled representations. In Advances in Neural Information Processing Systems, 2019. +K. Lum and J. Johndrow. A statistical framework for fair predictive algorithms. arXiv preprint arXiv:1610.08077, 2016. + +D. Madras, E. Creager, T. Pitassi, and R. Zemel. Learning adversarially fair and transferable representations. In International Conference on Machine Learning, 2018. +N. Mehrabi, F. Morstatter, N. Saxena, K. Lerman, and A. Galstyan. A survey on bias and fairness in machine learning. arXiv preprint arXiv:1908.09635, 2019. +A. K. Menon and R. C. Williamson. The cost of fairness in binary classification. In Conference on Fairness, Accountability and Transparency, 2018. +Z. Obermeyer, B. Powers, C. Vogeli, and S. Mullainathan. Dissecting racial bias in an algorithm used to manage the health of populations. Science, 366(6464), 2019. +J. Platt et al. Probabilistic outputs for support vector machines and comparisons to regularized likelihood methods. Advances in Large Margin Classifiers, 1999. +H. Robbins and S. Monro. A stochastic approximation method. The annals of mathematical statistics, 1951. +M. Saerens, P. Latinne, and C. Decaestecker. Adjusting the outputs of a classifier to new a priori probabilities: a simple procedure. Neural computation, 14(1), 2002. +A. D. Selbst, D. Boyd, S. A. Friedler, S. Venkatasubramanian, and J. Vertesi. Fairness and abstraction in sociotechnical systems. In Conference on Fairness, Accountability, and Transparency, 2019. +C. Sun, A. Shrivastava, S. Singh, and A. Gupta. Revisiting unreasonable effectiveness of data in deep learning era. In International Conference on Computer Vision, 2017. +A. Torralba and A. A. Efros. Unbiased look at dataset bias. In Conference on Computer Vision and Pattern Recognition. IEEE, 2011. +A. Wang, A. Narayanan, and O. Russakovsky. Revise: A tool for measuring and mitigating bias in visual datasets. In European Conference on Computer Vision, 2020a. +Z. Wang, K. Qinami, I. C. Karakozis, K. Genova, P. Nair, K. Hata, and O. Russakovsky. Towards fairness in visual recognition: Effective strategies for bias mitigation. In Conference on Computer Vision and Pattern Recognition, 2020b. +D. Wei, K. N. Ramamurthy, and F. d. P. Calmon. Optimized score transformation for fair classification. arXiv preprint arXiv:1906.00066, 2019. +B. Woodworth, S. Gunasekar, M. I. Ohannessian, and N. Srebro. Learning non-discriminatory predictors. arXiv preprint arXiv:1702.06081, 2017. +H. Xu and S. Mannor. Robustness and generalization. Machine learning, 86(3), 2012. +K. Yang, K. Qinami, L. Fei-Fei, J. Deng, and O. Russakovsky. Towards fairer datasets: Filtering and balancing the distribution of the people subtree in the imagenet hierarchy. In Conference on Fairness, Accountability, and Transparency, 2020a. +Y. Yang, C. Zhang, C. Fan, A. Mostafavi, and X. Hu. Towards fairness-aware disaster informatics: an interdisciplinary perspective. IEEE Access, 8, 2020b. +I.-C. Yeh and C.-h. Lien. The comparisons of data mining techniques for the predictive accuracy of probability of default of credit card clients. Expert Systems with Applications, 36(2), 2009. +M. B. Zafar, I. Valera, M. Gomez Rodriguez, and K. P. Gummadi. Fairness beyond disparate treatment & disparate impact: Learning classification without disparate mistreatment. In International Conference on World Wide Web, 2017a. +M. B. Zafar, I. Valera, M. G. Rogriguez, and K. P. Gummadi. Fairness Constraints: Mechanisms for Fair Classification. In International Conference on Artificial Intelligence and Statistics, 2017b. +M. B. Zafar, I. Valera, M. Gomez-Rodriguez, and K. P. Gummadi. Fairness Constraints: A Flexible Approach for Fair Classification. Journal of Machine Learning Research, 2019. + +R. Zemel, Y. Wu, K. Swersky, T. Pitassi, and C. Dwork. Learning fair representations. In International Conference on Machine Learning, 2013. +B. H. Zhang, B. Lemoine, and M. Mitchell. Mitigating unwanted biases with adversarial learning. In Conference on AI, Ethics, and Society, 2018. +B. Zoph, V. Vasudevan, J. Shlens, and Q. V. Le. Learning transferable architectures for scalable image recognition. In Conference on Computer Vision and Pattern Recognition, 2018. \ No newline at end of file diff --git a/anearoptimalalgorithmfordebiasingtrainedmachinelearningmodels/images.zip b/anearoptimalalgorithmfordebiasingtrainedmachinelearningmodels/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9c914587ba80f54d9d55c5cba9df308f0765ab86 --- /dev/null +++ b/anearoptimalalgorithmfordebiasingtrainedmachinelearningmodels/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0ea4b8252d037cbc230a24a73b70b070573a3186c57cfffa01ee5ff102336bb9 +size 398148 diff --git a/anearoptimalalgorithmfordebiasingtrainedmachinelearningmodels/layout.json b/anearoptimalalgorithmfordebiasingtrainedmachinelearningmodels/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..813cf81db3777cc8f45a77be710fffcd16928393 --- /dev/null +++ b/anearoptimalalgorithmfordebiasingtrainedmachinelearningmodels/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:59e9776f7a81082960aaad7e8322c03633f8d1366e266ed4fcbd0affba364f36 +size 520529 diff --git a/anearoptimalalgorithmforstochasticbileveloptimizationviadoublemomentum/8dc6fc0e-9e92-4be1-87e9-e135c909b751_content_list.json b/anearoptimalalgorithmforstochasticbileveloptimizationviadoublemomentum/8dc6fc0e-9e92-4be1-87e9-e135c909b751_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..211221a0bf4dcb9136d1c5c057d0be1cbfb87c85 --- /dev/null +++ b/anearoptimalalgorithmforstochasticbileveloptimizationviadoublemomentum/8dc6fc0e-9e92-4be1-87e9-e135c909b751_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a6bd42312fad37165fe4d100ac4a1b786aa99cea83a3159bf550acfb163bb689 +size 85593 diff --git a/anearoptimalalgorithmforstochasticbileveloptimizationviadoublemomentum/8dc6fc0e-9e92-4be1-87e9-e135c909b751_model.json b/anearoptimalalgorithmforstochasticbileveloptimizationviadoublemomentum/8dc6fc0e-9e92-4be1-87e9-e135c909b751_model.json new file mode 100644 index 0000000000000000000000000000000000000000..c70edfdf20da449c49a4dc89c779d1eb729d96ce --- /dev/null +++ b/anearoptimalalgorithmforstochasticbileveloptimizationviadoublemomentum/8dc6fc0e-9e92-4be1-87e9-e135c909b751_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e88cdc87a03d070727b6de51adfec1b46982c20ad60fb6c68f4b8a8c1387befc +size 106160 diff --git a/anearoptimalalgorithmforstochasticbileveloptimizationviadoublemomentum/8dc6fc0e-9e92-4be1-87e9-e135c909b751_origin.pdf b/anearoptimalalgorithmforstochasticbileveloptimizationviadoublemomentum/8dc6fc0e-9e92-4be1-87e9-e135c909b751_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..56c909b004a10383243d05c8818f2145a0bd7241 --- /dev/null +++ b/anearoptimalalgorithmforstochasticbileveloptimizationviadoublemomentum/8dc6fc0e-9e92-4be1-87e9-e135c909b751_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4dc79bda389651ce4cfa10ad5ec2f25010efccc30e423edc2dfbd0c07e92513f +size 1075857 diff --git a/anearoptimalalgorithmforstochasticbileveloptimizationviadoublemomentum/full.md b/anearoptimalalgorithmforstochasticbileveloptimizationviadoublemomentum/full.md new file mode 100644 index 0000000000000000000000000000000000000000..504da02642e173bdffd13553770f62c2609d5e67 --- /dev/null +++ b/anearoptimalalgorithmforstochasticbileveloptimizationviadoublemomentum/full.md @@ -0,0 +1,393 @@ +# A Near-Optimal Algorithm for Stochastic Bilevel Optimization via Double-Momentum + +Prashant Khanduri + +University of Minnesota khand095@umn.edu + +Siliang Zeng + +University of Minnesota +zeng0176@umn.edu + +Mingyi Hong* + +University of Minnesota mhong@umn.edu + +Hoi-To Wai + +CUHK + +htwai@se.cuhk.edu.hk + +Zhaoran Wang + +Northwestern University +zhaoranwang@gmail.com + +Zhuoran Yang + +Princeton University +zy6@princeton.edu + +# Abstract + +This work proposes a new algorithm – the Single-timescale Double-momentum Stochastic Approximation (SUSTAIN) – for tackling stochastic unconstrained bilevel optimization problems. We focus on bilevel problems where the lower level subproblem is strongly-convex and the upper level objective function is smooth. Unlike prior works which rely on two-timescale or double loop techniques, we design a stochastic momentum-assisted gradient estimator for both the upper and lower level updates. The latter allows us to control the error in the stochastic gradient updates due to inaccurate solution to both subproblems. If the upper objective function is smooth but possibly non-convex, we show that SUSTAIN requires $\mathcal{O}(\epsilon^{-3/2})$ iterations (each using $\mathcal{O}(1)$ samples) to find an $\epsilon$ -stationary solution. The $\epsilon$ -stationary solution is defined as the point whose squared norm of the gradient of the outer function is less than or equal to $\epsilon$ . The total number of stochastic gradient samples required for the upper and lower level objective functions match the best-known complexity for single-level stochastic gradient algorithms. We also analyze the case when the upper level objective function is strongly-convex. + +# 1 Introduction + +Many learning and inference problems take a "hierarchical" form, wherein the optimal solution of one problem affects the objective function of others [27]. Bilevel optimization is often used to model problems of this kind with two levels of hierarchy [27, 8], where the variables of an upper level problem depend on the optimizer of certain lower level problem. In this work, we consider unconstrained bilevel optimization problems of the form: + +$$ +\begin{array}{l} \min _ {x \in \mathbb {R} ^ {d _ {\mathrm {u p}}}} \ell (x) = f (x, y ^ {*} (x)) := \mathbb {E} _ {\xi} [ f (x, y ^ {*} (x); \xi) ] \\ \begin{array}{l} \text {s . t .} \quad y ^ {*} (x) = \arg \min _ {y \in \mathbb {R} ^ {d \mid \circ}} \left\{g (x, y) := \mathbb {E} _ {\zeta} [ g (x, y; \zeta) ] \right\}, \end{array} \\ \end{array} +$$ + +where $f, g: \mathbb{R}^{d_{\mathrm{up}}} \times \mathbb{R}^{d_{\mathrm{lo}}} \to \mathbb{R}$ with $x \in \mathbb{R}^{d_{\mathrm{up}}}$ and $y \in \mathbb{R}^{d_{\mathrm{lo}}}$ ; $f(x,y;\xi)$ with $\xi \sim \pi_f$ (resp. $g(x,y;\zeta)$ with $\zeta \sim \pi_g$ ) represents a stochastic sample of the upper level objective (resp. lower level objective). Note here that the upper level objective $f$ depends on the minimizer of the lower level objective $g$ , and we refer to $\ell(x)$ as the outer function. Throughout this paper, $g(x,y)$ is assumed to be strongly-convex in $y$ , which implies that $\ell(x)$ is smooth but possibly non-convex. + +The applications of (1) include many machine learning problems that have a hierarchical structure. Examples are meta learning [13, 31], data hyper-cleaning [35], hyper-parameter optimization [12, + +
AlgorithmSample (Upper, Lower)ImplementationBatch SizePer-Iteration Complexity
BSA [14]O(ε-2), O(ε-3)Double loopO(1)O(dlo2·logT)
stocBiO [19]O(ε-2), O(ε-2)Double loopO(ε-1)O(dlo2·logT)
TTSA [18]O(ε-5/2), O(ε-5/2)Single loopO(1)O(dlo2·logT)
STABLE [5]O(ε-2), O(ε-2)Single loopO(1)O(d3lo)
SVRB [17]O(ε-3/2), O(ε-3/2)Single loopO(1)O(d3lo)
SUSTAIN (this work)O(ε-3/2), O(ε-3/2)Single loopO(1)O(d2lo·logT)
+ +Table 1: Comparison of the number of upper and lower level gradient samples required to achieve an $\epsilon$ -stationary point in Definition 1.1. For the algorithms with $\mathcal{O}(d_{\mathrm{lo}}^2 \cdot \log T)$ per-iteration dependence, the Hessian inverse can be computed via matrix vector products; algorithms with $\mathcal{O}(d_{\mathrm{lo}}^3)$ dependency require Hessian inverses and Hessian projections, which incur heavy computational cost. + +13, 29], and reinforcement learning [22], etc.. To better contextualize our study, below we describe examples on meta-learning problem and data hyper-cleaning problem: + +Example 1: Meta learning. The meta learning problem aims to learn task specific parameters that generalize to a diverse set of tasks [30]. Suppose we have $M$ tasks $\{\mathcal{T}_i, i = 1, \dots, M\}$ and each task has a corresponding loss function $L(x, y_i; \xi_i)$ with $\xi_i$ representing a data sample for task $\mathcal{T}_i$ , $x \in \mathbb{R}^{d_{\mathrm{up}}}$ the model parameters shared among tasks, and $y_i \in \mathbb{R}^{d_{\mathrm{io}}}^i$ the task specific parameters. The goal of meta learning is then to solve the following problem: + +$$ +\begin{array}{l} \min _ {x \in \mathbb {R} ^ {d _ {\mathrm {u p}}}} \left\{L _ {\mathsf {t s}} (x, \bar {y} ^ {*} (x)) := \frac {1}{M} \sum_ {i = 1} ^ {M} \mathbb {E} _ {\xi_ {i} \sim \mathcal {D} _ {i}} [ L (x, y _ {i} ^ {*} (x); \xi_ {i}) ] \right\} \\ s. t. \bar {y} ^ {*} (x) \in \arg \min _ {\bar {y} \in \mathbb {R} ^ {\sum_ {i = 1} ^ {M} d _ {\mathrm {l o}} ^ {i}}} L _ {\operatorname {t r}} (x, \bar {y}) := \frac {1}{M} \sum_ {i = 1} ^ {M} \left(\mathbb {E} _ {\zeta_ {i} \sim \mathcal {S} _ {i}} [ L (x, y _ {i}; \zeta_ {i}) ] + \mathcal {R} (y _ {i})\right), \tag {2} \\ \end{array} +$$ + +where $\bar{y} = [y_1^T, \ldots, y_M^T]^T$ , $\mathcal{R}(\cdot)$ is a strongly convex regularizer while $S_i$ and $\mathcal{D}_i$ are the training and testing datasets for task $T_i$ . Compared to the number of tasks, the dataset sizes are usually small for meta-learning problems, so the stochasticity in tackling (2) results from the fact that at each iteration we can only sample a subset $m$ out of $M$ tasks. Note that this problem is a special case of (1). + +Example 2: Data hyper-cleaning. The data hyper-cleaning is a hyperparameter optimization problem that aims to train a classifier model with a dataset of randomly corrupted labels [35]. The optimization problem is formulated below: + +$$ +\begin{array}{l} \min _ {x \in \mathbb {R} ^ {d _ {\mathrm {u p}}}} \ell (x) := \sum_ {i \in \mathcal {D} _ {\mathrm {v a l}}} L \left(a _ {i} ^ {\top} y ^ {*} (x), b _ {i}\right) \tag {3} \\ \mathrm {s . t .} y ^ {*} (x) = \arg \min _ {y \in \mathbb {R} ^ {d _ {\mathrm {l o}}}} \left\{c \| y \| ^ {2} + \sum_ {i \in \mathcal {D} _ {\mathrm {t r}}} \sigma (x _ {i}) L (a _ {i} ^ {\top} y, b _ {i}) \right\}. \\ \end{array} +$$ + +In this problem, we have $d_{\mathrm{up}} = |\mathcal{D}_{\mathrm{tr}}|$ and $d_{\mathrm{lo}}$ is the dimension of the classifier. Moreover, $(a_i, b_i)$ is the $i$ th data point; $L(\cdot)$ is the loss function, with $y$ being the model parameter; $x_i$ is the parameter that determines the weight for the $i$ th data sample, and $\sigma: \mathbb{R} \to \mathbb{R}_+$ is the weight function; $c > 0$ is a regularization parameter; $\mathcal{D}_{\mathrm{val}}$ and $\mathcal{D}_{\mathrm{tr}}$ are validation and training sets, respectively. Clearly, (3) is a special case of (1) where the lower level problem finds the classifier $y^*(x)$ with the training set $\mathcal{D}_{\mathrm{tr}}$ , and the upper level problem finds the best weights $x$ with respect to the validation set $\mathcal{D}_{\mathrm{val}}$ . + +A natural approach to tackling (1) is to apply alternating stochastic gradient (SG) updates. Let $\beta, \alpha > 0$ be some step sizes, one performs the recursion + +$$ +y ^ {+} \leftarrow y - \beta \hat {\nabla} _ {y} g (x, y), \quad x ^ {+} \leftarrow x - \alpha \hat {\nabla} _ {x} \hat {\ell} (x; y) \tag {4} +$$ + +such that $\hat{\nabla}_y g(x,y),\hat{\nabla}_x\hat{\ell} (x;y)$ are stochastic estimates of $\nabla_yg(x,y)$ $\nabla \ell (x)$ , respectively. Notice that (4) is significantly different from the standard alternating primal-dual gradient algorithm for saddle point problems. Particularly, the design of $\hat{\nabla}_x\hat{\ell} (x;y)$ is crucial to the SG scheme in (4). Observe that $\nabla \ell (x)$ can be computed using the implicit function theorem, and its evaluation requires $f(\cdot ,\cdot)$ and $y^{\star}(x)$ , the minimizer of $g(x,y)$ given $x$ (cf. (5)). This gives rise to a unique challenge to bilevel optimization, where $y^{\star}(x)$ can only be approximated by $y$ obtained in the first relation of (4). + +In light of the above observations, previous endeavors have considered two approaches to improve the estimate of $y^{\star}(x)$ while $\hat{\nabla}_x\hat{\ell} (x;y)$ is used as a biased approximation of $\nabla \ell (x)$ . The first approach is to apply the double-loop algorithms. For example, [14] proposed to repeat the $y^{+}$ update for multiple times to obtain a better estimate of $y^{\star}(x)$ before performing the $x^{+}$ update, [19] proposed + +to take a large batch size to estimate $\nabla_y g(x,y)$ . While simple to analyze, these algorithms may suffer from a poor sample complexity for the inner problem. The second approach is to apply single-loop algorithms where the $y^{+}$ -updates are performed simultaneously with the $x^{+}$ -updates. Instead, advanced techniques are utilized that allows $y^{+}$ to accurately track $y^{\star}(x)$ . For example, [18] suggested to tune the step size schedule with $\beta \gg \alpha$ , [5, 17] proposed single-timescale algorithms with advanced variance reduction techniques. However, the latter two algorithms require Hessian projections onto a compact set along with Hessian matrices inversion which scales poorly with dimension (i.e., in $\mathcal{O}(d_{\mathrm{lo}}^3)$ ). We summarize and compare the complexity results of the state-of-the-art algorithms in Table 1. + +A careful inspection on the above results reveals a gap in the iteration/sample complexity compared to single-level stochastic optimization. For instance, an optimal stochastic gradient algorithm finds an $\epsilon$ -stationary solution [cf. Definition 1.1] to $\min_x \mathbb{E}_\xi[\ell(x; \xi)]$ in $\mathcal{O}(\epsilon^{-3/2})$ iterations [10, 7, 37, 42]. For bilevel optimization, the fastest rate available is only $\mathcal{O}(\epsilon^{-2})$ to the best of the authors' knowledge. In comparison, the proposed algorithm achieves a rate of $\mathcal{O}(\epsilon^{-3/2})$ . During the preparation of the current paper, a preprint [17] has appeared which extended [5], and achieves an improved rate of $\mathcal{O}(\epsilon^{-3/2})$ . We remark that the latter work follows a different design philosophy from ours and maybe less efficient; see the detailed discussion at the end of Sec. 3. + +Contributions. In this paper, we depart from the prior developments which focused on finding better inner solutions $y^{*}(x)$ to approximate $\hat{\nabla}_x\hat{\ell} (x;y)\approx \nabla \ell (x)$ . Our idea is to exploit the gradient estimates from prior iterations to improve the quality of the current gradient estimation. This leads to momentum-assisted stochastic gradient estimators for both $\nabla_yg(x,y)$ and $\nabla \ell (x)$ using similar techniques in [7, 37] for single-level stochastic optimization. The resultant algorithm only requires $O(1)$ samples at each update, and updates $x$ and $y$ using step sizes of the same order, hence the name single-timescale double-momentum stochastic approximation(SUSTAIN) algorithm. Additionally, it is worth noting that our algorithm has a $\mathcal{O}(d_{\mathrm{lo}}^2)$ per iteration complexity, compared to the $\mathcal{O}(d_{\mathrm{lo}}^3)$ complexity of STABLE [5] and SVRB [17]. That is, the SUSTAIN algorithm is both sample and computation efficient. Our specific contributions are: + +- We propose the SUSTAIN algorithm for bilevel problems which matches the best complexity bounds as the optimal SGD algorithms for single-level stochastic optimization. That is, it requires $\mathcal{O}(\epsilon^{-3/2})$ [resp. $\mathcal{O}(\epsilon^{-1})$ ] samples to find an $\epsilon$ -stationary solution for non-convex (resp. strongly-convex) bilevel problems; see Table 1. Furthermore, the algorithm utilizes a single-loop update with step sizes of the same order for both upper and lower level problems. Such complexity bounds match the optimal sample complexity of stochastic gradient algorithms for single-level problems. +- By developing the Lipschitz continuous property of the (biased) stochastic estimates of $\nabla \ell(x)$ , we show that obtaining a good estimate of $\nabla \ell(x)$ does not require explicit (sampled) Hessian inversion. This key result ensures that our algorithm depends favorably on the problem dimension. +- Comparing with prior works such as TTSA [18], BSA [14], STABLE [5] and SVRB [17], our analysis reveals that improving the gradient estimation quality for both $\nabla_y g(x,y)$ and $\nabla \ell (x)$ is the key to obtain a sample and computation efficient stochastic algorithm for bilevel optimization. + +Related works. The study of the bilevel problem (1) can be traced to that of game theory [36] and was formally introduced in [2-4]. It is also related to the broader class of problems of Mathematical Programming with Equilibrium Constraints [26]. Related algorithms include approximate descent [9, 38], and penalty-based methods [40]; see [6] and [25] for a comprehensive survey. + +In addition to the works cited in Table 1, recent works on bilevel optimization have focused on algorithms with provable convergence rates. In [34], the authors proposed BigSAM algorithm for solving simple bilevel problems (with a single variable) with convex lower level problem. Subsequently, the works [24, 23] utilized BigSAM and developed algorithms for a general bilevel problem for the cases when the solution of the lower level problem is not a singleton. Note that all the aforementioned works [34, 24, 23] assumed the upper level problem to be strongly-convex with convex lower level problem. In a separate line of work, backpropagation based algorithms have been proposed to approximately solve bilevel problems [12, 35, 16, 15]. However, the major focus of these works was to develop efficient gradient estimators rather than on developing efficient optimization algorithms. + +Notation. For any $x \in \mathbb{R}^d$ , we denote $\|x\|$ as the standard Euclidean norm; as for $X \in \mathbb{R}^{n \times d}$ , $\|X\|$ is induced by the Euclidean norm. For a multivariate function $f(x, y)$ , the notation $\nabla_x f(x, y)$ [resp. $\nabla_y f(x, y)$ ] refers to the partial gradient taken with respect to (w.r.t.) $x$ [resp. $y$ ]. For some $\mu > 0$ , + +0, a function $f(x,y)$ is said to be $\mu$ -strongly-convex in $x$ if $f(x,y) - \frac{\mu}{2} \|x\|^2$ is convex in $x$ . For some $L > 0$ , the map $\mathcal{A}: \mathbb{R}^d \to \mathbb{R}^m$ is said to be $L$ -Lipschitz continuous if $\| \mathcal{A}(x) - \mathcal{A}(y) \| \leq L \| x - y \|$ for any $x,y \in \mathbb{R}^d$ . A function $f: \mathbb{R}^d \to \mathbb{R}$ is said to be $L$ -smooth if its gradient is $L$ -Lipschitz continuous. Uniform distribution over a discrete set $\{1,\dots,T\}$ is represented by $\mathcal{U}\{1,\dots,T\}$ . + +Finally, we state the following definitions for the optimality criteria of (1). + +Definition 1.1 ( $\epsilon$ -Stationary Point). A point $x$ is called $\epsilon$ -stationary if $\|\nabla \ell(x)\|^2 \leq \epsilon$ . A stochastic algorithm is said to achieve an $\epsilon$ -stationary point in $t$ iterations if $\mathbb{E}[\|\nabla \ell(x_t)\|^2] \leq \epsilon$ , where the expectation is over the stochasticity of the algorithm until time instant $t$ . + +Definition 1.2 ( $\epsilon$ -Optimal Point). A point $x$ is called $\epsilon$ -optimal if $\ell(x) - \ell^{*} \leq \epsilon$ , where $\ell^{*} := \min_{x \in \mathbb{R}^{d_{\mathrm{up}}}} \ell(x)$ . A stochastic algorithm is said to achieve an $\epsilon$ -optimal point in $t$ iterations if $\mathbb{E}[\ell(x_t) - \ell^{*}] \leq \epsilon$ , where the expectation is over the stochasticity of the algorithm until time instant $t$ . + +# 2 Preliminaries + +We discuss the assumptions on (1) to specify the problem class of interest. We also preface the proposed algorithm by describing a practical procedure for estimating the stochastic gradients. + +Assumption 1 (Upper Level Function). $f(x,y)$ satisfies the following conditions: + +(i) $\nabla_x f(x,y)$ and $\nabla_y f(x,y)$ are Lipschitz continuous w.r.t. $(x,y) \in \mathbb{R}^{d_{\mathrm{up}}} \times \mathbb{R}^{d_{\mathrm{lo}}}$ , and with constants $L_{f_x} \geq 0$ and $L_{f_y} \geq 0$ , respectively. +(ii) For any $(x,y)\in \mathbb{R}^{d_{\mathrm{up}}}\times \mathbb{R}^{d_{\mathrm{lo}}}$ , we have $\| \nabla_yf(x,y)\| \leq C_{f_y}$ , for some $C_{f_y}\geq 0$ + +Assumption 2 (Lower level Function). $g(x,y)$ satisfies the following conditions: + +(i) For any $x \in \mathbb{R}^{d_{\mathrm{up}}}$ and $y \in \mathbb{R}^{d_{\mathrm{lo}}}$ , $g(x,y)$ is twice continuously differentiable in $(x,y)$ . +(ii) $\nabla_{y}g(x,y)$ is Lipschitz continuous w.r.t. $(x,y)\in \mathbb{R}^{d_{\mathrm{up}}}\times \mathbb{R}^{d_{\mathrm{lo}}}$ , and with constant $L_{g}\geq 0$ +(iii) For any $x\in \mathbb{R}^{d_{\mathrm{up}}}$ , $g(x,\cdot)$ is $\mu_g$ -strongly-convex in $y$ for some $\mu_g > 0$ . +(iv) $\nabla_{xy}^2 g(x,y)$ and $\nabla_{yy}^2 g(x,y)$ are Lipschitz continuous w.r.t. $(x,y)\in \mathbb{R}^{d_{\mathrm{up}}}\times \mathbb{R}^{d_{\mathrm{io}}}$ , and with constants $L_{g_{xy}}\geq 0$ and $L_{g_{yy}}\geq 0$ , respectively. +(v) For any $(x,y)\in \mathbb{R}^{d_{\mathrm{up}}}\times \mathbb{R}^{d_{\mathrm{lo}}}$ , we have $\| \nabla_{xy}^2 g(x,y)\|^2\leq C_{g_{xy}}$ for some $C_{g_{xy}} > 0$ . + +Assumption 3 (Stochastic Functions). Assumptions 1 and 2 hold for $f(x,y;\xi)$ and $g(x,y;\zeta)$ , for all $\xi \in \mathrm{supp}(\pi_f)$ and $\zeta \in \mathrm{supp}(\pi_g)$ where $\mathrm{supp}(\pi)$ is the support of $\pi$ . Moreover, we assume the following variance bounds. + +$$ +\begin{array}{l} \mathbb {E} \left[ \| \nabla_ {x} f (x, y) - \nabla_ {x} f (x, y; \xi) \| ^ {2} \right] \leq \sigma_ {f _ {x}} ^ {2}, \quad \mathbb {E} \| \nabla_ {y} f (x, y) - \nabla_ {y} f (x, y; \xi) \| ^ {2} \leq \sigma_ {f _ {y}} ^ {2}, \\ \mathbb {E} \| \nabla_ {x y} ^ {2} g (x, y) - \nabla_ {x y} ^ {2} g (x, y; \xi) \| ^ {2} \leq \sigma_ {g _ {x y}} ^ {2} \text {f o r s o m e} \sigma_ {f _ {x}} \geq 0, \sigma_ {f _ {y}} \geq 0 \text {a n d} \sigma_ {g _ {x y}} \geq 0. \\ \end{array} +$$ + +These assumptions are standard in the analysis of bilevel optimization [14]. For example, they are satisfied by a range of applications such as the meta learning problem (2), data hypercleaning problem (3) with linear classifier. Notice that under these assumptions, the gradient $\nabla \ell (\cdot)$ is well-defined. By utilizing Assumption 2-(i) and (ii) along with the implicit function theorem [33], it is easy to show that for a given $\bar{x}\in \mathbb{R}^{d_{\mathrm{up}}}$ , the following holds [14, Lemma 2.1]: + +$$ +\nabla \ell (\bar {x}) = \nabla_ {x} f (\bar {x}, y ^ {*} (\bar {x})) - \nabla_ {x y} ^ {2} g (\bar {x}, y ^ {*} (\bar {x})) [ \nabla_ {y y} ^ {2} g (\bar {x}, y ^ {*} (\bar {x}))) ] ^ {- 1} \nabla_ {y} f (\bar {x}, y ^ {*} (\bar {x})). \tag {5} +$$ + +Obtaining $y^{*}(x)$ in closed-form is usually a challenging task, so it is natural to use the following gradient surrogate. At any $(\bar{x},\bar{y})\in \mathbb{R}^{d_{\mathrm{up}}\times d_{\mathrm{lo}}}$ , define: + +$$ +\bar {\nabla} f (\bar {x}, \bar {y}) = \nabla_ {x} f (\bar {x}, \bar {y}) - \nabla_ {x y} ^ {2} g (\bar {x}, \bar {y}) [ \nabla_ {y y} ^ {2} g (\bar {x}, \bar {y}) ] ^ {- 1} \nabla_ {y} f (\bar {x}, \bar {y}). \tag {6} +$$ + +Evaluating (6) requires computing the exact gradients and Hessian inverse which can be non-trivial. Below, we describe a practical procedure from [14] to generate a biased estimate of $\overline{\nabla} f(\bar{x},\bar{y})$ + +Stochastic gradient estimator for $\nabla \ell(x)$ . The estimator requires a parameter $K \in \mathbb{N}$ and is based on a collection of $K + 3$ independent samples $\bar{\xi} \coloneqq \{\xi, \zeta^{(0)}, \dots, \zeta^{(K)}, \mathsf{k}(K)\}$ , where $\xi \sim \mu$ , $\zeta^{(i)} \sim \pi_g$ , $i = 0, \dots, K$ , and $\mathsf{k}(K) \sim \mathcal{U}\{0, \dots, K - 1\}$ . We set + +$$ +\bar {\nabla} f (x, y; \bar {\xi}) = \nabla_ {x} f (x, y; \xi) - \frac {K}{L _ {g}} \nabla_ {x y} ^ {2} g (x, y; \zeta^ {(0)}) \prod_ {i = 1} ^ {k (K)} \left(I - \frac {\nabla_ {y y} ^ {2} g (x , y ; \zeta^ {(i)})}{L _ {g}}\right) \nabla_ {y} f (x, y; \xi), \tag {7} +$$ + +where we have used the convention $\prod_{i=1}^{j} A_i = I$ if $j = 0$ . It has been shown in [14, 18] that the bias with the gradient estimator (7) decays exponentially fast with $K$ , as summarized below: + +Lemma 2.1. Under Assumptions 1, 2. For any $K \geq 1$ , the gradient estimator in (7) satisfies + +$$ +\left\| \bar {\nabla} f (x, y) - \mathbb {E} _ {\bar {\xi}} [ \bar {\nabla} f (x, y; \bar {\xi}) ] \right\| \leq \frac {C _ {g _ {x y}} C _ {f _ {y}}}{\mu_ {g}} \left(1 - \frac {\mu_ {g}}{L _ {g}}\right) ^ {K}, \forall (x, y) \in \mathbb {R} ^ {d _ {\mathrm {u p}}} \times \mathbb {R} ^ {d _ {\mathrm {l o}}}. \tag {8} +$$ + +The detailed statement of the above lemma is included in Appendix C. We remark that each computation of $\overline{\nabla} f(x,y;\bar{\xi})$ requires at most $K$ Hessian-vector products, and later we will show that setting $K = \mathcal{O}(\log (T))$ is necessary for the proposed algorithm. Since $\nabla_{yy}^2 g(x,y;\zeta)$ is of size $d_{\mathrm{lo}}\times d_{\mathrm{lo}}$ , the total complexity of this step is $\mathcal{O}(\log (T)d_{\mathrm{lo}}^2)$ . On the contrary, STABLE [5] and SVRB [17] require $\mathcal{O}(d_{\mathrm{lo}}^3)$ to estimate the Hessian inverse, which is more computationally expensive when $d_{\mathrm{lo}}\gg 1$ . Indeed, it has been explicitly mentioned in [5] that "our algorithm (STABLE) is preferable in the regime where the sampling is more costly than computation or the dimension $d$ is relatively small". + +Notice that (7) is not the only option for estimating the gradient surrogate $\bar{\nabla} f(x,y)$ . For ease of presentation, below we abstract out the conditions on the stochastic estimates of $\nabla_y g$ , $\bar{\nabla} f$ required by our analysis as the following assumption: + +Assumption 4 (Stochastic Gradients). For any $(x,y)\in \mathbb{R}^{d_{\mathrm{up}}}\times \mathbb{R}^{d_{\mathrm{lo}}}$ , there exists constants $\sigma_f,\sigma_g\geq 0$ such that the estimates $\nabla_yg(x,y;\zeta),\bar{\nabla} f(x,y;\bar{\xi})$ satisfy: + +(i) The gradient estimate of the upper level objective satisfies: + +$$ +\mathbb {E} _ {\bar {\xi}} \left[ \| \bar {\nabla} f (x, y; \bar {\xi}) - \bar {\nabla} f (x, y) - B (x, y) \| ^ {2} \right] \leq \sigma_ {f} ^ {2}, \tag {9} +$$ + +where $B(x,y) = \mathbb{E}_{\bar{\xi}}[\bar{\nabla} f(x,y;\bar{\xi})] - \bar{\nabla} f(x,y)$ is the bias in estimating $\bar{\nabla} f(x,y)$ . + +(ii) The gradient estimate of the lower level objective satisfies + +$$ +\mathbb {E} _ {\zeta} \left[ \| \nabla_ {y} g (x, y; \zeta) - \nabla_ {y} g (x, y) \| ^ {2} \right] \leq \sigma_ {g} ^ {2}. \tag {10} +$$ + +As observed from Lemma 2.1, the gradient estimator (7) satisfies Assumption 4(i). + +Lastly, the approximate gradient defined in (6), the true gradient (5), as well as the optimal solution of the lower level problem are Lipschitz continuous, as proven below: + +Lemma 2.2. [14, Lemma 2.2] Under Assumptions 1, 2 and 3, we have + +$$ +\left\| \bar {\nabla} f (x, y) - \nabla \ell (x) \right\| \leq L \| y ^ {*} (x) - y \|, \quad \left\| y ^ {*} \left(x _ {1}\right) - y ^ {*} \left(x _ {2}\right) \right\| \leq L _ {y} \| x _ {1} - x _ {2} \|, \tag {11} +$$ + +$$ +\left\| \nabla \ell \left(x _ {1}\right) - \nabla \ell \left(x _ {2}\right) \right\| \leq L _ {f} \| x _ {1} - x _ {2} \|, +$$ + +for all $x, x_1, x_2 \in \mathbb{R}^{d_{\mathrm{up}}}$ and $y \in \mathbb{R}^{d_{\mathrm{io}}}$ . The above Lipschitz constants are defined as: + +$$ +L = L _ {f _ {x}} + \frac {L _ {f _ {y}} C _ {g _ {x y}}}{\mu_ {g}} + C _ {f _ {y}} \left(\frac {L _ {g _ {x y}}}{\mu_ {g}} + \frac {L _ {g _ {y y}} C _ {g _ {x y}}}{\mu_ {g} ^ {2}}\right), \quad L _ {f} = L + \frac {L C _ {g _ {x y}}}{\mu_ {g}}, \quad L _ {y} = \frac {C _ {g _ {x y}}}{\mu_ {g}}. \tag {12} +$$ + +The first result in (11) reveals that $\bar{\nabla} f(x,y)$ approximates $\nabla \ell (x)$ when $y\approx y^{*}(x)$ . This suggests that a double-loop algorithm which solves the strongly-convex lower level problem to sufficient accuracy can be applied to tackle (1). Such approach has been pursued in [14, 19]. Next, we propose an algorithm which relies on single-loop updates with improved sample efficiency. + +# 3 The proposed SUSTAIN algorithm + +Equipped with a practical stochastic gradient estimator for $\nabla \ell (x)$ [cf. (7)], our next endeavor is to develop a single-loop algorithm to tackle (1) through drawing $\mathcal{O}(1)$ samples for upper and lower level problems at each iteration. Our main idea is to adopt the recursive momentum techniques developed in [7, 37]. Notice that these works utilize unbiased stochastic gradients evaluated at consecutive iterates to construct a variance reduced gradient estimate for single-level stochastic optimization. + +In the context of bilevel stochastic optimization (1), a few key challenges are in order: + +# Algorithm 1 The Proposed SUSTAIN Algorithm + +1: Input: Parameters: $\{\beta_t\}_{t=0}^{T-1}, \{\alpha_t\}_{t=0}^{T-1}, \{\eta_t^f\}_{t=0}^{T-1}$ , and $\{\eta_t^g\}_{t=0}^{T-1}$ with $\eta_0^f = \eta_0^g = 1$ +2: Initialize: $x_0, y_0$ ; set $x_{-1} = y_{-1} = h_{-1}^f = h_{-1}^g = 0$ +3: for $t = 0$ to $T - 1$ do +4: (y-update) Compute the gradient estimator $h_t^g$ by (13) and set $y_{t + 1} = y_t - \beta_th_t^g$ . +5: (x-update) Compute the gradient estimator $h_t^f$ by (14) and set $x_{t + 1} = x_t - \alpha_th_t^f$ . +6: end for +7: Return: $x_{a(T)}$ where $a(T) \sim \mathcal{U}\{1, \dots, T\}$ . + +- Recall from Lemma 2.1 that obtaining an unbiased estimator for the outer gradient $\nabla \ell(x)$ requires using $K \to \infty$ samples in (7), this calls for the new techniques to control the bias arising from approximating $\nabla \ell(x)$ . +- The gradient estimator (7) has a more complicated structure than a plain gradient estimator, as it involves up to three different stochastic vectors/matrices related to $\nabla_{x}f(x,y)$ , $\nabla_{y}f(x,y)$ , $\nabla_{xy}g(x,y)$ , and one stochastic inversion that is related to $[\nabla_{yy}g(x,y)]^{-1}$ . It is not clear which are the most important objects for which variance reduction shall be applied. + +Our key innovation is to develop a useful estimate of $\bar{\nabla} f(x,y)$ by using a novel double-momentum technique. First, we build a recursive momentum estimator for $\nabla_y g(x,y)$ , based upon which the variable $y$ gets updated. Then, with such a "stabilized" inner iteration, we compute an estimate of $\bar{\nabla} f(x,y)$ as given in (7), by using the four stochastic vectors/matrices mentioned above but without performing any variance reduction. Such a stochastic estimator will then be used to construct a recursive momentum estimator for $\bar{\nabla} f(x,y)$ . The intuition is that as long as $y$ is accurate enough, then the stochastic terms in (7) are also accurate enough, so they can be used to construct the estimator for the outer gradient. Our approach only tracks two vector estimators, while still being able to leverage the low-complexity sample-based Hessian inversion as given in (7). + +The SUSTAIN algorithm is summarized in Algorithm 1. Define $\eta_t^g \in [0,1]$ , $\eta_t^f \in [0,1]$ . For the lower level problem involving $y$ , it utilizes the following momentum-assisted gradient estimator, $h_t^g \in \mathbb{R}^{d_{\mathrm{lo}}}$ , defined recursively as + +$$ +h _ {t} ^ {g} = \eta_ {t} ^ {g} \nabla_ {y} g \left(x _ {t}, y _ {t}; \zeta_ {t}\right) + \left(1 - \eta_ {t} ^ {g}\right) \left(h _ {t - 1} ^ {g} + \nabla_ {y} g \left(x _ {t}, y _ {t}; \zeta_ {t}\right) - \nabla_ {y} g \left(x _ {t - 1}, y _ {t - 1}; \zeta_ {t}\right)\right); \tag {13} +$$ + +For the upper level problem involving $x$ , we utilize a similar estimate, $h_t^f \in \mathbb{R}^{d_{\mathrm{up}}}$ , defined as + +$$ +h _ {t} ^ {f} = \eta_ {t} ^ {f} \bar {\nabla} f \left(x _ {t}, y _ {t}; \bar {\xi} _ {t}\right) + \left(1 - \eta_ {t} ^ {f}\right) \left(h _ {t - 1} ^ {f} + \bar {\nabla} f \left(x _ {t}, y _ {t}; \bar {\xi} _ {t}\right) - \bar {\nabla} f \left(x _ {t - 1}, y _ {t - 1}; \bar {\xi} _ {t}\right)\right). \tag {14} +$$ + +The gradient estimators $h_t^g$ and $h_t^f$ are computed from the current and past gradient estimates $\nabla_y g(x_t, y_t; \zeta_t), \nabla_y g(x_{t-1}, y_{t-1}; \zeta_t)$ and $\bar{\nabla} f(x_t, y_t; \bar{\xi}_t), \bar{\nabla} f(x_{t-1}, y_{t-1}; \bar{\xi}_t)$ . Note that the stochastic gradients at two consecutive iterates are computed using the same sample sets $\zeta_t$ for $h_t^g$ and $\bar{\xi}_t$ for $h_t^f$ . + +Both $x$ and $y$ -update steps mark a major departure of the SUSTAIN algorithm from existing algorithms on bilevel optimization [14, 18, 19]. The latter works apply the direct gradient estimator $\bar{\nabla} f(x_{t},y_{t + 1};\bar{\xi}_{t})$ [cf. (7)] to serve as an estimate to $\bar{\nabla} f(x,y)$ [and subsequently $\nabla \ell (x)]$ . To guarantee convergence, these works focused on improving the tracking performance of $y_{t + 1}\approx y^{\star}(x_{t})$ by employing double-loop updates, e.g., by repeatedly applying SG step multiple times for the inner problem; or a sophisticated two-timescale design for the step sizes, e.g., by setting $\beta_t / \alpha_t\to \infty$ . + +A recent preprint [17] suggested the SVRB algorithm which applies a similar recursive momentum technique as SUSTAIN. However, SVRB is different from SUSTAIN as the momentum estimator is applied exhaustively to all the individual random quantities involved in (7) and requires Hessian projection. As a result, the SVRB algorithm entails a high complexity in storage and computation as the latter has to store matrix variables of size $d_{\mathrm{lo}} \times d_{\mathrm{lo}}$ and computes a matrix inverse for each iteration. In comparison, the SUSTAIN algorithm only requires storing the gradient estimators $h_t^g$ , $h_t^f$ of size $d_{\mathrm{lo}}$ , $d_{\mathrm{up}}$ , respectively, and the computation complexity is only $\mathcal{O}(d_{\mathrm{lo}}^2 K)$ for each iteration. + +# 3.1 Convergence analysis + +In the following, we present the convergence analysis for the SUSTAIN algorithm when $\ell(\cdot)$ is a smooth function [cf. consequence of Assumptions 1, 2 and 3]. Before proceeding to the main results, we present a lemma about the Lipschitzness of the gradient estimate $\vec{\nabla} f(x,y;\xi)$ given in (7): + +Lemma 3.1. Under Assumptions 1, 2 and 3, we have for any $(x_{1},y_{1}),(x_{2},y_{2})\in \mathbb{R}^{d_{\mathrm{up}}}\times \mathbb{R}^{d_{\mathrm{lo}}}$ + +$$ +\mathbb {E} _ {\bar {\xi}} \| \bar {\nabla} f (x _ {1}, y _ {1}; \bar {\xi}) - \bar {\nabla} f (x _ {2}, y _ {2}; \bar {\xi}) \| \leq L _ {K} ^ {2} \left\{\| x _ {1} - x _ {2} \| + \| y _ {1} - y _ {2} \| \right\} ^ {2}, +$$ + +where + +$$ +L _ {K} = \sqrt {2 L _ {f _ {x}} ^ {2} + \frac {6 C _ {g _ {x y}} ^ {2} L _ {f _ {y}} ^ {2} K}{2 \mu_ {g} L _ {g} - \mu_ {g} ^ {2}} + \frac {6 C _ {f _ {y}} ^ {2} L _ {g _ {x y}} ^ {2} K}{2 \mu_ {g} L _ {g} - \mu_ {g} ^ {2}} + \frac {6 C _ {g _ {x y}} ^ {2} C _ {f _ {y}} ^ {2} L _ {g _ {y y}} ^ {2} K ^ {3}}{\left(L _ {g} - \mu_ {g}\right) ^ {2} \left(2 \mu_ {g} L _ {g} - \mu_ {g} ^ {2}\right)}}, \tag {15} +$$ + +and $K$ is the number of samples required to construct the stochastic gradient estimate given in (7). + +The detailed proof can be found in Appendix C. We remark that the above result is crucial for analyzing the error of the gradient estimate $h_t^f$ defined in (14). To see this, let us first define the errors of the gradient estimates for the outer and inner functions as follows + +$$ +e _ {t} ^ {f} := h _ {t} ^ {f} - \bar {\nabla} f \left(x _ {t}, y _ {t}\right) - B _ {t}, \quad e _ {t} ^ {g} := h _ {t} ^ {g} - \bar {\nabla} _ {y} g \left(x _ {t}, y _ {t}\right), \tag {16} +$$ + +where $B_{t} \coloneqq B(x_{t},y_{t})$ denotes the bias. Rewriting $e_t^f$ using (14) gives the following recursion: + +$$ +\begin{array}{l} e _ {t} ^ {f} = \left(1 - \eta_ {t} ^ {f}\right) e _ {t - 1} ^ {f} + \left(1 - \eta_ {t} ^ {f}\right) \left\{\bar {\nabla} f \left(x _ {t}, y _ {t}; \bar {\xi} _ {t}\right) - \bar {\nabla} f \left(x _ {t - 1}, y _ {t - 1}; \bar {\xi} _ {t}\right) \right. \\ \left. - \left(\bar {\nabla} f \left(x _ {t}, y _ {t}\right) + B _ {t} - \bar {\nabla} f \left(x _ {t - 1}, y _ {t - 1}\right) - B _ {t - 1}\right) \right\} + \eta_ {t} ^ {f} \left(\bar {\nabla} f \left(x _ {t}, y _ {t}; \bar {\xi} _ {t}\right) - \bar {\nabla} f \left(x _ {t}, y _ {t}\right) - B _ {t}\right). \\ \end{array} +$$ + +Lemma 3.1 allows us to control the variance of the second term in the above relation as $\mathcal{O}(\alpha_t^2\| h_{t - 1}^f\|^2 +\beta_t^2\| h_{t - 1}^g\|^2)$ . This subsequently leads to a reduced error magnitude for $\mathbb{E}[\| e_t^f\|^2]$ . Similarly, we can show a reduced error magnitude for $\mathbb{E}[\| e_t^g\|^2]$ for the inner gradient estimate. + +The above discussion suggests that we can track the gradient $\nabla \ell (x)$ using only stochastic gradient estimates (7), without needing to track each component stochastic vectors/matrices. This allows us to avoid costly Hessian inversions. In contrast, [5, 17] track the individual stochastic vectors/matrices of (7), and then combine them together to yield an estimate of $\nabla \ell (x)$ . This approach is unable to utilize the cheap stochastic estimates of Hessian and have to invert it directly. + +Turning back to the convergence analysis of the SUSTAIN algorithm, the main idea of our analysis is to demonstrate reduction of a properly constructed potential function across iterations. For smooth (possibly non-convex) objective function, this potential function consists of a linear combination of the norms of the error terms $\mathbb{E}[\| e_t^f\|^2]$ and $\mathbb{E}[\| e_t^g\|^2]$ along with the outer objective function $\ell(x_{t})$ and the inner optimality gap $\| y_t - y^*(x_t)\|^2$ . We obtain: + +Theorem 3.2. Under Assumptions 1-4. Fix $T \geq 1$ as the maximum iteration number. Set the number of samples used for the gradient estimator in (7) as $K = (L_g / \mu_g) \log (C_{g_{xy}} C_{f_y} T / \mu_g)$ and + +$$ +\alpha_ {t} = \frac {1}{(w + t) ^ {1 / 3}}, \quad \beta_ {t} = c _ {\beta} \alpha_ {t}, \quad \eta_ {t} ^ {f} = c _ {\eta_ {f}} \alpha_ {t} ^ {2}, \quad \eta_ {t} ^ {g} = c _ {\eta_ {g}} \alpha_ {t} ^ {2}, \tag {17} +$$ + +where $w, c_{\beta}, c_{\eta_f}, c_{\eta_g}$ are defined in (29) of appendix. The iterates generated by Algorithm 1 satisfy + +$$ +\mathbb {E} \| \nabla \ell \left(x _ {a (T)}\right) \| ^ {2} = \mathcal {O} \left(\frac {\ell \left(x _ {0}\right) - \ell^ {*}}{T ^ {2 / 3}} + \frac {\left\| y _ {0} - y ^ {*} \left(x _ {0}\right) \right\| ^ {2}}{T ^ {2 / 3}} + \frac {\log (T) \sigma_ {f} ^ {2}}{T ^ {2 / 3}} + \frac {\log (T) \sigma_ {g} ^ {2}}{T ^ {2 / 3}}\right). \tag {18} +$$ + +Details of the constants in the theorem and its proof can be found in Appendix D. The above result shows that to reach an $\epsilon$ -stationary point, the SUSTAIN algorithm requires $\widetilde{\mathcal{O}}(\epsilon^{-3/2})$ (omitting logarithmic factors) samples of stochastic gradients from both the upper and lower level functions. + +This sample complexity matches the best complexity bounds for single-level stochastic optimization like SPIDER [10], STORM [7], SNVRG [42] and Hybrid SGD [37]. We claim that this is a near-optimal sample complexity for bilevel stochastic optimization since for example, we have imposed additional smoothness conditions on the Hessian of the lower level problem. We will leave this as an open question to investigate the lower bound complexity for bilevel stochastic optimization. + +Strongly-convex $\ell(x)$ . We also discuss the case when in addition to smoothness, $\ell(\cdot)$ is $\mu_f$ -strongly-convex. Here, a stronger guarantee can be obtained: + +Theorem 3.3. Under Assumptions 1-4, and suppose $\ell(x)$ is $\mu_f$ -strongly-convex. Fix any $T \geq 1$ , set the number of samples for the gradient estimator (7) as $K = (L_g / 2\mu_g) \log \left(C_{g_{xy}}^2 C_{f_y}^2 T / \mu_g^2\right)$ and + +$$ +\alpha_ {t} \equiv \alpha \leq \left\{\frac {1}{\mu_ {f} + 1}, \frac {1}{2 \mu_ {g} \hat {c} _ {\beta}}, \frac {\mu_ {g}}{\hat {c} _ {\beta} L _ {g} ^ {2}}, \frac {1}{8 L _ {K} ^ {2} + L _ {f}}, \frac {L ^ {2} + 2 L _ {y} ^ {2}}{4 L _ {K} ^ {2} L _ {g} ^ {2} \hat {c} _ {\beta} ^ {2}} \right\}, \eta_ {t} ^ {f} \equiv (\mu_ {f} + 1) \alpha , \beta_ {t} \equiv \hat {c} _ {\beta} \alpha , +$$ + +where $\eta_t^g \equiv 1$ , $\hat{c}_{\beta} = 8L_y^2 + 8L^2 + 2\mu_f / \mu_g$ and $L_K$ is defined in (15). The iterates generated by Algorithm 1 satisfy for any $t \geq 1$ that: + +$$ +\mathbb {E} \left[ \ell \left(x _ {t}\right) - \ell^ {*} \right] \leq \left(1 - \mu_ {f} \alpha\right) ^ {t} \bar {\Delta} _ {0} + \frac {1}{\mu_ {f}} \left\{\frac {2}{T} + \left[ \left(2 \hat {c} _ {\beta} ^ {2} + 8 \hat {c} _ {\beta} ^ {2} L _ {K} ^ {2}\right) \sigma_ {g} ^ {2} + 2 \left(\mu_ {f} + 1\right) ^ {2} \sigma_ {f} ^ {2} \right] \alpha \right\}, \tag {19} +$$ + +where $\bar{\Delta}_0\coloneqq \ell (x_0) - \ell^* +\sigma_f^2 +\| y_0 - y^* (x_0)\| ^2$ + +The detailed proof can be found in Appendix E. For large $T$ , setting $\alpha \asymp 1 / T$ shows that the bound in (19) decreases at the rate of $\mathcal{O}(1 / T)$ . + +Theorem 3.3 shows that to reach an $\epsilon$ -optimal point, the SUSTAIN algorithm requires $\widetilde{\mathcal{O}}(\epsilon^{-1})$ stochastic gradient samples from the upper and lower level problems, also see the detailed calculations in Appendix E. This improves over TTSA [18] which requires $\widetilde{\mathcal{O}}(\epsilon^{-1.5})$ samples, and BSA [14] which requires $\widetilde{\mathcal{O}}(\epsilon^{-1}), \mathcal{O}(\epsilon^{-2})$ samples for the upper and lower level problems, respectively. Again, we achieve similar sample complexity as SGD applied on strongly-convex single-level optimization. + +Interestingly, in Theorem 3.3, we have selected $\eta_t^g \equiv 1$ where the momentum term in the lower level gradient vanishes. In this way, the SUSTAIN algorithm is reduced into a single-momentum algorithm where the recursive momentum acceleration is only applied to the upper level gradient. Similarly, in Theorem 3.2, if SUSTAIN utilizes only the upper level momentum, i.e., $\eta_t^g \equiv 1$ , then with appropriate choice of parameters, we get $\mathbb{E}\|\nabla \ell(x_{a(T)})\|^2 \leq \mathcal{O}(1/\sqrt{T})$ (please see [20] for further details). This implies that to achieve an $\epsilon$ -stationary solution SUSTAIN with only upper level momentum requires $\mathcal{O}(\epsilon^{-2})$ stochastic samples for both the upper and the lower level functions. Note that this improves over TTSA [18] which utilizes a vanilla SGD update for both the upper and the lower level problems, i.e., $\eta_t^f \equiv 1$ and $\eta_t^g \equiv 1$ and requires $\mathcal{O}(\epsilon^{-5/2})$ stochastic samples for both upper and lower level functions. + +# 4 Numerical experiments + +In this section, we evaluate the performance of the SUSTAIN algorithm on two popular machine learning tasks: hyperparameter optimization and meta learning. + +Hyperparameter optimization. We consider the data hyper-cleaning task (3), and compare SUSTAIN with several algorithms such as stocBiO [19] for different batch size choices, and the HOAG algorithm in [29]. Note that in [19], the authors shown that stocBio exhibits better practical performance compared with other bilevel optimization algorithms. + +We consider problem (3) with $L(\cdot)$ being the cross-entropy loss (i.e., a data cleaning problem for logistic regression); $\sigma(x) \coloneqq \frac{1}{1 + \exp(-x)}$ ; $c = 0.001$ ; see [35]. The problem is trained on the FashionMNIST dataset [41] with 50k, 10k, and 10k image samples allocated for training, validation and testing purposes, respectively. The step sizes for different algorithms are chosen according to their theoretically suggested values. Let the outer iteration be indexed by $t$ , for SUSTAIN we choose $\alpha_{t} = \beta_{t} = 0.1 / (1 + t)^{1/3}$ and tune for $c_{\eta_{f}}$ and $c_{\eta_{g}}$ (see Theorem 3.2), for stocBiO and HOAG we select $\alpha_{t} = d_{\alpha}$ , $\beta_{t} = d_{\beta}$ and tune for parameters $d_{\alpha}$ and $d_{\alpha}$ in the range [0, 1]. + +In Figure 1, we compare the performance of different algorithms when the dataset has a corruption probability of 0.3. As observed, SUSTAIN outperforms stocBiO and HOAG. We remark that HOAG is a deterministic algorithm and hence requires full batch gradient computations at each iteration. Similarly, stocBio relies on large batch gradients which results in relatively slow convergence. This fast convergence of SUSTAIN results from the single timescale update with reduced variance resulting from the double-momentum variance reduced updates. + +Meta learning. We consider a few-shot meta learning problem [11, 30] (cf. (2)) and compare the performance of SUSTAIN to ITD-BiO [19] and ANIL [30]. The task of interest is 5-way 5-shot + +![](images/bc7004cf0eb7d0a044fb5abc39115e3eec12c59dbc791e0a5135f62453cc2c10.jpg) +Figure 1: Hyperparameter optimization: Data hyper-cleaning task on the FashionMNIST dataset. We plot the training loss and testing accuracy against the number of gradients evaluated with corruption rate $p = 0.3$ . + +![](images/100c3593dd1e651b70fc872dacf53e42080b4a285a7d79c6966d72ebaa600489.jpg) + +![](images/285084857d6fb6b82796ca01dd0877a2e0d0c3a459ef7fc1ea43335f63e045e4.jpg) +Figure 2: Meta learning: 5-way 5-shot learning task on the miniImageNet dataset. We plot the training and testing accuracy against the number of iterations. + +![](images/6ca06a2cd9fb0a80be6029cd2e5e77042c0d90b941dfd3dba5d33b0e6b3f2729.jpg) + +learning and we conduct experiments on the miniImageNet dataset [39, 32] with 100 classes and 600 images per class. We apply learn2learn [1] (available: https://github.com/learnables/learn2learn) to partition the 100 classes from miniImageNet into subsets of 64, 16 and 20 for meta training, meta validation and meta testing, respectively. Similar to [1, 19], we implement a 4-layer convolutional neural network (CNN) with ReLU activation for the learning task. At each iteration, we sample a batch of 32 tasks from a set of 20000 tasks allocated for training and 600 each for validation and testing. For each algorithm, we implement 10 inner and 1 outer update. The performance is averaged over 10 Monte Carlo runs. + +For ANIL and ITD-BiO, we use the parameter selection suggested in [1, 19]. Specifically, for ANIL, we use inner-loop stepsize of 0.1 and the outer-loop (meta) stepsize as 0.002. For ITD-BiO, we choose the inner-loop stepsize as 0.05 and the outer-loop stepsize to be 0.005. For SUSTAIN, we choose the outer-loop stepsize $\alpha_{t}$ as $\kappa/(1 + t)^{1/3}$ and choose $\kappa \in [0.1, 1]$ , we choose the momentum parameter $\eta_{t}$ as $\bar{c}\alpha_{t}^{2}/\kappa^{2}$ and tune for $\bar{c} \in \{2, 5, 10, 15, 20\}$ , finally, we fix the inner stepsize as 0.05. For the outer loop update ANIL and ITD-BiO utilize SGD optimizer whereas SUSTAIN uses the hybrid gradient estimator. + +From Figure 2 which compares the training and testing accuracy against the iteration number, we observe that SUSTAIN achieves a better performance compared to ANIL and ITD-BiO on the meta learning task. Also, notice that in the initial iterations SUSTAIN converges faster but then converges probably as a consequence of diminishing step sizes (and momentum parameter). In contrast, ANIL and ITD-BiO slowly improve in performance and catch up with SUSTAIN's performance. In the appendix, we show that the SUSTAIN algorithm requires less computation time to achieve better performance compared to the ANIL and ITD-BiO. + +For further evaluation of the performance of SUSTAIN, we have included additional experiments on hyperparameter optimization and meta learning on different datasets in the supplementary material. + +# Conclusions and limitations + +We have developed the SUSTAIN algorithm for unconstrained bilevel optimization with strongly convex lower level subproblems. The proposed algorithm executes on a single-timescale, without the need to use either two-timescale updates, large batch gradients, or double-loop algorithm. We showed that SUSTAIN is both sample and computation efficient, because it matches the best-known sample complexity guarantees for single-level problems with non-convex and strongly convex objective (smooth) functions, while matching the best-known per-iteration computational complexity for the same class of bi-level problems. In the future, we plan to rigorously show the sample complexity lower bounds for the considered class of bilevel problems. Further, we plan to develop sample and communication efficient algorithms for a more general class of bilevel problems, such as those with constraints in the lower level problems. + +# Acknowledgement + +We thank the anonymous reviewers for their valuable comments and suggestions. The work of Prashant Khanduri, Siliang Zeng, and Mingyi Hong was supported by the National Science Foundation (NSF) through grant CIF-1910385. The work of Mingyi Hong was also supported by an IBM Faculty Research award. The work of Hoi-To Wai was supported by CUHK Direct Grant #4055113. Zhaoran Wang acknowledges National Science Foundation (Awards 2048075, 2008827, 2015568, 1934931), Simons Institute (Theory of Reinforcement Learning), Amazon, J.P. Morgan, and Two Sigma for their support. Zhuoran Yang acknowledges Simons Institute (Theory of Reinforcement Learning). + +# References + +[1] S. M. R. Arnold, P. Mahajan, D. Datta, I. Bunner, and K. S. Zarkias. learn2learn: A library for Meta-Learning research. CoRR, Aug. 2020. +[2] J. Bracken and J. T. McGill. Mathematical programs with optimization problems in the constraints. Operations Research, 21(1):37-44, 1973. ISSN 0030364X, 15265463. +[3] J. Bracken and J. T. McGill. Defense applications of mathematical programs with optimization problems in the constraints. Operations Research, 22(5):1086-1096, 1974. ISSN 0030364X, 15265463. +[4] J. Bracken, J. E. Falk, and J. T. McGill. Technical note—the equivalence of two mathematical programs with optimization problems in the constraints. Operations Research, 22(5):1102-1104, 1974. doi: 10.1287/opre.22.5.1102. +[5] T. Chen, Y. Sun, and W. Yin. A single-timescale stochastic bilevel optimization method. arXiv preprint arXiv:2102.04671, 2021. +[6] B. Colson, P. Marcotte, and G. Savard. An overview of bilevel optimization. Annals of Operations Research, 153:235-256, 2007. +[7] A. Cutkosky and F. Orabona. Momentum-based variance reduction in non-convex SGD. In Advances in Neural Information Processing Systems 32, pages 15236–15245. Curran Associates, Inc., 2019. +[8] S. Dempe. Foundations of bilevel programming. Springer Science & Business Media, 2002. +[9] J. E. Falk and J. Liu. On bilevel programming, part I: General nonlinear cases. Mathematical Programming volume, 70:47-72, 1995. +[10] C. Fang, C. J. Li, Z. Lin, and T. Zhang. Spider: Near-optimal non-convex optimization via stochastic path-integrated differential estimator. In Advances in Neural Information Processing Systems, pages 689–699, 2018. +[11] C. Finn, P. Abbeel, and S. Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 1126–1135. JMLR.org, 2017. +[12] L. Franceschi, M. Donini, P. Frasconi, and M. Pontil. Forward and reverse gradient-based hyperparameter optimization. In Proceedings of the 34th International Conference on Machine Learning - Volume 70, page 1165-1173, 2017. +[13] L. Franceschi, P. Frasconi, S. Salzo, R. Grazzi, and M. Pontil. Bilevel programming for hyperparameter optimization and meta-learning. arXiv preprint arXiv:1806.04910, 2018. +[14] S. Ghadimi and M. Wang. Approximation methods for bilevel programming. arXiv preprint arXiv:1802.02246, 2018. +[15] R. Grazzi, L. Franceschi, M. Pontil, and S. Salzo. On the iteration complexity of hypergradient computation. arXiv preprint arXiv:2006.16218, 2020. +[16] R. Grazzi, M. Pontil, and S. Salzo. Convergence properties of stochastic hypergradients. arXiv preprint arXiv:2011.07122, 2020. +[17] Z. Guo and T. Yang. Randomized stochastic variance-reduced methods for stochastic bilevel optimization. arXiv preprint arXiv:2105.02266, 2021. +[18] M. Hong, H.-T. Wai, Z. Wang, and Z. Yang. A two-timescale framework for bilevel optimization: Complexity analysis and application to actor-critic. arXiv preprint arXiv:2007.05170, 2020. +[19] K. Ji, J. Yang, and Y. Liang. Bilevel optimization: Nonasymptotic analysis and faster algorithms. arXiv preprint arXiv:2010.07962, 2020. + +[20] P. Khanduri, S. Zeng, M. Hong, H.-T. Wai, Z. Wang, and Z. Yang. A momentum-assisted single-timescale stochastic approximation algorithm for bilevel optimization. arXiv preprint arXiv:2102.07367, 2021. +[21] D. P. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. +[22] V. R. Konda and J. N. Tsitsiklis. Actor-critic algorithms. In Advances in neural information processing systems, pages 1008-1014, 2000. +[23] J. Li, B. Gu, and H. Huang. Improved bilevel model: Fast and optimal algorithm with theoretical guarantee. arXiv preprint arXiv:2009.00690, 2020. +[24] R. Liu, P. Mu, X. Yuan, S. Zeng, and J. Zhang. A generic first-order algorithmic framework for bi-level programming beyond lower-level singleton. arXiv preprint arXiv:2006.04045, 2020. +[25] R. Liu, J. Gao, J. Zhang, D. Meng, and Z. Lin. Investigating bi-level optimization for learning and vision from a unified perspective: A survey and beyond. arXiv preprint arXiv:2101.11517, 2021. +[26] Z.-Q. Luo, J.-S. Pang, and D. Ralph. Mathematical Programs with Equilibrium Constraints. Cambridge University Press, 1996. doi: 10.1017/CBO9780511983658. +[27] A. Migdalas, P. M. Pardalos, and P. Värbrand. Multilevel optimization: algorithms and applications, volume 20. Springer Science & Business Media, 2013. +[28] B. N. Oreshkin, P. Rodriguez, and A. Lacoste. Tadam: Task dependent adaptive metric for improved few-shot learning. arXiv preprint arXiv:1805.10123, 2018. +[29] F. Pedregosa. Hyperparameter optimization with approximate gradient. In International conference on machine learning, pages 737-746. PMLR, 2016. +[30] A. Raghu, M. Raghu, S. Bengio, and O. Vinyals. Rapid learning or feature reuse? towards understanding the effectiveness of maml. In ICLR, 2019. +[31] A. Rajeswaran, C. Finn, S. M. Kakade, and S. Levine. Meta-learning with implicit gradients. In Advances in Neural Information Processing Systems, volume 32, pages 113-124. Curran Associates, Inc., 2019. +[32] S. Ravi and H. Larochelle. Optimization as a model for few-shot learning. In Proceedings of the 5th International Conference on Learning Representations, 2017. +[33] W. Rudin. Principles of mathematical analysis. McGraw-Hill New York, 3d ed. edition, 1976. ISBN 007054235. +[34] S. Sabach and S. Shtern. A first order method for solving convex bilevel optimization problems. SIAM J. Optim., 27(2):640-660, 2017. +[35] A. Shaban, C.-A. Cheng, N. Hatch, and B. Boots. Truncated back-propagation for bilevel optimization. arXiv preprint arXiv:1810.10667, 2019. +[36] H. V. Stackelberg. The Theory of Market Economy. Oxford University Press, 1952. +[37] Q. Tran-Dinh, N. H. Pham, D. T. Phan, and L. M. Nguyen. Hybrid stochastic gradient descent algorithms for stochastic nonconvex optimization. arXiv preprint arXiv:1905.05920, 2019. +[38] L. Vicente, , G. Savard, and J. Judice. Descent approaches for quadratic bilevel programming. Journal of Optimization Theory and Applications, pages 379-399, 1994. +[39] O. Vinyals, C. Blundell, T. Lillicrap, k. kavukcuoglu, and D. Wierstra. Matching networks for one shot learning. In D. Lee, M. Sugiyama, U. Luxburg, I. Guyon, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 29. Curran Associates, Inc., 2016. +[40] D. J. White and G. Anandalingam. A penalty function approach for solving bi-level linear programs. Journal of Global Optimization, 3:397-419, 1993. + +[41] H. Xiao, K. Rasul, and R. Vollgraf. Fashion-mnist: a novel image dataset for benchmarking machine learning algorithms. arXiv preprint arXiv:1708.07747, 2017. +[42] D. Zhou, P. Xu, and Q. Gu. Stochastic nested variance reduction for nonconvex optimization. arXiv preprint arXiv:1806.07811, 2018. \ No newline at end of file diff --git a/anearoptimalalgorithmforstochasticbileveloptimizationviadoublemomentum/images.zip b/anearoptimalalgorithmforstochasticbileveloptimizationviadoublemomentum/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..daa4d94728e5dfc042fe80da692f0103de84fd60 --- /dev/null +++ b/anearoptimalalgorithmforstochasticbileveloptimizationviadoublemomentum/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c83364c15ceffdef38881803388f7c4555dc34b3f180a61c10de47c7247d8f1 +size 390419 diff --git a/anearoptimalalgorithmforstochasticbileveloptimizationviadoublemomentum/layout.json b/anearoptimalalgorithmforstochasticbileveloptimizationviadoublemomentum/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..62526180dc6e5647a0e42e5f0eb9af5a66b73f2e --- /dev/null +++ b/anearoptimalalgorithmforstochasticbileveloptimizationviadoublemomentum/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:687a759c8481e25a3bcc8a3947e5348d6e7cbeb8b7b766b4f75401b245dcb5d9 +size 624659 diff --git a/anerfarticulatedneuralradiancefieldsforlearninghumanshapeappearanceandpose/d4e6f671-f770-4cdb-ba23-cca62446556f_content_list.json b/anerfarticulatedneuralradiancefieldsforlearninghumanshapeappearanceandpose/d4e6f671-f770-4cdb-ba23-cca62446556f_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..019550400f5e383ab6a46aefc7a9d273ffe53dea --- /dev/null +++ b/anerfarticulatedneuralradiancefieldsforlearninghumanshapeappearanceandpose/d4e6f671-f770-4cdb-ba23-cca62446556f_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:809a40b3f18e1bd51dfa38f25ee918179e201f27387f2ba2c82b8f030ac4af96 +size 98573 diff --git a/anerfarticulatedneuralradiancefieldsforlearninghumanshapeappearanceandpose/d4e6f671-f770-4cdb-ba23-cca62446556f_model.json b/anerfarticulatedneuralradiancefieldsforlearninghumanshapeappearanceandpose/d4e6f671-f770-4cdb-ba23-cca62446556f_model.json new file mode 100644 index 0000000000000000000000000000000000000000..30884e11ba7c47b3bc931080ea105bc9f9863a79 --- /dev/null +++ b/anerfarticulatedneuralradiancefieldsforlearninghumanshapeappearanceandpose/d4e6f671-f770-4cdb-ba23-cca62446556f_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2ca0f1e6992c5c9799f4da53bf15a6ab5fc6b5f4ad196e453464deec3f304f3a +size 121899 diff --git a/anerfarticulatedneuralradiancefieldsforlearninghumanshapeappearanceandpose/d4e6f671-f770-4cdb-ba23-cca62446556f_origin.pdf b/anerfarticulatedneuralradiancefieldsforlearninghumanshapeappearanceandpose/d4e6f671-f770-4cdb-ba23-cca62446556f_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8f2f84450b2372e49adfaed2b72bf0e1d0d73da3 --- /dev/null +++ b/anerfarticulatedneuralradiancefieldsforlearninghumanshapeappearanceandpose/d4e6f671-f770-4cdb-ba23-cca62446556f_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a49b8062f432fa7a8e377d518549c65406272a95448697535d8fe134cd5b3cf +size 19515570 diff --git a/anerfarticulatedneuralradiancefieldsforlearninghumanshapeappearanceandpose/full.md b/anerfarticulatedneuralradiancefieldsforlearninghumanshapeappearanceandpose/full.md new file mode 100644 index 0000000000000000000000000000000000000000..ac1557fc631f5ba77fc9fb38af9f482c2f80124b --- /dev/null +++ b/anerfarticulatedneuralradiancefieldsforlearninghumanshapeappearanceandpose/full.md @@ -0,0 +1,476 @@ +# A-NeRF: Articulated Neural Radiance Fields for Learning Human Shape, Appearance, and Pose + +Shih-Yang $\mathbf{S}\mathbf{u}^{1}$ + +Frank $\mathbf{Y}\mathbf{u}^{1}$ + +Michael Zollhöfer2 + +Helge Rhodin + +1University of British Columbia + +$^{2}$ Facebook Reality Labs + +# Abstract + +While deep learning reshaped the classical motion capture pipeline with feedforward networks, generative models are required to recover fine alignment via iterative refinement. Unfortunately, the existing models are usually hand-crafted or learned in controlled conditions, only applicable to limited domains. We propose a method to learn a generative neural body model from unlabelled monocular videos by extending Neural Radiance Fields (NeRFs). We equip them with a skeleton to apply to time-varying and articulated motion. A key insight is that implicit models require the inverse of the forward kinematics used in explicit surface models. Our reparameterization defines spatial latent variables relative to the pose of body parts and thereby overcomes ill-posed inverse operations with an overparameterization. This enables learning volumetric body shape and appearance from scratch while jointly refining the articulated pose; all without ground truth labels for appearance, pose, or 3D shape on the input videos. When used for novel-view-synthesis and motion capture, our neural model improves accuracy on diverse datasets. Project website: https://lemonatsu.github.io/nerf/. + +# 1 Introduction + +Generative models have evolved from Generative Adversarial Networks (GANs) recreating images [14, 21] to neural scene representations [39, 56, 57] providing control and image understanding for downstream tasks via structured latent variables. However, most 3D models require 3D labels that cannot be crowd-sourced on natural images and require dedicated depth sensors. It is hence an important research problem to learn 3D representations from 2D observations, which is particularly challenging for humans with diverse body shapes and appearances and their non-rigid motion. + +Modern human motion capture techniques typically combine the advantages of discriminative and generative approaches. A feed-forward 3D human pose estimation approach provides a rough initial estimate of human pose. Afterward, a generative approach based on either a high-quality 3D scan of the person [17], or a parametric human body model learned from laser scans [4] refines the estimate iteratively based on the image evidence. Although achieving unprecedented accuracy, existing models require a low-dimensional, restrictive, shape body model or a personalized 3D scan of the user. + +We introduce Articulated Neural Radiance Fields (A-NeRF) for learning a user-specific neural 3D body model and underlying skeleton pose from unlabelled videos (see Figure 1). When applied to motion capture, it alleviates the need for template models while maintaining the advantages and accuracy of current generative approaches. A-NeRF extends Neural Radiance Fields (NeRF) [39] to work with single videos and articulated motion. NeRF parameterizes the scene implicitly as + +$$ +F _ {\phi} (\Gamma (\mathbf {q}), \Gamma (\mathbf {d})) \mapsto (\sigma , \mathbf {c}), \quad \text {w i t h} \sigma \in \mathbb {R}, \mathbf {c} \in \mathbb {R} ^ {3}, \mathbf {q} \in \mathbb {R} ^ {3}, \text {a n d} \mathbf {d} \in \mathbb {R} ^ {3}, \tag {1} +$$ + +by chaining $F_{\phi}$ , a Multi-layer Perceptron (MLP), with $\Gamma$ , the Positional Encoding (PE) [66]. First, the PE maps the input scene point $\mathbf{q}$ and view direction $\mathbf{d}$ to a higher dimensional space that enables the + +![](images/69131b81c0952701f477c57d146480e2fcca3ae42850d681afe88cfa1958e2a5.jpg) +(a) A-NeRF body model for animation and novel-view-synthesis + +![](images/4a0b778f93539448e068010406f5d9dc5d269aa30e24cc18bd552e56a6d27198.jpg) + +![](images/985867b2bbefa3bf935430081e1caa68b38b48a12ba429818d13504773d70cb2.jpg) + +![](images/dc7efc5e7475359e07a49114ba8b9ad16e8bf0a95ab321c2e8c7e958df309268.jpg) + +![](images/cb31c8659eb61b3fb255b4cf1061c1061af639b9893b1e16dbaf51d69d40fdbe.jpg) +Figure 1: Our A-NeRF jointly learns a neural body model of the user and works with diverse body poses (left) while also refining the initial 3D articulated skeleton pose estimate from a single or, if available, multiple views without tedious camera calibration (center). Underlying is a template-free neural representation (right) and skeleton-based embedding coupled with volume volumetric rendering. Real faces and their reconstructions are blurred in all figures for anonymity. + +![](images/4ce0a47dd058e49ba30870fe16fe638a995096cea4355ea5207b6d7a1506324c.jpg) +(b) 3D pose refinement for real images + +![](images/1985126c10ca864c2e97642d44a6bd1781612531b69fcab2efd826361e35acd0.jpg) + +![](images/3f1f99d5e269fd96965a06d29863df0ad3031ca7a3ceb170010e3f32f16764cd.jpg) +(c) Body shape + +MLP to learn a meaningful scene representation function $F_{\phi}$ that subsequently outputs the radiance $c$ and opacity $\sigma$ at every point in space. Second, the implicitly described scene (via conditioning on query locations) is rendered via classical ray-marching from computer graphics. The advantage of the MLP representation is that it avoids the complexity of volumetric grids [29], circumvents the artifacts induced by the implicit bias of screen-space convolution [40, 54], and, unlike surface meshes, can have flexible topology. However, the original NeRF only works for static scenes captured from dozens of calibrated cameras such that each 3D point is seen from multiple views. + +Our conceptual contribution lies in learning a neural latent representation relative to an articulated skeleton. While explicit models such as the popular SMPL body model [30] deform a surface via forwards kinematics, the implicit form of A-NeRF makes us re-think how skeletons can be integrated—implicit networks require the inverse transformation from 3D world coordinates to the reference skeleton, a significantly harder task that has not been fully explored. Our core technical novelty is to come up with and evaluate different parameterizations of $\Gamma(\mathbf{q}), \Gamma(\mathbf{d})$ in Eq. 1 to create local coordinates relative to the articulated skeleton. Since a point in 3D world coordinates cannot uniquely be associated with a body part, we resolve the mentioned ill-posed inverse problem by overparameterizing with one embedding per bone. This embeds domain knowledge of how humans move and provides a common frame for the neural network to combine body shape and appearance constraints across the entire captured sequence (see Figure 2). + +We demonstrate that all our contributions together enable learning of a neural body model from monocular video, requiring only rough 3D pose estimates for initialization, that reaches a level of detail previously only attained with parametric surface models or multi-view approaches [51]. + +Scope. We apply the model to motion capture, character animation, and appearance and motion transfer and demonstrate that the pose refinement improves on existing monocular skeleton reconstruction. We learn in the transductive setting, for a specific target video that is known at training time but has no ground truth. A-NeRF enables novel view synthesis of dynamic motions, with plausible however non-physical illumination. Additional steps are needed to enable relighting applications. + +General impact. Building a self-supervised approach for personalized human body modelling promises to be more inclusive to people and activities that are not well represented in supervised datasets. However, it bears the risk that 3D models of people are created without consent. We urge users to only use datasets collected for developing and validating motion capture algorithms. + +# 2 Related Work + +Our approach builds upon and is related to the following work on human pose and shape estimation, human modeling, and neural scene representations [62]. + +Discriminative Human Pose Estimation. While feed-forward estimation of the 3D joint positions [26, 32, 34, 35, 43, 44, 52, 59, 64, 69, 72] or joint angles and bone lengths [53, 73] of the skeleton is highly accurate, such discriminative estimates are prone to misalignment when overlayed onto the input image due to the generalization gap. The skeleton pose can be refined to better match the 2D pose estimates, but this usually leads to larger errors in 3D [36, 37]. We use [23] for initializing skeleton pose and combine it with a neural body model. + +Surface-based Generative Body Models. These are obtained by either constraining template meshes via deformation energies [17, 70] or learning parametric human body models from a large collection of laser scans [6, 9, 30]. Their low-dimensional parameters constrain the space of plausible human shapes and motions. This enables real-time reconstructions from single images [7, 15], detailed texturing and displacement mapping [3, 5], and alleviates manual rigging [2]. It also enables optimization within the bounds of the learned prior [11, 16, 25] and weak-supervision when integrated in a differentiable form [27] into neural training processes [4, 20, 23, 42, 45, 65]. Closest to our approach in this category are the model fitting methods by [74] that textures and geometrically refines an untextured parametric quadruped model to zebra images and to [68] that uses optical flow to refine human pose. Although in a similar setting, our surface-free neural body model and volumetric rendering is fundamentally different to their textured triangle mesh that is rigged with forward kinematics and needs to be obtained a-priori. + +Implicit Body Models. A-NeRF bears close similarities with body models defined implicitly in terms of level-sets [58] and density of a sum of Gaussians [18, 48, 49] that are used for refining human pose, shape, and appearance via differentiable ray-tracing. However, sum of Gaussians and other primitives only provide rough approximations. + +Neural Scene Representations. Recent neural scene representations learn low-dimensional nonlinear representations of meshes [28, 63], point clouds [1, 38, 67], sphere sets [24], and dense volumetric grids [29, 55]. Their respective geometric output representations enable rendering with classical rendering techniques but have limited expressiveness, e.g., due to the fixed connectivity of a surface mesh and large memory footprint of discretized volumes. This limitation is overcome by using unconstrained MLPs [39] paired with positional encoding [60] to characterize an arbitrary point in 3D space. Common are surface definitions via level-sets of the MLP that are rendered with sphere tracing [56] and density representations rendered with ray-marching [39]. The rendering step is required for maximum likelihood estimation, to define a likelihood over observable variables—real images—while learning a 3D model. The rendering can be learned too [40, 50, 51] but usually leads to inconsistencies, particularly when training data is scarce. Some concurrent works also use neural scene representations for refining camera motion [71], video reenactment [47], and facial models [12, 13]. Orthogonal to these works, our A-NeRF learns an articulated body model from estimated poses and uncalibrated cameras. + +Closely related to ours is the NASA surface body model [10] that also defines an implicit function as the minimum of individual implicit functions that are rigidly attached to the bones of a skeleton, each conditioned on the entire human pose to model dependencies and learned from 3D scans. By contrast, we learn a volumetric model instead of a surface model and include appearance and rendering. Even more similar is the recent NeuralBody [46] representation, which combines a NeRF with a surface body model and underlying skeleton. By contrast to both approaches, we do not require surface supervision or initialization, condition pose differently, and refine pose, which enables us to learn from single videos in unconstrained environments. + +# 3 Formulation + +Objective. Given a sequence $[\mathbf{I}_k]_{k=1}^N$ of $\mathbf{N}$ images $\mathbf{I}_k \in \mathbb{R}^{H \times W \times 3}$ stemming from one or several videos of the same person, our goal is to simultaneously estimate the time-varying skeleton poses $[\theta_k]_{k=1}^N$ and learn a detailed body model. Our A-NeRF body model $C_\phi$ is parametrized by neural network parameters $\phi$ that define volumetric shape and color while the skeleton captures motion over time. Figure 2 gives an overview of this generative model. It enables a rendering of the virtual body + +![](images/8d298d0b68d69e63b9f445d2498bd68c0dcfc95b992f89527cd2964c713cfdcc.jpg) +Figure 2: Overview. A-NeRF is a generative model that can be rendered and optimized on a photometric loss $\mathcal{L}^{\mathrm{SV}}$ (white). First, the skeleton pose is initialized with an off-the-shelf estimator (orange). Second, this pose is refined via a skeleton-relative embedding (blue) that, when fed to NeRF (green), drives the implicit body model that is rendered by ray-marching (red). A key property of the skeleton-relative embedding is that a single 3D query location maps to an overcomplete reparametrization, with the same point represented relative to each skeleton bone (right). + +![](images/175063b8cbf4a9999a3ac2db05231bdbd585857ea2e695a1b655f55dd4db874b.jpg) +(a) NeRF +Figure 3: Importance of our skeleton-relative encodings. The original NeRF breaks (a) when training on a diverse set of poses and (b) further degrades when the poses are rotated. Even if (e) conditioned directly on $\theta_{k}$ , the NeRF still suffers from artifacts due to the complexity and ambiguity of human articulation. With our skeleton-relative encoding (f, g), the geometry for the subject is consistent under rotation, and the quality is greatly improved, with the full model working best. + +![](images/c84843d59d7e1376e5099973c659300ac2c2e25f4b4aad4b11ecb9d67cb7ff16.jpg) +(b) Rotate $24^{\circ}$ + +![](images/68a39a35136c2e797bcbff2b9cd8d6707a7b39611920f4a52fb43e4c345f7258.jpg) +(c) Ours + +![](images/2fba4b7c96f036eb12593787e71551fae5c2acff743f6f1a0d7bce46e786ffc1.jpg) +(d) Rotate $24^{\circ}$ + +![](images/a0ea05496cfece4fefed6a869420ee0d944c6585ed417dfff73d82b0018472e7.jpg) +(e) w/o $\tilde{\mathbf{v}},\tilde{\mathbf{r}},\tilde{\mathbf{d}}$ + +![](images/fafa97349b31b1e98371dc0daebccba44f5dffa4d7d765e111ec74df3a81a087.jpg) +(f) w/o $\tilde{\mathbf{v}}$ + +![](images/9a1ec39fbe457915d2747530e7319fdc14f319687221f4a5b5b0c733ddc53f32.jpg) +(g) Ours + +model in unseen poses and optimizes its parameters $\theta$ and $\phi$ on the image reconstruction objective + +$$ +\mathcal {L} ^ {\mathrm {S V}} (\theta , \phi) = \sum_ {k} \underbrace {\left\| C _ {\phi} \left(\theta_ {k}\right) - \mathbf {I} _ {k} \right\| _ {1}} _ {\text {d a t a t e r m}} + \underbrace {\lambda_ {\theta} d \left(\theta_ {k} - \hat {\theta} _ {k}\right)} _ {\text {p o s e r e g u l a r i z e r}} + \underbrace {\lambda_ {t} \left\| \frac {\partial^ {2} \theta_ {k}}{\partial t ^ {2}} \right\| _ {2} ^ {2}} _ {\text {s m o o t h n e s s p r i o r}}. \tag {2} +$$ + +with the influence of all three terms balanced by hyperparameters $\lambda_{t}$ and $\lambda_{\theta}$ . The data term measures the distance between the images generated by $C_{\phi}$ and the input image with the L1 distance. The pose regularizer encourages the solution to stay close to an initial pose estimate $\hat{\theta}$ obtained from an off-the-shelf predictor [23], tolerating small shifts up to $\epsilon = 0.01$ with $d(x) = \min (\| x\| _2^2 -\epsilon ,0)$ . Lastly, the smoothness prior penalizes acceleration $\frac{\partial^2\theta_k}{\partial t^2}$ between poses of consecutive frames. Minimizing Eq. 2 can be seen as maximizing a corresponding probabilistic model, with the quadratic energy terms being the log-likelihoods of Gaussian distributions. Our focus is on formalizing the neural body model. For simplicity, we continue to write equations in terms of the objective functions used during inference with stochastic gradient descent. + +# 3.1 NeRF and A-NeRF Image Formation Model + +Instead of modeling the scene as a collection of triangles or other primitives, we define the human implicitly by a neural network as a function (Eq. 1) defined over all possible 3D points and view + +directions in space [39]. Similar to NeRF, we render the image of the human subject via ray marching + +$$ +C _ {\phi} (u, v; \theta_ {k}) = \sum_ {i = 1} ^ {Q} T _ {i} \left(1 - \exp \left(- \sigma_ {i} \delta_ {i}\right)\right) \mathbf {c} _ {i}, \quad T _ {i} = \exp \left(- \sum_ {j = 1} ^ {i - 1} \sigma_ {j} \delta_ {j}\right), \tag {3} +$$ + +with $(u,v)$ the 2D pixel location on the image, $i$ the index to 3D query positions $\mathbf{q}_i$ sampled along $\mathbf{d}$ and $\delta_{i}$ the distance to neighboring samples—a constant if samples would be taken at regular intervals. The $T_{i}$ is the accumulated transmittance for the ray traveling from the near plane to $\mathbf{q}_i$ —the fraction of light reaching the sensor from sample point $i$ . The $\mathbf{c}_i$ is the light color emitted or reflected at $i$ . The final pixel color is the sum over all $Q$ samples, with the last sample taking the special role of the background. The background color is easily inferred as the median pixel color over the entire video for static camera setups. The ray direction $\mathbf{d} = \mathbf{K}_k^{-1}(u,v)$ is computed using the estimated camera intrinsics [23]. In the following, we introduce our skeleton parametrization $\theta_{k}$ and how to use it to effectively model dynamic articulated human motion. + +# 3.2 Articulated Skeleton Pose Model + +Our skeleton representation encodes the connectivity and static bone lengths via a rest pose of 3D joint locations. Dynamics are modeled with per-frame skeleton poses $\theta_{k}$ , which define an affine transformation $T(\theta_{k},m)$ for each bone $m$ . Specifically, $T(\theta_{k},m)$ maps a 3D position $\mathbf{p}_{k,m} \in \mathbb{R}^3$ in the $m$ -th local bone coordinates to world coordinates $\mathbf{q} \in \mathbb{R}^3$ using homogeneous coordinates, + +$$ +\left[ \begin{array}{l} \mathbf {q} \\ 1 \end{array} \right] = T \left(\theta_ {k}, m\right) \left[ \begin{array}{c} \mathbf {p} _ {k, m} \\ 1 \end{array} \right], \tag {4} +$$ + +where subscript $k, m$ indicates that a variable is related to the $m$ -th joint of image $\mathbf{I}_k$ . Conversely, $T(\theta_k, m)^{-1}$ maps world to local bone coordinates. Note that our skeleton is equivalent to SMPL [30] and others, but without their parametric surface model, and can therefore be initialized with any skeleton pose estimator. We include more details of our skeleton representation in the supplementary. + +# 3.3 A-NeRF Skeleton-Relative Encoding + +Our core contribution is to transform the query locations $\mathbf{q}$ and view direction $\mathbf{d}$ relative to the skeleton before determining the color and opacity at that transformed point via NeRF. It is a form of reparameterization that explicitly incorporates domain knowledge of how the human body parts are linked and transformed relative to each other. Intuitively, our implicit formulation turns explicit models, such as SMPL [30], on its head. Instead of deforming the output surface via skinning, the query location is mapped in the inverse direction to local bone-relative coordinate + +![](images/b40144d7a3890574d264324961bf6d36aab5b80082b9528819fe53fc3a1c619f.jpg) + +systems before processing through the NeRF network. Our final model uses a combined encoding $\mathbf{e}_k = [h(\tilde{\mathbf{v}}_k)\Gamma (\tilde{\mathbf{v}}_k),\tilde{\mathbf{r}}_k,h(\tilde{\mathbf{v}}_k)\Gamma (\tilde{\mathbf{d}}_k)]$ as input to the NeRF $F_{\phi}$ . Note that the skeleton embedding introduces the desired time dependency, denoted by subscript $k$ . The inlet shows our most crucial contribution, the relative distance encoding $\tilde{\mathbf{v}}_k$ followed by PE with Cutoff to reduce the influence of irrelevant bones. We derive the components of our encoding $\mathbf{e}_k$ and the other alternatives below. + +- Reference Pose Encoding One could compensate motion by attaching the query $\mathbf{q}$ in world coordinates at frame $k$ to the closest bone $m$ and transforming it with + +$$ +\mathbf {a} _ {k} = T \left(\theta_ {0}, m\right) T ^ {- 1} \left(\theta_ {k}, m\right) \mathbf {q}. \tag {5} +$$ + +This puts the query relative to the bone $m$ as in frame $k$ but with the skeleton in rest pose $\theta_0$ . NeRF could then learn without change in the 3D space of the rest pose as done before for surfaces [61]. However, this cannot capture non-rigid pose-dependent effects, such as muscle bulging, and has ambiguities when $\mathbf{q}$ is at equal distance to two bones. + +- Bone-relative Position (Rel. Pos.) To remove these ambiguities and the ill-posed association to a single part, we map $\mathbf{q}$ relative to each bone $m$ with, + +$$ +\tilde {\mathbf {q}} _ {k} = \left[ \tilde {\mathbf {q}} _ {k, 1}, \dots , \tilde {\mathbf {q}} _ {k, 2 4} \right] \text {a n d} \tilde {\mathbf {q}} _ {k, m} = T ^ {- 1} \left(\theta_ {k}, m\right) \mathbf {q}. \tag {6} +$$ + +The resulting individual bone coordinates are well suited to model the overwhelmingly rigid motion of the corresponding body part. Moreover, the overparameterization of position by concatenating all local encodings enables learning when complex interactions are necessary. However, such an embedding for all bones increases the dimensionality by an order of magnitude. + +- Relative Distance (Rel. Dist.) Much simpler to compute are distances from $\mathbf{q}$ to all bones $m$ , + +$$ +\tilde {\mathbf {v}} _ {k} = \left[ \tilde {\mathbf {v}} _ {k, 1}, \dots , \tilde {\mathbf {v}} _ {k, 2 4} \right], \text {w i t h} \tilde {\mathbf {v}} _ {k, m} = \| \tilde {\mathbf {q}} _ {k, m} \| _ {2} \in \mathbb {R}. \tag {7} +$$ + +This radial encoding is used in our final model in favor of $\tilde{\mathbf{q}}$ because it naturally captures spherically shaped limbs, is lower-dimensional, and thereby improves reconstruction accuracy. + +- Relative Direction (Rel. Dir.) Since the distance encoding is invariant to direction, we additionally obtain the direction vector to capture the orientation information of $\mathbf{q}$ , + +$$ +\tilde {\mathbf {r}} _ {k} = \left[ \tilde {\mathbf {r}} _ {k, 1}, \dots , \tilde {\mathbf {r}} _ {k, 2 4} \right], \quad \tilde {\mathbf {r}} _ {k, m} = \frac {\tilde {\mathbf {q}} _ {k , m}}{\left\| \tilde {\mathbf {q}} _ {k , m} \right\| _ {2}} \in \mathbb {R} ^ {3}. \tag {8} +$$ + +Note that by contrast to all other embeddings, this direction encoding did not profit from subsequent PE. We therefore pass it directly into $\mathbf{e}_k$ . + +- Relative Ray Direction (Rel. Ray.) NeRF models the illumination effects in a static 3D scene using the position and view direction. By contrast, our goal is to learn a body model that produces plausible colors with dynamic skeleton poses. Therefore, we transform $\mathbf{d}$ to obtain $\tilde{\mathbf{d}}$ , the outgoing ray direction relative to each bone, similar to query position, + +$$ +\tilde {\mathbf {d}} _ {k} = \left[ \tilde {\mathbf {d}} _ {k, 1}, \dots , \tilde {\mathbf {d}} _ {k, 2 4} \right], \quad \tilde {\mathbf {d}} _ {k, m} = \left[ T ^ {- 1} \left(\theta_ {k}, m\right) \right] _ {3 \times 3} \mathbf {d} \in \mathbb {R} ^ {3}, \tag {9} +$$ + +with $[T^{-1}(\theta_k, m)]_{3 \times 3}$ the rotational part of the bone-to-world transformation $T^{-1}(\theta_k, m)$ . Following concurrent works [33, 46], we also optimize an appearance code for each image to handle dynamic light effects. The combination of $\tilde{\mathbf{d}}$ and the per-image code enables A-NeRF to approximate the light effects in $\mathbf{I}_k$ plausibly. See the supplemental material for detailed discussions on modeling view-dependent effects in our setting. + +- Cutoff. We desire a local embedding where points should not be influenced by all but only nearby bones. To this end, we introduce a windowed version of positional encoding by multiplying the encoding with respect to bone $m$ by $h(\tilde{\mathbf{v}}_{k,m}) = 1 - S(\tau (\tilde{\mathbf{v}}_{k,m} - t))$ , with $S$ the sigmoid step function, $t$ the cutoff point, $\tau$ the sharpness. This leaves queries unaffected by distant bones. + +Our embedding choice of $\mathbf{e}_k = [h(\tilde{\mathbf{v}}_k)\Gamma (\tilde{\mathbf{v}}_k),\tilde{\mathbf{r}}_k,h(\tilde{\mathbf{v}}_k)\Gamma (\mathbf{d}_k)]$ has the advantage of being invariant to the global shift and rotation of the person and preserves the piece-wise rigidity of articulated motion while still allowing for pose-dependent deformation (see Figure 3). In addition to $\mathbf{e}_k$ , we also consider other embedding variants. See the supplementary and Section 4 for a detailed discussion. + +# 4 Evaluation + +We performed experiments to validate that A-NeRF learns accurate body models and poses, with fewer assumptions (single view, uncalibrated, and w/o a parametric surface model) than the related works. This makes it applicable to fine-grained pose refinement that improves the estimates of state-of-the-art methods. The supplements provide the implementation details, additional comparisons and ablation studies. + +Inference and Implementation Details Our A-NeRF model is learned without supervision on a single or multiple videos of the same person. Camera intrinsics, bone lengths for setting $\mathbf{a}_m$ , and pose $\theta_k$ are initialized with [23] for every frame $k$ . These poses are then optimized on objective Eq.2, alongside the generative A-NeRF model. See supplementary for more details. + +Datasets. We evaluate on the following benchmarks, and additionally on synthetic data created from SURREAL and Mixamo characters, which are listed in the supplement. + +- Human 3.6M [19] The dataset consists of 5 training and 2 testing subjects (S9/S11) with ground truth 3D joint locations. We follow two widely adopted test protocols denoted as Protocol I [20, 22, 23] and Protocol II [41, 59], in which we evaluate 14/17-joint estimation error on every $5^{th} / 64^{th}$ frame of the test videos, respectively. See the supplement for details. + +- MPI-INF-3DHP [35] This dataset is a standard benchmark for human pose estimation. It consists of 4 indoor and 2 outdoor subjects with challenging human poses. The number of frames per subject range from 276 to 603. +- MonoPerfCap [70] The dataset consists of human performance video captured with a monocular camera in both indoor and outdoor settings. We use two subjects, Weipeng_outdoor and Nadia_outdoor, for our qualitative experiments. The two subjects have 1151 and 1635 frames, respectively, for training. + +**Pose Metrics.** We report the PA-MPJPE metric, the Euclidean distance between Procrustes-aligned (PA) predictions and ground truth 3D joint position averaged over all frames and joints of the test set. The PA alignment in scale and orientation is essential for comparing approaches that do not assume knowledge of the ground truth calibration and are, hence, ill-posed to the factors that the alignment removes. Following prior work [23, 22, 35], we also report percentage of correct keypoints (PCK) for MPI-INF-3DHP; the percentage of joints that lie within a distance of $150\mathrm{mm}$ to the ground truth. + +Visual Metrics. We quantify the visual quality on MonoPerfCap and Human 3.6M datasets by training on a subset and testing on a held-out test set of the same character. Image quality is quantified via the PSNR and SSIM of the rendering compared with the reference image within the character bounding boxes. Because no ground truth pose is available in the required skeleton format on these datasets, we train our model once on the entire dataset to get reliable skeleton pose estimates as pseudo ground truth, and a second time with a part withheld to learn the body model for visual quality evaluation. Since MonoPerfCap has one sequence per actor, we exclude the last $20\%$ of each video. For Human 3.6M we exclude entire actions, namely Geeting-1,2, Posing-1,2 and Walking-1,2. The body model is then transferred to the held-out portion by using the pseudo ground truth poses as the driving motion. Thereby, we can still test the generalization of different models to new poses and viewpoints, irrespective of the underlying skeleton model provided in the dataset. + +![](images/81de3dbedf0162bfb987b18048c64c246eadf6900a211c0312e09614f59bbc66.jpg) +Figure 4: Novel view synthesis from all models. All models are trained with SPIN [23] estimated human pose and camera parameters. A-NeRF renderings (ours) align better with the reference images (top row), and the rendered novel views (2nd and 3rd rows) show better details (limbs, facial features). + +Novel-View-Synthesis and Character Animation. Our body model is generative, which allows us to train on a single or multiple uncalibrated videos and alter viewpoint and human pose. Figure 4 shows renderings of the same persons from a new camera angle; novel-view-synthesis. Likewise, Figure 5 demonstrates character animation, where the view is fixed, and the underlying skeleton is reposed by manually changing joint angles or by transferring the motion between characters. A-NeRF is the first model that learns a detailed human body model with such capabilities without needing a 3D surface or multi-view supervision. While NeuralBody [46] can also learn photo-realistic human models from monocular images, their model anchors its representation on the SMPL 3D + +![](images/7c50f47e31a541d2003b8b1240e13d846e2c0bc1859757dac6a16ed63cf21234.jpg) + +![](images/39430528d1550f59c8dbd8d7f0504e3fe42a6e90f344126eafd46b13706c8a5d.jpg) + +![](images/70b19b8d5482be31c55bbd34cbd53419759bbc87a9ba13b1d1b8163e07575e25.jpg) + +![](images/b0307d55efd6d55e943d76366214a29ecd1f0d9bbf79bc8e0f9c944c0f741c73.jpg) + +![](images/f82cccd1f197e8af2757c7be395f28321317eb0e5f9e7d45690a9782777afabe.jpg) + +![](images/54eca6cff2c5ae9a9168634bc77aa10f7793b74650aec46375cd9fe01fb22ea7.jpg) + +![](images/e07e2ad716e1e6ead2d96ff330c6b74c152d59401f8bac0edd404089c5aa77cb.jpg) + +![](images/461c913d5ca832abcbd2d8c041b1f55b63970b22dbad2b52fc03d4f0f631a211.jpg) + +![](images/50ea6ceb56d7b8e574bb5c157b5be217ef8a363a5393d09095e63f19e1b30bc8.jpg) + +![](images/04ac4655fc526d330e883417607b166c3632144dc05f45baed278a0f31d79412.jpg) +Source + +![](images/2e6850906498b53a359eed511932a7e7dd5e4d76048b1e888cc536c7bf6be2d7.jpg) +NeuralBody + +![](images/ea4a549e4e47f8c7e558a1143b21c924af053d4a023a0dd59893dca00a978736.jpg) +Ours + +![](images/3acc17231d645925bc7d765f58c687f3b8e75db6f1e6526d88ee36e2badf2979.jpg) +Source + +![](images/563eeabcc6ebe672f055393583dc6b8227d36ddfb35d2f2cb24487b3963f0742.jpg) + +![](images/e2ed4c9adeccd56a512d9170ed23d22ea2848ef3aa9e11820ce65f6a124032b7.jpg) +Ours + +![](images/5b4b71bb8a20c46e01a0ab31bc1ce48218f99ffdb9accd77d93751b8fddf18e9.jpg) +Source + +![](images/a07225e3ab8fd4b9b0302baa883a609bdf9cbc8d2f91ba4e2c56d96b870eef20.jpg) +NeuralBody + +![](images/0a37622a8fa385ae1cd0c28516142d279f8faa3c5f884961147d194915bf5942.jpg) +Ours + +![](images/9cc4664653c37bd4c2108ff3c96e0c8957bd99ca25842f4a6af82e3b86baf0d9.jpg) +Figure 5: Motion retargeting and animation. Top rows: Pose transfer, with the source pose reconstructed by A-NeRF and rendered with different target body models. Last row: Animating the A-NeRF model while keeping the lower or upper part of the body fixed. + +![](images/b4fe5cc6614ad1214dfc173142067e6956ea3c569ad057a6bdf171da23d98517.jpg) + +![](images/04a486c0dbea44d226096d658fe201aa84beb8ef8cec070fd14d3f7af3401ba0.jpg) +NeuralBody + +![](images/1cd4fd13623582155fe733aa05d7b427115a79279e17dfed121479a9e0a07ef5.jpg) + +![](images/6c3dc4bcf5f6c6b4f97dc287ec4410204f4878797da254a540c4cd1c0f495ba3.jpg) + +![](images/268fc5b82db63e80b593ec9cd543952917501d9c504268ef42979a082e9690fa.jpg) + +Table 1: Quantitative evaluation on Human3.6M [19] and MPI-INF-3DHP [35]. Our test-time pose refinement improves consistently upon the SPIN baseline, with largest improvements for extremities (PA-Wrist). + +
MethodHuman 3.6MMPI-INF-3DHP
Protocol IProtocol IIProt. II WristProt. II Multi-view
PA-MPJPE↓PA-MPJPE↓PA-Wrist↓PA-MPJPE↓PA-MPJPE↓PCK↑
MotioNet [53]54.6-----
HoloPose [16]46.5-----
VIBE [22]41.4n/an/an/a64.689.3
SPIN [23]41.1---67.576.4
Baseline (SPIN github [23])42.7*41.9*66.5*34.0*68.2*79.3*
SPIN-SMPLify†[7, 23]57.759.2100.9---
Ours (w/o smoothness prior)39.439.657.328.066.980.4
Ours39.3n/an/an/a66.880.4
+ +* Reevaluation of publicly-available model because missing evaluation protocols or not reproducible. +† We refine the SPIN estimated pose using SMPLify. We adopt the implementation from the SPIN repository. + +surface. When trained on our single-view setup with the same noisy estimated poses $\hat{\theta}$ as input, NeuralBody suffers from artifacts and less detail when training, as it assumes 3D ground truth, which is only available in controlled conditions. The importance of our joint body and pose optimization is further validated by the ablation with refinement disabled (Ours w/o rf.), which similarly produces ghosting artifacts around extremities. + +Human Pose Estimation. Training A-NeRF includes a form of test-time optimization (see Figure 1, right), only the initialization from [23] is trained supervised on the Human3.6M training set. Table 1 shows that on Human 3.6M, A-NeRF reaches comparable results with other single-view approaches, and achieves a $8.0\%$ improvement in PA-MPJPE upon the baseline used for pose initialization on Protocol I $(42.7 \rightarrow 39.3)$ and $5.5\%$ on Protocol II $(41.9 \rightarrow 39.6)$ . Note that these are average numbers across all joints, including easy-to-predict hip, shoulder, and head joints. Our largest gains are on the extremities, e.g., with an improvement of $14\%$ $(9.2 \mathrm{~mm})$ for the wrist joint on Protocol II (PA-Wrist). We also compare to applying SMPLify [7], a method that refines 3D poses using 2D joint locations (estimated with [8]) as constraints, at test time. It tends to explain the 2D joint estimates perfectly but degrades the 3D pose. The final pose estimations become less accurate than the initial ones. In contrast, A-NeRF optimizes the poses by implicitly minimizing the disagreement + +Table 2: Visual quality evaluation on the Human3.6M [19] and MonoPerfCap [70] held-out sets. Our full A-NeRF model significantly improves the visual quality. The body model itself attains a higher quality than NeuralBody (2nd vs. 3rd row), and additional detail is gained with the proposed pose refinement (last row). + +
MonoPerfCapHuman 3.6M
PSNR ↑SSIM ↑PSNR ↑SSIM ↑
NeuralBody, driving motion from [23]21.800.847622.080.8766
NeuralBody, driving motion from A-NeRF refinement21.750.846822.550.8782
A-NeRF w/o pose refinement21.990.840523.330.8776
A-NeRF (Our full model)24.390.885127.450.9277
+ +![](images/60dd74c2d131b8f72b06eeb577296151e027846ea5b1af82b16b5559645f7045.jpg) + +![](images/6043328ef211a8617bfd2afff490216eb72900b7abf861548308ebc517259a2a.jpg) + +![](images/ec1b5d3eef5cdf5e81c720935210203856434b3be731b3918390edd0c685b47e.jpg) + +![](images/a2252fbd1e7686325b8b9f382d8f6c014c583a7c26f8c6baa0269099128fc351.jpg) + +![](images/912a52a98ec7cfa9d6067aef846836d5dbb42847614d64fa1b699699be8bc974.jpg) +Ref. Image + +![](images/c0540cfb6fcf1cefb936e2c2c748114e47b74d04c522f27fecd819ad417fdcca.jpg) +Geometry $\rightarrow$ + +![](images/4ead92e7d8d3912f3c92046ad969fe5e2f5479c3b950fa6fe3c2023327b2dd4e.jpg) + +![](images/bb173cabcf271439645236ec580d925a222dc316a5117cc4a5fd51a420aa49be.jpg) + +![](images/9caed8d65f506e3af10fc3441ab2956cabfd8330b6d92f44c35487d4a1112c2e.jpg) + +![](images/5d861b8bac6c24892bb4994c6d7f6fef1a26708b55198800ec1ba229971638c4.jpg) + +![](images/094c0c292b0d9942457d1fdd3b2986848ce703013db75598275659d9cf689a50.jpg) +Novel views + +![](images/195b324709bbdba404fd101ae6fd9205c71352ed21c79c7c313a29e61e5fb7b3.jpg) +Figure 6: Geometry. The isosurface of our density model is rendered from multiple unseen views. A-NeRF learns plausible geometry without using explicit surface templates and accurate initial poses. + +![](images/018d07a20f5369c9d4ffbd663679427d28fdc8a5d17b148a83e5baf5bf4cc1bc.jpg) + +![](images/16c5e21413ff983c34ac837c840794e58f2208e5fb3496c0f728d8de233ebee3.jpg) + +![](images/5a8bbd6a99b7e3cddbed0b466194bb0243091047352b93109eaad8f7c707388d.jpg) + +![](images/b0c06cdf58f585cf98cd2b4432ac6e772b7f3939d6067745dfd3bf54c83c9a37.jpg) + +![](images/c224d49f8e49d52ee6051e75cf2995bc58e3f1f2c08c3bc51605273d3465fd24.jpg) + +![](images/54248ea0bd978d383ce1d9ca1717f8736b805cb309996deac66c817efc7852bd.jpg) + +![](images/2f99612450520a129cd516999c371986475fd5fe83190384c59e22de617fd10d.jpg) + +![](images/502f33a140e7c8012338838acd8c5777f0962fd5dfa0950e43e04e450a2f5f0d.jpg) + +![](images/437093e478ccec6fca0e7a39f64c5dffeec51f13537935dd47fd698ced15c4ce.jpg) + +among the 3D body representation in different images, and thus achieves better performance. On MPI-INF-3DHP, Table 1 shows the results averaged over the 6 test subjects from MPI-INF-3DHP. Despite having a low number of frames and human poses available for learning the skeleton-relative encoding, A-NeRF still provides moderate improvements over the baseline estimations. + +Video-based volumetric reconstruction. Figure 6 visualizes the learned density using Marching Cubes [31], with voxel grid resolution of 256 and density threshold 10. Despite only learned from monocular videos (no stereo, depth camera, or multi-view constraints) and without using a predefined template model, A-NeRF reconstructs a detailed volumetric body with details that could not be captured by offsets to a parametric surface model, such as the head phones and baseball cap in the last row of Figure 6. Note that no geometric smoothness term is enforced. + +Multi-view extension. A-NeRF can also leverage multi-view refinement (Table 1, Protocol II Multi-view), even without access to ground truth camera calibration (see supplementary). + +Visual Quality Comparison. We report the results in Table 2. We compare to NeuralBody with both the initial estimates from [23] and our refined pose since NeuralBody has no refinement step. Compared to both variants, our A-NeRF shows significantly better reconstruction performance on held-out poses. We observe that NeuralBody models can retain the facial features and hands as they anchor their representation on a 3D surface model. However, the rendered limbs and faces are blurry and distorted. Results are similar to training A-NeRF without refinement (see Figure 7). As the estimation for these joints is often inaccurate and noisy, the models without pose refinement simply learn to predict mean pixel values. To conclude, it is important to train with pose refinement, with which A-NeRF suffers less from artifacts with overall better visual quality. + +![](images/d5b7f436f7bbb375cb8018fd018f3dde65c5d268fb60655e0d49a3b82be00405.jpg) +Ground Truth + +![](images/c50c65ea0038bc70545bf53eb0524339def28f482793d7f53551aba820ef8a4d.jpg) +Photometric error $(\rightarrow)$ +Ground Truth +Photometric error $(\rightarrow)$ + +![](images/c41d1cf3e33e8dfaa2ba85e32aaacb07ad5d0b562465b5e59805f0150fc5c0b5.jpg) + +![](images/8e9f3fbfe954f559c96bcc030849acfbe26af6db10569c645fdfe517abbdb57a.jpg) + +![](images/c395ba77e71e98d342e158b4e271d549a3e214a4fd51eaac46743bca43ff44b9.jpg) + +![](images/d0691327bb65bdc4ec7d742c93511cede4222f8cc8d6a8255c3e02509d4395ba.jpg) +NeuralBody w/ pose from [23] + +![](images/f348836e926bbbe3ff4dce0ca8327c95fd065d6d010c9509a786e21971ad8813.jpg) + +![](images/4fc8252546469d52713f308b1d77987c42e46b73acb5a4525d50db225b63d02a.jpg) + +![](images/9b15779211307cf7405737eb73be266ed308fdd61eca445dd514e21c28d38751.jpg) + +![](images/26a11de605ca11ceb2408c6e3968ea9cfe712b8aced65c289be4cd310fee7f20.jpg) +NeuralBody w/ pose from A-NeRF rf. + +![](images/ddaaa2e04404965db86d944dea12f3db1ba26194ce1b53ba8b252e3230e092f8.jpg) + +![](images/0c6848c504a21a8baf25b1717345466e19268cbc4ea208d45127e21aabde6025.jpg) + +![](images/9185db2ad54e9f71d1e25a616faea4d33d8ffc6b63cd3a61a2479f87be3dc863.jpg) + +![](images/3fc00daf44e50525cd2836eff08cebb68c9e450ae25f5fc63d795cade45edf3b.jpg) +A-NeRF w/o rf. +Figure 7: A-NeRF with pose refinement generalizes better to test sequences. We visualize both the rendered images, as well as the photometric error (squared distance, normalized to [0, 1]) between the rendered and the ground truth images (warmer color indicates higher error) from our MonoPerfCap (1-2th rows) and Human 3.6M (3-4th rows) held-out sets. NeuralBody models produce artifacts around body contours. A-NeRF w/o refinement cannot reproduce facial features and limbs. With pose refinement, A-NeRF can produce both appearances and shapes more plausibly. + +![](images/cc01f473090f8dab85ba2dc32329bad3e8fcb96a74f91fb2a8735763c1672192.jpg) + +![](images/5950edb370d73c1b86cc440f91fd313489af98b5b3204acb625cac12c961d87f.jpg) + +![](images/dc610929cd296c31b3bf478b4e609497729b91d7bf35cfb2484f83ad0f972daa.jpg) + +![](images/445018c28e546523616fe697471adbb64e6abf3fe2fbe522fcb235d5b3fbcd55.jpg) +A-NeRF + +Ablation study. Our detailed ablation studies are reported in the supplemental document. In summary, they reveal: i) Embedding relative 3D position, $\tilde{\mathbf{q}}_k$ , instead of our proposed radial embedding $\tilde{\mathbf{v}}$ yields only half as good pose refinements. ii) Our embedding choices keep the dimensionality moderate while improving on or matching the PSNR and SSIM of higher-dimensional variants. iii) For a fixed number of images with accurate poses, learning from a long video with diverse poses has visual quality comparable to learning from multiple shorter clips. + +Limitations and Failure Cases. Our computation time is the biggest bottleneck in extending A-NeRF to long sequences and multiple actors. Although a single static camera suffices, A-NeRF requires to see the person from all sides in varying poses to learn pose dependencies from data. The inlet shows a rendering of an extreme breakdance pose retargeted to a model trained on normal walking motions. Hence, the source pose is unseen during training and far from the data distribution, which leads to artifacts. + +![](images/12300a7f47a6fba763fcc89deca2d2297df9b41f5d570273678f824b2731733f.jpg) +Reference + +![](images/7d383646c508d7b71ef2a829f5486f9d98fd50532bcc802c8e46780e494170bc.jpg) +Failure + +# 5 Conclusion + +We propose a new way for integrating articulated skeleton models and implicit functions via an overcomplete re-parametrization. It includes learning an interpretable 3D representation from 2D images; a personalized volumetric density field with texture detail and time-varying poses of the actor depicted in the input. The underlying ill-posed problem of mapping a single query location to multiple parts is addressed with an overparametrization over nearby parts. To the best of our knowledge, A-NeRF is the first approach to define NeRF models for extreme and articulated motion on unconstrained video and this new approach scores high on the Human 3.6M benchmark. Importantly, it works from a single video and naturally extends to multi-view and does not require camera calibration in either scenario. This is an important step towards making motion capture more accurate and practical. In future work, we will learn a general human model from a database of subjects instead of individuals. + +Funding in direct support of this work: NSERC Discovery grant, UBC Advanced Research Computing (ARC) GPU cluster, Compute Canada GPU servers, and a gift by Facebook Reality Labs. + +# References + +[1] K.-A. Aliev, A. Sevastopolsky, M. Kolos, D. Ulyanov, and V. Lempitsky. Neural point-based graphics. arXiv preprint arXiv:1906.08240, 2019. +[2] T. Alldieck, M. Magnor, W. Xu, C. Theobalt, and G. Pons-moll. Video Based Reconstruction of 3D People Models. In CVPR, 2018. +[3] T. Alldieck, M. Magnor, W. Xu, C. Theobalt, and G. Pons-Moll. Detailed human avatars from monocular video. In 3DV, pages 98-109. IEEE, 2018. +[4] T. Alldieck, M. Magnor, B. L. Bhatnagar, C. Theobalt, and G. Pons-Moll. Learning to reconstruct people in clothing from a single rgb camera. In CVPR, pages 1175-1186, 2019. +[5] T. Alldieck, G. Pons-Moll, C. Theobalt, and M. Magnor. Tex2shape: Detailed full human body geometry from a single image. In ICCV, 2019. +[6] A. O. Balan, L. Sigal, M. J. Black, J. E. Davis, and H. W. Haussecker. Detailed human shape and pose from images. In CVPR, pages 1-8, 2007. +[7] F. Bogo, A. Kanazawa, C. Lassner, P. Gehler, J. Romero, and M. J. Black. Keep it smpl: Automatic estimation of 3d human pose and shape from a single image. In ECCV, pages 561-578. Springer, 2016. +[8] Z. Cao, G. H. Martinez, T. Simon, S.-E. Wei, and Y. A. Sheikh. Openpose: Realtime multiperson 2d pose estimation using part affinity fields. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2019. +[9] V. Choutas, G. Pavlakos, T. Bolkart, D. Tzionas, and M. J. Black. Monocular expressive body regression through body-driven attention. In ECCV, 2020. URL https://expose.is.tue.mpg.de. +[10] B. Deng, J. Lewis, T. Jeruzalski, G. Pons-Moll, G. Hinton, M. Norouzi, and A. Tagliasacchi. Nasa: neural articulated shape approximation. arXiv preprint arXiv:1912.03207, 2019. +[11] J. Dong, Q. Shuai, Y. Zhang, X. Liu, X. Zhou, and H. Bao. Motion capture from internet videos. In ECCV, pages 210-227. Springer, 2020. +[12] G. Gafni, J. Thies, M. Zollhöfer, and M. Nießner. Dynamic neural radiance fields for monocular 4d facial avatar reconstruction. In CVPR, 2021. +[13] C. Gao, A. Saraf, J. Kopf, and J.-B. Huang. Dynamic view synthesis from dynamic monocular video. In ICCV, 2021. +[14] I. Goodfellow, J. Pouget-abadie, M. Mirza, B. Xu, D. Warde-farley, S. Ozair, A. Courville, and Y. Bengio. Generative Adversarial Nets. In NeurIPS, pages 2672-2680, 2014. +[15] P. Guan, A. Weiss, A. O. Bālan, and M. J. Black. Estimating human shape and pose from a single image. In CVPR, pages 1381-1388, Sep. 2009. doi: 10.1109/ICCV.2009.5459300. +[16] R. A. Guler and I. Kokkinos. Holopose: Holistic 3d human reconstruction in-the-wild. In CVPR, pages 10884-10894, 2019. +[17] M. Habermann, W. Xu, , M. Zollhoefer, G. Pons-Moll, and C. Theobalt. Livecap: Real-time human performance capture from monocular video. ACM TOG (Proc. SIGGRAPH), jul 2019. +[18] Z. Huang, Y. Xu, C. Lassner, H. Li, and T. Tung. ARCH: animatable reconstruction of clothed humans. In CVPR, 2020. doi: 10.1109/CVPR42600.2020.00316. URL https://doi.org/10.1109/CVPR42600.2020.00316. + +[19] C. Ionescu, D. Papava, V. Olaru, and C. Sminchisescu. Human3.6m: Large scale datasets and predictive methods for 3d human sensing in natural environments. PAMI, 36(7):1325-1339, 2014. +[20] A. Kanazawa, M. J. Black, D. W. Jacobs, and J. Malik. End-to-end recovery of human shape and pose. In CVPR, pages 7122-7131, 2018. +[21] T. Karras, S. Laine, and T. Aila. A style-based generator architecture for generative adversarial networks. In CVPR, 2019. +[22] M. Kocabas, N. Athanasiou, and M. J. Black. Vibe: Video inference for human body pose and shape estimation. In CVPR, 2020. +[23] N. Kolotouros, G. Pavlakos, M. J. Black, and K. Daniilidis. Learning to reconstruct 3d human pose and shape via model-fitting in the loop. In ICCV, 2019. +[24] C. Lassner and M. Zollhöfer. Pulsar: Efficient sphere-based neural rendering. In CVPR, 2021. +[25] C. Lassner, J. Romero, M. Kiefel, F. Bogo, M. J. Black, and P. V. Gehler. Unite the people: Closing the loop between 3d and 2d human representations. In CVPR, July 2017. +[26] S. Li, L. Ke, K. Pratama, Y.-W. Tai, C.-K. Tang, and K.-T. Cheng. Cascaded deep monocular 3d human pose estimation with evolutionary training data. In CVPR, June 2020. +[27] S. Liu, T. Li, W. Chen, and H. Li. Soft rasterizer: A differentiable renderer for image-based 3d reasoning. In ICCV, pages 7708-7717, 2019. +[28] S. Lombardi, J. Saragih, T. Simon, and Y. Sheikh. Deep appearance models for face rendering. ACM TOG (Proc. SIGGRAPH), 37(4), July 2018. ISSN 0730-0301. doi: 10.1145/3197517.3201401. URL https://doi.org/10.1145/3197517.3201401. +[29] S. Lombardi, T. Simon, J. Saragih, G. Schwartz, A. Lehrmann, and Y. Sheikh. Neural volumes: Learning dynamic renderable volumes from images. ACM TOG (Proc. SIGGRAPH), 38(4), July 2019. ISSN 0730-0301. doi: 10.1145/3306346.3323020. URL https://doi.org/10.1145/3306346.3323020. +[30] M. Loper, N. Mahmood, J. Romero, G. Pons-Moll, and M. J. Black. Smpl: A skinned multiperson linear model. ACM TOG (Proc. SIGGRAPH), 34(6):1-16, 2015. +[31] W. E. Lorensen and H. E. Cline. Marching cubes: A high resolution 3d surface construction algorithm. ACM SIGGRAPH, 1987. +[32] C. Luo, X. Chu, and A. L. Yuille. Orinet: A fully convolutional network for 3d human pose estimation. In BMVC, page 92, 2018. URL http://bmvc2018.org/contents/papers/0289.pdf. +[33] R. Martin-Brualla, N. Radwan, M. S. M. Sajjadi, J. T. Barron, A. Dosovitskiy, and D. Duckworth. NeRF in the Wild: Neural Radiance Fields for Unconstrained Photo Collections. In CVPR, 2021. +[34] J. Martinez, R. Hossain, J. Romero, and J. J. Little. A simple yet effective baseline for 3d human pose estimation. In ICCV, 2017. +[35] D. Mehta, H. Rhodin, D. Casas, P. Fua, O. Sotnychenko, W. Xu, and C. Theobalt. Monocular 3d human pose estimation in the wild using improved cnn supervision. In 3DV. IEEE, 2017. doi: 10.1109/3dv.2017.00064. URL http://gvv.mpi-inf.mpg.de/3dhp_dataset. +[36] D. Mehta, S. Sridhar, O. Sotnychenko, H. Rhodin, M. Shafiei, H.-P. Seidel, W. Xu, D. Casas, and C. Theobalt. Vnect: Real-time 3d human pose estimation with a single rgb camera. In TOG, volume 36, July 2017. doi: 10.1145/3072959.3073596. URL http://gvv.mpi-inf.mpg.de/projects/VNect/. +[37] D. Mehta, O. Sotnychenko, F. Mueller, W. Xu, M. Elgharib, P. Fua, H.-P. Seidel, H. Rhodin, G. Pons-Moll, and C. Theobalt. XNect: Real-time multi-person 3D motion capture with a single RGB camera. In ACM TOG (Proc. SIGGRAPH), 2020. + +[38] M. Meshry, D. B. Goldman, S. Khamis, H. Hoppe, R. Pandey, N. Snavely, and R. Martin-Brualla. Neural rerendering in the wild. In CVPR, pages 6878-6887, 2019. +[39] B. Mildenhall, P. P. Srinivasan, M. Tancik, J. T. Barron, R. Ramamoorthi, and R. Ng. Nerf: Representing scenes as neural radiance fields for view synthesis. In ECCV, 2020. +[40] T. Nguyen-Phuoc, C. Li, L. Theis, C. Richardt, and Y.-L. Yang. Hologan: Unsupervised learning of 3d representations from natural images. In ICCV, pages 7588–7597, 2019. +[41] A. Nibali, Z. He, S. Morgan, and L. Prendergast. 3d human pose estimation with 2d marginal heatmaps. In WACV, 2019. +[42] M. Omran, C. Lassner, G. Pons-Moll, P. Gehler, and B. Schiele. Neural body fitting: Unifying deep learning and model based human pose and shape estimation. In 3DV, 2018. +[43] S. Park, J. Hwang, and N. Kwak. 3d human pose estimation using convolutional neural networks with 2d pose information. In European Conference on Computer Vision (ECCV), pages 156-169, 2016. doi: 10.1007/978-3-319-49409-8\_15. URL https://doi.org/10.1007/978-3-319-49409-8_15. +[44] G. Pavlakos, X. Zhou, K. G. Derpanis, and K. Daniilidis. Coarse-to-fine volumetric prediction for single-image 3d human pose. Conference on Computer Vision and Pattern Recognition (CVPR), pages 1263-1272, 2017. +[45] G. Pavlakos, L. Zhu, X. Zhou, and K. Daniilidis. Learning to estimate 3D human pose and shape from a single color image. In CVPR, 2018. +[46] S. Peng, Y. Zhang, Y. Xu, Q. Wang, Q. Shuai, H. Bao, and X. Zhou. Neural body: Implicit neural representations with structured latent codes for novel view synthesis of dynamic humans. In CVPR, 2021. +[47] A. Pumarola, E. Corona, G. Pons-Moll, and F. Moreno-Noguer. D-NeRF: Neural Radiance Fields for Dynamic Scenes. In CVPR, 2020. +[48] H. Rhodin, N. Robertini, C. Richardt, H.-P. Seidel, and C. Theobalt. A versatile scene model with differentiable visibility applied to generative pose estimation. In ICCV, pages 765-773, 2015. +[49] H. Rhodin, N. Robertini, D. Casas, C. Richardt, H.-P. Seidel, and C. Theobalt. General automatic human shape and motion capture using volumetric contour cues. In ECCV, pages 509-526, 2016. +[50] H. Rhodin, M. Salzmann, and P. Fua. Unsupervised Geometry-Aware Representation for 3D Human Pose Estimation. In ECCV, 2018. +[51] H. Rhodin, V. Constantin, I. Katircioglu, M. Salzmann, and P. Fua. Neural scene decomposition for multi-person motion capture. In CVPR, 2019. +[52] G. Rogez, P. Weinzaepfel, and C. Schmid. LCR-Net: Localization-Classification-Regression for Human Pose. In CVPR, pages 1216–1224, Honolulu, United States, July 2017. IEEE. doi: 10.1109/CVPR.2017.134. URL https://hal.inria.fr/hal-01505085. +[53] M. Shi, K. Aberman, A. Aristidou, T. Komura, D. Lischinski, D. Cohen-Or, and B. Chen. Motionet: 3d human motion reconstruction from monocular video with skeleton consistency. ACM TOG (Proc. SIGGRAPH), 40(1):1-15, 2020. +[54] A. Shysheya, E. Zakharov, K.-A. Aliev, R. Bashirov, E. Burkov, K. Iskakov, A. Ivakhnenko, Y. Malkov, I. Pasechnik, D. Ulyanov, et al. Textured neural avatars. In CVPR, pages 2387-2397, 2019. +[55] V. Sitzmann, J. Thies, F. Heide, M. Nießner, G. Wetzstein, and M. Zollhöfer. Deepvoxels: Learning persistent 3d feature embeddings. In CVPR, 2019. +[56] V. Sitzmann, M. Zollhöfer, and G. Wetzstein. Scene representation networks: Continuous 3d-structure-aware neural scene representations. In NeurIPS, pages 1121–1132, 2019. + +[57] V. Sitzmann, J. Martel, A. Bergman, D. Lindell, and G. Wetzstein. Implicit neural representations with periodic activation functions. NeurIPS, 33, 2020. +[58] C. Stoll, N. Hasler, J. Gall, H.-P. Seidel, and C. Theobalt. Fast articulated motion tracking using a sums of Gaussians body model. In ICCV, pages 951-958, 2011. +[59] X. Sun, J. Shang, S. Liang, and Y. Wei. Compositional human pose regression. In ICCV, pages 2602-2611, 2017. +[60] M. Tancik, P. P. Srinivasan, B. Mildenhall, S. Fridovich-Keil, N. Raghavan, U. Singhal, R. Ramamoorthi, J. T. Barron, and R. Ng. Fourier features let networks learn high frequency functions in low dimensional domains. NeurIPS, 2020. +[61] J. Taylor, J. Shotton, T. Sharp, and A. Fitzgibbon. The vitruvian manifold: Inferring dense correspondences for one-shot human pose estimation. In CVPR, pages 103-110. IEEE, 2012. +[62] A. Tewari, O. Fried, J. Thies, V. Sitzmann, S. Lombardi, K. Sunkavalli, R. Martin-Brualla, T. Simon, J. Saragih, M. Nießner, R. Pandey, S. Fanello, G. Wetzstein, J.-Y. Zhu, C. Theobalt, M. Agrawala, E. Shechtman, D. B. Goldman, and M. Zollhöfer. State of the Art on Neural Rendering. Computer Graphics Forum (EG STAR 2020), 2020. +[63] J. Thies, M. Zollhöfer, and M. Nießner. Deferred neural rendering: Image synthesis using neural textures. ACM TOG (Proc. SIGGRAPH), 2019. +[64] D. Tome, C. Russell, and L. Agapito. Lifting from the deep: Convolutional 3d pose estimation from a single image. In CVPR, July 2017. +[65] H.-Y. Tung, H.-W. Tung, E. Yumer, and K. Fragkiadaki. Self-supervised learning of motion capture. In NeurIPS, pages 5242-5252, 2017. +[66] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin. Attention is all you need. In NeurIPS, 2017. +[67] O. Wiles, G. Gkioxari, R. Szeliski, and J. Johnson. Synsin: End-to-end view synthesis from a single image. In CVPR, pages 7467-7477, 2020. +[68] D. Xiang, H. Joo, and Y. Sheikh. Monocular total capture: Posing face, body, and hands in the wild. In CVPR, pages 10965-10974, 2019. +[69] J. Xu, Z. Yu, B. Ni, J. Yang, X. Yang, and W. Zhang. Deep kinematics analysis for monocular 3d human pose estimation. In CVPR, June 2020. +[70] W. Xu, A. Chatterjee, M. Zollhöfer, H. Rhodin, D. Mehta, H.-P. Seidel, and C. Theobalt. Monoperfcap: Human performance capture from monocular video. TOG, 37(2):27, 2018. +[71] L. Yen-Chen, P. Florence, J. T. Barron, A. Rodriguez, P. Isola, and T.-Y. Lin. inerf: Inverting neural radiance fields for pose estimation. In IROS, 2020. +[72] K. Zhou, X. Han, N. Jiang, K. Jia, and J. Lu. Hemlets pose: Learning part-centric heatmap triplets for accurate 3d human pose estimation. In ICCV, pages 2344-2353, 2019. +[73] X. Zhou, X. Sun, W. Zhang, S. Liang, and Y. Wei. Deep kinematic pose regression. In ECCV Workshop, 2016. +[74] S. Zuffi, A. Kanazawa, T. Berger-Wolf, and M. J. Black. Three-d safari: Learning to estimate zebra pose, shape, and texture from images "in the wild". In ICCV, pages 5358-5367. IEEE, Oct. 2019. \ No newline at end of file diff --git a/anerfarticulatedneuralradiancefieldsforlearninghumanshapeappearanceandpose/images.zip b/anerfarticulatedneuralradiancefieldsforlearninghumanshapeappearanceandpose/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ffe6a14756f5eb260e0c5ee6fd7b3bf8055100a7 --- /dev/null +++ b/anerfarticulatedneuralradiancefieldsforlearninghumanshapeappearanceandpose/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:641ee77496c722f2a7420ba12dc0cd6ebb4545cb454718824dbbba92c108b485 +size 535444 diff --git a/anerfarticulatedneuralradiancefieldsforlearninghumanshapeappearanceandpose/layout.json b/anerfarticulatedneuralradiancefieldsforlearninghumanshapeappearanceandpose/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..44462238c571d00e6a794ad548e5da578bc05c9a --- /dev/null +++ b/anerfarticulatedneuralradiancefieldsforlearninghumanshapeappearanceandpose/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:74361eb7ac389df8e27a14198ee4b25e96b8f71f511d27a15b56a0c37e0aa536 +size 576333 diff --git a/anogotheoremforrobustaccelerationinthehyperbolicplane/05ef724e-ec77-410e-88d5-0218f795b4c2_content_list.json b/anogotheoremforrobustaccelerationinthehyperbolicplane/05ef724e-ec77-410e-88d5-0218f795b4c2_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..df172926192d1d46008a8031e22518377db0f465 --- /dev/null +++ b/anogotheoremforrobustaccelerationinthehyperbolicplane/05ef724e-ec77-410e-88d5-0218f795b4c2_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2b2a4fa8b53a35a6fe94201c2e2fbf37b70005797c905262be02268aa33a91fd +size 64187 diff --git a/anogotheoremforrobustaccelerationinthehyperbolicplane/05ef724e-ec77-410e-88d5-0218f795b4c2_model.json b/anogotheoremforrobustaccelerationinthehyperbolicplane/05ef724e-ec77-410e-88d5-0218f795b4c2_model.json new file mode 100644 index 0000000000000000000000000000000000000000..5ce76580f5ac38475369e67a1477adc4c0d4d94a --- /dev/null +++ b/anogotheoremforrobustaccelerationinthehyperbolicplane/05ef724e-ec77-410e-88d5-0218f795b4c2_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:542e62b2fa7ee99e623a5fc77d3e793d46dfe62c27b02e58435f6a81c71bcdab +size 82816 diff --git a/anogotheoremforrobustaccelerationinthehyperbolicplane/05ef724e-ec77-410e-88d5-0218f795b4c2_origin.pdf b/anogotheoremforrobustaccelerationinthehyperbolicplane/05ef724e-ec77-410e-88d5-0218f795b4c2_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fac145538e7f079827e2a1c1cf77d4107600907e --- /dev/null +++ b/anogotheoremforrobustaccelerationinthehyperbolicplane/05ef724e-ec77-410e-88d5-0218f795b4c2_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:02e4dcb34c8214a4a223dde47ee40633cbd919e392a66baa2354e522566eb1f2 +size 362651 diff --git a/anogotheoremforrobustaccelerationinthehyperbolicplane/full.md b/anogotheoremforrobustaccelerationinthehyperbolicplane/full.md new file mode 100644 index 0000000000000000000000000000000000000000..176831262bf779402e8b086f72119600ac6b8352 --- /dev/null +++ b/anogotheoremforrobustaccelerationinthehyperbolicplane/full.md @@ -0,0 +1,314 @@ +# A No-go Theorem for Robust Acceleration in the Hyperbolic Plane + +Linus Hamilton* Ankur Moitra† + +# Abstract + +In recent years there has been significant effort to adapt the key tools and ideas in convex optimization to the Riemannian setting. One key challenge has remained: Is there a Nesterov-like accelerated gradient method for geodesically convex functions on a Riemannian manifold? Recent work has given partial answers and the hope was that this ought to be possible. Here we prove that in a noisy setting, there is no analogue of accelerated gradient descent for geodesically convex functions on the hyperbolic plane. Our results apply even when the noise is exponentially small. The key intuition behind our proof is short and simple: In negatively curved spaces, the volume of a ball grows so fast that information about the past gradients is not useful in the future. + +# 1 Introduction + +Convex optimization [24] undergirds much of machine learning, theoretical computer science, operations research and statistics. Geodesically convex optimization is a natural generalization that replaces Euclidean space with a Riemannian manifold and we require that the function we want to minimize is convex along geodesics [31, 1, 5]. It turns out that many optimization problems of interest, while non-convex in the Euclidean view, become geodesically convex when equipped with the right geometry. Some notable examples: The fastest known algorithms for computing Brascamp-Lieb constants [17, 3], and solving related problems like the null cone problem [8, 6, 7], exploit geodesic convexity. In machine learning, it arises in matrix completion [9, 28, 33], dictionary learning [11, 26], robust subspace recovery [39], mixture models [18] and optimization under orthogonality constraints [14]. In statistics, some basic problems like estimating the shape of an elliptical distribution [35, 16] or estimation matrix normal models [29, 4] are best viewed through the lens of geodesic convexity. + +In recent years there has been significant effort to adapt the key tools and ideas in convex optimization to the Riemannian setting. This includes giving new deterministic [37], stochastic [21, 30], variance-reduced [25, 36], projection-free [34], adaptive [20] and saddle-point escaping [12, 27] first-order methods. Many new ingredients are needed because the traditional analyses in the Euclidean setting rely on the linear structure. Still, one of the key challenges has remained elusive thus far: + +Is there a Nesterov-like accelerated gradient method for geodesically convex functions on a Riemannian manifold? + +This question is particularly natural in settings where the curvature is non-positive, since it inherits many useful properties of Euclidean space such as having unique geodesics between any pair of + +points. There has been notable partial progress. Zhang and Sra [38] were among the first to clearly articulate this question. They gave a method that achieves Nesterov-like acceleration if you start sufficiently close to the optimum. Since then, the aim has been to develop methods that achieve global acceleration. Ahn and Sra [2] gave a partial answer by giving a method that converges strictly faster than gradient descent and eventually accelerates. Martínez-Rubio [23] gave a method that achieves global acceleration but at the expense of having hidden constants that depend exponentially on the diameter of the space. + +In this work, our main contribution is to dash these hopes by showing that acceleration is impossible even in the simplest of settings where we want to minimize a smooth and strongly geodesically convex function over the hyperbolic plane. Our proof assumes that the gradient oracle returns an answer that has just an exponentially small amount of noise. In comparison, in the Euclidean setting it is possible to achieve Nesterov-like acceleration with an inverse polynomial amount of noise. Of course, in realistic settings some amount of noise is usually unavoidable. + +Theorem 1. Given access to a $\delta$ -noisy gradient oracle, any algorithm for finding a point within distance $r/5$ of the minimum of a 1-strongly convex and $O(r)$ -smooth function in the hyperbolic plane that succeeds with probability at least $2/3$ must make at least + +$$ +\Omega \left(\frac {r}{\log r + \log 1 / \delta}\right) +$$ + +queries in expectation. Here $r$ is a bound on how far the optimum is from the origin. + +Comment 1. While it may at first seem like a limitation to restrict to functions whose condition number depends on the radius, we show in Section 5 that in the hyperbolic plane this is inevitable in the sense that every geodesically convex function has a condition number that is at least linear in the radius. + +See Theorem 3 for the full version. The key intuition is short and simple: In negatively curved spaces, the volume of a ball grows so fast that information about the past gradients is not useful in the future. Indeed for discrete approximations to the hyperbolic plane, like a 4-regular tree, it is not hard to make this intuition precise. This intuition also helps clarify why existing acceleration results need to assume that you are already within a constant neighborhood of the optimum or depend badly on the radius. + +It is more challenging to reason about general algorithms that can make queries anywhere they like and not just at a discrete set of locations. The proof of our main result is based on an abstraction in terms of a game where a player wants to find a hidden item in a set and can make queries to a noisy oracle. We prove an information-theoretic lower bound for this game, and then connect it back to convex optimization over curved spaces. The key point is that balls in hyperbolic space grow exponentially with their radius, and this is in turn related to the size of the set in our game. We believe that our query lower bounds for the noisy oracle game can be more broadly applicable, even beyond the realm of optimization. + +Remark 1. The natural open question in our work is to prove similar lower bounds when we are given an exact gradient oracle. However any such algorithm that depends on exact gradient computations, and fails with even an exponentially small amount of noise, would seem to be rather brittle to issues of practical concern, like rounding due to machine precision. + +This paper is structured as follows: in Section 2 we introduce the reader to the counterintuitive properties of the hyperbolic plane. Section 3 defines the noisy gradient problem and phrases it as a more general 'noisy query game'. Section 4 proves our crucial lower bound on general noisy query problems, and then applies it to prove our no-go theorem about acceleration in curved spaces. + +# 2 The Hyperbolic Plane + +This section serves as an introduction to the hyperbolic plane $\mathbb{H}^2$ , establishing the important facts we use for our proof as well as intuition for our main result. The first and most important fact about the hyperbolic plane is that it is large: + +Fact 1. [10] The circumference and area of a hyperbolic circle are both exponential in its radius. + +For illustration, consider a tiling of the hyperbolic plane with congruent equilateral pentagons. As you can see, the number of pentagons at distance $r$ from the origin grows exponentially in $r$ . + +![](images/d79808c0815d49b55126a01528cd54af1411c4f943445d13b1a1f7f513d5e240.jpg) + +This gives intuition for our result: When attempting to minimize a function whose minimum lies somewhere within a ball of radius $r$ , the hyperbolic plane forces you to search over a much larger area than any fixed dimension of Euclidean space would. This inherently makes it harder to exploit information from past queries about the function value and gradient, as you can in acceleration in the Euclidean case, when we are interested in reaching a point far away from the origin. + +# 2.1 Convexity + +Definition 1. [32, 1, 31] A function from a manifold (here, the hyperbolic plane $\mathbb{H}^2$ ) to $\mathbb{R}$ is geodesically convex if it is convex along any geodesic. This is equivalent to the Hessian of the function having nonnegative eigenvalues. We say that a function is $\alpha$ -strongly convex if the eigenvalues of its Hessian are bounded below by $\alpha$ . Moreover, it is $\beta$ -smooth if the eigenvalues of its Hessian are bounded above by $\beta$ . + +Note that even though a function $f: \mathbb{H}^2 \to \mathbb{R}$ may live in the hyperbolic plane, its gradient at any point, denoted by $\nabla f(x)$ , lives in a space isomorphic to $\mathbb{R}^2$ . And similarly its Hessian at that point is an ordinary $2 \times 2$ matrix. This is because the gradient and Hessian are local properties of a function, and locally the hyperbolic plane looks Euclidean. This can be made formal through the concept of tangent spaces, but will not be needed for our purposes. + +In this paper we will prove lower bounds for minimizing arguably the simplest geodesically convex function, the distance squared function: + +Fact 2. In the hyperbolic plane, the distance squared function $x \mapsto d(x, x^{\star})^{2}$ is geodesically convex and its minimum is $x^{\star}$ . At distance $r$ from $x^{\star}$ , this function is 1-strongly convex and $(r / \tanh r)$ -smooth. + +The strong convexity and smoothness come from the formula for its Hessian given in [15]. + +# 2.2 Why Pirates Don't Search for Treasure in the Hyperbolic Plane + +The purpose of this subsection is to provide intuition for our main theorem and is not required to understand our results. Imagine a pirate who has buried treasure in the desert somewhere at distance 100 away from her. She does not remember exactly where the treasure is, but is in possession of a compass which points towards it. The compass' reading has error, though: on the order of $10^{-16}$ degrees. (This setting is analogous to an algorithm able to make noisy queries to the gradient of some function.) In the Euclidean plane, the pirate could easily find the treasure: take a compass bearing, walk 100 steps, and dig. An error of $10^{-16}$ degrees would literally be subatomic. + +However, if the pirate attempted this strategy in the hyperbolic plane, she would end up at distance just over 190 from her treasure. She would have started to walk away from the treasure after just a few steps! (Specifically, a constant number of steps that scales with $\log(1/10^{-16})$ .) Therefore, she + +would have to repeatedly look at her compass every few steps in order to make progress towards the treasure. This is why gradient descent has only linear convergence in hyperbolic spaces. Of course, this falls short of explaining why no algorithm converges faster. One of the authors (though we won't say who) is indebted to the video game HyperRogue [22] for giving intuition about the hyperbolic plane. One level of this game features a similar scenario with pirates and compasses. + +# 3 Optimization with a Noisy Gradient Oracle + +In this section we define the main model we will be interested in. Moreover we recall convergence bounds in the Euclidean case, particularly those that continue to hold in the presence of a small amount of noise, as a point of comparison. + +Definition 2. The radius- $r$ gradient optimization model is as follows: There is an unknown differentiable function $f$ whose minimum is within distance $r$ of the origin. An algorithm may query points $x$ within distance $1000r$ of the origin. Upon querying $x$ , the algorithm learns $f(x)$ and the gradient $\nabla f(x)$ . + +Definition 3. In the noisy version of the model, instead of learning the exact values of $f(x)$ and $\nabla f(x)$ , the algorithm receives $f(x) + z_{1}$ and $\nabla f(x) + z_{2}$ where $z_{1}$ and $z_{2}$ are noise. We do not require the noise to be of a specific form such as Gaussian, uniform, etc – we only require that the noise terms for different queries are independent. + +Definition 4. We say noise is $c$ -non-concentrated if on any query, the probability distribution function of the noise is everywhere bounded above by $c$ . We say noise is $C$ -precise if the noise term never has magnitude larger than $C$ . + +In Euclidean space, a small amount of noise does not preclude acceleration. As a point of comparison, we restate the key result (Theorem 7) from [13]: + +Theorem 2 (from [13]). There is an algorithm that, given $C$ -precise noisy oracle access to an $L$ -smooth $\mu$ -strongly convex function $f$ and its gradient, along with a starting point at distance $d$ from the minimum of $f$ , outputs after $k$ oracle queries a point $x_{k}$ such that + +$$ +f \left(x _ {k}\right) - \min f \leq O \left(L d \cdot \min \left(1 / k ^ {2}, \exp (- k / 2 \sqrt {\mu / L})\right) + \min \left(k \cdot p o l y (C), \sqrt {L / \mu}\right)\right) +$$ + +(The bound in the original paper is more precise, making big-O constants explicit and using a more refined notion of precision.) This theorem implies that accelerated gradient descent works in Euclidean space even in the presence of noise, provided that the noise has magnitude at most some inverse polynomial in $r$ . Contrast our main result: in hyperbolic space, accelerated gradient descent is impossible even with exponentially small noise. + +# 4 The Noisy Gradient Task in the Hyperbolic Plane + +Recall, we will be interested in the simplest example of a convex function in the hyperbolic plane: $f(x) \coloneqq \mathrm{dist}(x, x^{\star})^{2}$ , where $x^{\star}$ is some point at distance $r$ from the origin. Finding the minimum of $f$ is equivalent to locating $x^{\star}$ . Without noise, an algorithm could locate $x^{\star}$ exactly in one query, because any gradient is guaranteed to both point exactly at $x^{\star}$ and indicate the distance to $x^{\star}$ . What about with noisy gradients? + +Within the hyperbolic of radius $r$ centered at the origin, our function $f$ is $O(r)$ -smooth and 1-strongly convex. (As an aside, in Theorem 6 we show that for any $\beta$ -smooth and $\alpha$ -strongly convex function in the hyperbolic disk we must have $\beta / \alpha = \Omega(r)$ ). If Nesterov-like acceleration in the hyperbolic plane were possible we should be able to locate $x^{\star}$ to within distance 1 in time $O(\sqrt{r})$ . Unfortunately, as we will show, this task is impossible. Even worse, it is impossible to get any polynomial factor speedup in the convergence. + +Theorem 3. In the radius- $r$ noisy gradient optimization model in the hyperbolic plane, if queries receive noisy answers with $c$ -non-concentrated $C$ -precise noise, then any algorithm that can find a point within distance $r/5$ of the minimum of the function at succeeds with probability at least $2/3$ must make at least + +$$ +\Omega \left(\frac {r}{\log r + \log C + \log c}\right) +$$ + +queries. This is true even if the function is guaranteed to be 1-strongly convex and $O(r)$ -smooth at every point within distance $r$ from the origin. + +To prove this result, we will generalize the noisy gradient model to any setting in which an agent makes queries and receives probabilistic answers over a discrete set of possibilities. In this general setting, we will prove a lower bound on the number of queries needed to determine the state of the world. + +# 4.1 Noisy Query Games + +Definition 5. A noisy query game is a tuple $(n, Q, \mathcal{X}, f)$ , with which the following one-player game is played: A secret number $i^{\star}$ is chosen uniformly at random from $\{1, 2, \dots, n\}$ . The player's goal is to determine $i^{\star}$ . To do so, the player may make a query $q \in Q$ and receive an observation $X \in \mathcal{X}$ . The observation is sampled using some probability distribution function $f_{q,i^{\star}}(x)$ . The player wins when they can guess $i^{\star}$ with probability at least $2/3$ . + +We remark that for us $\mathcal{X}$ will be a region in Euclidean space and we will use $|\mathcal{X}|$ to denote its volume. The noisy game broadly seems to be a natural model for a class of noisy learning tasks. In particular, it generalizes the noisy gradient task in the hyperbolic plane, as we show in the following comment: + +Comment 2. Consider the noisy gradient task in which we place $n = e^{\Theta (r)}$ points equally in a circle of radius $r$ in the hyperbolic plane, so that the points are distance $\geq r / 2$ apart. (This is possible because circles are exponentially large - see [10], page 92 - so greedily picking points one at a time and removing a ball of radius $r / 2$ around each runs out of volume only after exponentially many steps.) The secret number $i^{\star}$ corresponds to one of these points $x^{\star}$ . Define the function $f(x) = \mathrm{dist}(x,x^{\star})^{2}$ whose optimum is $x^{\star}$ . The player makes queries in $Q \coloneqq$ a region in the hyperbolic plane with radius $O(r)$ , and receives noisy gradient observations. Now the player can win if and only if they can locate the optimum of $f(x)$ , among the discrete set of possibilities, with probability at least $2 / 3$ . + +We now state our lower bound for noisy query games: + +Theorem 4. In a noisy query game $(n, Q, \mathcal{X}, f)$ , suppose the noise is $c$ -non-concentrated, i.e. all probability distribution functions $f_{q,i^{\star}}$ are everywhere bounded above by some constant $c$ . Then for the player to be able to guess $i^{\star}$ with probability at least $2/3$ , the player must make at least $\Omega \left( \frac{\log n}{\log(c|\mathcal{X}|)} \right)$ queries. + +Theorem 4 is difficult to prove directly, because the player's knowledge is a posterior distribution over the options $\{1,2,\dots ,n\}$ which can change in complicated ways. To overcome this obstacle and prove Theorem 4, we will define an easier 'transparent' version of the noisy query game, where the player's knowledge is a subset of $\{1,2,\ldots ,n\}$ representing which options could possibly be the correct one. Then we will show that even in the easier version of the game, the player needs many queries in expectation to succeed. + +# 4.2 The Transparent Noisy Query Game + +In a noisy query game, observations are sampled from probability distribution functions $f_{q,i}$ on a space $\mathcal{X}$ . One way to sample an observation from $f_{q,i}$ is to sample uniformly from the region under its graph. Let $G_{q,i}$ denote this region. Note that the volume of $G_{q,i}$ must be 1, because probabilities always sum to 1. In the transparent noisy query game, we answer a query $q$ by telling the player a point $(x,y)$ uniformly sampled from the graph region $G_{q,i^{\star}}$ . In the normal query game the player only learns $x$ , so the normal version can only be harder. + +The key question is: How does the player's knowledge update when she receives an observation $(x,y)$ ? For any option $i$ whose graph area $G_{q,i}$ does not include the point $(x,y)$ , the player learns + +that $i$ cannot possibly be correct. For the rest of the options, the player learns nothing. This is because observations are sampled uniformly and each $G_{q,i}$ has unit area, so by Bayes' rule the player's posterior on $i^{\star}$ remains uniform over all remaining options. (Here we have assumed that the prior is uniform at the beginning.) + +Indeed, this convenient property is the reason we defined this transparent version: It allows us to easily analyze the player's progress by tracking only the number of remaining possible options, rather than the messy details of what happens to the posterior distribution. + +Lemma 5. Suppose all the $f_{q,i}$ are $c$ -non-concentrated distributions. Then in the transparent noisy query game, a query decreases the logarithm of the number of possible remaining options by at most $\log (c|\mathcal{X}|)$ in expectation. + +Proof. Let $m$ be the number of options remaining before the query. For convenience, use the notation $N(x,y)$ for the number of graph areas $G_{q,i}$ , among the $m$ remaining options, that contain $(x,y)$ . If the player receives the query result $(x,y)$ , they would be left with $N(x,y)$ remaining options. So after the query, the expected number of options remaining is + +$$ +\mathbb {E} _ {i ^ {\star}} \left[ \int_ {G _ {q, i ^ {\star}}} \log (N (x, y)) d x d y \right], +$$ + +where the expectation is taken uniformly at random from among the $m$ remaining options. Moving the expectation inside the integral sign and using the assumption that all graph areas are contained within $\mathcal{X} \times [0, c]$ , we get that the above expectation is equal to: + +$$ +\int_ {\mathcal {X} \times [ 0, c ]} \frac {N (x , y)}{m} \log \left(N (x, y)\right) d x d y +$$ + +Since each graph has area 1, the integral $\int_{\mathcal{X} \times [0,c]} N(x,y)$ is $m$ . So by Jensen's inequality, subject to this restriction, the above quantity is minimized when $N$ is constant over the entire domain $\mathcal{X} \times [0,c]$ . The minimum value is + +$$ +\int_ {\mathcal {X} \times [ 0, c ]} \frac {m / c | \mathcal {X} |}{m} \log (m / c | \mathcal {X} |) d x d y = \log (m / c | \mathcal {X} |) = \log m - \log (c | \mathcal {X} |) +$$ + +So the expectation of the logarithm of the number of possible options left decreases by at most $\log (c|\mathcal{X}|)$ , as desired. + +Now we can prove our main lower bound for the noisy query game: + +Proof of Theorem 4. Let $n_i$ denote the number of possible remaining options after $i$ steps. Thus we have $n_0 = n$ . Now let $X$ be a random variable that represents the cumulative progress the algorithm has made. In particular let + +$$ +X = \sum_ {i = 1} ^ {T} \log n _ {i - 1} - \log n _ {i} +$$ + +Applying Lemma 5 and Markov's bound we have that $X \leq 3\mathbb{E}[X]$ with probability at least $2/3$ . If the algorithm succeeds at being able to determine $i^{\star}$ after $T$ steps we must have $n_T = 1$ . Putting everything together we have + +$$ +0 = \log n _ {T} = \log n - X \geq \log n - 3 | T | \log (c | \mathcal {X} |) +$$ + +and rearranging completes the proof. + +![](images/ed5288782fb83891dfd69648cefd7bc3a1aedc9fef12cdf0bb8933117f36624a.jpg) + +# 4.3 Proof of the Main Theorem + +Our main result now follows easily from the machinery of noisy query games: + +Proof of Theorem 3. Suppose we want to minimize the function $f(x) = \mathrm{dist}(x,x^{\star})^{2}$ . This function is 1-strongly convex and $2r$ -smooth within distance $r$ of the origin. (As mentioned earlier, [15] shows the eigenvalues of the Hessian are 1 and $r / \tanh r \leq r + 1$ .) First we apply the reduction in Comment 2 so that we have $n = e^{\Theta (r)}$ points with pairwise distance at least $r / 2$ . Moreover $x^{\star}$ is among them and corresponds to the secret number $i^{\star}$ in the noisy query game. + +In the setting of Theorem 3, a player makes queries within a certain region of the hyperbolic plane, and learns the (noisy) function value and gradient at their query point. They are tasked with finding a point within distance $r / 5$ of $x^{\star}$ . Because the $n$ points have pairwise distance at least $r / 2$ , doing so requires figuring out which of the $n$ points is $x^{\star}$ . So the player must win the query game, which by Theorem 4, takes at least $\frac{\log n}{\log(|X|c)}$ queries. + +We picked $n = e^{\Theta (r)}$ above, and the value of $c$ is stated in Theorem 3's assumptions. But what is $|\mathcal{X}|$ , i.e. the volume containing all query answers? Since the player's queries are restricted to a region in the hyperbolic plane of radius $O(r)$ , the true answer to their query is a function value in the interval $[0,O(r^{2})]$ along with a gradient in the disk $B(0,O(r))\subseteq \mathbb{R}^2$ . (Recall from Section 2.1 that the gradient lives in $\mathbb{R}^2$ , not the hyperbolic plane.) By assumption, the noise causes error at most $C$ , so the observed query answer must lie in + +$$ +[ - C, O (r ^ {2}) + C ] \times B (0, O (r) + C) \subset \mathbb {R} ^ {3} +$$ + +This is a compact set whose volume is a polynomial in $r$ and $C$ . In particular we have $|\mathcal{X}| \leq O(r^4 C^3)$ . Therefore overall the player needs at least + +$$ +\frac {\log n}{\log (| \mathcal {X} | c)} = \frac {r)}{\log (c) + O (\log r + \log C)} +$$ + +queries. This completes the proof. + +![](images/4dfc09274fa35e3745b74b07013daf39dcd4731ec09f1870b15b15da8625e0f7.jpg) + +# 5 Lower Bounds on the Condition Number + +In Euclidean space, the function $f(x) = ||x||^2$ is 1-smooth and 1-strongly convex at every point. However, as we will show, in the hyperbolic plane geodesically convex functions always have a condition number that depends on the radius: + +Theorem 6. If $f$ is a $\beta$ -smooth, $\alpha$ -strongly convex function defined in a hyperbolic disk of radius $r$ , then $\beta / \alpha \geq \Omega(r)$ . + +Proof. First we will give the intuition for the proof. Consider a geodesic that dips a distance of 1 into the disk of radius $r$ (see the picture below). On the one hand, due to $\alpha$ -strong convexity, the value of $f$ must vary a large amount along this geodesic. But on the other hand, this geodesic is short, so by $\beta$ -smoothness $f$ cannot vary much. These two properties will give us a lower bound on the condition number. + +Now we proceed to the formal proof. Of all points at distance $r - 1$ from the center of the disk, let $x$ be one at which $f$ is minimal. Without loss of generality suppose that $f = 0$ at the center of the disk. By convexity and the minimality of $x$ , we deduce that + +$$ +f (y) \geq \frac {r}{r - 1} f (x) +$$ + +for all $y$ on the circumference of the disk. By $\alpha$ -strong convexity, $f(x) \geq \Omega(\alpha r^2)$ . Now draw a geodesic through $x$ , as pictured, perpendicular to the geodesic between the center of the disk and $x$ . This geodesic intersects the disk at two points $y$ and $y'$ . By $\beta$ -smoothness, + +$$ +\frac {1}{2} \left(f (y) + f \left(y ^ {\prime}\right)\right) \leq f (x) + O \left(\beta d \left(y, y ^ {\prime}\right) ^ {2}\right) +$$ + +Finally, in hyperbolic geometry, the distance $d(y,y')$ is $O(1)$ . See Lemma 7 for an explicit calculation justifying this. Finally combining the three inequalities in the previous paragraph gives $\beta/\alpha \geq \Omega(r)$ , as desired. + +![](images/4dff3d0c45508b436a4a56db8029c3151f4d62c1a043b5b6524f0ad7ddd24dc4.jpg) +Lemma 7. A hyperbolic triangle with two sides of length $r$ , whose altitude between those sides has length $r - 1$ , has a third side of length $O(1)$ . + +Proof. This is a straightforward calculation using formulas from [19]. Let $c$ denote the length of the third side and $A$ denote the measure of either angle adjacent to side $c$ . (Those angles are equal because the triangle is isosceles.) The hyperbolic law of cosines from [19] gives $\cos A = \frac{(-1 + \cosh c)\cosh r}{\sinh c\sinh r}$ . The altitude length formula gives $\sin A = \frac{\sinh(r - 1)}{\sinh r}$ . Using $1 - \sin^2 = \cos^2$ gives: + +$$ +1 - \frac {\sinh^ {2} (r - 1)}{\sinh^ {2} r} = \frac {(- 1 + \cosh c) ^ {2} \cosh^ {2} r}{\sinh^ {2} c \sinh^ {2} r} +$$ + +Rearranging the above expression, we get: + +$$ +\left(1 - \frac {\sinh^ {2} (r - 1)}{\sinh^ {2} r}\right) \frac {\sinh^ {2} r}{\cosh^ {2} r} = \frac {(- 1 + \cosh c) ^ {2}}{\sinh^ {2} c} +$$ + +As $r \to \infty$ the left-hand side tends to $1 - \frac{1}{e^2} \approx 0.86$ . Then solving the right-hand side for $c$ gives a solution, unique in the reals, that is approximately 3.31, which is $\bar{O}(1)$ as desired. + +# References + +[1] P-A Absil, Robert Mahony, and Rodolphe Sepulchre. Optimization algorithms on matrix manifolds. Princeton University Press, 2009. +[2] Kwangjun Ahn and Suvrit Sra. From nesterov's estimate sequence to riemannian acceleration. pages 84-118, 2020. +[3] Zeyuan Allen-Zhu, Ankit Garg, Yuanzhi Li, Rafael Oliveira, and Avi Wigderson. Operator scaling via geodesically convex optimization, invariant theory and polynomial identity testing. In Proceedings of the 50th Annual ACM SIGACT Symposium on Theory of Computing, pages 172-181, 2018. +[4] Carlos Amendola, Kathlen Kohn, Philipp Reichenbach, and Anna Seigal. Invariant theory and scaling algorithms for maximum likelihood estimation. arXiv preprint arXiv:2003.13662, 2020. +[5] Miroslav Bacák. Convex analysis and optimization in Hadamard spaces, volume 22. Walter de Gruyter GmbH & Co KG, 2014. +[6] Peter Burgisser, Cole Franks, Ankit Garg, Rafael Oliveira, Michael Walter, and Avi Wigderson. Efficient algorithms for tensor scaling, quantum marginals, and moment polytopes. In 2018 IEEE 59th Annual Symposium on Foundations of Computer Science (FOCS), pages 883-897. IEEE, 2018. +[7] Peter Burgisser, Cole Franks, Ankit Garg, Rafael Oliveira, Michael Walter, and Avi Wigderson. Towards a theory of non-commutative optimization: geodesic first and second order methods for moment maps and polytopes. arXiv preprint arXiv:1910.12375, 2019. +[8] Peter Burgisser, Ankit Garg, Rafael Oliveira, Michael Walter, and Avi Wigderson. Alternating minimization, scaling algorithms, and the null-cone problem from invariant theory. arXiv preprint arXiv:1711.08039, 2017. + +[9] Léopold Cambier and P-A Absil. Robust low-rank matrix completion by riemannian optimization. SIAM Journal on Scientific Computing, 38(5):S440-S460, 2016. +[10] James W Cannon, William J Floyd, Richard Kenyon, Walter R Parry, et al. Hyperbolic geometry. Flavors of geometry, 31:59-115, 1997. +[11] Anoop Cherian and Suvrit Sra. Riemannian dictionary learning and sparse coding for positive definite matrices. IEEE transactions on neural networks and learning systems, 28(12):2859-2871, 2016. +[12] Christopher Criscitiello and Nicolas Boumal. Efficiently escaping saddle points on manifolds. In Advances in Neural Information Processing Systems, pages 5987-5997, 2019. +[13] Olivier Devolder, François Glineur, Yurii Nesterov, et al. First-order methods with inexact oracle: the strongly convex case. CORE Discussion Papers, 2013016:47, 2013. +[14] Alan Edelman, Tomás A Arias, and Steven T Smith. The geometry of algorithms with orthogonality constraints. SIAM journal on Matrix Analysis and Applications, 20(2):303-353, 1998. +[15] Ricardo Ferreira and Joao Xavier. Hessian of the riemannian squared distance function on connected locally symmetric spaces with applications. In Controlo 2006, 7th Portuguese conference on automatic control, volume 2. CiteSeer, 2006. +[16] Cole Franks and Ankur Moitra. Rigorous guarantees for tyler's m-estimator via quantum expansion. arXiv preprint arXiv:2002.00071, 2020. +[17] Ankit Garg, Leonid Gurvits, Rafael Oliveira, and Avi Wigderson. Algorithmic and optimization aspects of brascamp-lieb inequalities, via operator scaling. Geometric and Functional Analysis, 28(1):100-145, 2018. +[18] Reshad Hosseini and Suvrit Sra. Matrix manifold optimization for gaussian mixtures. Advances in Neural Information Processing Systems, 28:910-918, 2015. +[19] Svante Janson. Euclidean, spherical and hyperbolic trigonometry. Notes, 2015. +[20] Hiroyuki Kasai, Pratik Jawanpuria, and Bamdev Mishra. Riemannian adaptive stochastic gradient algorithms on matrix manifolds. 97:3262-3271, 2019. +[21] Masoud Badiei Khuzani and Na Li. Stochastic primal-dual method on riemannian manifolds of bounded sectional curvature. In 2017 16th IEEE International Conference on Machine Learning and Applications (ICMLA), pages 133-140. IEEE, 2017. +[22] Eryk Kopczyński, Dorota Celinska, and Marek Črnáct. Hyperrogue: Playing with hyperbolic geometry. In David Swart, Carlo H. Séquin, and Kristóf Fenyvesi, editors, Proceedings of Bridges 2017: Mathematics, Art, Music, Architecture, Education, Culture, pages 9–16, Phoenix, Arizona, 2017. Tessellations Publishing. +[23] David Martinez-Rubio. Acceleration in hyperbolic and spherical spaces. arXiv preprint arXiv:2012.03618, 2020. +[24] Yurii Nesterov. Introductory lectures on convex optimization: A basic course, volume 87. Springer Science & Business Media, 2013. +[25] Hiroyuki Sato, Hiroyuki Kasai, and Bamdev Mishra. Riemannian stochastic variance reduced gradient algorithm with retraction and vector transport. SIAM Journal on Optimization, 29(2):1444-1472, 2019. +[26] Ju Sun, Qing Qu, and John Wright. Complete dictionary recovery over the sphere ii: Recovery by riemannian trust-region method. IEEE Transactions on Information Theory, 63(2):885-914, 2016. +[27] Yue Sun, Nicolas Flammarion, and Maryam Fazel. Escaping from saddle points on riemannian manifolds. In Advances in Neural Information Processing Systems, pages 7276-7286, 2019. +[28] Mingkui Tan, Ivor W Tsang, Li Wang, Bart Vandereycken, and Sinno Jialin Pan. Riemannian pursuit for big matrix recovery. In International Conference on Machine Learning, pages 1539-1547, 2014. +[29] Tiffany M Tang and Genevera I Allen. Integrated principal components analysis. arXiv preprint arXiv:1810.00832, 2018. + +[30] Nilesh Tripuraneni, Nicolas Flammarion, Francis Bach, and Michael I Jordan. Averaging stochastic gradient descent on riemannian manifolds. pages 650-687, 2018. +[31] Constantin Udriste. Convex functions and optimization methods on Riemannian manifolds, volume 297. Springer Science & Business Media, 2013. +[32] user1952770. Geodesic convexity and the geometric hessian. Available online at https://mathoverflow.net/q/356224. +[33] Bart Vandereycken. Low-rank matrix completion by riemannian optimization. SIAM Journal on Optimization, 23(2):1214-1236, 2013. +[34] Melanie Weber and Suvrit Sra. Nonconvex stochastic optimization on manifolds via riemannian frank-wolfe methods. arXiv preprint arXiv:1910.04194, 2019. +[35] Ami Wiesel and Teng Zhang. Structured robust covariance estimation. Now Foundations and Trends, 2015. +[36] Hongyi Zhang, Sashank J Reddi, and Suvrit Sra. Riemannian svrg: Fast stochastic optimization on riemannian manifolds. Advances in Neural Information Processing Systems, 29:4592-4600, 2016. +[37] Hongyi Zhang and Suvrit Sra. First-order methods for geodesically convex optimization. In Conference on Learning Theory, pages 1617-1638, 2016. +[38] Hongyi Zhang and Suvrit Sra. An estimate sequence for geodesically convex optimization. In Conference On Learning Theory, pages 1703-1723, 2018. +[39] Teng Zhang. Robust subspace recovery by geodesically convex optimization. arXiv preprint arXiv:1206.1386, 60(11):5597-5625, 2012. + +# Checklist + +1. For all authors... + +(a) Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope? [Yes] We include complete proofs of the promised lower bounds for geodesically convex optimization. +(b) Did you describe the limitations of your work? [Yes] We emphasized both the necessity of noise in our lower bound, as well as the rationale for why some noise, perhaps due to machine precision, is natural in most practical settings. +(c) Did you discuss any potential negative societal impacts of your work? [N/A] The main results of the paper are a lower bound for a class of algorithms. Since we do not give new algorithms, nor give new applications of existing ones, it does not seem like there could be any direct negative impacts of our owrk. +(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] + +2. If you are including theoretical results... + +(a) Did you state the full set of assumptions of all theoretical results? [Yes] We fully explained all the assumptions we make in our lower bound. We also gave examples showing their necessity. +(b) Did you include complete proofs of all theoretical results? [Yes] The proofs are short and simple and fit within the main body of the submission. + +3. If you ran experiments... + +(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [N/A] +(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [N/A] +(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [N/A] +(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [N/A] + +4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... + +(a) If your work uses existing assets, did you cite the creators? [N/A] +(b) Did you mention the license of the assets? [N/A] +(c) Did you include any new assets either in the supplemental material or as a URL? [N/A] + +(d) Did you discuss whether and how consent was obtained from people whose data you're using/curating? [N/A] +(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] + +5. If you used crowdsourcing or conducted research with human subjects... + +(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] +(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] +(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] \ No newline at end of file diff --git a/anogotheoremforrobustaccelerationinthehyperbolicplane/images.zip b/anogotheoremforrobustaccelerationinthehyperbolicplane/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..f89237acf2637477366dd957dc7f0cf8c5ea1e4c --- /dev/null +++ b/anogotheoremforrobustaccelerationinthehyperbolicplane/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:30da6ee86e928d91e1c6f5f12acef1c28d16ce51e2b2b3eba4addb93af1c72d0 +size 127407 diff --git a/anogotheoremforrobustaccelerationinthehyperbolicplane/layout.json b/anogotheoremforrobustaccelerationinthehyperbolicplane/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..d311143ddaa93ab2c0b2b2d9c963dd2e9f7cf39b --- /dev/null +++ b/anogotheoremforrobustaccelerationinthehyperbolicplane/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:39d3005b0fd7634772fcbeaa4339a39f87093e53d33aa1a754268b2652a90947 +size 463724 diff --git a/anoncommutativeextensionofleeseungsalgorithmforpositivesemidefinitefactorizations/b9e3dbcd-6bc6-4eb8-8eac-187c7de9d79d_content_list.json b/anoncommutativeextensionofleeseungsalgorithmforpositivesemidefinitefactorizations/b9e3dbcd-6bc6-4eb8-8eac-187c7de9d79d_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..ab0d2cee78d85963d672ef3751bad34550fb5f4e --- /dev/null +++ b/anoncommutativeextensionofleeseungsalgorithmforpositivesemidefinitefactorizations/b9e3dbcd-6bc6-4eb8-8eac-187c7de9d79d_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0dfbab25095cee5a2e1fb2aaed0d56d22477f1c1f94cc73204e99f0902288c13 +size 92143 diff --git a/anoncommutativeextensionofleeseungsalgorithmforpositivesemidefinitefactorizations/b9e3dbcd-6bc6-4eb8-8eac-187c7de9d79d_model.json b/anoncommutativeextensionofleeseungsalgorithmforpositivesemidefinitefactorizations/b9e3dbcd-6bc6-4eb8-8eac-187c7de9d79d_model.json new file mode 100644 index 0000000000000000000000000000000000000000..333c45fea426fcf8badc30302fdbbb57311451ad --- /dev/null +++ b/anoncommutativeextensionofleeseungsalgorithmforpositivesemidefinitefactorizations/b9e3dbcd-6bc6-4eb8-8eac-187c7de9d79d_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e3eccc3a43ae449e6b7c197a285f47777b7aec71a9b982522693f21f214a9c4 +size 107785 diff --git a/anoncommutativeextensionofleeseungsalgorithmforpositivesemidefinitefactorizations/b9e3dbcd-6bc6-4eb8-8eac-187c7de9d79d_origin.pdf b/anoncommutativeextensionofleeseungsalgorithmforpositivesemidefinitefactorizations/b9e3dbcd-6bc6-4eb8-8eac-187c7de9d79d_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7e954389d073fc69dc0e8cc10e04b04bac0f30ee --- /dev/null +++ b/anoncommutativeextensionofleeseungsalgorithmforpositivesemidefinitefactorizations/b9e3dbcd-6bc6-4eb8-8eac-187c7de9d79d_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7698194f4f18d9bc711ba8239a074c57790bf14456c09c280c0095bee23412f4 +size 473668 diff --git a/anoncommutativeextensionofleeseungsalgorithmforpositivesemidefinitefactorizations/full.md b/anoncommutativeextensionofleeseungsalgorithmforpositivesemidefinitefactorizations/full.md new file mode 100644 index 0000000000000000000000000000000000000000..5dcf3af4edb2a3c4875a80f8ff132aca122e6e0b --- /dev/null +++ b/anoncommutativeextensionofleeseungsalgorithmforpositivesemidefinitefactorizations/full.md @@ -0,0 +1,467 @@ +# A Non-commutative Extension of Lee-Seung's Algorithm for Positive Semidefinite Factorizations + +Yong Sheng Soh + +Department of Mathematics + +National University of Singapore + +10 Lower Kent Ridge Road, Singapore 119076 + +and + +Institute of High Performance Computing + +1 Fusionopolis Way, #16-16 Connexis, Singapore 138632 + +matsys@nus.edu.sg + +Antonios Varvitsiotis + +Engineering and Systems Design Pillar + +Singapore University of Technology and Design + +8 Somapah Road, Singapore 487372 + +avarvits@gmail.com + +# Abstract + +Given a data matrix $X \in \mathbb{R}_{+}^{m \times n}$ with non-negative entries, a Positive Semidefinite (PSD) factorization of $X$ is a collection of $r \times r$ -dimensional PSD matrices $\{A_i\}$ and $\{B_j\}$ satisfying the condition $X_{ij} = \operatorname{tr}(A_i B_j)$ for all $i \in [m]$ , $j \in [n]$ . PSD factorizations are fundamentally linked to understanding the expressiveness of semidefinite programs as well as the power and limitations of quantum resources in information theory. The PSD factorization task generalizes the Nonnegative Matrix Factorization (NMF) problem in which we seek a collection of $r$ -dimensional non-negative vectors $\{a_i\}$ and $\{b_j\}$ satisfying $X_{ij} = a_i^T b_j$ , for all $i \in [m]$ , $j \in [n]$ - one can recover the latter problem by choosing matrices in the PSD factorization to be diagonal. The most widely used algorithm for computing NMFs of a matrix is the Multiplicative Update algorithm developed by Lee and Seung, in which non-negativity of the updates is preserved by scaling with positive diagonal matrices. In this paper, we describe a non-commutative extension of Lee-Seung's algorithm, which we call the Matrix Multiplicative Update (MMU) algorithm, for computing PSD factorizations. The MMU algorithm ensures that updates remain PSD by congruence scaling with the matrix geometric mean of appropriate PSD matrices, and it retains the simplicity of implementation that the multiplicative update algorithm for NMF enjoys. Building on the Majorization-Minimization framework, we show that under our update scheme the squared loss objective is non-increasing and fixed points correspond to critical points. The analysis relies on Lieb's Concavity Theorem. Beyond PSD factorizations, we show that the MMU algorithm can be also used as a primitive to calculate block-diagonal PSD factorizations and tensor PSD factorizations. We demonstrate the utility of our method with experiments on real and synthetic data. + +# 1 Introduction + +Let $X \in \mathbb{R}_+^{m \times n}$ be a $m \times n$ dimensional matrix with non-negative entries and $r \in \mathbb{N}$ a user-specified parameter. An $r$ -dimensional positive semidefinite (PSD) factorization of $X$ is given by two families of $r \times r$ PSD matrices $A_1, \ldots, A_m$ and $B_1, \ldots, B_n$ satisfying + +$$ +X _ {i j} = \operatorname {t r} \left(A _ {i} B _ {j}\right), i \in [ m ], j \in [ n ]. \tag {1} +$$ + +Every non-negative matrix admits an $r$ -dimensional PSD factorization for an appropriate value of $r \in \mathbb{N}$ - we may, for instance, take $A_{i} = \mathrm{diag}(X_{i:})$ and $B_{j} = \mathrm{diag}(e_{j})$ , a choice that corresponds to an $n$ -dimensional PSD factorization. The smallest $r \in \mathbb{N}$ for which $X$ admits an $r$ -dimensional PSD factorization is called the PSD-rank [6]. + +PSD factorizations are of fundamental importance to a wide range of areas, most notably towards understanding the expressive power of linear optimization over the cone of positive semidefinite matrices, [9, 12], studying the power and limitations of quantum resources within the framework of information theory [9, 15], and as a natural non-commutative generalization of the extremely popular dimensionality reduction technique of non-negative matrix factorizations (NMFs) [23, 24, 30]. We elaborate further on the relevance of PSD factorizations to each of these areas below. + +Links to Semidefinite Programming. A Semidefinite Program (SDP) is a convex optimization problem in which we minimize a linear function over the set of PSD matrices intersected with an affine subspace. SDPs are a powerful generalization of Linear Programs with extensive modeling power and tractable algorithms for solving them, e.g., see [36] and references therein. SDPs are frequently used as convex relaxations to combinatorial problems, and have many important applications including optimal power flow computation [21], robustness certification to adversarial examples in neural networks [31], and inference in graphical models [5]. + +Given a bounded polytope $P = \{x \in \mathbb{R}^d : c_i^\top x \leq d_i, i \in [\ell]\} = \mathrm{conv}(v_1,.., v_k)$ , a basic question concerning the expressive power of SDPs is to find the smallest possible SDP description of $P$ , i.e., the minimum $r \in \mathbb{N}$ for which we can express $P$ as the projection of an affine slice of the cone of $r \times r$ PSD matrices. Concretely, the goal in this setting is to express $P$ as: + +$$ +P = \pi \left(\mathbb {S} _ {+} ^ {r} \cap \mathscr {L}\right), \tag {2} +$$ + +where $\mathbb{S}_+^r$ is the cone of $r\times r$ PSD matrices, $\mathcal{L}$ is an affine subspace of the space of $r\times r$ symmetric matrices and $\pi$ a linear projection from the space of $r\times r$ symmetric matrices to $\mathbb{R}^d$ . A representation of the form (2) is called an extended formulation or PSD-lift of $P$ and is extremely useful for optimization purposes. Indeed, the existence of a PSD-lift immediately implies that $\min \{\langle c,x\rangle :x\in P\} = \min \{\langle \pi^\top (c),y\rangle :y\in \mathbb{S}_+^r\cap \mathcal{L}\}$ , and consequently, linear optimization over $P$ (which can be hard) corresponds to an SDP (which can be solved efficiently). + +To describe the connection of PSD factorizations with SDP-lifts, let $S_P$ be the slack matrix of $P$ , namely, $S_P$ is a rectangular matrix whose rows are indexed by the facets of $P$ , its columns indexed by extreme points $v_j$ , and the $ij$ -entry of $S_P$ corresponds to the slack between the $i$ -th facet and the $j$ -th vertex, $S_{ij} = d_i - c_i^\top v_j$ . Generalizing a seminal result by Yannakakis for LPs [38], it was shown independently in [9] and [12] that if $S_P$ admits an $r$ -dimensional PSD factorization, the polytope $P$ admits a PSD-lift over the cone of $r \times r$ PSD matrices. The proof is also constructive – given a PSD factorization of $S$ , there is an explicit description of $\mathcal{L}$ and $\pi$ that gives rise to $P$ . + +An important special case of the PSD factorization problem is when the PSD factors are block-diagonal PSD matrices, where both the number of blocks and the size of each block is fixed, i.e., $A_{i}, B_{j} \in (\mathbb{S}_{+}^{r})^{k}$ . For a fixed and user-specified $r \in \mathbb{N}$ , the least $k \in \mathbb{N}$ for which $X \in \mathbb{R}_{+}^{m \times n}$ admits a PSD factorization with PSD-factors in $(\mathbb{S}_{+}^{r})^{k}$ is called the $r$ -block diagonal PSD-rank of $X$ . In terms of the geometric interpretation of PSD factorizations, block-diagonal PSD factorizations of the slack matrix $S_{P}$ correspond to extended formulations of $P$ over a Cartesian product of PSD cones, i.e., $P = \pi((\mathbb{S}_{+}^{r})^{k} \cap \mathcal{L})$ . In terms of relevance to optimization, extended formulations over $(\mathbb{S}_{+}^{r})^{k}$ allow to perform linear optimization over $P$ by solving block-diagonal SDPs, which can be solved numerically much faster compared to dense SDPs. In fact, most interior-point algorithms for SDPs are designed to exploit block-diagonal structure if it is present in the problem. The first systematic study of block-diagonal PSD-lifts was given in [7], where the focus was mainly on lower bounds. + +Links to quantum information theory. Consider two parties, Alice and Bob, that try to generate samples $(i,j)$ following some joint distribution $P(i,j)$ . For this section, it is crucial to think of the distribution $P(i,j)$ as being arranged in an entrywise non-negative matrix, and we use $P$ to simultaneously refer to both the distribution and its matrix representation. Clearly, if $P$ is not a product distribution, Alice and Bob should either communicate or share some common information to be able to generate samples according to $P$ . In the correlation generation problem, the goal is to find the least amount of shared resources that are needed to achieve this task. The considered resources can be either classical (shared randomness), quantum (shared entangled state) or hybrid. + +In the quantum case, correlation generation boils down to finding a quantum state $\rho \in \mathbb{S}_{+}^{r^2}$ with $\mathrm{tr}(\rho) = 1$ and quantum measurements $E_{i},F_{j}$ (i.e., $E_{i},F_{j}\in \mathbb{S}_{+}^{r}$ and $\sum_{i}E_{i} = \sum_{j}F_{j} = I$ ) such that + +$$ +P (i, j) = \operatorname {t r} \left(\left(E _ {i} \otimes F _ {j}\right) \rho\right), i \in [ m ], j \in [ n ]. \tag {3} +$$ + +The least $r \in \mathbb{N}$ for which a factorization of the form (3) is possible is given by the (logarithm) of the psd-rank of the matrix $P$ [15]. Moreover, the proof of [15] is constructive, in the sense that, given a $r$ -dimensional PSD factorization of $P$ , there is an explicit description of a quantum state $\rho \in \mathbb{S}_{+}^{r^2}$ and measurement operators acting on $\mathbb{C}^r$ that satisfy (3), e.g., see [6, Proposition 3.8]. + +Moving beyond purely quantum protocols, there has been recent interest in hybrid classical-quantum protocols, motivated by the fact that near-term quantum devices can only operate reliably on a limited number of qubits [26]. Specifically, assuming that their quantum capabilities are limited to manipulating $s$ qubits, hybrid classical-quantum protocols that allow to generate samples from a joint distribution $P(i,j)$ , correspond to PSD factorizations of $P$ where the PSD factors are block-diagonal, with block-size at most $2^{s}$ . Moreover, the minimum amount of classical resources required in a classical-quantum protocol with $s$ qubits, is given by the $2^{s}$ -block diagonal PSD-rank of $P$ . + +Links to nonnegative matrix factorizations. An $r$ -dimensional nonnegative matrix factorization (NMF) of $X \in \mathbb{R}_+^{m \times n}$ [23, 30] is specified by two families of $r$ -dimensional entrywise nonnegative vectors $a_1, \ldots, a_m \in \mathbb{R}_+^r$ and $b_1, \ldots, b_n \in \mathbb{R}_+^r$ satisfying + +$$ +X _ {i j} = \left\langle a _ {i}, b _ {j} \right\rangle , i \in [ m ], j \in [ n ]. \tag {4} +$$ + +NMF is a widely used dimensionality reduction tool that gives parts-based representation of the input data, as it only allows for additive, not subtractive, combinations. To make this point clear, note that an equivalent reformulation of an $r$ -dimensional NMF (4) is $X = AB$ where $A \in \mathbb{R}_{+}^{m \times r}$ is the matrix whose rows are the $a_{i}$ 's and the matrix $B \in \mathbb{R}_{+}^{r \times n}$ has as columns the $b_{j}$ 's, or equivalently, + +$$ +X _ {: j} \in \operatorname {c o n e} \left(A _ {: 1}, \dots , A _ {: r}\right), j \in [ n ]. \tag {5} +$$ + +The equivalent viewpoint for NMFs given in (5) is more amenable to interpretation, as it gives a representation of each column of $X$ (i.e., each data point) as nonnegative (and thus additive) combination of the $r$ columns of $A$ , and the columns of $B$ give the coefficients of the conic combination. NMF factorizations have applications in many areas, notable examples including document clustering [37], music analysis [8], speech-source separation [32] and cancer-class identification [10]. For a comprehensive discussion on NMFs the reader is referred to the survey [11] and references therein. + +NMF factorizations are a special case of PSD factorizations where the $r \times r$ PSD matrices $A_{i}$ and $B_{j}$ are diagonal, i.e., we have that $A_{i} = \mathrm{diag}(a_{i})$ and $B_{j} = \mathrm{diag}(b_{j})$ for some vectors $a_{i}, b_{j} \in \mathbb{R}_{+}^{r}$ (recall that a diagonal matrix is PSD iff its diagonal entries are nonnegative). Moreover, a PSD factorization of $X$ , $X_{ij} = \mathrm{tr}(A_{i}B_{j})$ , for which all the PSD factors $A_{i}, B_{j}$ commute corresponds to an NMF factorization. In this sense, PSD factorizations are a non-commutative generalization of NMF factorizations. + +Interpretability of PSD factorizations. An equivalent way to define an $r$ -dimensional NMF for a data matrix $X$ (cf. (4)) is through the existence of a liner mapping $\mathcal{A}:\mathbb{R}^r\to \mathbb{R}^m$ satisfying + +$$ +X _ {: j} \in \mathcal {A} \left(\mathbb {R} _ {+} ^ {r}\right) \text {f o r a l l} j \in [ n ] \quad \text {a n d} \quad \mathcal {A} \left(\mathbb {R} _ {+} ^ {r}\right) \subseteq \mathbb {R} _ {+} ^ {n}. \tag {6} +$$ + +Consequently, the mapping $\mathcal{A}$ (or rather, the image of the extreme rays of the cone $\mathbb{R}_+^r$ under $\mathcal{A}$ ), describe a latent space that can generate all data points $X_{:j}$ via nonnegative combinations. + +Analogously, in the setting of PSD factorizations, the existence of an $r$ -dimensional PSD factorization of $X$ (cf. (1)) is equivalent to the existence of a linear mapping $\mathcal{A}:\mathbb{S}^r\to \mathbb{R}^m$ satisfying + +$$ +X _ {: j} \in \mathcal {A} \left(\mathbb {S} _ {+} ^ {r}\right) \text {f o r a l l} j \in [ n ] \quad \text {a n d} \quad \mathcal {A} \left(\mathbb {S} _ {+} ^ {r}\right) \subseteq \mathbb {R} _ {+} ^ {n}. \tag {7} +$$ + +Comparing (6) and (7), the difference between NMF and PSD factorizations is immediately apparent. In the setting of PSD factorizations the latent space is infinite-dimensional, and specifically, it is the image of the extreme rays of the cone of $r \times r$ PSD matrices (i.e., all matrices $uu^{\top}$ where $u \in \mathbb{R}^r$ ) under $\mathcal{A}$ . In this latent space, each data point $X_{:j}$ is represented by a PSD matrix $B_j \in \mathbb{S}_+^r$ , and using its spectral decomposition $B_j = \sum_{i=1}^{r} \lambda_i u_i u_i^\top$ , leads to the representation $X_{:j} = \sum_{i} \lambda_i \mathcal{A}(u_i u_i^\top)$ . Additional details and explicit examples demonstrating the qualitative difference in expressive power between NMF and PSD factorizations are given in Section 6. + +# 2 Prior Works on PSD Factorizations and Summary of Results + +A canonical starting point for finding an (approximate) $r$ -dimensional PSD factorization of a given matrix $X \in \mathbb{R}_+^{m \times n}$ is to solve the non-convex optimization problem + +$$ +\inf \sum_ {i, j} \left(X _ {i j} - \operatorname {t r} \left(A _ {i} B _ {j}\right)\right) ^ {2} \quad \text {s . t .} \quad A _ {1}, \dots , A _ {m}, B _ {1}, \dots B _ {n} \in \mathbb {S} _ {+} ^ {r}, \tag {8} +$$ + +aiming to find an approximate $r$ -dimensional PSD factorization that minimizes the square loss over all entries of $X$ . Fixing one of the two families of matrix variables, say the $A_{i}$ 's, problem (8) is separable with respect to $B_{1},\ldots ,B_{m}$ . Consequently, a reasonable solution approach for (8) is to alternate between updating the $A_{i}$ 's and $B_{j}$ 's by solving the sub-problems: + +$$ +A _ {i} \leftarrow \arg \inf \sum_ {i, j} \left(X _ {i j} - \operatorname {t r} \left(A _ {i} B _ {j}\right)\right) ^ {2} \quad \text {s . t .} \quad A _ {1}, \dots , A _ {m} \in \mathbb {S} _ {+} ^ {r} \tag {9} +$$ + +$$ +B _ {j} \leftarrow \arg \inf \sum_ {i, j} \left(X _ {i j} - \operatorname {t r} \left(A _ {i} B _ {j}\right)\right) ^ {2} \quad \text {s . t .} \quad B _ {1}, \dots , B _ {n} \in \mathbb {S} _ {+} ^ {r} \tag {10} +$$ + +The two sub-problems in each update step are symmetric in the variables $A_{i}$ and $B_{j}$ , with the small modification where we replace $X$ with its transpose. As such, for the remainder of this discussion, we only focus on the sub-problem (10) corresponding to fixing the $A_{i}$ 's and updating the $B_{j}$ 's. Moreover, (10) is separable with respect to each variable $B_{i}$ , so it suffices to focus on + +$$ +\inf \sum_ {i} \left(X _ {i j} - \operatorname {t r} \left(A _ {i} B _ {j}\right)\right) ^ {2} \quad \text {s . t .} \quad B _ {j} \in \mathbb {S} _ {+} ^ {r}. \tag {11} +$$ + +Lastly, to simplify notation we omit subscripts, and specifically, we denote by $x$ the $j$ -th column of $X$ and by $B$ the PSD matrix variable $B_{j}$ . Defining $\mathcal{A}:\mathbb{S}^r\to \mathbb{R}^m$ to be the linear map $\mathcal{A}(Z) = (\langle A_1,Z\rangle ,\ldots ,\langle A_m,Z\rangle)$ , problem (11) can be then equivalently written as + +$$ +\inf \| x - \mathcal {A} (B) \| _ {2} ^ {2} \quad \text {s . t .} \quad B \in \mathbb {S} _ {+} ^ {r}. \tag {12} +$$ + +The optimization problem (12) is convex, and in fact, falls within the well-studied class of convex quadratic SDPs. Nevertheless, there is no closed-form solution for this family of optimization problems, and consequently, typical solution strategies rely on numerical optimization, e.g., see [33]. + +Summary of results. In this paper we introduce and study an iterative algorithm (Algorithm 1) we call the Matrix Multiplicative Update (MMU) algorithm for computing PSD factorizations. The MMU algorithm builds on the Majorization-Minimization framework, and as discussed in the previous section, the main workhorse is an iterative algorithm for the convex quadratic SDP (12). + +From a computational perspective, the iterates of the MMU algorithm are updated via conjugation with appropriately defined matrices, so our method has the advantage of being simple to implement and moreover, the PSDness of the iterates is automatically guaranteed. From a theoretical perspective, the squared loss objective is non-increasing along the algorithms' trajectories (Theorem 1) and moreover, its fixed points satisfy the first-order optimality conditions (Theorem 2). The analysis of the MMU algorithm relies on the use of several operator trace inequalities (including Von Neumann's trace inequality and Lieb's Concavity Theorem). + +An important feature of the MMU algorithm is that if it is initialized with block-diagonal PSD matrices, the same block-diagonal structure is preserved throughout its execution, which leads to an algorithm for calculating block-diagonal PSD factorizations. In particular, if the MMU algorithm + +is initialized with diagonal PSD matrices, the iterates remain diagonal PSD throughout, and as it turns out, our algorithm in this case reduces to Lee-Seung's seminal Multiplicative Update algorithm for computing NMFs [24]. Moreover, we show how the MMU algorithm can be used as a primitive to calculate PSD factorizations of nonnegative tensors. In terms of numerical experiments, we demonstrate the utility of our method for both synthetic and real data (CBCL image dataset). + +Existing work. All existing algorithms for computing PSD factorizations employ the alternating minimization approach described in the previous section, where we fix one set of variables and minimize over the other, and essentially boil down into finding algorithms for the convex problem (12). + +Projected Gradient Method (PGM). The first approach for computing PSD factorizations is based on applying PGM to (12), alternating between a gradient step to minimize the objective and a projection step onto the set of PSD matrices [35]. The latter projection step uses the following useful fact: Given the spectral decomposition $C = U\mathrm{diag}(\lambda_i)U^\top$ of a matrix $C\in \mathbb{S}^n$ , the projection onto the PSD cone is $U\mathrm{diag}(\max (0,\lambda_i))U^\top$ [13]. The vanilla PGM has slow convergence rate, so the authors in [35] also propose an accelerated variant that incorporates a momentum term. + +Coordinate Descent. The authors in [35] also propose a different algorithm combining the ideas of coordinate descent and a change of variables that allows them to also control the rank of the PSD factors, which was popularized by the seminal work of Burer and Monteiro for solving rank-constrained SDPs [3]. Concretely, the authors use the parameterization $A_{i} = a_{i}a_{i}^{\top}$ , and $B_{j} = b_{j}b_{j}^{\top}$ where $a_{i}\in \mathbb{R}^{r\times r_{A_{i}}}$ , and $b_{j}\in \mathbb{R}^{r\times r_{B_{j}}}$ for some fixed $r_{A_i},r_{B_j}\in \mathbb{N}$ , and optimize using a coordinate descent scheme over the entries of the matrices $a_{i}$ and $b_{j}$ . In this setting, problem (12) is a quartic polynomial in the entries of $b$ . Thus, its gradient is a cubic polynomial, and its roots can be found using Cardano's method and careful book-keeping (for a similar approach see also [27]). + +Connections to Affine Rank Minimization and Phase Retrieval. A different set of algorithms developed in [17, 18, 19] is based on the connections between computing PSD factorizations with the affine rank minimization (ARM) and the phase retrieval (PR) in signal processing. First, recall that the PSD-ARM problem focuses on recovering a low-rank matrix from affine measurements: + +$$ +\begin{array}{l l} \min & \operatorname {r a n k} (B) \quad \text {s . t .} \quad \mathcal {A} (B) = x, B \in \mathbb {S} _ {+} ^ {r}. \end{array} +$$ + +Here, $\mathcal{A}$ is a known linear map representing measurements while $x$ is known vector of observations. Due to the non-convexity of the rank function, a useful heuristic initially popularized in the control community is to replace the rank by the trace function, e.g., see [28] and [29], in which case the resulting problem is an instance of an SDP. A different heuristic for PSD-ARM is to find a PSD matrix of rank at most $k$ that minimizes the squared loss function, i.e., + +$$ +\inf \| x - \mathcal {A} (B) \| _ {2} ^ {2} \quad \text {s . t .} \quad B \in \mathbb {S} _ {+} ^ {r}, \operatorname {r a n k} (B) \leq k, \tag {13} +$$ + +where alternatively, the rank constraint can be enforced by parametrizing the PSD matrix variable $B \in \mathbb{S}_+^r$ as $B = bb^\top$ with $b \in \mathbb{R}^{r \times k}$ . The point of departure for the works [17, 18, 19] is that problem (13) corresponds exactly to the sub-problem (12) encountered in any alternate minimization strategy for computing PSD factorizations, albeit with an additional rank constraint. In view of this, any algorithm from the signal processing literature developed for ARM can be applied to (12). + +The main algorithms considered in [17, 18, 19] are Singular Value Projection (SVP) [14], Procrustes Flow [34], and variants thereof. In terms of convergence guarantees, for affine maps $\mathcal{A}$ obeying the Restricted Isometry Property [4], both algorithms converge to an optimal solution. Nevertheless, it is unclear whether these guarantees carry over when applied to the PSD factorization problem. + +Roadmap. In Section 3 we derive our MMU algorithm for computing PSD factorizations and in Section 4 we show that its fixed points correspond to KKT points. In Section 5 we give various theoretical applications of the MMU algorithm and in Section 6 we go from theory to practise and apply the MMU algorithm to synthetic and real datasets. + +# 3 A Matrix Multiplicative Update Algorithm for PSD Factorizations + +In this section we describe our algorithm for computing (approximate) PSD factorizations of a matrix $X$ . As we discussed, our method is an alternating minimization approach in which we alternate + +between optimizing over the variables $\{A_i\}$ and $\{B_j\}$ . The sub-problem in each update step is symmetric in the variables $\{A_i\}$ and $\{B_j\}$ , with the small modification whereby we replace $X$ with its transpose. As such, in the remainder of this discussion, we assume that the variables $\{A_i\}$ are fixed and we perform the update on the variables $\{B_j\}$ . The resulting sub-problem is given by (12). + +Majorization-Minimization (MM) Framework. Our algorithm is an instance of the (MM) framework, e.g. see [20] and references therein. To briefly describe this approach, suppose we need to solve the optimization problem $\min \{F(x):x\in \mathcal{X}\}$ . The MM framework relies on the existence of a parametrized family of auxiliary functions $u_{x}:\mathcal{X}\to \mathbb{R}$ , one for each $x\in \mathcal{X}$ , where: + +$$ +F (y) \leq u _ {x} (y), \text {f o r a l l} y \in \mathcal {X} \text {a n d} F (x) = u _ {x} (x). \tag {14} +$$ + +Based on these two properties, $F$ is nonincreasing under the update rule: + +$$ +x ^ {\text {n e w}} = \operatorname {a r g m i n} \left\{u _ {x ^ {\text {o l d}}} (y): y \in \mathcal {X} \right\}, \tag {15} +$$ + +as can be easily seen by: $F(x^{\mathrm{new}}) \leq u_{x^{\mathrm{old}}} (x^{\mathrm{new}}) \leq u_{x^{\mathrm{old}}} (x^{\mathrm{old}}) = F(x^{\mathrm{old}})$ . + +We conclude with two important remarks concerning the MM framework. First, note that although the iterates generated by the MM update rule (23) are nonincreasing in objective function value, there is in general no guarantee that they converge to a minimizer. Secondly, for the MM approach to be of any use, the auxiliary functions employed at each iteration need to be easy to optimize. + +Matrix Geometric Mean. Our choice of auxiliary functions relies on the well-studied notion of a geometric mean between a pair of positive definite matrices, whose definition we recall next. For additional details and omitted proofs the reader is referred to [2, 22]. The matrix geometric mean of two positive definite matrices $C$ and $D$ is given by + +$$ +C \# D = C ^ {1 / 2} \left(C ^ {- 1 / 2} D C ^ {- 1 / 2}\right) ^ {1 / 2} C ^ {1 / 2}, \tag {16} +$$ + +or equivalently, it is the unique positive definite solution of the Riccati equation + +$$ +X C ^ {- 1} X = D, \tag {17} +$$ + +in the matrix variable $X$ . The matrix geometric mean also has a nice geometric interpretation in terms of the Riemannian geometry of the manifold of positive definite matrices, and specifically, $C\# D$ is the midpoint of the unique geodesic joining $C$ and $D$ . Finally, the matrix geometric mean is symmetric in its two arguments $C\# D = D\# C$ and also satisfies $(C\# D)^{-1} = C^{-1}\# D^{-1}$ . + +The MMU Algorithm for PSD Factorizations. The main step for deriving our algorithm for approximately computing PSD factorizations is to apply the MM framework, with a meticulously chosen auxiliary function, to the convex quadratic SDP (12). Our main result is the following: + +Theorem 1. Consider a fixed vector $x \in \mathbb{R}_{+}^{m}$ and let $\mathcal{A} : \mathbb{S}^{r} \to \mathbb{R}^{m}$ be the linear map defined by $Z \mapsto \mathcal{A}(Z) = (\mathrm{tr}(A_{1}Z), \ldots, \mathrm{tr}(A_{m}Z))$ , for some fixed $r \times r$ positive definite matrices $A_{1}, \ldots, A_{m}$ . Then, the objective function $\| x - \mathcal{A}(B)\|_{2}^{2}$ is non-increasing under the update rule + +$$ +B _ {\mathrm {n e w}} = W (\mathcal {A} ^ {\top} x) W, \quad w h e r e \quad W = ([ \mathcal {A} ^ {\top} \mathcal {A} ] (B _ {\mathrm {o l d}})) ^ {- 1} \# (B _ {\mathrm {o l d}}), +$$ + +and moreover, if initialized with a positive definite matrix, the iterates remain positive definite. + +Proof. First, note that if the $A_{i}$ 's and $B_{\mathrm{old}}$ are all positive definite, the update rule is well-defined. Indeed, we have $[\mathcal{A}^\top \mathcal{A}] (B_{\mathrm{old}}) = \sum_{k=1}^{m} \operatorname{tr}(A_k B_{\mathrm{old}}) A_k$ is also positive definite, and thus invertible. + +Set $F(B)\coloneqq \| x - \mathcal{A}(B)\| _2^2$ and define the function + +$$ +u _ {B _ {\text {o l d}}} (B) := F \left(B _ {\text {o l d}}\right) + \left\langle \nabla F \left(B _ {\text {o l d}}\right), B - B _ {\text {o l d}} \right\rangle + \left\langle B - B _ {\text {o l d}}, T \left(B - B _ {\text {o l d}}\right)\right), \tag {18} +$$ + +where $T:\mathbb{S}^r\to \mathbb{S}^r$ is the operator given by + +$$ +T (Z) = W ^ {- 1} Z W ^ {- 1} \quad \text {a n d} \quad W = \left(\left[ \mathcal {A} ^ {\top} \mathcal {A} \right] \left(B _ {\text {o l d}}\right)\right) ^ {- 1} \# \left(B _ {\text {o l d}}\right). +$$ + +The claim of the theorem will follow as an immediate consequence of the MM framework, as long as we establish that $u_{B_{\mathrm{old}}}(B)$ is an auxiliary function, i.e., it satisfies the two properties given in (14). + +Clearly, we have that $u_{B_{\mathrm{old}}}(B_{\mathrm{old}}) = F(B_{\mathrm{old}})$ , so it only remains to show the domination property, that is, $u_{B_{\mathrm{old}}}(B) \leq F(B)$ , for all $B \in \mathbb{S}_+^r$ . In fact, we show a slightly stronger result, namely that + +$u_{B_{\mathrm{old}}}(B) \leq F(B)$ holds for all symmetric matrices $B \in \mathbb{S}^r$ . To see this we use the second order Taylor expansion of $F$ at $B_{\mathrm{old}}$ , which as $F$ is quadratic in $B$ , is given by + +$$ +F (B) = F \left(B _ {\text {o l d}}\right) + \left\langle \nabla F \left(B _ {\text {o l d}}\right), B - B _ {\text {o l d}} \right\rangle + \| A \left(B - B _ {\text {o l d}}\right) \| _ {2} ^ {2}. \tag {19} +$$ + +Comparing the expressions (18) and (19), to show that $F(B) \leq u_{B_{\mathrm{old}}}(B)$ for all $B \in \mathbb{S}^r$ it suffices to check that the operator $T - \mathcal{A}^\top \mathcal{A}$ is positive; i.e., $\langle Z, [T - \mathcal{A}^\top \mathcal{A}](Z) \rangle \geq 0$ for any matrix $Z \in \mathbb{S}^r$ . This claim is the main technical part of the proof, deferred to Lemma ?? in the Appendix. + +Furthermore, the fact that $T - \mathcal{A}^\top \mathcal{A}$ is a positive operator, also implies that $T$ is itself a positive operator. Consequently, the MM update (23) obtained by using the auxiliary function (18) can be calculated just by setting the gradient equal to zero, and is given by + +$$ +B _ {\text {n e w}} = B _ {\text {o l d}} - T ^ {- 1} \left(\left[ \mathcal {A} ^ {\top} \mathcal {A} \right] \left(B _ {\text {o l d}}\right) - \mathcal {A} ^ {\top} (x)\right). \tag {20} +$$ + +Moreover, as $T^{-1}(Z) = W Z W$ and $W = ([\mathcal{A}^{\top}\mathcal{A}](\mathcal{B}_{\mathrm{old}}))^{-1}\# (\mathcal{B}_{\mathrm{old}})$ it follows that + +$$ +B _ {\text {o l d}} = W \left(\left[ \mathcal {A} ^ {\top} \mathcal {A} \right] \left(B _ {\text {o l d}}\right)\right) W = T ^ {- 1} \left(\left[ \mathcal {A} ^ {\top} \mathcal {A} \right] \left(B _ {\text {o l d}}\right)\right), \tag {21} +$$ + +where for the first equality we use the unicity property of the matrix geometric mean (recall (17)). Subsequently, using (21), the MM update rule in (20) simplifies to the following: + +$$ +B _ {\text {n e w}} = T ^ {- 1} \left(\mathcal {A} ^ {\top} \mathbf {x}\right) = W \left(\mathcal {A} ^ {\top} \mathbf {x}\right) W. \tag {22} +$$ + +Lastly, since the $A_{i}$ 's are PSD, it follows that $\mathcal{A}^{\top}\mathbf{x} = \sum_{i}x_{i}A_{i}$ is a conic combination of PSD matrices (recall that $x\in \mathbb{R}_+^m$ ), and thus, it is itself PSD. Consequently, $B_{\mathrm{new}}$ is PSD. In fact, if the matrices $A_{i}$ and $B_{\mathrm{old}}$ are positive definite, the updated matrix $B_{\mathrm{new}}$ is also positive definite. + +Having established an iterative method for problem (12) that is non-increasing in value and retains PSDness, we can incorporate this as a sub-routine in our alternating optimization scheme for computing PSD factorizations. The pseudocode of the resulting method is given in Algorithm 1. + +Algorithm 1 Matrix Multiplicative Update algorithm for computing PSD factorizations +Input: A matrix $X\in \mathbb{R}_{\geq 0}^{m\times n}$ , parameter $r\in \mathbb{N}$ +Output: $\{A_1,\ldots ,A_m\} ,\{B_1,\ldots ,B_n\} \subseteq \mathbb{S}_+^r$ $X_{ij}\approx \mathrm{tr}(A_iB_j)$ for all $i,j$ while stopping criterion not satisfied: + +$$ +A _ {i} \leftarrow V _ {i} \left(\mathcal {B} ^ {\top} x _ {i}\right) V _ {i} \quad \text {w h e r e} \quad V _ {i} = \left([ \mathcal {B} ^ {\top} \mathcal {B} ] (A _ {i})\right) ^ {- 1} \# A _ {i}, \quad x _ {i} = X _ {i:} \tag {23} +$$ + +$$ +B _ {j} \leftarrow W _ {j} \left(\mathcal {A} ^ {\top} x _ {j}\right) W _ {j} \quad \text {w h e r e} \quad W _ {j} = \left([ \mathcal {A} ^ {\top} \mathcal {A} ] (B _ {j})) ^ {- 1} \# (B _ {j}), x _ {j} = X: _ {j} \right. +$$ + +# 4 Fixed Points of the MMU Algorithm + +In this section, we show that the fixed points of the MMU algorithm satisfy the Karush-Kuhn-Tucker (KKT) optimality conditions for problem (8). Letting $\{A_i^*\}_{i\in [m]},\{M_i^*\}_{i\in [m]}$ and $\{B_j^*\}_{j\in [n]},\{\Lambda_j^*\}_{j\in [n]}$ be pairs of primal-dual optimal solutions of (8) with zero duality gap, it is straightforward to verify that the KKT conditions are + +$$ +\operatorname {t r} \left(A _ {i} ^ {*} M _ {i} ^ {*}\right) = \operatorname {t r} \left(B _ {j} ^ {*} \Lambda_ {j} ^ {*}\right) = 0, \quad i \in [ m ], j \in [ n ] +$$ + +$$ +\mathcal {B} ^ {\top} \left(X _ {: i}\right) - \left[ \mathcal {B} ^ {\top} \mathcal {B} \right] \left(A _ {i} ^ {*}\right) = M _ {i} ^ {*}, \quad i \in [ m ] +$$ + +$$ +\mathcal {A} ^ {\top} (X _ {: j}) - [ \mathcal {A} ^ {\top} \mathcal {A} ] (B _ {j} ^ {*}) = \Lambda_ {j} ^ {*}, \quad j \in [ n ]. +$$ + +Furthermore, assuming that the primal optimal solutions $\{A_i^*\}_{i\in [m]}$ and $\{B_j^*\}_{j\in [n]}$ are all positive definite, it follows immediately from the complementary slackness conditions that $M_{i}^{*} = \Lambda_{j}^{*} = 0$ for all $i\in [m], j\in [n]$ . Consequently, in the special case of positive definite optimal solutions $\{A_i^*\}_{i\in [m]}$ and $\{B_j^*\}_{j\in [n]}$ , the KKT conditions reduce to + +$$ +\mathcal {B} ^ {\top} \left(X _ {: i}\right) = \left[ \mathcal {B} ^ {\top} \mathcal {B} \right] \left(A _ {i} ^ {*}\right), i \in [ m ] \quad \text {a n d} \quad \mathcal {A} ^ {\top} \left(X _ {: j}\right) = \left[ \mathcal {A} ^ {\top} \mathcal {A} \right] \left(B _ {j} ^ {*}\right), j \in [ n ]. \tag {24} +$$ + +Based on the preceding discussion, in the next result (whose proof follows by Lemma ?? in the Appendix) shows that we can interpret our MMU algorithm as a fixed-point method for satisfying the KKT optimality conditions corresponding to problem (8). + +Theorem 2. If $\{A_i\}_{i\in [m]}$ and $\{B_j\}_{j\in [n]}$ are positive definite fixed points of the update rule of the MWU algorithm given in (23), then they also satisfy the KKT conditions (24). + +# 5 Applications of the MMU algorithm + +Block-diagonal (BD) PSD factorizations. If the MMU algorithm is initialized with BD positive definite matrices with the same block structure, the BD structure is preserved at each update. Indeed, as $[A^{\top}A](B_{\mathrm{old}}) = \sum_{k=1}^{m}\operatorname{tr}(A_kB_{\mathrm{old}})A_k$ we see that $[A^{\top}A](B_{\mathrm{old}})^{-1}$ , and thus, $([A^{\top}A](B_j))^{-1}\#(B_j)$ share the same block structure. Lastly, by definition of the MMU algorithm (23), $B_{\mathrm{new}}$ is also block-diagonal with the same structure. Thus, if initialized with BD-PSD matrices, the MMU algorithm gives a method for computing a BD-PSD factorization. + +Recovering Lee-Seung's algorithm for NMF. Diagonal matrices can be considered as block-diagonal in a trivial manner. Nevertheless, by the preceding discussion, if initialized with diagonal PSD matrices, the iterates of the MMU algorithm remain diagonal PSD throughout. In this special case, our MMU algorithm reduces to Lee-Seung's (LS) seminal Multiplicative Update algorithm for computing NMFs [24]. LS's algorithm is perhaps the most widely used method for computing NMFs as it has succeeded to identify meaningful features in a diverse collection of real-life data sets and is extremely simple to implement. Specifically, LS's updates are + +$$ +A \leftarrow A \circ \frac {X B ^ {\top}}{A B B ^ {\top}} \text {a n d} B \leftarrow B \circ \frac {A ^ {\top} X}{A ^ {\top} A B}, \tag {25} +$$ + +where $X \circ Y, X / Y$ denote the componentwise multiplication, division of two matrices respectively. Setting $A_{i} = \mathrm{diag}(a_{i})$ and $B_{j} = \mathrm{diag}(b_{j})$ , the MMU algorithm updates $B_{j}$ as $B_{j} \gets B_{j}\left(\sum_{i=1}^{m}\langle a_{i}, b_{j}\rangle A_{i}\right)^{-1}\left(\sum_{i=1}^{m}X_{ij}A_{i}\right)$ , which is also a diagonal PSD matrix. Setting $A^{\top} = \left(a_{1}^{\top}\dots a_{m}^{\top}\right)$ and $B = (b_{1}\dots b_{n})$ , this coincides with LS's update rule (25). + +PSD factorizations for nonnegative tensors. Motivated by PSD factorizations of nonnegative matrices, [16] define an $r$ -dimensional PSD factorization of a nonnegative tensor $T$ (with $n$ indices of dimension $d$ ) as a collection of PSD matrices $C_{i_1}^{(1)}, \ldots, C_{i_n}^{(n)} \in \mathbb{S}_+^r$ for all $i_k \in [d]$ such that $T_{i_1 \ldots i_n} = \sum (C_{i_1}^{(1)} \circ \dots \circ C_{i_n}^{(n)})$ , for all $i_k \in [d]$ , where $\circ$ denotes the Schur product of matrices and $\mathrm{sum}(X) = \sum_{ij} X_{ij}$ . The motivation for studying tensor PSD factorizations comes from the fact that they characterize the quantum correlation complexity for generating multipartite classical distributions [16]. We now show how our MMU algorithm can be used as a primitive to calculate tensor PSD factorizations. For simplicity of presentation we restrict to $n = 3$ and consider + +$$ +\inf \sum_ {i _ {1}, i _ {2}, i _ {3}} \left(T _ {i _ {1} i _ {2} i _ {3}} - \operatorname {s u m} \left(C _ {i _ {1}} ^ {(1)} \circ C _ {i _ {2}} ^ {(2)} \circ C _ {i _ {3}} ^ {(3)}\right)\right) ^ {2} \quad \text {s u b j e c t t o} \quad C _ {i _ {1}} ^ {(1)}, C _ {i _ {2}} ^ {(2)}, C _ {i _ {3}} ^ {(3)} \in \mathbb {S} _ {+} ^ {r}. \tag {26} +$$ + +As in the case of PSD factorizations we employ a block coordinate descent approach. Specifically, fixing all matrices $C_{i_1}^{(1)}, C_{i_2}^{(2)}$ the optimization problem (26) is separable wrt each $C_{i_3}^{(3)}$ for all $i_3 \in [d]$ . Thus, defining the map $\mathcal{A}: \mathbb{S}^r \to \mathbb{R}^{d^2}$ , $X \mapsto (\langle X, C_{i_1}^{(1)} \circ C_{i_2}^{(2)} \rangle)_{i_1, i_2}$ , we need to solve + +$$ +\arg \inf \| \operatorname {v e c} \left(T _ {: i _ {3}}\right) - \mathcal {A} (C) \| _ {2} ^ {2} \quad \text {s u b j e c t t o} \quad C \in \mathbb {S} _ {+} ^ {r}, \tag {27} +$$ + +for all $i_3 \in [d]$ . Note that $\mathcal{A}^\top : \mathbb{R}^{d^2} \to \mathbb{S}^r$ where $x = (x_{x_1 x_2}) \mapsto \sum_{i_1, i_2 \in [d]} x_{i_1 i_2} C_{i_1}^{(1)} \circ C_{i_2}^{(2)}$ is a PSD matrix, as the Schur product of PSD matrices is PSD. Thus, Theorem 1 gives an update rule that preserves PSDness and for which the objective function (27) is nonincreasing. + +# 6 Numerical experiments + +Damping. The implementation of the MMU algorithm requires us to compute inverses and square-roots of certain positive definite matrices. These operations become ill-conditioned whenever the input matrices contain eigenvalues that are close to zero. To mitigate such issues, we apply a damping operation. First, when computing $\left([B^{\top}B](A_i)\right)^{-1}$ in (23), we instead compute $\left([B^{\top}B](A_i) + \epsilon I\right)^{-1}$ . Second, when computing the matrix square root $X^{1/2}$ in the process of computing the matrix geometric mean (23) using the expression (16), we instead compute $(X + \epsilon I)^{1/2}$ . In our implementations, we apply a choice of $\epsilon = 10^{-8}$ . + +Distance matrices. Let $v \in \mathbb{R}^n$ be a vector and let $M$ be a $n \times n$ matrix whose entries are $M_{ij} = (v_i - v_j)^2$ . $M$ is known as a distance matrix and it admits the following 2-dimensional PSD factorization + +$$ +M _ {i j} = \operatorname {t r} (A _ {i} B _ {j}), \qquad \text {w h e r e} \qquad A _ {i} = \left( \begin{array}{c} 1 \\ v _ {i} \end{array} \right) \left( \begin{array}{c} 1 \\ v _ {i} \end{array} \right) ^ {\top}, B _ {j} = \left( \begin{array}{c} - v _ {j} \\ 1 \end{array} \right) \left( \begin{array}{c} - v _ {j} \\ 1 \end{array} \right) ^ {\top}. +$$ + +We generate a random $v \in \mathbb{R}^n$ with $n = 20$ where each entry is drawn from the standard normal distribution. We apply our algorithm to compute a 2-dimensional factorization whereby we perform 500 iterations over 50 random initializations. We compute the normalized squared error loss of the factorization from the data matrix, and we plot the error over each iteration $\mathrm{Err} = \sum_{i,j} (\mathrm{tr}(A_i B_j) - M_{ij})^2 / \sum_{i,j} M_{ij}^2$ in Figure 1. Our experiments suggest that, with sufficient random initializations, our algorithm finds a PSD factorization that is close to being exact. + +![](images/4b540c9e34bd8c3b5272212566eab6f1ff0329cf84e6af7b9c2d749a3a99cb4e.jpg) +Figure 1: Performance of the MWU algorithm for computing a PSD factorization of a distance matrix. Different curves correspond to different random initializations. + +![](images/83374f2cba30609d67e585d0ab8f0cb73e5c0ee3ca58faa57fe80622f609a9b1.jpg) + +CBCL Face Image Dataset. In our second experiment, we apply the MMU method to compute a PSD factorization of a matrix comprising face images from the CBCL Face Database [1]. The objective of this experiment is to illustrate how computing a PSD factorization can be viewed as a representation learning algorithm that generalizes NMF. The CBCL dataset comprises 2429 images of faces, each of size $19 \times 19$ pixels. We process the images so that the pixel intensity has mean 0.5 and standard deviation 0.25, with values subsequently clipped at $[0,1]$ . The resulting data matrix has size $361 \times 2429$ . + +We note that an $r$ -dimensional PSD factorization of $X$ specified by $\{A_i\}, \{B_j\}$ gives rise to a decomposition $X_{:j} = \sum_{i=1}^{r} \lambda_i \mathcal{A}(u_i u_i^\top)$ , where $B_j = \sum_{i=1}^{r} \lambda_i u_i u_i^\top$ is the spectral decomposition. Subsequently, one can view the collection $\{\mathcal{A}(u_i u_i^\top) : \|u_i\| = 1\}$ as basic constituents from which all face images are expressible via non-negative linear combinations. This is analogous to NMF in which we express every data point as non-negative linear combinations from a collection of nonnegative basis vectors - these are precisely the linear image of a matrix factor $B$ on standard basis vectors. In this experiment, given a specific face image $X_{:j}$ , we show its decomposition as sums of constituents identified by the MMU algorithm - these are the images $\mathcal{A}(u_i u_i^\top)$ , where $u_i$ are the eigenvectors of $B_j$ . + +As our baseline, we compute a 27-dimensional NMF of the CBCL data matrix over 500 iterations. In Figure 2 we illustrate the decomposition of one of images from the dataset into these 27 constituents. Next, we calculate a 7-dimensional PSD factorization of the CBCL data matrix over 500 iterations and illustrate the decomposition of the same image in the new basis in Figure 3. We compute a 7-dimensional PSD factorization because a symmetric matrix of dimension $7 \times 7$ has 28 degrees of freedom, which is comparable with our NMF example. We note that the constituents learned from the PSD factorization appear to capture global features, a phenomenon that has been also observed for NMF applied to datasets beyond CBCL [25]. + +Last, we apply the MMU algorithm to compute a block-diagonal PSD factorization with 9 blocks of size $2 \times 2$ over 500 iterations (the number of degrees of freedom is 27), and we illustrate the decomposition in Figure 4. In this instance, constituents contain more localized features. An advantage of learning a continuum of basic building blocks is that one can express certain geometries in the data that is otherwise not possible using a finite number of building blocks. As an illustration of this intuition, in Figure 5, we show a continuum of atoms corresponding to a single $2 \times 2$ block which captures a transition between the nose and the nostrils. + +Computational specifications. Our experiments were conducted in Python on an Intel 7-th Gen i7 processor at $2.8\mathrm{GHz}$ . + +Code repository. Our codes are available on the following online repository + +https://github.com/yssoh/PSD_MM + +![](images/427f542eb30beff0a58f7bf00a271ff60495fe2ba77cc7267b1dc7ceb6af8081.jpg) +Original + +![](images/f181fb9eca090ba857b250bcec25ec207a17d80046d59f4837482ffad8c3b0cd.jpg) +Reconstruction + +![](images/fc1397f3b30903e2b21fe5fb107d00a9a05c0a13da0296909bdfe669ff11d225.jpg) +Figure 2: Image decomposition into building blocks learned from 27-dimensional NMF. + +![](images/7363cd4f657f98770246357b629ae993894878ee0850460b7aa2c797fcecffc0.jpg) +Original + +![](images/c0b98351a1af5e8e9ffba84e066c74cdae15fa5657bc511700ed696ea62708e7.jpg) +Reconstruction + +![](images/43cc20a66cb611cc2d69dc67c5fb57df2b5f6b604b442153de737b4eba09a4ba.jpg) + +![](images/f1d84e29c366c71764e31af0a34bb152df0e9abea9edb5756cce6f52d82e27b1.jpg) + +![](images/7ed8230250eb9973eaec272adf29446d91a8f02278c34bf42d463a069a58a2e3.jpg) + +![](images/1800534344dfb7b05e443e1b27be22bbf4f3eb87450def5b7c8ba64d40c4db2e.jpg) + +![](images/b3e870600314e3dba52b63df60ab21bfa16691115dc62a0aa1d00f3d1dfa7b1a.jpg) + +![](images/b0a10d96fc23f20957201b5118ee0812cf86d7f82f597ee68b25e4b17069fbd7.jpg) + +![](images/26dc28c9c2692d451df33b3fe658e85921ab74779239a211b174ff620a392d81.jpg) + +![](images/be68644e2db5577015fda096091a34383c9a9ff5021d46357c24bb3bfc5798fc.jpg) + +![](images/20d6ae09154b35a14ea122e7d9cef42a0dba96819d34f85ef2d37907fce5145e.jpg) + +![](images/9e6514b91178244c13415871cf91d7d2b9b5cb93fdab38fa0f2ba345a71b7f4f.jpg) + +![](images/7185a962ff87c126458fc775cbfb958df6c557f107ca26c060fd87e31dde7fae.jpg) +Figure 3: Image decomposition into building blocks learned from 7-dimensional PSD factorization. +Original + +![](images/b7ee75bf64c2ac62fbff1f93a7bd608cb947c8ef1f9c0f508bac8c168e592680.jpg) +Reconstruction + +![](images/7a825f955c66c39eb3185ddac6e9d743a981d6f13f01f28f576e462313b562f8.jpg) + +![](images/a928c971972a3689591d88c6a6e45fd14ab57d81a165453c252546cc553862f8.jpg) + +![](images/b16f4e24ba046e8360dce0a77b551db058de844e86754ae6b346b8ef9c979dd9.jpg) + +![](images/52f8705891fcfb9e06dec502df40d4e19d596135feb826014bd3729c740eee23.jpg) + +![](images/9e3adc92760b03f37aefc5154bb4b1280fb5f5bfcedd60e0032ff5a31c382e3d.jpg) + +![](images/33249b2586234fa427dfdc61ae2edb76d177d9015964fbdab7c0087a3b9ee904.jpg) + +![](images/53241c8e19559ee67025f6b7600d65675f4c57313aa010c185bde19a69854034.jpg) + +![](images/3bd47cd0cbfd3c8164b85a26923d78f033e78d168d266aebd4f6b8822f4e02de.jpg) + +![](images/ace28e99e58b964ded391713d6c6ec11e489b599d0edf47eb797e830d3a7b557.jpg) + +![](images/de72ad987fdaa7159f5781dd6bcd05d0efb6070869ca4673547d2fa164f83e6d.jpg) + +![](images/33e24f1f22432c35bf5f9dd0f8d9ecf18f36738b3eb7b4a77f32725f9ebaa9d3.jpg) + +![](images/39301446cb4bf934bb00e2f420b6695959dc041244b353851f351c2c59bbe2a4.jpg) +Figure 4: Image decomposition into building blocks learned using $2 \times 2$ -block PSD factorization. +Figure 5: Visualization of continuum of building blocks learned using $2 \times 2$ -block PSD factorization. + +Funding transparency statement. Yong Sheng Soh gratefully acknowledges Ministry of Education (Singapore) Academic Research Fund (Tier 1) R-146-000-329-133. Antonios Varvitsiotis gratefully acknowledges Ministry of Education (Singapore) Start-Up Research Grant SRG ESD 2020 154 and NRF2019-NRF-ANR095 ALIAS grant. Antonios Varvitsiotis acknowledges initial discussions with Cedric Févotte, Sandra Tan, and Vincent Tan. + +# References + +[1] MIT-CBCL Face Database, Center for Biological and Computational Learning, Massachusetts Institute of Technology. http://cbcl.mit.edu/software-datasets/FaceData2.html. +[2] Rajendra Bhatia. Positive Definite Matrices. Princeton University Press, 2007. +[3] Samuel Burer and Renato D. C. Monteiro. A Nonlinear Programming Algorithm for Solving Semidefinite Programs via Low-rank Factorization. Mathematical Programming, 95(2):329-357, 2003. +[4] Emmanuel J. Candes and Terence Tao. Decoding by Linear Programming. IEEE Transactions on Information Theory, 51:4203-4215, 2004. +[5] Murat A. Erdogdu, Yash Deshpande, and Andrea Montanari. Inference in graphical models via semidefinite programming hierarchies. In Advances in Neural Information Processing Systems, 2017. + +[6] Hamza Fawzi, João Gouveia, Pablo A. Parrilo, Richard Z. Robinson, and Rekha R. Thomas. Positive Semidefinite Rank. Mathematical Programming, 153(1):133-177, 2015. +[7] Hamza Fawzi and Pablo A. Parrilo. Exponential lower bounds on fixed-size psd rank and semidefinite extension complexity. https://arxiv.org/pdf/1311.2571.pdf, 2013. +[8] Cédric Févotte, Nancy Bertin, and Jean-Louis Durrieu. Nonnegative Matrix Factorization with the Itakura-Saito Divergence: With Application to Music Analysis. Neural Computation, 21(3):793-830, 2009. +[9] Samuel Fiorini, Serge Massar, Sebastian Pokutta, Hans Raj Tiwary, and Ronald de Wolf. Exponential Lower Bounds for Polytopes in Combinatorial Optimization. Journal of the ACM, (17), 2015. +[10] Yuan Gao and George Church. Improving Molecular Cancer Class Discovery Through Sparse Non-negative Matrix Factorization. Bioinformatics, 21(21):3970-3975, 2005. +[11] Nicolas Gillis. The Why and How of Nonnegative Matrix Factorization, chapter Regularization, Optimization, Kernels, and Support Vector Machines, pages 257-291. Number Chapman & Hall/CRC in Machine Learning and Pattern Recognition Series. 2014. +[12] João Gouveia, Pablo A. Parrilo, and Rekha Thomas. Lifts of Convex Sets and Cone Factorizations. Mathematics of Operations Research, 38(2):248-264, 2013. +[13] Nicholas J. Higham. Computing a Nearest Symmetric Positive Semidefinite Matrix. Linear Algebra and its Applications, 103:03-118, 1988. +[14] Prateek Jain, Raghu Meka, and Inderjit Dhillon. Guaranteed Rank Minimization via Singular Value Projection. In Advances in Neural Information Processing Systems, 2010. +[15] Rahul Jain, Yaoyun Shi, Zhaohui Wei, and Shengyu Zhang. Efficient Protocols for Generating Bipartite Classical Distributions and Quantum States. IEEE Transactions on Information Theory, 59:5171-5178, 2013. +[16] Rahul Jain, Zhaohui Wei, Penghui Yao, and Shengyu Zhang. Multipartite quantum correlation and communication complexities. computational complexity volume, 26:199-228, 2017. +[17] Dana Lahat and Cédric Févotte. Positive Semidefinite Matrix Factorization: A Link to Phase Retrieval and a Block Gradient Algorithm. In IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2020. +[18] Dana Lahat and Cédric Févotte. Positive Semidefinite Matrix Factorization Based on Truncated Wirtinger Flow. In 28th European Signal Processing Conference (EUSIPCO), 2020. +[19] Dana Lahat, Yanbin Lang, Vincent Y. F. Tan, and Cédric Févotte. Positive Semidefinite Matrix Factorization: A Connection with Phase Retrieval and Affine Rank Minimization. IEEE Transactions on Signal Processing, in press, 2021. +[20] Kenneth Lange. MM Optimization Algorithms. SIAM, 2016. +[21] Javad Lavaei and Steven H. Low. Zero Duality Gap in Optimal Power Flow Problem. IEEE Transactions on Power Systems, 27(1), 2012. +[22] Jimmie D. Lawson and Yongdo Lim. The Geometric Mean, Metrics, and More. In *The American Mathematical Monthly*, volume 108, pages 797-812, 2001. +[23] Daniel D. Lee and H. Sebastian Seung. Learning the Parts of Objects by Non-negative Matrix Factorization. Nature, 401, 1999. +[24] Daniel D. Lee and H. Sebastian Seung. Algorithms for Non-negative Matrix Factorization. In Advances in Neural Information Processing Systems 13, 2000. +[25] Stan Z. Li, Xin Wen Hou, Hong Jiang Zhang, and Qian Sheng Cheng. Learning Spatially Localized, Parts-based Representation. In Proceedings of the 2001 IEEE Computer Society Conference on Computer Vision and Pattern Recognition., 2001. + +[26] Xiaodie Lin, Zhaohui Wei, and Penghui Yao. Quantum and Classical Hybrid Generations for Classical Correlations. https://arxiv.org/abs/2007.10673, 2020. +[27] Jakub Marecek and Martin Takac. A low-rank coordinate-descent algorithm for semidefinite programming relaxations of optimal power flow. Optimisation Methods and Software, 32(4):849-871, 2017. +[28] Mehran Mesbahi and George P. Papavassilopoulos. On the Rank Minimization Problem Over a Positive Semidefinite Linear Matrix Inequality. IEEE Transactions on Automatic Control, 42(2), 1997. +[29] Karthik Mohan and Maryam Fazel. New Restricted Isometry Results for Noisy Low-rank Recovery. In IEEE International Symposium on Information Theory (ISIT), 2010. +[30] Pentti Paatero and Unto Tapper. Positive matrix factorization: A non-negative factor model with optimal utilization of error. *Environmental*, 5:111-126, 1994. +[31] Aditi Raghunathan, Jacob Steinhardt, and Percy Liang. Semidefinite relaxations for certifying robustness to adversarial examples. In Advances in Neural Information Processing Systems 31, 2018. +[32] Mikkel N. Schmidt and Rasmus K. Olsson. Single-channel Speech Separation Using Sparse Non-negative Matrix Factorization. In Ninth International Conference on Spoken Language Processing, 2006. +[33] Kim-Chuan Toh. An inexact primal-dual path following algorithm for convex quadratic sdp. Mathematical Programming, 112:221-254, 2008. +[34] Stephen Tu, Ross Boczar, Max Simchowitz, Mahdi Soltanolkotabi, and Benjamin Recht. Low-rank Solutions of Linear Matrix Equations via Procrustes Flow. In Proceedings of The 33rd International Conference on Machine Learning, pages 964-973, 2016. +[35] Arnaud Vandaele, François Glineur, and Nicolas Gillis. Algorithms for Positive Semidefinite Factorization. Computational Optimization and Applications, 71(1):193-219, 2018. +[36] Lieven Vandenberghe and Stephen P. Boyd. Semidefinite Programming. SIAM Review, 48(1):49-95, 1996. +[37] Wei Xu, Xin Liu, and Yihong Gong. Document Clustering Based on Non-negative Matrix Factorization. In the 26th Annual International ACM SIGIR Conference on Research and Development in Informaion Retrieval, pages 267-273, 2003. +[38] Mihalis Yannakakis. Expressing Combinatorial Optimization Problems by Linear Programs. Journal of Computer and System Sciences, 43:441-466., 1991. \ No newline at end of file diff --git a/anoncommutativeextensionofleeseungsalgorithmforpositivesemidefinitefactorizations/images.zip b/anoncommutativeextensionofleeseungsalgorithmforpositivesemidefinitefactorizations/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..dd7076acccfb1df4f03099f12c4ca747270d477f --- /dev/null +++ b/anoncommutativeextensionofleeseungsalgorithmforpositivesemidefinitefactorizations/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ca17b5abc395fa1444a353bdb274a19cc8c64ddd42ca4d44e647a50ca3a7a317 +size 294954 diff --git a/anoncommutativeextensionofleeseungsalgorithmforpositivesemidefinitefactorizations/layout.json b/anoncommutativeextensionofleeseungsalgorithmforpositivesemidefinitefactorizations/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..62fa963929c0eebb4622bcaf79e84bae16b4cb70 --- /dev/null +++ b/anoncommutativeextensionofleeseungsalgorithmforpositivesemidefinitefactorizations/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:abb4df6e5a44d7dafb3cd57405c55bb640ed066e2a483b32e7fd6cf7484eefdf +size 638501 diff --git a/anonparametricmethodforgradualchangeproblemswithstatisticalguarantees/07e59d4a-48a8-46c8-84e9-f79c427c91aa_content_list.json b/anonparametricmethodforgradualchangeproblemswithstatisticalguarantees/07e59d4a-48a8-46c8-84e9-f79c427c91aa_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..9df801ee21b85deffeb51da7216e1edd436384aa --- /dev/null +++ b/anonparametricmethodforgradualchangeproblemswithstatisticalguarantees/07e59d4a-48a8-46c8-84e9-f79c427c91aa_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2bae4e76172c850b604e63439382f979881f3cc5b8254c7ed1380abd5e887f83 +size 100745 diff --git a/anonparametricmethodforgradualchangeproblemswithstatisticalguarantees/07e59d4a-48a8-46c8-84e9-f79c427c91aa_model.json b/anonparametricmethodforgradualchangeproblemswithstatisticalguarantees/07e59d4a-48a8-46c8-84e9-f79c427c91aa_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b8f90203566fccdf6d984dbcec5e831b49d3dc49 --- /dev/null +++ b/anonparametricmethodforgradualchangeproblemswithstatisticalguarantees/07e59d4a-48a8-46c8-84e9-f79c427c91aa_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dbf057454722bbdab4cbf780a0c817c1c29e0f6b2b8056d7f0a9664d9edc020f +size 123960 diff --git a/anonparametricmethodforgradualchangeproblemswithstatisticalguarantees/07e59d4a-48a8-46c8-84e9-f79c427c91aa_origin.pdf b/anonparametricmethodforgradualchangeproblemswithstatisticalguarantees/07e59d4a-48a8-46c8-84e9-f79c427c91aa_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..46241fce2bf1bc324b50807df74ee69844ac2260 --- /dev/null +++ b/anonparametricmethodforgradualchangeproblemswithstatisticalguarantees/07e59d4a-48a8-46c8-84e9-f79c427c91aa_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd7579d99ce1ade71add0d9e5559569eef3adebeb979f5fea2bd0edb01b06a92 +size 1178036 diff --git a/anonparametricmethodforgradualchangeproblemswithstatisticalguarantees/full.md b/anonparametricmethodforgradualchangeproblemswithstatisticalguarantees/full.md new file mode 100644 index 0000000000000000000000000000000000000000..909995fe9337bb350cf938a72e11809a6ce16b84 --- /dev/null +++ b/anonparametricmethodforgradualchangeproblemswithstatisticalguarantees/full.md @@ -0,0 +1,478 @@ +# A nonparametric method for gradual change problems with statistical guarantees + +Lizhen Nie + +Department of Statistics + +The University of Chicago + +lizhen@statistics.uchicago.edu + +Dan Nicolae + +Department of Statistics + +The University of Chicago + +nicolae@statistics.uchicago.edu + +# Abstract + +We consider the detection and localization of gradual changes in the distribution of a sequence of time-ordered observations. Existing literature focuses mostly on the simpler abrupt setting which assumes a discontinuity jump in distribution, and is unrealistic for some applied settings. We propose a general method for detecting and localizing gradual changes that does not require a specific data generating model, a particular data type, or prior knowledge about which features of the distribution are subject to change. Despite relaxed assumptions, the proposed method possesses proven theoretical guarantees for both detection and localization. + +# 1 Introduction + +In a sequence of time-ordered observations $\{Y_{t,T} : t = 1,2,\dots,T\}$ , the aim of change point detection (CPD) is to (a) detect: answer the question of whether the distribution of $Y_{t,T}$ changes, and (b) localize: if it changes, answer the question of when. The classic formulation of CPD usually assumes that the possible change point is abrupt, i.e., there is a discontinuity jump in the distribution of $Y_{t,T}$ , leading to a simpler problem. However, in many real-life situations, the changes in a sequence happen smoothly or gradually, rather than abruptly. Figure 1 illustrates some examples. + +![](images/96269ea3ae3a462cc604acb558922916d728ca2742b7a3dd4134ba52f12dec26.jpg) +(a) Annual average temperature in central England. + +![](images/bb75f56c8ecb2361a9f36cbab8998e18651393b35e3ddece868049dfd7dbdd19.jpg) +Figure 1: Examples of gradual changes. The vertical red dashed lines indicate the gradual change start points estimated by the method proposed in this paper. + +![](images/46575cea68e8a55152ce88a29d5a3bf664fde18ea2d726294a8516e6166f1153.jpg) +(b) S&P 500 stock index daily returns. + +The first example concerns climatology, and investigates the temperature patterns over years. Figure 1a depicts the annual average temperature in central England from 1750 to 2020, where we observe a smooth increase starting around 1850. The second example comes from finance. The S&P 500 stock index is an important indicator of the overall market. As shown in Figure 1b, its volatility level usually remains constant in a stable market, and then gradually increases with the development of some events such as the financial crisis in 2008 or the COVID-19 pandemic in 2020. + +Despite the wide variety of applications, inference for gradual changes is under-researched, and most existing methods require domain knowledge. Early research assumed that the gradual change follows a particular parametric model. For example, Lombard (1987) considers a setting where some + +unknown parameter changes linearly, while others (Hušković, 1999; Hušković and Steinebach, 2002; Aue and Steinebach, 2002) consider models with polynomial changes. + +Recent methods also consider nonparametric settings. However, most of them still require specific assumptions on the data model. For example, Muller (1992); Raimondo (1998); Goldenshluger et al. (2006) consider the location model where first order moment of observations changes. Mallik et al. (2011, 2013) investigate a stronger assumption: the mean change is monotonic. Mercurio et al. (2004) consider the volatility model where second order moment of observations fluctuates. Quessy (2019) assumes that the sequence follows two stationary distributions at the beginning and the end, and the changing phase in-between is a mixture of them with weights changing linearly with time. + +As far as we know, Vogt and Dette (2015) is the only nonparametric method that applies to general types of models and data types. Despite its generality, the method proposed in Vogt and Dette (2015) requires prior knowledge about which stochastic feature(s) might change. Moreover, their method requires specification of a threshold determined through expensive simulations. Also, Vogt and Dette (2015) considers only the localization problem, while ignoring the detection step which is shown to be important for false positive control in real-data applications (Van den Burg and Williams, 2020). + +We propose a nonparametric method for detecting and localizing gradual changes. The proposed method requires no prior domain knowledge, and we offer theoretical guarantees on both detection (false positive rate, power) and localization (consistency). + +# 2 Problem Statement + +Suppose we observe a time-ordered independent sequence $\{Y_{t,T}:t = 1,2,\dots ,T\}$ taking values in a general metric space $(\mathcal{V},\| \cdot \|_{\mathcal{V}})$ . $Y_{t,T}$ is observed at time $u = t / T\in [0,1]$ . We are concerned with: + +1. (Detection) Deciding whether the distribution of observation changes with time $u$ . This is formulated as a hypothesis testing problem with null $H_0$ and alternative $H_A$ hypotheses shown below. Let $P_u$ be a probability measure on $(\mathcal{V}, \| \cdot \|_{\mathcal{V}})$ such that $Y_{t,T} \sim P_u$ for $u = t / T$ , then + +$H_0: P_u$ is constant over $u \in [0,1]$ . + +$H_{A}:P_{u}$ is constant over $u\in [0,u_0]$ for some $u_0\in (0,1)$ , but is not constant over $u\in [0,1]$ . (1) + +Further, we assume that $P_{u}$ is continuous with respect to the weak topology in the sense that $\forall u \in [0,1]$ , $P_{v}$ weakly converges to $P_{u}$ , as $v \to u$ . + +2. (Localization) If rejecting $H_0$ in step 1, obtain an estimator $\hat{\rho}$ of the gradual change point $\rho^*$ where the probability measure $P_u$ starts to change, i.e., $\rho^* := \sup \{u : P_v = P_0, \forall v \in [0, u]\}$ . + +Notice that we do not put specific assumptions on the data type or distribution of $Y_{t,T}$ and thus, our formulation allows a large number of special models such as + +location model: $Y_{t,T} = \mu (t / T) + \varepsilon_{t},$ (2) + +volatility model: $Y_{t,T} = \sigma (t / T)\varepsilon_t$ (3) + +where $\mu (\cdot),\sigma (\cdot)$ can be any continuous function, and $\varepsilon_{t}$ 's are zero mean i.i.d errors. + +Notations. We denote $\lceil x\rceil$ as the least integer no smaller than $x$ , $\mathbf{1}_d = (1,\dots ,1)^\top \in \mathbb{R}^d$ , $I_{d}\in \mathbb{R}^{d\times d}$ the identity matrix. We use $\mathbb{I}$ to denote indicator function, $\stackrel {w}{\rightarrow}$ weak convergence, $\mathbb{Z}_{+}$ the set of positive integers. For a set of constants $a_{T},b_{T}$ and random variables $X_{T}$ , we write $a_{T} = \Theta (b_{T})$ if there exist constants $C_1,C_2 > 0,t_0\in \mathbb{Z}_+$ s.t. $C_1a_T\leq b_T\leq C_2a_T,\forall T\geq t_0$ . Denote $X_{T} = O_{p}(a_{T})$ if $X_{T} / a_{T}$ is stochastically bounded, and $X_{T} = o_{p}(a_{T})$ if $X_{T} / a_{T}$ converges to zero in probability. + +# 3 Methodology + +Existing statistic. We consider first univariate $Y_{t,T}$ 's. Suppose the change is in $\mathbb{E}Y_{t,T}$ ; traditional CUSUM statistic (Page, 1954) solves CPD problem by defining + +$$ +\widehat {C} _ {T} (u, v) = 1 / T \sum_ {t = 1} ^ {\lceil v T \rceil} Y _ {t, T} - v / (u T) \sum_ {t = 1} ^ {\lceil u T \rceil} Y _ {t, T}, \quad \text {f o r a n y} 0 \leq v < u \leq 1. +$$ + +which compares cumulative sums of $Y_{t,T}$ over different time spans $[0,v]$ and $[0,u]$ . Then + +$$ +\widehat {\mathcal {D}} _ {T} ^ {\mathrm {u n i}} (u) = \max _ {v \in [ 0, u ]} | \widehat {C} _ {T} (u, v) |, \quad \text {f o r a n y} 0 \leq u \leq 1. +$$ + +![](images/b33015355166e3f28a7910b2a1042b28bdf7ef8cdd056a4c6f44d6b0ed51ed7a.jpg) + +![](images/be97cd7ef047cbb58b20932e1a78fa2262d6a72d9a442bf8e2c838da30db4ab2.jpg) + +![](images/b07beec6d63d9c19c4dd0d170e01f3a607c6c8ce3531806d7775f0b35f5144fe.jpg) + +![](images/7939eb951c40acb17293872445b05eabbdd030ea51a6467c522d0b5e57056dec.jpg) + +![](images/6d0c38af7e09ede87e4f847f491e69fc8b887114aaf8760f399057144bbaef23.jpg) +Figure 2: Plots of $Y_{t,T}$ (top row) and their $\widehat{\mathcal{D}}_T^{\mathrm{gen}}(t / T)$ (bottom row) against $t$ . The blue vertical line denotes true change point. Data in column 1, 2 follow location model (2) with $\varepsilon_t \sim N(0,1)$ , and $\mu_1(u) = \mathbb{I}(1/3 \leq u \leq 2/3)(3u - 1)^{1.5} + \mathbb{I}(u > 2/3)$ , $\mu_2(u) = 2\sin(4\pi(u - 1/3))\mathbb{I}(1/3 \leq u \leq 2/3) + 2\sin(4\pi/3)\mathbb{I}(u \geq 2/3)$ , respectively. Data in column 3 follows volatility model (3) with $\varepsilon_t \sim N(0,1)$ and $\sigma(\cdot) = \mu_1(\cdot) + 1$ . Column 1, 2 set $\mathcal{F} = \{f : x \mapsto x\}$ , and column 3 $\mathcal{F} = \{f : x \mapsto x^2\}$ . + +![](images/f1047b3af1887e9d92afef55125da5b1cb34deca7373b03c336ce8d80a88c2a6.jpg) + +![](images/f4b05413d328f06f458861a384344ca61aed054f6ee49fc45efc322c7dc3c5c8.jpg) + +![](images/e26686efdcdbecd0d88b5b0ad8b61aafee1b94fdd6a3d31aa35667e36b40afd9.jpg) + +can be used to detect changes in feature $\mathbb{E}Y_{t,T}$ over time span $[0,u]$ . Intuitively, if there are no changes over $[0,u]$ , $\widehat{\mathcal{D}}_T^{\mathrm{uni}}(u)$ should be small. For example, in Figure 2, the first and second column depicts a sequence with change in $\mathbb{E}Y_{t,T}$ (shown in top row), and $\widehat{\mathcal{D}}_T^{\mathrm{uni}}$ (shown in bottom row) take small values before $\tau^{*} = 200$ where $\tau^{*} = [T\rho^{*}]$ , and then grow substantially. Thus, $\widehat{\mathcal{D}}_T^{\mathrm{uni}}(u)$ essentially measures the variation over $[0,u]$ in these univariate settings. + +For multivariate/structured $Y_{t,T}$ or for changes in more general features of the form $\mathbb{E}f(Y_{t,T})$ where $f:\mathcal{Y}\to \mathbb{R}$ is a measurable function, Vogt and Dette (2015) replaces $\widehat{\mathcal{D}}_T^{\mathrm{uni}}$ with + +$$ +\widehat {\mathcal {D}} _ {T} ^ {\text {g e n}} (u) = \sup _ {f \in \mathcal {F}} \max _ {v \in [ 0, u ]} | \widehat {C} _ {T} (u, v, f) |, \quad \text {w h e r e} +$$ + +$$ +\widehat {C} _ {T} (u, v, f) = 1 / T \sum_ {t = 1} ^ {\lceil v T \rceil} f \left(Y _ {t, T}\right) - v / (u T) \sum_ {t = 1} ^ {\lceil u T \rceil} f \left(Y _ {t, T}\right). \tag {4} +$$ + +$\widehat{\mathcal{D}}_T^{\mathrm{gen}}$ takes supremum over a pre-specified set of functions $\mathcal{F}$ to ensure that changes in $\mathbb{E}f(Y_{t,T})$ for all $f\in \mathcal{F}$ are considered. Note that $\widehat{\mathcal{D}}_T^{\mathrm{uni}}$ is a special case of $\widehat{\mathcal{D}}_T^{\mathrm{gen}}$ with $\mathcal{F} = \{f:x\mapsto x\}$ , and column 3 of Figure 2 sets $\mathcal{F} = \{f:x\mapsto x^2\}$ . + +There are three main issues with $\widehat{\mathcal{D}}_T^{\mathrm{gen}}$ . First, it relies heavily on the pre-specified function class $\mathcal{F}$ . Also, to calculate $\widehat{\mathcal{D}}_T^{\mathrm{gen}}$ , $\mathcal{F}$ can only contain a finite (usually small) number of functions (e.g., $f: x \mapsto x$ or $f: x \mapsto x^2$ ), the choice of which relies heavily on prior knowledge about which features might change. When $\mathcal{F}$ is misspecified, $\widehat{\mathcal{D}}_T^{\mathrm{gen}}$ can be non-informative and fail subsequent tasks. Second, $\widehat{\mathcal{D}}_T^{\mathrm{gen}}$ does not consider the scale of $\widehat{C}_T(\cdot, \cdot, f)$ which could be incomparable for different $f$ 's. Third, the limiting distribution of $\widehat{\mathcal{D}}_T^{\mathrm{gen}}(\cdot)$ is unknown, leading to computational challenges in subsequent analyses. + +Proposed statistic. We introduce a new statistic that puts minimal assumptions on data types and generating process, and is free of the issues discussed above. It is motivated by the recent success of applying kernel approaches to abrupt CPD problems (e.g., Harchaoui et al. (2008); Li et al. (2015); see Section 7 for more details). These kernel approaches assume access to a positive semidefinite kernel $k: \mathcal{V} \times \mathcal{V} \to \mathbb{R}$ that measures pairwise similarity among observations. Compared with features, kernels are more flexible and easier to specify, especially for structured data, showing great potential for solving gradual CPD problem. Inference starts with measuring data variation in time span $[0, u]$ ; for each possible change point $v < u$ , $v$ divides the observations into two groups: those coming before $\lceil Tv \rceil$ and those after $\lceil Tv \rceil$ . Note that the average similarity among observations within the same group is: + +$$ +\widehat {S} _ {T} ^ {\mathrm {w i t h i n}} (u, v) = 0. 5 (l) ^ {- 2} \sum_ {s, t = 1} ^ {l} k \left(Y _ {s, T}, Y _ {t, T}\right) + 0. 5 (r - l) ^ {- 2} \sum_ {s, t = l + 1} ^ {r} k \left(Y _ {s, T}, Y _ {t, T}\right), +$$ + +where $l = \lceil vT \rceil$ , $r = \lceil uT \rceil$ , and the average similarity among observations between different groups is + +$$ +\widehat {S} _ {T} ^ {\text {b e t w e e n}} (u, v) = \left[ l (r - l) \right] ^ {- 1} \sum_ {s = 1} ^ {l} \sum_ {t = l + 1} ^ {r} k \left(Y _ {s, T}, Y _ {t, T}\right). +$$ + +Intuitively, $k(y, y')$ should in general be larger if $y, y'$ follow the same distribution, and smaller if $y, y'$ follow different distributions. Thus, if $v$ is the true change point, we expect $\widehat{S}_T^{\text{within}}(u, v)$ to be large compared with $\widehat{S}_T^{\text{between}}(u, v)$ . This intuition underlies the following statistic, + +$$ +\widehat {\mathcal {D}} _ {T} (u) = \max _ {v \in [ 0, u ]} \widehat {\mathcal {K}} _ {T} (u, v) \quad \text {w h e r e} \tag {5} +$$ + +$$ +\widehat {\mathcal {K}} _ {T} (u, v) = 2 v ^ {2} (u - v) ^ {2} / u ^ {2} \left[ \widehat {S} _ {T} ^ {\text {w i t h i n}} (u, v) - \widehat {S} _ {T} ^ {\text {b e t w e e n}} (u, v) \right]. \tag {6} +$$ + +$\widehat{\mathcal{D}}_T$ takes the maximum over $v \in [0, u]$ using a similar idea as $\widehat{\mathcal{D}}_T^{\mathrm{uni}}$ and $\widehat{\mathcal{D}}_T^{\mathrm{gen}}$ . The scaling factor $v^2 (u - v)^2 / u^2$ is important and ensures that the limiting distribution of $\widehat{\mathcal{D}}_T$ is well-defined for all $u \in (0, 1]$ (see more details in Section 4). $\widehat{\mathcal{D}}_T$ plays the same role as $\widehat{\mathcal{D}}_T^{\mathrm{gen}}$ and measures data variation among $[0, u]$ . + +Note that $\widehat{\mathcal{D}}_T$ has also a CUSUM-style representation, which is crucial for understanding its theoretical properties. Define a centered kernel $k_{0}(y,y^{\prime}) = k(y,y^{\prime}) - \mathbb{E}_{Y\sim P_{0}}k(y,Y) - \mathbb{E}_{Y\sim P_{0}}k(y^{\prime},Y) + \mathbb{E}_{Y,Y^{\prime}\sim P_{0}}k(Y,Y^{\prime})$ . Then $k_{0}$ can be decomposed in terms of eigenfunctions $\{\psi_j\}_{j = 1}^{\infty}$ w.r.t. $P_0$ as: + +$$ +k _ {0} (y, y ^ {\prime}) = \sum_ {j = 1} ^ {\infty} \lambda_ {j} \psi_ {j} (y) \psi_ {j} \left(y ^ {\prime}\right) \quad \text {w i t h} \tag {7} +$$ + +$$ +\int k _ {0} (y, y ^ {\prime}) \psi_ {j} (y) d P _ {0} (y) = \lambda_ {j} \psi_ {j} (y ^ {\prime}), \int \psi_ {j} (y) \psi_ {j ^ {\prime}} (y) d P _ {0} (y) = \delta_ {j, j ^ {\prime}}, +$$ + +and $\delta_{j,j'}$ is the Kronecker delta function. We denote the feature map $\phi$ associated with $k_0$ as + +$$ +\phi (y) = \left(\lambda_ {1} ^ {1 / 2} \psi_ {1} (y), \lambda_ {2} ^ {1 / 2} \psi_ {2} (y), \dots\right) ^ {\top} \in \mathcal {H}, \langle \phi (y), \phi (y ^ {\prime}) \rangle_ {\mathcal {H}} := \sum_ {l = 1} ^ {\infty} \phi_ {l} (y) \phi_ {l} (y ^ {\prime}) = k _ {0} (y, y ^ {\prime}). +$$ + +Using properties of $\langle \cdot ,\cdot \rangle_{\mathcal{H}}^{1 / 2}$ and denoting $\| \cdot \|_{\mathcal{H}} = \langle \cdot ,\cdot \rangle_{\mathcal{H}}^{1 / 2}$ , we have + +$$ +\widehat {\mathcal {K}} _ {T} (u, v) = \| 1 / T \sum_ {t = 1} ^ {[ v T ]} \phi (Y _ {t, T}) - v / (u T) \sum_ {t = 1} ^ {[ u T ]} \phi (Y _ {t, T}) \| _ {\mathcal {H}} ^ {2} = \sum_ {j = 1} ^ {\infty} | \widehat {C} _ {T} (u, v, \phi_ {j}) | ^ {2}. \tag {8} +$$ + +Equation (8) helps the comparison of $\widehat{\mathcal{D}}_T$ against $\widehat{\mathcal{D}}_T^{\mathrm{gen}}$ . In general, $\widehat{\mathcal{D}}_T$ has three advantages. First, recall that $\widehat{\mathcal{D}}_T^{\mathrm{gen}}$ strongly depends on the specification of the function class $\mathcal{F}$ ; we allow implicitly a much larger $\mathcal{F}$ with infinite functions. For example, by using universal kernels such as $k(y,y') = \exp \{-\| y - y' \|_Y^2 / 2\}$ , we consider any change in $\mathbb{E}f(Y_{t,T})$ , $f \in \mathcal{F}$ where $\mathcal{F}$ has infinite cardinality and satisfies the property that under mild assumptions, there always exists $f \in \mathcal{F}$ such that $\mathbb{E}f(X) \neq \mathbb{E}f(X')$ when random variables $X, X'$ follow different distributions. Second, the asymptotic distribution of $\widehat{\mathcal{D}}_T^{\mathrm{gen}}$ (as $n$ grows to infinity) is intractable, caused by its dependence structure on $\widehat{C}_T$ . There are two key facts, under $H_0$ , for fixed $u, v$ , as $T$ goes to infinity, + +$\widehat{C}_T(u,v,\phi_j)\stackrel {d}{\to}$ Gaussian random variable, and $\mathbb{E}[\widehat{C}_T(u,v,\phi_j)\widehat{C}_T(u,v,\phi_{j'})]\to 0$ $\forall j,j^{\prime}\in \mathbb{Z}_{+}$ + +It implies $\widehat{C}_T(u,v,\phi_j)$ are asymptotically independent Gaussian random variables (r.v.). Since the sum of squares of independent Gaussian r.v. follows a known distribution (chi-square), in view of (8), the asymptotic distribution of our statistic is much simpler than that of $\widehat{\mathcal{D}}_T^{\mathrm{gen}}$ . Third, using kernels to define $\widehat{\kappa}_{T}$ does not lead to technical/implementation issues. In contrast, if we define $\widehat{\kappa}_{T}$ directly using (8) with the function class $\mathcal{F} = \{\phi_j,j = 1,2,\dots \}$ replaced by an arbitrary function class of infinite cardinality, the infinite series will not necessarily converge, and even when it converges, it may not be calculated exactly. Using kernels, we circumvent this issue and with the trick mentioned in Appendix A, the total cost of calculating $\widehat{\mathcal{D}}_T(u)$ for all $u$ ’s takes $O(T^{2})$ in both time and space. + +Remark 3.1. Some useful kernels for the gradual CPD problem: (i) For $\mathcal{V} = \mathbb{R}^d$ , we recommend using the dot-product kernel $k(y, y') = \langle y, y' \rangle_{\mathbb{R}^d}$ if location model (2) holds. Here $\phi_j : x = (x_1, \dots, x_d)^\top \mapsto x_j - \mathbb{E}_{P_0} X_j, \forall j = 1, \dots, d$ . When $d = 1$ , $\widehat{\mathcal{D}}_T$ with this kernel equals $\widehat{\mathcal{D}}_T^{\mathrm{gen}}$ with $\mathcal{F} = \{f : x \mapsto x - \mathbb{E}_{P_0} X\}$ and $\widehat{\mathcal{D}}_T^{\mathrm{uni}}$ . (ii) For $\mathcal{V} = \mathbb{R}$ , we recommend using $k(y, y') = y^2 (y')^2$ if volatility model (3) holds. Here $\phi_j : x \mapsto x^2 - a$ where $a = \mathbb{E}_{X \sim P_0} X^2$ . And $\widehat{\mathcal{D}}_T$ with this kernel equals $\widehat{\mathcal{D}}_T^{\mathrm{gen}}$ with $\mathcal{F} = \{f : x \mapsto x^2 - a\}$ . (iii) For any general $\mathcal{V}$ , $k(y, y') = \exp\{-\|y - y'\|_{\mathcal{V}}^2 / h\}$ is the RBF kernel with bandwidth $h > 0$ . This can be set as the default kernel without any prior knowledge about data model. + +Now we will utilize $\widehat{\mathcal{D}}_T$ for the detection and localization of gradual change points. + +Detection. As shown in Figure 2, under a good choice of $k$ , $\widehat{\mathcal{D}}_T(u)$ summarizes the degree of variation over time span $[0, u]$ and satisfies + +$$ +\widehat {\mathcal {D}} _ {T} (u) \text {i s} \left\{ \begin{array}{l l} \text {s m a l l}, & \text {w h e n} u \leq \rho^ {*}, \\ \text {l a r g e}, & \text {w h e n} u > \rho^ {*}. \end{array} \right. \tag {9} +$$ + +The case of no change point is equivalent to $\rho^{*} = 1$ . The existence of a change point can be tested using $\widehat{\mathcal{D}}_T(1)$ . The p-value depends on the asymptotic null distribution of $\widehat{\mathcal{D}}_T(1)$ , the rigorous establishment of which requires many technical details and is deferred to the next section (Theorem 4.4). Practitioners can use the following formula to calculate p-values: + +$$ +\mathbb {P} (T \widehat {\mathcal {D}} _ {T} (1) > x) \approx 2 ^ {(\widehat {q} + 3) / 2} [ \Gamma (\widehat {q} / 2) ] ^ {- 1} \sqrt {\pi} (x / \widehat {\lambda} _ {1}) ^ {(\widehat {q} - 1) / 2} e ^ {- 2 x / \widehat {\lambda} _ {1}} \prod_ {l = q + 1} ^ {T} (1 - \widehat {\lambda} _ {l} / \widehat {\lambda} _ {1}) ^ {- 1 / 2}, \tag {10} +$$ + +where $\hat{\lambda}_1\geq \hat{\lambda}_2\geq \dots \geq \hat{\lambda}_T$ are eigenvalues of the matrix $(1 / T)K_{0}$ where + +$$ +K _ {0} = H K H \in \mathbb {R} ^ {T \times T}, K = \left[ k \left(Y _ {i, t}, Y _ {j, T}\right) \right] _ {i, j = 1} ^ {T} \in \mathbb {R} ^ {T \times T} \text {a n d} H = I _ {T} - (1 / T) \mathbf {1} _ {T} \mathbf {1} _ {T} ^ {\top}, \tag {11} +$$ + +and $\hat{q}$ is the estimated multiplicity of the leading eigenvalue. Accuracy of this approximation depends on the accuracy of estimated eigenvalues. In practice, we find it works well when $q$ is small (say, $q \leq 5$ ). When $q$ is large, we recommend estimating p-values by permutation tests. + +Localization. Once a significant change point is detected, the next step is to localize it. Observing property (9) with $\widehat{\mathcal{D}}_T$ replaced by $\widehat{\mathcal{D}}_T^{\mathrm{gen}}$ , Vogt and Dette (2015) propose an estimator for $\rho^{*}$ as: + +$$ +\hat {\rho} ^ {\text {g e n}} = T ^ {- 1} \sum_ {t = 1} ^ {T} \mathbb {I} \left(T ^ {1 / 2} \widehat {\mathcal {D}} _ {T} ^ {\text {g e n}} (t / T) \leq b _ {T} ^ {\text {g e n}}\right), +$$ + +where the scaling factor $T^{1/2}$ ensures that $T^{1/2}\widehat{\mathcal{D}}_T^{\mathrm{gen}}$ follows a non-degenerate distribution asymptotically as data size goes to infinity, and $b_T^{\mathrm{gen}}$ is set to the $(1 - \alpha)$ -quantile of the limiting distribution of $\sup_{v\in [0,\rho^*]}\widehat{\mathcal{D}}_T^{\mathrm{gen}}(v)$ . In practice, both $\rho^*$ and limiting distribution of $\widehat{\mathcal{D}}_T^{\mathrm{gen}}(\cdot)$ are unknown, thus $b_T$ is approximated by a two-step procedure with expensive simulations. For our statistic, we find that under the null, $\widehat{\mathcal{D}}_T(u)$ and $u\widehat{\mathcal{D}}_T(1)$ follow the same limiting distribution for any $u$ . It implies that we can estimate $\rho^*$ by + +$$ +\hat {\rho} = T ^ {- 1} \sum_ {t = 1} ^ {T} \mathbb {I} \left(T \widehat {\mathcal {D}} _ {T} (t / T) \leq c _ {T} (t / T)\right), \quad \text {w h e r e} \quad c _ {T} (u) = u b _ {T}, \tag {12} +$$ + +and the scaling factor $T$ ensures that $T\widehat{\mathcal{D}}_T$ has a non-degenerate limiting distribution. Here, $\hat{\rho}$ is affected by $c_{T}$ : a larger $c_{T}$ will lead to a larger $\hat{\rho}$ and vice versa. Ideally, the optimal choice of $c_{T}$ should minimize a measure of error, and we propose using $l_{1}(\hat{\rho}) = \mathbb{E}|\hat{\rho} -\rho^{*}|$ . It depends on the finite sample distribution of $\widehat{\mathcal{D}}_T$ and could be hard to control in nonparametric settings, but we know the asymptotic distribution of $\widehat{\mathcal{D}}_T(\cdot)$ (Theorem 4.4). Thus, we choose the $c_{T}$ which minimizes the $l_{1}$ error of the population version $\rho^{\infty}$ of $\hat{\rho}$ : + +$$ +l _ {1} (\rho^ {\infty}) = \mathbb {E} | \rho^ {\infty} - \rho^ {*} | \quad \text {w i t h} \quad \rho^ {\infty} = \int_ {0} ^ {\rho^ {*}} \mathbb {I} (L _ {0} (u) \leq c _ {T} (u)) d u + \int_ {\rho^ {*}} ^ {1} \mathbb {I} (T ^ {1 / 2} L _ {1} (u) + T D (u) \leq c _ {T} (u)) d u, +$$ + +where $L_0(\cdot), L_1(\cdot)$ correspond to the asymptotic distribution of properly re-scaled and re-centered $\widehat{\mathcal{D}}_T(\cdot)$ before and after $\rho^*$ , respectively, and they are defined in Theorem 4.4. Under some assumptions, minimizing $l_1(\rho^\infty)$ leads to + +$$ +b _ {T} = \hat {\lambda} _ {1} / (2 \kappa) \log T, \tag {13} +$$ + +where $\kappa \geq 2$ is determined by the smoothness of change and the smoother it is, the larger $\kappa$ is. The derivation of Equation (13) is included in the next section. The theoretical value of $\kappa$ is defined in Assumption 4, and it depends on the alternative distribution of $Y_{t,T}$ and the kernel $k$ . For practitioners, we only need to know it for abrupt changes and any choice of kernel, $\kappa = 2$ (indeed, our method is also applicable for abrupt changes). For RBF, if the change in $\mathbb{E}\exp \{Y_{t,T}\}$ can be approximated by $(u - \rho^{*})^{\beta}$ in time span $u\in [\rho^{*},\rho^{*} + \varepsilon)$ for some small $\varepsilon >0$ , we have $\kappa = 2\beta +2$ . We emphasize that the choice of $\kappa$ does not affect the consistency of $\hat{\rho}$ . In experiments, using rule of thumb $\kappa = 4$ works well. An alternative estimator that is less sensitive to $\kappa$ is introduced next. + +Max-gap estimator. Despite its good theoretical properties, $\hat{\rho}$ has often a large positive bias. This arises from the nature of gradual changes, and is common to previous gradual CPD methods as discussed in Vogt and Dette (2015). Intuitively, we need to wait for enough signal strength in order to identify the gradual change point. To design a less biased estimator, recall that in Figure 2, we plotted $\widehat{\mathcal{D}}_T(\cdot)$ against time and easily visually identified the change point as the time when $\widehat{\mathcal{D}}_T(\cdot)$ starts to grow. For example, for data in the first column, a zoomed-in region is shown in Figure 3, where the black line is $T\widehat{\mathcal{D}}_T(\cdot)$ and red line $c_{T}(\cdot)$ . In Figure 3, the growth starts around the point 285 (shown in + +brown vertical line). However, using $\hat{\rho}$ gives $\hat{\tau} = 342$ (shown in green vertical line). We want an algorithm capable of identifying this elbow point (285). Note that from Theorem 4.4, we have + +$$ +\mathbb {E} [ c _ {T} (u) - T \widehat {\mathcal {D}} _ {T} (u) ] \left\{ \begin{array}{l l} \text {i n c r e a s e s w i t h u ,} & \text {i f u \leq \rho^ {*}} \\ \text {d e c r e a s e s w i t h u ,} & \text {i f u > \rho^ {*}}. \end{array} \right. +$$ + +Thus, $\rho^{*}$ should be the $u$ where $c_{T}(u) - T\widehat{\mathcal{D}}_{T}(u)$ is maximized (in Figure 3, this is where the gap between the red line and black curve is maximized). It suggests setting + +$$ +\check {\rho} = \operatorname {m a r g} \max _ {u \in (0, \hat {\rho} ]} [ c _ {T} (u) - T \widehat {\mathcal {D}} _ {T} (u) ], \tag {14} +$$ + +where $m$ arg max takes the largest value in the set formed by arg max. In Figure 3, $\check{\rho}$ is shown by the brown line. + +Compared with $\hat{\rho}$ , empirical studies show two advantages of the max-gap estimator $\check{\rho}$ : it is more accurate, and is much less sensitive to choice of $\kappa$ . Some intuition for insensitivity to $\kappa$ : in Figure 3, $\kappa$ changes the slope of the red line and a slight change in slope does not affect the time where its gap between the black line is maximized. The higher accuracy of $\check{\rho}$ also has a theoretical explanation, which is included in the Appendix due to space limit. In short, the $l_{1}$ error of $\check{\rho}$ consists of two parts: the overestimation error $\mathbb{E}[\check{\rho} - \rho^{*}]_{+}$ and the underestimation error $\mathbb{E}[\rho^{*} - \check{\rho}]_{+}$ with $[x]_{+}$ denotes the positive part of $x$ . There is always a trade-off between overestimation and underestimation. Roughly, $\check{\rho}$ focuses more on controlling the overestimation error (delay) while guaranteeing consistency of the estimator, since delay is the main concern in small samples. In contrast, $\hat{\rho}$ controls the over/underestimation error equally, which might be less accurate in small samples. + +Practical considerations. All steps of the proposed procedure are summarized in Algorithm 1 in Section A of the Appendix. There we also discuss its time and space complexity. + +# 4 Theory + +This section establishes all theoretical results mentioned previously. + +Asymptotic distribution of $\widehat{\mathcal{D}}_T$ . In order to utilize $\widehat{\mathcal{D}}_T$ for downstream tasks, we need to know its asymptotic distribution. To establish that, we will first introduce some technical assumptions. + +Assumption 1. $\exists M\in (0, + \infty),\forall t\in \{1,2,\dots ,T\} ,k(Y_{t,T},Y_{t,T})\leq M^2$ almost surely (a.s.). + +Remark 4.1. Assumption 1 requires that the kernel is a.s. bounded for all $Y_{t,T}$ . It is a weak assumption which is satisfied when $k(\cdot, \cdot)$ is continuous and $\mathcal{V}$ is closed and bounded, or when $k$ is RBF kernel. + +Assumption 1 suffices for getting asymptotic null of $\widehat{\mathcal{D}}_T$ . Under $H_{A}$ , however, we need to restrict the changing pattern of $Y_{t,T}$ : roughly, we require the change to be gradual, so the speed of change cannot be too fast compared with sample size. One useful concept to regulate such behavior is the locally stationary process, which has been used in Vogt and Dette (2015) for gradual CPD problems. + +Assumption 2 (Locally Stationary Process). The array $\{Y_{t,T} : t = 1,2,\dots,T\}_{T=1}^{\infty}$ is a locally stationary process, i.e., $\forall u \in [0,1]$ , there exists a strictly stationary process $\{Y_t(u) : t \in \mathbb{Z}\}$ s.t. + +$$ +\left\| Y _ {t, T} - Y _ {t} (u) \right\| _ {\mathcal {Y}} \leq \left(| t / T - u | + 1 / T\right) U _ {t, T} (u) \quad a. s. +$$ + +where $\{U_{t,T}(u):t = 1,2,\dots ,T\}_{T = 1}^{\infty}$ is an array of positive random variables which satisfies $\mathbb{E}[U_{t,T}^{\gamma}(u)]\leq c_0$ for some constant $c_{0}\in (0, + \infty)$ , $\gamma >0$ . + +Remark 4.2. Assumption 2 ensures that locally around each $u = t / T$ , $\{Y_{t,T}\}$ can be approximated by a stationary process $\{Y_t(u)\}$ . The constant $\gamma$ measures how well $Y_{t,T}$ is approximated by $Y_{t}(u)$ : the larger $\gamma$ is, the better the approximation will be. + +Define + +$$ +\mathcal {D} (u) = \max _ {v \in [ 0, u ]} \mathcal {K} (u, v) \quad \text {w i t h} \quad \mathcal {K} (u, v) = \left\| \int_ {0} ^ {v} \mu (w) d w - v / u \int_ {0} ^ {u} \mu (w) d w \right\| _ {\mathcal {H}} ^ {2}, \tag {15} +$$ + +where $\mu (\cdot) = (\mu_{1}(\cdot),\mu_{2}(\cdot),\dots)^{\top},\mu_{j}(\cdot) = \mathbb{E}\phi_{j}(Y_{t}(\cdot))$ . Comparing Equations (15) and (8), we find that $\widehat{\mathcal{K}}_T(u,v)$ is in fact an estimator for $\kappa (u,v)$ and thus, $\widehat{\mathcal{D}}_T(u)$ is an estimator for $\mathcal{D}(u)$ . Using the + +![](images/17b98a6be064b72869b78f08a12092c4ea44f2a38a44eca7df3b45ab100d7c63.jpg) +comparison of estimators +Figure 3: Comparison of max-gap estimator and original estimator in simulated data. + +decomposition $\widehat{\mathcal{D}}_T(u) = \mathcal{D}(u) + [\widehat{\mathcal{D}}_T(u) - \mathcal{D}(u)]$ , in order to study asymptotics of $\widehat{\mathcal{D}}_T$ , we only need to study the approximation error $\widehat{\mathcal{D}}_T - \mathcal{D}$ . We will need the following assumptions: + +Assumption 3. The feature map $\phi$ and stochastic processes $\{\mu_j(u):u\in [0,1]\}$ $\forall j\in \mathbb{Z}_{+}$ satisfy + +(i) $\| \phi (y) - \phi (y^{\prime})\|_{\mathcal{H}}\leq C_1\| y - y^{\prime}\|_{\mathcal{Y}}$ for all $y,y^{\prime}\in \mathcal{V}$ +(ii) $\gamma \geq 2$ where $\gamma$ is defined in Assumption 2. +(iii) $\sum_{j=1}^{\infty} \max_{u \in (0,1)} d\mu_j(u) / du < +\infty.$ + +Remark 4.3. Condition (i) requires sufficient smoothness for $\phi$ which is always satisfied for sufficiently smooth kernels $k$ . Intuitively, this helps us preserve the smoothness of the change in $Y_{t,T}$ . Condition (ii) requires that $Y_{t,T}$ can be sufficiently well approximated by $Y_{t}(u)$ in the sense that $U_{t,T}(u)$ has finite variance. Condition (iii) roughly says that $\mu_{j}$ has a well-defined Riemann integral over $[0,1]$ so that the integral in $\mathcal{D}$ can be approximated by the Riemann sum in $\widehat{\mathcal{D}}_T$ . + +Now we are ready to present our main result, where $\rho^{*} = 1$ corresponds to no change point. + +Theorem 4.4. Suppose Assumption 1 holds. + +(1) For any $u \in (0, \rho^*]$ , + +$$ +T \left[ \widehat {\mathcal {D}} _ {T} (u) - \mathcal {D} (u) \right] \xrightarrow {w} \max _ {v \in [ 0, u ]} \sum_ {l = 1} ^ {\infty} \lambda_ {l} \left[ W _ {l} (v) - \frac {v}{u} W _ {l} (u) \right] ^ {2} =: L _ {0} (u), \tag {16} +$$ + +where $\lambda_{l}$ 's are defined in (7), and $W_{l}(\cdot), l = 1, \dots$ are independent standard Wiener processes. + +(2) If, in addition, Assumptions 2 and 3 hold, for any $u \in (\rho^*, 1]$ , we have + +$$ +\sqrt {T} \left[ \widehat {\mathcal {D}} _ {T} (u) - \mathcal {D} (u) \right] \xrightarrow {w} \max _ {v \in [ 0, u ]} G (v, u) =: L _ {1} (u), \tag {17} +$$ + +where for any $u$ , $G(\cdot, u)$ is a sample continuous Gaussian process. + +Remark 4.5. Both $\sum_{l=1}^{\infty} \lambda_l [W_l(\cdot) - \frac{\dot{\alpha}}{u} W_l(u)]^2$ and $G(\cdot, u)$ are sample continuous and thus, the right hand size of (16) (17) are well-defined. $\lambda_l$ 's are determined by $P_0, k$ and (16) states that the higher the noise level of $P_0$ is, the more dispersed the asymptotic null of $\widehat{\mathcal{D}}_T$ will be. Note that the asymptotic distribution of $\widehat{\mathcal{D}}_T$ is quite different before and after the change point: before change point, for each $u$ , $\widehat{\mathcal{D}}_T(u) = O_p(T^{-1})$ and after re-scaling, $\widehat{\mathcal{D}}_T(u)$ is maximum of a chi-square process; after change point, $\widehat{\mathcal{D}}_T(u) = \mathcal{D}(u) + O_p(T^{-1/2})$ and after re-centering and re-scaling, $\widehat{\mathcal{D}}_T(u)$ is maximum of a Gaussian process. This distinct property of $\widehat{\mathcal{D}}_T(\cdot)$ is critical for the success of the proposed procedure. + +Detection. To calculate p-values, Theorem 2.1 of Liu and Ji (2014) says that for $\forall n\in \mathbb{Z}_{+}$ and $\lambda_1 = \dots = \lambda_q > \lambda_{q + 1}\geq \lambda_{q + 2}\geq \dots \geq \lambda_n > 0$ , as $x\to \infty$ + +$$ +\begin{array}{l} \mathbb {P} \big (\max _ {v \in [ 0, 1 ]} \sum_ {l = 1} ^ {n} \lambda_ {l} \left[ W _ {l} (v) - v W _ {l} (1) \right] ^ {2} > x \big) \\ = 2 ^ {(q + 3) / 2} [ \Gamma (q / 2) ] ^ {- 1} \sqrt {\pi} \left(x / \lambda_ {1}\right) ^ {(q - 1) / 2} \exp \left\{- 2 x / \lambda_ {1} \right\} \prod_ {l = q + 1} ^ {n} \left(1 - \lambda_ {l} / \lambda_ {1}\right) ^ {- 1 / 2} \left(1 + o (1)\right). \\ \end{array} +$$ + +Combined with Theorem 4.4, it implies (10). Also, we have the following: + +Corollary 4.1 (Power Consistency). Suppose Assumption 1, 2, 3 hold. If $\sqrt{T}\mathcal{D}(1)\to \infty$ + +$$ +\forall x > 0, \quad \mathbb {P} (T \widehat {\mathcal {D}} _ {T} (1) > x) \to 1, \quad T \to \infty . +$$ + +Remark 4.6. Corollary 4.1 shows that power of the proposed test is affected by the magnitude of change measured in $\mathcal{D}(1)$ . As long as $\mathcal{D}(1)$ goes to zero at a rate slower than $T^{-1/2}$ , the change will be detected if it exists; it ensures correctness of the detection step. + +Localization. Recall we need to optimize $c_{T}$ . This requires regulating the local behavior of $\mathcal{D}$ at $\rho^{*}$ : + +Assumption 4. There is a cusp of order $\kappa$ at $\rho^{*}$ for $\mathcal{D}(\cdot)$ , i.e., $\frac{\mathcal{D}(u)}{(u - \rho^{*})^{\kappa}}\to m > 0$ , $u\to \rho^{*} +$ . + +Remark 4.7. Assumption 4 says $\mathcal{D}$ can be locally approximated by a Taylor-type expansion around $\rho^{*}$ , which is a common assumption for gradual CPD (Mallik et al., 2013; Vogt and Dette, 2015). + +Theorem 4.8. Suppose Assumptions 1, 2, 3, 4 hold, and $c_{T}(u) = ub_{T}$ . The $c_{T}$ minimizing $l_{1}(\rho^{\infty})$ satisfies + +$$ +c _ {T} (u) = \left(u \lambda_ {1} r \log T\right) / 2, r \geq 1 / \kappa . \tag {18} +$$ + +Remark 4.9. In Equation (18), the larger the noise level $\lambda_{1}$ is, the larger $c_{T}$ is. The smoother the gradual change is (the larger $\kappa$ is), the smaller $c_{T}$ is. And $r$ can be viewed as a tuning parameter s.t. if we are less tolerant to delays in $\hat{\rho}$ , we could set $r$ to be small, and vice versa. In practice, $\hat{\rho}$ is often overestimated. Thus, we suggest choosing $r = 1 / \kappa$ , which ultimately leads to (13). + +Theorem 4.10. Under Assumptions 1, 2, 3, 4 and Equation (18), $\hat{\rho} -\rho^{*} = o_{p}(1)$ $\check{\rho} -\rho^{*} = o_{p}(1)$ + +Remark 4.11. Theorem 4.10 shows that the original estimator and the max-gap estimator are both consistent, and establishes theoretical guarantees for the localization step. + +# 5 Simulations + +To better understand finite sample properties of the proposed method, we evaluate its performance in simulations and against baselines. Additional details and results including type I error (p-value calibration), power comparison and performance comparison on strings are included in the Appendix. + +Data generating process. We set $\rho^{*} = 1/3$ . Following Vogt and Dette (2015), we consider a location model, a volatility model, and we add a network model. For the location model (2), we include univariate cases with $\varepsilon_{t} \sim N(0,1)$ and four different types of change ordered in increasing difficulty: (i) linear change $\mu_{1}(u) = \mathbb{I}(1/3 \leq u \leq 2/3)(3u - 1) + \mathbb{I}(u \geq 2/3)$ ; (ii) quadratic change $\mu_{2}(u) = \mathbb{I}(1/3 \leq u \leq 2/3)(3u - 1)^{2} + \mathbb{I}(u \geq 2/3)$ ; (iii) one-sided change $\mu_{3}(u) = 2\sin(2.5\pi(u - 1/3))\mathbb{I}(1/3 \leq u \leq 2/3) + \mathbb{I}(u \geq 2/3)$ in the sense that $\mu_{3}(u) > \mu_{3}(\rho^{*})$ for all $u > \rho^{*}$ ; and (iv) a complex change $\mu_{4}(u) = 2\sin(4\pi(u - 1/3))\mathbb{I}(1/3 \leq u \leq 2/3) + 2\sin(4\pi/3)\mathbb{I}(u \geq 2/3)$ . We also consider multivariate $Y_{t,T} \in \mathbb{R}^{d}$ where $\mu_{5} = \mu_{1}\mathbf{1}_{d}, \varepsilon_{t} \sim N_{d}(0,I_{d})$ . For volatility model (3), we consider $\sigma_{i}(u) = \mu_{i}(u) + 1, \varepsilon_{t} \sim N(0,1), \forall i = 1,4$ . For network model, we set $Y_{t,T}$ as the Erdos-Renyi random graph with 10 nodes. At each time $u \in [0,1]$ , there exists a 3-node community such that the possibility of forming an edge among them follows Binomial $(1,p(u))$ independently. Here $p(u) = 0.8\mathbb{I}(1/3 \leq u \leq 2/3)(3u - 1) + 0.8\mathbb{I}(u \geq 2/3) + 0.1$ . The probability of forming an edge between other pairs of nodes always follows a Binomial $(1,0.1)$ . + +Baselines. We consider four gradual CPD baselines, ordered in increasing generality: $\hat{\rho}^{\mathrm{poly}}$ (Huskova, 1999) which requires univariate location model with polynomial change, $\hat{\rho}^{\mathrm{one-side}}$ (Mallik et al., 2013) which requires univariate location model with one-sided change, $\hat{\rho}^{\mathrm{mix}}$ (Quessy, 2019) which requires any general model with a mixture type of change whose mixture weight changes linearly with time, and $\hat{\rho}^{\mathrm{gen}}$ (Vogt and Dette, 2015) which does not have any particular constraints on model or type of change. We also include three nonparametric abrupt CPD methods: KCpA (Harchaoui et al., 2008), $Z_{w}$ (Chu et al., 2019), and $Q$ (Matteson and James, 2014)). + +Detailed setup. Setting I (main experiment): We set $T = 600$ . For $\hat{\rho}^{\mathrm{one-side}}$ we tune the bandwidth on 20 independently generated datasets among $\{0.01, 0.05, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 5\}$ . For each dataset, for fairness we use the same kernel for $\hat{\rho}, \check{\rho}$ and KCpA, and use its corresponding distance for $Q, Z_w$ and function class $\mathcal{F}$ for $\hat{\rho}^{\mathrm{gen}}$ . For location model, $\mathcal{F} = \{f : x \mapsto x_i, \forall i = 1, \dots, d\}$ ; for network model, $\mathcal{F} = \{f : x \mapsto x_{ij}, \forall i, j = 1, \dots, 10\}$ ; for volatility model, $\mathcal{F} = \{f : x \mapsto x^2\}$ . For $\hat{\rho}^{\mathrm{poly}}$ we set the polynomial to the true degree if the polynomial model is correct, and 1 otherwise. As recommended by their authors, we use a granularity of 20 for $\hat{\rho}^{\mathrm{mix}}$ and minimum spanning tree to construct the binary graph for $Z_w$ . Threshold for $\hat{\rho}^{\mathrm{gen}}$ is computed using strategy described in Section 6 of Vogt and Dette (2015). + +Setting II (influence of bandwidth): We note that both the proposed method and KCpA are kernel-based. In setting I, we use the kernel that is theoretically best for both of them. As suggested by reviewers, in this setting, we search for the empirically best RBF kernel $k(y, y') = \exp\{-\|y - y'\|^2/h\}$ where $h$ is the bandwidth and is tuned among $\{0.01, 0.05, 0.1, 1, 5, 10, 20, 50, 100, 500\}$ on 20 independently generated data sets. Here $\| \cdot \|$ is the $l_2$ distance for scalars/vectors and Frobenius norm for network. We set $T = 210$ and report the testing performance on 20 separate testing sets. + +Metrics and Results. We report the power and $l_{1}$ error of estimated change points. For fairness, power of all methods are computed via 500 permutations under significance level $\alpha = 0.05$ . Due to space limit, detailed results on power are included in the Appendix - performance of all abrupt as well as gradual CPD methods are similar. In terms of localization, however, performance varies. In Table 1a, the abrupt CPD methods (KCpA, $Q$ , $Z_{w}$ ) have a large error in most settings, which is not surprising because KCpA, $Q$ are designed for abrupt changes. For $\hat{\rho}^{\mathrm{poly}}$ , $\hat{\rho}^{\mathrm{one-side}}$ which require assumptions on the changing form, the localization is accurate when assumptions are satisfied, but + +Table 1: Comparison of average $l_{1}$ localization error over 20 simulations. Numbers after $\pm$ are the standard error of the average. Methods marked with ' -' means not applicable to that model. +(a) Setting I. + +
MODELLOCATIONVOLATILITYNETWORK
DIM CHANGE1 LINEAR1 QUADRATIC1 ONE-SIDED1 COMPLEX10 LINEAR20 LINEAR50 LINEAR1 LINEAR1 COMPLEX102 LINEAR
ρ0.09±0.010.15±0.010.03±0.000.03±0.010.07±0.010.06±0.010.05±0.010.15±0.010.05±0.000.10±0.02
ρ0.10±0.010.24±0.010.08±0.000.05±0.010.08±0.010.10±0.010.09±0.010.26±0.010.12±0.000.11±0.02
ρPOLY0.05±0.010.09±0.020.10±0.010.23±0.00------
ρONE-SIDE0.07±0.010.09±0.020.02±0.000.62±0.00------
ρMIX0.05±0.010.09±0.010.14±0.000.12±0.000.08±0.000.18±0.020.43±0.000.08±0.010.14±0.00-
ρGEN0.17±0.010.24±0.010.07±0.000.05±0.000.13±0.010.15±0.010.14±0.000.26±0.010.12±0.000.27±0.00
Q0.18±0.010.23±0.010.05±0.000.27±0.000.16±0.010.17±0.000.16±0.000.21±0.010.06±0.000.16±0.01
KCPA0.18±0.010.23±0.010.05±0.000.27±0.000.16±0.010.16±0.000.16±0.000.21±0.010.06±0.000.16±0.01
Zw0.24±0.040.29±0.040.09±0.020.29±0.010.16±0.010.17±0.010.18±0.010.18±0.030.16±0.030.16±0.02
+ +(b) Setting II. + +
MODELLOCATIONVOLATILITYNETWORK
DIM CHANGE1 LINEAR1 QUADRATIC1 ONE-SIDED1 COMPLEX10 LINEAR20 LINEAR50 LINEAR1 LINEAR1 COMPLEX102 LINEAR
ρ0.14±0.010.19±0.010.05±0.010.04±0.010.07±0.010.05±0.010.08±0.010.15±0.010.13±0.010.02±0.01
ρ0.12±0.010.18±0.010.09±0.010.07±0.010.09±0.010.07±0.010.11±0.010.15±0.010.21±0.010.07±0.01
KCPA0.18±0.010.23±0.010.05±0.010.29±0.010.21±0.010.16±0.010.18±0.010.28±0.020.23±0.060.17±0.01
+ +poor otherwise. $\hat{\rho}^{\mathrm{mix}}$ performs well in low dimensions and when the change (approximately) satisfies its assumption, but poorly when either one is violated. The proposed estimators $\hat{\rho},\check{\rho}$ are robust across different settings and $\tilde{\rho}$ has improved performance over $\hat{\rho}$ . $\hat{\rho}^{\mathrm{gen}}$ is also significantly outperformed by $\check{\rho}$ . Finally, note $\hat{\rho}^{\mathrm{mix}},\hat{\rho}^{\mathrm{gen}}$ are more computationally expensive than the others. In Table 1b, the conclusion is consistent where we use RBF kernel with tuned bandwidth. Together, Table 1 shows the advantage of $\hat{\rho},\check{\rho}$ in terms of handling general types of data and general types of changes. + +# 6 Real Data Applications + +Different from most machine learning tasks, there are currently no benchmarking dataset with human annotations for gradual CPD. Thus, we consider the applications introduced in Section 1, and compare our result with known external events and/or other CPD estimators. + +Central England Temperature. The Central England Temperature (CET) record (Parker et al., 1992) under Open Government License is the oldest temperature record worldwide and is a valuable source for studying climate change. It contains the monthly mean temperature in central England from 1750 to 2020. Since there is a cycle of 12 months for the measurements, following Horváth et al. (1999), we view the data as $n = 271$ curves with 12 measurements on each curve. We set $k(y, y') = y^\top y'$ where $y, y' \in \mathbb{R}^{12}$ . Using max-gap estimator, we identify 1827 as the change point (shown in red vertical line in Figure 1a), which roughly corresponds to the beginning of mass industrialization and is close to the 1850 estimated by Berkes et al. (2009). + +S&P 500 Index. The S&P 500 is a stock market index which tracks the stock of 500 large US companies and is usually used as a benchmark of the overall market. We investigate the daily return data of the S&P 500 index1 in two periods, one from 2008/01/02 to 2008/12/31 and another from 2019/06/03 to 2020/06/01. Both time periods contain a change point where volatility level gradually increases. Following Vogt and Dette (2015), the daily return $Y_{t,T}$ roughly follows the volatility model (3) and our task is to identify changes in $\sigma(\cdot)$ . We define the kernel as $k(y, y') = y^2(y')^2$ where $y, y' \in \mathbb{R}$ . In both periods, we detect a change under $\alpha = 0.05$ . The first period has an estimated change point 2008/09/16, following Lehman Brothers Bankruptcy in September 15 which is often viewed as a turning point in the crisis. The second period has an estimated change point 2020/02/24, days in the initial phase of the community spread of COVID-19 in the United States. The estimated change points are shown in red vertical lines in Figure 1b. + +# 7 Related Work + +Here we discuss some related work, with some additional reviews included in Section E in Appendix. + +Difference with Vogt and Dette (2015). The major improvements of this work over Vogt and Dette (2015) are discussed in detail in Sections 1, 3. Other differences include: Vogt and Dette (2015) allow correlated observations, while we assume independence; Vogt and Dette (2015) uses estimator (3), while we propose a refined max-gap estimator that performs better empirically. We note that the our method might also be adapted for the correlated case, a possible direction for future work. + +Abrupt CPD. Abrupt CPD methods assume the distribution remains stationary until the change point when it jumps to another distribution, and remains stationary there. There is a rich literature on them; see Niu et al. (2016); Aminikhanghahi and Cook (2017); Truong et al. (2020) for detailed surveys. In our experiments, we find that abrupt CPD methods seem to produce poor localization estimators for gradual changes. Here we explain this phenomenon by giving a toy example in which the abrupt CPD methods fail to be consistent. Consider the case where $Y_{i,T} = \mu_1(i / T)$ with $\mu_1(u) = \mathbb{I}(1 / 3\leq u\leq 2 / 3)(3u - 1) + \mathbb{I}(u\geq 2 / 3)$ . Recall that all three abrupt CPD methods we consider (KCpA, $Q$ , $Z_w$ ) estimate the change point as + +$$ +\tilde {\rho} := \arg \max _ {t} d \left(P _ {0} (t), P _ {1} (t)\right), \tag {19} +$$ + +where $d(P_0(t), P_1(t))$ is some (standardized) discrepancy measure between the two groups of data separated by $t$ . Notice that Equation (19) differs fundamentally from the proposed estimator (12). For $Q$ , if we set $\alpha = 2$ in Equation (4) of Matteson and James (2014), one can easily show that $\tilde{\rho}$ converges to $1/2$ , which is different from the truth $1/3$ . This same observation also holds for KCpA and $Z_w$ with more complicated analysis, but the general observation is that estimators of the form (19) may fail to be consistent under some gradual changes. + +MMD. The Maximum Mean Discrepancy (MMD) is proposed in Gretton et al. (2012) for two-sample tests. We note that our intermediate statistic $\widehat{\mathcal{K}}_T(u,v)$ is similar to MMD. However, we emphasize the differences here: First, MMD is designed for two-sample tests where all theoretical analyses are based on two fixed samples, while we aim at the change point problem where we do not know where the true change point is. Thus, our final statistic $\widehat{\mathcal{D}}_T$ requires extra and careful handling (e.g., the scaling factor $v^2 (u - v)^2 /u^2$ and the max over $v\in [0,u]$ ). These extra terms complicate the theoretical analysis (see Theorem 4.4). Second, the alternative in two-sample tests is that the two groups of data follow two different distributions; however, with gradual change point problems, we really do not have two distinct distributions but an infinite number of different distributions! Indeed, the main theoretical difficulty of this work lies in characterizing the behavior of $\widehat{\mathcal{D}}_T$ under the alternative with gradual changes, which is quite different from the (local) alternatives in two-sample tests and requires more involved analysis. Further, the more difficult task we address is to localize the change point (instead of detecting change points), which does not exist for two sample tests. + +CUSUM. The CUSUM principle was proposed by Page (1954) and has led to a rich literature. Some papers have investigated using CUSUM under gradual changes (Bissell, 1984a,b; Gan, 1992), but they considered only simple settings with a linear trend in the mean of univariate data, and their analyses are based mostly on empirical studies. + +Kernel-based CPD methods. Existing kernel-based CPD methods all focus on the abrupt settings (Harchaoui et al., 2008; Arlot et al., 2012; Li et al., 2015; Garreau et al., 2018). We emphasize that their method is fundamentally different from ours, and, as far as we know, none of them produces a consistent localization estimator in the settings considered in this paper. + +# 8 Discussion + +We propose a general method to detect and to localize gradual changes in sequence data. Despite the relaxed assumptions, the proposed method is theoretically guaranteed, and the proposed max-gap estimator achieves good empirical performance. Note that the proposed method also works for abrupt CPD with Corollary 4.1 and Theorem 4.10 hold. In contrast, many abrupt CPD methods perform poorly in gradual change settings. The trade-off is that for abrupt changes or gradual changes with a known pattern (e.g., polynomial), our method often does not perform as good as those designed especially for those settings. There are no foreseeable negative social impacts of this work. + +# References + +Aminikhanghahi, S. and D. J. Cook (2017). A survey of methods for time series change point detection. Knowledge and information systems 51(2), 339-367. +Arlot, S., A. Celisse, and Z. Harchaoui (2012). A kernel multiple change-point algorithm via model selection. arXiv:1202.3878. +Aue, A. and J. Steinebach (2002). A note on estimating the change-point of a gradually changing stochastic process. Statistics & probability letters 56(2), 177-191. +Berkes, I., R. Gabrys, L. Horváth, and P. Kokoszka (2009). Detecting changes in the mean of functional observations. Journal of the Royal Statistical Society: Series B (Statistical Methodology) 71(5), 927-946. +Bissell, A. (1984a). Estimation of linear trend from a cumum chart or tabulation. Journal of the Royal Statistical Society: Series C (Applied Statistics) 33(2), 152-157. +Bissell, A. (1984b). The performance of control charts and cusums under linear trend. Journal of the Royal Statistical Society: Series C (Applied Statistics) 33(2), 145-151. +Brown, B. M. et al. (1971). Martingale central limit theorems. Annals of Mathematical Statistics 42(1), 59-66. +Chen, H., N. Zhang, and L. Chu (2014). gseg: Graph-based change-point detection (g-segmentation). R package version 0.1. Available at CRAN. R-project.org/package= gSeg. +Chu, L., H. Chen, et al. (2019). Asymptotic distribution-free change-point detection for multivariate and non-euclidean data. The Annals of Statistics 47(1), 382-414. +Dehling, H., A. Rooch, M. S. Taqqu, et al. (2017). Power of change-point tests for long-range dependent data. *Electronic Journal of Statistics* 11(1), 2168-2198. +Gan, F. (1992). Cusum control charts under linear drift. Journal of the Royal Statistical Society: Series D (The Statistician) 41(1), 71-84. +Garreau, D., S. Arlot, et al. (2018). Consistent change-point detection with kernels. *Electronic Journal of Statistics* 12(2), 4440-4486. +Goldenshluger, A., A. Tsybakov, A. Zeevi, et al. (2006). Optimal change-point estimation from indirect observations. The Annals of Statistics 34(1), 350-372. +Gretton, A., K. M. Borgwardt, M. J. Rasch, B. Scholkopf, and A. Smola (2012). A kernel two-sample test. The Journal of Machine Learning Research 13(1), 723-773. +Harchaoui, Z., E. Moulines, and F. Bach (2008). Kernel change-point analysis. Advances in neural information processing systems 21, 609-616. +Horváth, L., P. Kokoszka, and J. Steinebach (1999). Testing for changes in multivariate dependent observations with an application to temperature changes. Journal of Multivariate Analysis 68(1), 96-119. +Hušková, M. (1999). Gradual changes versus abrupt changes. Journal of Statistical Planning and Inference 76(1-2), 109-125. +Hušková, M. and J. Steinebach (2002). Asymptotic tests for gradual changes. Statistics & Risk Modeling 20(1-4), 137-152. +Inglot, T. and T. Ledwina (2006). Asymptotic optimality of new adaptive test in regression model. In Annales de l'Institut Henri Poincare (B) Probability and Statistics, Volume 42, pp. 579-590. Elsevier. +Kim, S.-J., K. Koh, S. Boyd, and D. Gorinevsky (2009). $\ell_1$ trend filtering. SIAM review 51(2), 339-360. + +Levenshtein, V. I. et al. (1966). Binary codes capable of correcting deletions, insertions, and reversals. In Soviet physics doklady, Volume 10, pp. 707-710. Soviet Union. +Li, S., Y. Xie, H. Dai, and L. Song (2015). M-statistic for kernel change-point detection. In Advances in Neural Information Processing Systems, pp. 3366-3374. +Liu, P. and L. Ji (2014). Extremes of chi-square processes with trend. arXiv preprint arXiv:1407.6501. +Lombard, F. (1987). Rank tests for changepoint problems. Biometrika 74(3), 615-624. +Mallik, A., M. Banerjee, B. Sen, et al. (2013). Asymptotics for $p$ -value based threshold estimation in regression settings. Electronic Journal of Statistics 7, 2477-2515. +Mallik, A., B. Sen, M. Banerjee, and G. Michailidis (2011). Threshold estimation based on ap-value framework in dose-response and regression settings. Biometrika 98(4), 887-900. +Matteson, D. S. and N. A. James (2014). A nonparametric approach for multiple change point analysis of multivariate data. Journal of the American Statistical Association 109(505), 334-345. +Mercurio, D., V. Spokoiny, et al. (2004). Statistical inference for time-inhomogeneous volatility models. The Annals of Statistics 32(2), 577-602. +Moghtaderi, A., P. Flandrin, and P. Borgnat (2013). Trend filtering via empirical mode decompositions. Computational Statistics & Data Analysis 58, 114-126. +Muller, H.-G. (1992). Change-points in nonparametric regression analysis. The Annals of Statistics, 737-761. +Niu, Y. S., N. Hao, and H. Zhang (2016). Multiple change-point detection: A selective overview. Statistical Science, 611-623. +Page, E. S. (1954). Continuous inspection schemes. Biometrika 41(1/2), 100-115. +Parker, D. E., T. P. Legg, and C. K. Folland (1992). A new daily central england temperature series, 1772-1991. International Journal of Climatology 12(4), 317-342. +Quessy, J.-F. (2019). Consistent nonparametric tests for detecting gradual changes in the marginals and the copula of multivariate time series. Statistical Papers 60(3), 717-746. +Raimondo, M. (1998). Minimax estimation of sharp change points. Annals of statistics, 1379-1397. +Ramdas, A. and R. J. Tibshirani (2016). Fast and flexible admm algorithms for trend filtering. Journal of Computational and Graphical Statistics 25(3), 839-858. +Sadhanala, V. and R. J. Tibshirani (2017). Additive models with trend filtering. arXiv preprint arXiv:1702.05037. +Tewes, J. (2017). Change-point tests and the bootstrap under long-and short-range dependence. Ph.D. thesis, Ruhr-Universität Bochum. +Tibshirani, R. J. (2014). Adaptive piecewise polynomial estimation via trend filtering. The Annals of Statistics 42(1), 285-323. +Truong, C., L. Oudre, and N. Vayatis (2020). Selective review of offline change point detection methods. Signal Processing 167, 107299. +Van den Burg, G. J. J. and C. K. I. Williams (2020). An evaluation of change point detection algorithms. arXiv preprint arXiv:2003.06222. +Vogt, M. and H. Dette (2015). Detecting gradual changes in locally stationary processes. The Annals of Statistics 43(2), 713-740. +Wang, Y.-X., J. Sharpnack, A. Smola, and R. Tibshirani (2015). Trend filtering on graphs. In Artificial Intelligence and Statistics, pp. 1042-1050. PMLR. + +# Checklist + +1. For all authors... + +(a) Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope? [Yes] +(b) Did you describe the limitations of your work? [Yes] See Section 8. +(c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 8. +(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] + +2. If you are including theoretical results... + +(a) Did you state the full set of assumptions of all theoretical results? [Yes] +(b) Did you include complete proofs of all theoretical results? [Yes] See Appendix. + +3. If you ran experiments... + +(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] +(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] All methods included in the experiment are unsupervised and choice of other hyperparameters are specified in Section 5 and the Appendix. +(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] +(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [N/A] + +4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... + +(a) If your work uses existing assets, did you cite the creators? [Yes] See Section 6. +(b) Did you mention the license of the assets? [Yes] See Section 6. +(c) Did you include any new assets either in the supplemental material or as a URL? [No] +(d) Did you discuss whether and how consent was obtained from people whose data you're using/curating? [N/A] Data are publicly available. +(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] + +5. If you used crowdsourcing or conducted research with human subjects... + +(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] +(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] +(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] \ No newline at end of file diff --git a/anonparametricmethodforgradualchangeproblemswithstatisticalguarantees/images.zip b/anonparametricmethodforgradualchangeproblemswithstatisticalguarantees/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..3a85d02acb58cdf3ca6fd987d14137fee7caa698 --- /dev/null +++ b/anonparametricmethodforgradualchangeproblemswithstatisticalguarantees/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:112f0a7a45b49cc90a9c6539d72774fc26b03cfd21bc7918cfb540ffc3cf4d41 +size 454673 diff --git a/anonparametricmethodforgradualchangeproblemswithstatisticalguarantees/layout.json b/anonparametricmethodforgradualchangeproblemswithstatisticalguarantees/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..06e56caa7a01a2403029ecdd930967b4c6c151cd --- /dev/null +++ b/anonparametricmethodforgradualchangeproblemswithstatisticalguarantees/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31029d5f1d972244c604d689ca115165847fc7714c5f3216c8ea659976808271 +size 787727 diff --git a/anormativeandbiologicallyplausiblealgorithmforindependentcomponentanalysis/43a9b389-b73c-40cb-a72b-cf3243acee9b_content_list.json b/anormativeandbiologicallyplausiblealgorithmforindependentcomponentanalysis/43a9b389-b73c-40cb-a72b-cf3243acee9b_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..93eb8e9c7b78573a1bb4cd2b506b0063bb8cb6c8 --- /dev/null +++ b/anormativeandbiologicallyplausiblealgorithmforindependentcomponentanalysis/43a9b389-b73c-40cb-a72b-cf3243acee9b_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f88ec22ff42ede25265d211ac1d59503e7f139bdf74e3c2ec0937f13ad9221ea +size 99191 diff --git a/anormativeandbiologicallyplausiblealgorithmforindependentcomponentanalysis/43a9b389-b73c-40cb-a72b-cf3243acee9b_model.json b/anormativeandbiologicallyplausiblealgorithmforindependentcomponentanalysis/43a9b389-b73c-40cb-a72b-cf3243acee9b_model.json new file mode 100644 index 0000000000000000000000000000000000000000..5247cfe735ff428ea74caf4d83e94d3ab2d860fc --- /dev/null +++ b/anormativeandbiologicallyplausiblealgorithmforindependentcomponentanalysis/43a9b389-b73c-40cb-a72b-cf3243acee9b_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0b701f950fcbd4f300251566c2af264f7715a6cf0611fb3e8efccc90167269e9 +size 132764 diff --git a/anormativeandbiologicallyplausiblealgorithmforindependentcomponentanalysis/43a9b389-b73c-40cb-a72b-cf3243acee9b_origin.pdf b/anormativeandbiologicallyplausiblealgorithmforindependentcomponentanalysis/43a9b389-b73c-40cb-a72b-cf3243acee9b_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0329aa2b067a88ed622cc0efd5db14527d8afb77 --- /dev/null +++ b/anormativeandbiologicallyplausiblealgorithmforindependentcomponentanalysis/43a9b389-b73c-40cb-a72b-cf3243acee9b_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:06f51b202342f30f8dfb42a519b092186f8c5bdd0529a0859d384d4f829637a4 +size 2846445 diff --git a/anormativeandbiologicallyplausiblealgorithmforindependentcomponentanalysis/full.md b/anormativeandbiologicallyplausiblealgorithmforindependentcomponentanalysis/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2a86816bf41b72be7a92ae628580de1a627e87e6 --- /dev/null +++ b/anormativeandbiologicallyplausiblealgorithmforindependentcomponentanalysis/full.md @@ -0,0 +1,458 @@ +# A Normative and Biologically Plausible Algorithm for Independent Component Analysis + +Yanis Bahroun $^{1,2}$ Dmitri B. Chklovskii $^{1,4}$ Anirvan M. Sengupta $^{2,3,5}$ + +1 Center for Computational Neuroscience, Flatiron Institute + +$^{2}$ Center for Computational Mathematics, Flatiron Institute + +3 Center for Computational Quantum Physics, Flatiron Institute + +4 Neuroscience Institute, NYU Medical Center + +$^{5}$ Department of Physics and Astronomy, Rutgers University + +{yahroun,dchklovskii}@flatironinstitute.org anirvans.physics@gmail.com + +# Abstract + +The brain effortlessly solves blind source separation (BSS) problems, but the algorithm it uses remains elusive. In signal processing, linear BSS problems are often solved by Independent Component Analysis (ICA). To serve as a model of a biological circuit, the ICA neural network (NN) must satisfy at least the following requirements: 1. The algorithm must operate in the online setting where data samples are streamed one at a time, and the NN computes the sources on the fly without storing any significant fraction of the data in memory. 2. The synaptic weight update is local, i.e., it depends only on the biophysical variables present in the vicinity of a synapse. Here, we propose a novel objective function for ICA from which we derive a biologically plausible NN, including both the neural architecture and the synaptic learning rules. Interestingly, our algorithm relies on modulating synaptic plasticity by the total activity of the output neurons. In the brain, this could be accomplished by neuromodulators, extracellular calcium, local field potential, or nitric oxide. + +# 1 Introduction + +In the brain, visual, auditory, and olfactory systems effortlessly identify latent sources from their mixtures [1, 2, 3, 4]. In unsupervised learning, such task is known as blind source separation (BSS) [5]. BSS is often solved by Independent Component Analysis (ICA) [6, 7], which assumes a generative model, wherein the observed stimuli are linear combinations of independent sources. ICA algorithms determine the linear transformation back from the observed stimuli into their original sources without knowing how they were mixed in the first place. + +Developing a biologically plausible ICA algorithm may provide critical insight into neural computational primitives because ICA may be implemented throughout the brain. In particular, receptive fields of V1 neurons may be the result of performing ICA on natural images [8, 9]. Similarly, ICA may account for the receptive fields in the auditory system [10]. Moreover, the neural computational primitives used in the visual and the auditory cortex may be similar, as evidenced by anatomical similarity and by developmental experiments where auditory cortex neurons acquire V1-like receptive fields when visual inputs are redirected there [11]. Therefore, ICA may serve as a computational primitive underlying learning throughout the neocortex. + +The majority of existing ICA algorithms[5], for example, information-theoretic ones [12, 13, 14, 15, 16] do not meet our biological plausibility requirements. In this work, for the biological plausibility of neural networks (NN), we require that i) they operate in the online (or streaming) setting, namely, the input dataset is streamed one data vector at a time, and the corresponding output must be computed + +without storing any significant fraction of the dataset in memory, ii) the weights of synapses in an NN must be updated using local learning rules, i.e., they depend only on the biophysical variables present in only the two neurons that the synapse connects or extracellular space near the synapse. Most existing bio-inspired ICA NNs [17, 18, 19, 20, 7] operate online but, when extracting multiple components, rely on non-local learning rules, i.e., a synapse needs to "know" about the individual activities of neurons other than the two it connects. + +More biologically plausible ICA algorithms with local learning rules are limited to sources whose kurtosis deviates from the normal distribution in the same direction, are hand-crafted (ad hoc), and lack good theoretical guarantees[21, 22, 20]. An alternative to analyzing NNs with ad hoc learning rules is the normative approach. In the normative approach, an optimization problem with known offline solution is used as a starting point to derive online optimization algorithm which maps onto an NN with local learning rules. Such a normative approach led to the development of more biologically plausible ICA networks but only in limited settings of either nonnegative ICA [23, 24] or bounded component analysis [25, 26] + +In this work, we develop a biologically plausible ICA neural network inspired by kurtosis-based ICA methods [27, 7, 28]. Specifically, we take inspiration in the Fourth-Order Blind Identification (FOBI) procedure which separates sources with distinct kurtosis [27]. In this context, distributions are often distinguished depending on their kurtosis relative to a Gaussian distribution, i.e., super- and sub-Gaussian distribution known respectively as leptokurtic ("spiky") and platykurtic ("flat-topped"). Our normative approach is based on a novel similarity-preserving objective for ICA with an intuitive geometric interpretation. We reformulate this objective as a min-max optimization problem and solve it online by stochastic gradient optimization. We demonstrate that our algorithm performs well on synthetic datasets, audio signals, and natural images. + +Our online algorithm maps onto a single-layer NN that can separate independent sources without pre-processing. The synaptic weights in our NN are updated using local learning rules, extending more conventional Hebbian learning rules by a time-varying modulating factor, which is a function of the total output activity. The presence of such a modulating factor suggests a role of the extracellular environment on synaptic plasticity. Modulation of the plasticity rules by overall output activity agrees with several experimental studies that have reported that a third factor, in addition to pre- and post-synaptic activities, can play a crucial role in modulating the outcome of Hebbian plasticity. This could be accomplished by neuromodulators [29, 30, 31, 32], extracellular calcium [33], local field potential [34], or nitric oxide [35, 36, 37]. + +# 2 Problem statement and inspiration + +The problem of BSS consists of recovering a set of unobservable source signals from observed mixtures. When mixing is linear, BSS can be solved by ICA, which decomposes observed random vectors into statistically independent variables. + +Mathematically, ICA assumes the following generative model. There are $d$ sources recorded $T$ times forming the columns of $\mathbf{S} \coloneqq [\mathbf{s}_1, \ldots, \mathbf{s}_T] \in \mathbb{R}^{d \times T}$ whose components $s_t^1, \ldots, s_t^d$ are assumed non-Gaussian and independent. Without loss of generality, we assume that each source has zero-mean, unit variance, and finite kurtosis. We also assume that sources have distinct kurtosis as is commonly done in kurtosis-based ICA methods [28]. The kurtosis of a random variable $v$ is defined as $\mathrm{kurt}[v] = \mathbb{E}\left[(v - \mathbb{E}(v))^4\right] / \left(\mathbb{E}\left[(v - \mathbb{E}(v))^2\right]\right)^2$ . Finally, sources are linearly mixed, i.e., there exists a full rank mixing matrix, $\mathbf{A} \in \mathbb{R}^{d \times d}$ , producing the $d$ -dimensional mixture, $\mathbf{x}_t$ : + +$$ +\mathbf {x} _ {t} = \mathbf {A} \mathbf {s} _ {t} \quad \forall t \in \{1, \dots , T \}. \tag {1} +$$ + +Then the goal of ICA algorithms is to determine a linear transformation of the observed signal, $\mathbf{W}_{ICA} \in \mathbb{R}^{d \times d}$ , such that + +$$ +\mathbf {y} _ {t} := \mathbf {W} _ {I C A} \mathbf {x} _ {t}, \quad \forall t \in \{1, \dots , T \}, \tag {2} +$$ + +recovers unknown sources possibly up to a permutation and a sign flip. + +![](images/7c252774c88ecc3ff883801071ba15f558d65c9fe4e7880e0e435c7261a56032.jpg) +A Three Steps of the FOBI Procedure Illustrated on a 2D Dataset +(i) Input/mixed data, $\mathbf{x}_t$ + +![](images/e2aad55c27ef162b864997ccfb7a45c0ed7bc3bc6bd0a6b70e9e5749773825cd.jpg) +(ii) Whitened data, $\mathbf{h}_t$ +Combined similarity-preserving objective function + +![](images/758d72c97fa5324eeb43f8941dca77a20c36c59936c2741f3d22879dff7c9eee.jpg) +(iii) Weighted data, $\mathbf{z}_t$ + +![](images/d542bdd055b7792506d56e5a95f3e572548c357664a0a83787d7aa9c60869d35.jpg) +(iv) Recovered sources, $\mathbf{y}_t$ + +$$ +\min _ {\mathbf {Y} \in \mathbb {R} ^ {d \times T}} \left\| \mathbf {X} ^ {\top} \mathbf {C} _ {x} ^ {- 1 / 2} \left[ \frac {1}{T} \sum_ {t = 1} ^ {T} \| \mathbf {C} _ {x} ^ {- 1 / 2} \mathbf {x} _ {t} \| ^ {2} \mathbf {C} _ {x} ^ {- 1 / 2} \mathbf {x} _ {t} \mathbf {X} _ {t} ^ {\top} \mathbf {C} _ {x} ^ {- 1 / 2} \right] ^ {- 1} \mathbf {C} _ {x} ^ {- 1 / 2} \mathbf {X} - \mathbf {Y} ^ {\top} \boldsymbol {\Lambda} ^ {2} \mathbf {Y} \right\| _ {F} ^ {2}. +$$ + +![](images/333a22db582531a91a189c0f22b9d4f49583543dad3b193f69d6c3fe0df78dc7.jpg) +B Schematic of the Generative Model and De-mixing by the NN we Derived +Figure 1: A. The three steps of the FOBI procedure illustrated on a 2D dataset. The purple and pink arrows show the axes of the independent sources $s_i$ . (i) the observed signal, $\mathbf{x}_t$ , (ii) the whitened data, $\mathbf{h}_t$ , (iii) norm-weighted whitened data, $\mathbf{z}_t$ , black arrows represent the principal directions of $\mathbf{z}_t$ (iv) the recovered sources, $\mathbf{y}_t$ are projections of $\mathbf{h}_t$ onto the principal directions of $\mathbf{z}_t$ . These three steps are combined into a single objective function as indicated by color-coding. B. Schematic of the generative model and de-mixing by the NN we derived. The output layer consists of two-compartment neurons whose synapses obey local learning rules. The dendritic compartments of the output neurons whiten data. The somatic compartments reconstruct the sources by rotating the whitened data. The pale blue rounded rectangle represents modulation of plasticity by output activity. + +# 2.1 Review of the FOBI procedure + +FOBI algorithm exploits a connection between ICA and Principal Component Analysis (PCA) [38, 39] pointed out in [27, 40]. We reproduce the proof of source recovery by FOBI from [27, 40] in Appendix A. + +Description of the procedure. FOBI procedure consists of three steps, see Fig. 1A. First, the data must be whitened, i.e., all components become decorrelated and of unit variance, Fig. 1A(ii). The whitening step can be performed using sample covariance, $\mathbf{C}_x = \frac{1}{T}\sum_{t=1}^{T}\mathbf{x}_t\mathbf{x}_t^\top$ , as follows: + +$$ +\textbf {S t e p 1 : w h i t e n} \quad \mathbf {h} _ {t} = \mathbf {C} _ {x} ^ {- 1 / 2} \mathbf {x} _ {t}. +$$ + +Data whitening is often the first step in many ICA algorithms because recovering the sources after whitening corresponds to finding an orthogonal rotation matrix [17]. Various ICA methods differ in how the rotation is chosen. In FOBI, the whitened data, $\mathbf{h}_t$ , is scaled by its norm and termed $\mathbf{z}_t$ . Then, the directions of $\mathbf{h}_t$ and $\mathbf{s}_t$ with distinct kurtosis are recovered by finding the eigenvectors of + +the sample covariance matrix $\frac{1}{T}\sum_{t=1}^{T}\mathbf{z}_t\mathbf{z}_t^\top$ , Fig. 1A(iii). + +Step 2a: transform $\mathbf{z}_t = \|\mathbf{h}_t\| \cdot \mathbf{h}_t$ ; Step 2b: optimize $\mathbf{W}_z := \underset{\substack{\mathbf{W} \in \mathbb{R}^{d \times d} \\ \mathbf{W} \mathbf{W}^\top = \mathbf{I}_d}}{\arg \max} \frac{1}{T} \operatorname{Tr}\left(\mathbf{W} \sum_{t=1}^{T} \mathbf{z}_t \mathbf{z}_t^\top \mathbf{W}^\top\right)$ . + +Finally, to recover the sources, we project the whitened data, $\mathbf{h}_t$ , onto the rows of $\mathbf{W}_z$ , Fig. 1A(iv) + +Step 3: project $\mathbf{y}_t = \mathbf{W}_z\mathbf{h}_t$ + +Can a biologically plausible NN implement the FOBI algorithm? The first two steps of FOBI do not present a problem with a biological implementation. For example, Step 2b, essentially a PCA, can be solved by a stochastic gradient ascent algorithm using Oja's learning rule [41]: + +$$ +\Delta \mathbf {W} _ {z} = \eta \left(\mathbf {u} _ {t} \mathbf {z} _ {t} ^ {\top} - \mathbf {u} _ {t} \mathbf {u} _ {t} ^ {\top} \mathbf {W} _ {z}\right). \tag {3} +$$ + +Then, Step 2b can be mapped onto a single-layer network with upstream neurons' activity encoding $\mathbf{z}_t$ , and the output neurons computing the components of $\mathbf{u}_t \coloneqq \mathbf{W}_z\mathbf{z}_t$ where the elements of $\mathbf{W}_z$ are encoded in the weights of feedforward synapses. Eq.(3) gives the weight update for the feedforward synapses with the learning rate, $\eta > 0$ . However, according to step 3, the final output of FOBI must be $\mathbf{y}_t$ , obtained by multiplying the whitened inputs, $\mathbf{h}_t$ , by $\mathbf{W}_z$ without scaling them by their norm. Such output may be computed by another single-layer network with the same feedforward synaptic weights, $\mathbf{W}_z$ , but that would require weight-sharing (or weight transport). Alternatively, avoiding weight transport would require a non-local update rule for $\mathbf{W}_z$ . Thus, both alternatives lead to biologically implausible solutions. + +# 2.2 Similarity matching for principal subspace analysis + +To find a biologically plausible implementation of FOBI, we follow the approach used previously to derive biologically plausible networks for Principal Subspace Projection (PSP) [42], a variant of PCA, and other tasks[43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54]. This approach starts from reformulating the optimization objective for PSP in the so-called Similarity Matching (SM) form [55]: + +$$ +\min _ {\mathbf {Y} \in \mathbb {R} ^ {m \times T}} \left\| \mathbf {X} ^ {\top} \mathbf {X} - \mathbf {Y} ^ {\top} \mathbf {Y} \right\| _ {F} ^ {2}, \tag {4} +$$ + +where $\mathbf{X} \coloneqq [\mathbf{x}_1, \ldots, \mathbf{x}_T]$ is the data matrix, $\mathbf{Y} \coloneqq [\mathbf{y}_1, \ldots, \mathbf{y}_T]$ is the output matrix, and $\|\cdot\|_F$ the Frobenius norm. In turn, the objective (4) can be optimized by an online algorithm that maps onto a single-layer network of linear neurons whose synapses obey local learning rules [44]. + +Whereas the SM approach leads to biologically plausible NNs for solving eigenproblems, it was still unclear how to overcome the weight transport challenge arising in the FOBI algorithm implementation. In the next Section, we address this challenge by introducing a novel SM objective for ICA. + +# 3 A similarity-preserving objective for ICA + +To derive a single-layer NN for ICA, which can be trained with local learning rules, we adopt a normative approach. We design a novel objective function, the solution of which projects the whitened data, $\mathbf{h}_t$ , onto the eigenvectors of the covariance of $\mathbf{z}_t$ as specified in the FOBI procedure above using the SM approach. Specifically, we propose the following generalized nonlinearly weighted similarity matching objective using the notations, $\mathbf{H} := [\mathbf{h}_1, \dots, \mathbf{h}_T]$ and $\mathbf{Z} := [\mathbf{z}_1, \dots, \mathbf{z}_T]$ as defined earlier in Sec. 2.1 and illustrated in Fig. 1A, + +$$ +\min _ {\mathbf {Y} \in \mathbb {R} ^ {d \times T}} \left\| \mathbf {H} ^ {\top} \left[ \frac {1}{T} \mathbf {Z} \mathbf {Z} ^ {\top} \right] ^ {- 1} \mathbf {H} - \mathbf {Y} ^ {\top} \boldsymbol {\Lambda} ^ {2} \mathbf {Y} \right\| _ {F} ^ {2}, \quad \text {s . t .} \quad \frac {1}{T} \mathbf {Y} \mathbf {Y} ^ {\top} = \mathbf {I} _ {d}, \tag {5} +$$ + +with $\Lambda^2 = \mathrm{diag}(\lambda_1^2,\dots ,\lambda_d^2)$ any diagonal matrix with distinct finite positive entries. + +To accomplish all the three steps above in a single-layer network, we rewrite (5) in terms of the input data $\mathbf{X}$ by substituting the expressions for $\mathbf{H}$ (Step 1) and $\mathbf{Z}$ (Step 2a): + +$$ +\min _ {\substack {\mathbf {Y} \in \mathbb {R} ^ {d \times T} \\ \frac {1}{T} \mathbf {Y} \mathbf {Y} ^ {\top} = \mathbf {I} _ {d}}} \left\| \mathbf {X} ^ {\top} \mathbf {C} _ {x} ^ {- 1 / 2} \left[ \frac {1}{T} \sum_ {t = 1} ^ {T} \| \mathbf {C} _ {x} ^ {- 1 / 2} \mathbf {x} _ {t} \| ^ {2} \mathbf {C} _ {x} ^ {- 1 / 2} \mathbf {x} _ {t} \mathbf {x} _ {t} ^ {\top} \mathbf {C} _ {x} ^ {- 1 / 2} \right] ^ {- 1} \mathbf {C} _ {x} ^ {- 1 / 2} \mathbf {X} - \mathbf {Y} ^ {\top} \boldsymbol {\Lambda} ^ {2} \mathbf {Y} \right\| _ {F} ^ {2}. \tag{6} +$$ + +Then the global minima of objective (6) recover the sources as formalized by the following theorem: + +Theorem 1. Given that the sources are independent, centered, have unit variance, and distinct kurtosis (c.f. Sec 2), then the global optimal solution for our objective (6), denoted by $\mathbf{Y}^*$ satisfies + +$$ +\mathbf {Y} ^ {*} = \Xi \Pi \mathbf {S} \tag {7} +$$ + +where $\Xi$ is a diagonal matrix with $\pm 1$ 's on the diagonal, and $\Pi$ is a permutation matrix, and is thus a solution to the ICA problem. + +Proof. We give the detailed proof of the theorem in Appendix A. + +![](images/cf9ab17fd0fe6fb8c8d9692ebf963843adf87e22aa84144610aa23245dfbd5a7.jpg) + +# 4 Derivation of the algorithm + +While our objective (6) can be minimized by taking gradient descent steps with respect to $\mathbf{Y}$ , this would not lead to an online algorithm because such computation requires combining data from different time steps. Instead, following [44], we introduce auxiliary matrix variables corresponding to synaptic weights, which store sufficient statistics allowing for the ICA computation using solely instantaneous inputs. Such substitution leads to a min-max optimization problem that is solved by gradient descent/ascent. A corresponding online optimization algorithm using stochastic gradient descent/ascent maps onto an NN with local learning rules. + +# 4.1 Min-max formulation + +Here we modify the objective (6) by introducing auxiliary variables, namely $\mathbf{W}$ and $\mathbf{M}$ , leading to a min-max optimization problem. In the following sub-sections, the gradient descent/ascent optimization of the min-max objective will lead to an online algorithm that maps onto an NN where $\mathbf{W}$ and $\mathbf{M}$ correspond to synaptic weights. + +We expand the square in Eq. (6), normalizing by $T^2$ , and dropping terms that do not depend on $\mathbf{Y}$ yielding: + +$$ +\min _ {\mathbf {Y} \in \mathbb {R} ^ {d \times T}} \frac {1}{T ^ {2}} \operatorname {T r} \left(- 2 \mathbf {X} ^ {\top} \boldsymbol {\Gamma} _ {x} \mathbf {X} \mathbf {Y} ^ {\top} \boldsymbol {\Lambda} ^ {2} \mathbf {Y} + \mathbf {Y} ^ {\top} \boldsymbol {\Lambda} ^ {2} \mathbf {Y} \mathbf {Y} ^ {\top} \boldsymbol {\Lambda} ^ {2} \mathbf {Y}\right) \quad \text {s . t .} \quad \frac {1}{T} \mathbf {Y} \mathbf {Y} ^ {\top} = \mathbf {I} _ {d}, \tag {8} +$$ + +where, for convenience, we introduce + +$$ +\mathbf {\Gamma} _ {x} := \mathbf {C} _ {x} ^ {- 1 / 2} \left[ \frac {1}{T} \sum_ {t = 1} ^ {T} \| \mathbf {C} _ {x} ^ {- 1 / 2} \mathbf {x} _ {t} \| ^ {2} \mathbf {C} _ {x} ^ {- 1 / 2} \mathbf {x} _ {t} \mathbf {x} _ {t} ^ {\top} \mathbf {C} _ {x} ^ {- 1 / 2} \right] ^ {- 1} \mathbf {C} _ {x} ^ {- 1 / 2}. +$$ + +The quartic term in $\mathbf{Y}$ in (8) is a constant under the decorrelation constraint and can be dropped from the optimization. + +We now introduce auxiliary matrix variables $\mathbf{W}$ and $\mathbf{M}$ , resulting in: + +$$ +\min _ {\mathbf {Y} \in \mathbb {R} ^ {d \times T}} \min _ {\mathbf {W} \in \mathbb {R} ^ {d \times d}} \max _ {\mathbf {M} \in \mathbb {R} ^ {d \times d}} \mathcal {L} (\mathbf {W}, \mathbf {M}, \mathbf {Y}), \tag {9} +$$ + +where $\mathcal{L}(\mathbf{W},\mathbf{M},\mathbf{Y})\coloneqq \frac{1}{T}\operatorname {Tr}\left(-2\mathbf{X}^{\top}\mathbf{W}^{\top}\mathbf{Y} + \mathbf{Y}^{\top}\mathbf{M}\mathbf{Y}\right) + \operatorname {Tr}\left(\mathbf{W}\mathbf{T}_x^{-1}\mathbf{W}^{\top}\boldsymbol {\Lambda}^{-2} - \mathbf{M}\right)$ + +To verify the equivalence between the minimization problem (8) and the min-max problem (9) take partial derivatives of $\mathcal{L}(\mathbf{W},\mathbf{M},\mathbf{Y})$ with respect to $\mathbf{W}$ (resp. $\mathbf{M}$ ) and note that the minimum (resp. maximum) is achieved when $\mathbf{W} = \frac{1}{T}\boldsymbol{\Lambda}^2\mathbf{Y}\mathbf{X}^\top \boldsymbol{\Gamma}_x$ (resp. $\frac{1}{T}\mathbf{Y}\mathbf{Y}^\top = \mathbf{I}_d$ ). Substituting optimal $\mathbf{W}$ and $\mathbf{M}$ leads back to (8). + +Finally, interchanging the order of minimization with respect to $\mathbf{Y}$ , with the optimization with respect to $\mathbf{W}$ and $\mathbf{M}$ , yields + +$$ +\min _ {\mathbf {W} \in \mathbb {R} ^ {d \times d}} \max _ {\mathbf {M} \in \mathbb {R} ^ {d \times d}} \min _ {\mathbf {Y} \in \mathbb {R} ^ {d \times T}} \mathcal {L} (\mathbf {W}, \mathbf {M}, \mathbf {Y}). \tag {10} +$$ + +The interchange is justified by saddle point property of $\mathcal{L}(\mathbf{W},\mathbf{M},\mathbf{Y})$ with respect to $\mathbf{Y}$ and $\mathbf{M}$ [44]. + +# 4.2 Gradient optimization in the offline setting + +In this subsection, we optimize the objective (6) in the offline setting, where the entire data matrix $\mathbf{X}$ is accessible. In this case, we solve the min-max problem (9) by alternating optimization steps. For fixed $\mathbf{W}$ and $\mathbf{M}$ , we minimize the objective function $\mathcal{L}(\mathbf{W},\mathbf{M},\mathbf{Y})$ over $\mathbf{Y}$ , which yields the relation + +$$ +\mathbf {Y} := \underset {\mathbf {Y} \in \mathbb {R} ^ {d \times T}} {\arg \min } \mathcal {L} (\mathbf {W}, \mathbf {M}, \mathbf {Y}) = \mathbf {M} ^ {- 1} \mathbf {W} \mathbf {X}. \tag {11} +$$ + +Before applying gradient optimization steps of the objective function $\mathcal{L}(\mathbf{W},\mathbf{M},\mathbf{Y})$ with respect to $\mathbf{W}$ and $\mathbf{M}$ , we first simplify $\Gamma_x^{-1}$ appearing in (10), as a part of the term, $\mathrm{Tr}\left(\mathbf{W}\Gamma_x^{-1}\mathbf{W}^\top \boldsymbol{\Lambda}^{-2}\right)$ , + +$$ +\boldsymbol {\Gamma} _ {x} ^ {- 1} = \mathbf {C} _ {x} ^ {1 / 2} \left[ \frac {1}{T} \sum_ {t = 1} ^ {T} \| \mathbf {C} _ {x} ^ {- 1 / 2} \mathbf {x} _ {t} \| ^ {2} \mathbf {C} _ {x} ^ {- 1 / 2} \mathbf {x} _ {t} \mathbf {x} _ {t} ^ {\top} \mathbf {C} _ {x} ^ {- 1 / 2} \right] \mathbf {C} _ {x} ^ {1 / 2} = \frac {1}{T} \sum_ {t} ^ {T} \alpha_ {t} \mathbf {x} _ {t} \mathbf {x} _ {t} ^ {\top}, \tag {12} +$$ + +where $\alpha_{t} = \| \mathbf{C}_{x}^{-1 / 2}\mathbf{x}_{t}\|^{2}$ is the squared norm of the whitened data. As the transformation from whitened data to the recovered sources is an orthogonal rotation, the squared norm of the sources and of the outputs is preserved: + +$$ +\alpha_ {t} = \left\| \mathbf {C} _ {x} ^ {- 1 / 2} \mathbf {x} _ {t} \right\| ^ {2} = \left\| \mathbf {s} _ {t} \right\| ^ {2} = \left\| \mathbf {y} _ {t} \right\| ^ {2}. \tag {13} +$$ + +We then use (13) to rewrite (12) as + +$$ +\boldsymbol {\Gamma} _ {x} ^ {- 1} = \frac {1}{T} \mathbf {X} \operatorname {d d i a g} \left(\mathbf {Y} ^ {\top} \mathbf {Y}\right) \mathbf {X} ^ {\top} = \frac {1}{T} \sum_ {t = 1} ^ {T} \| \mathbf {y} _ {t} \| ^ {2} \mathbf {x} _ {t} \mathbf {x} _ {t} ^ {\top}, \tag {14} +$$ + +where $\mathrm{dddiag}(\cdot)$ represents a diagonal matrix which keeps only the diagonal elements of the argument matrix. + +We now obtain the update rules for $\mathbf{W}$ and $\mathbf{M}$ by gradient-descent ascent on (10) and by replacing $\Gamma_x^{-1}$ according to (14) + +$$ +\mathbf {W} \leftarrow \mathbf {W} + 2 \eta \left(\frac {1}{T} \mathbf {Y} \mathbf {X} ^ {\top} - \boldsymbol {\Lambda} ^ {- 2} \mathbf {W} \boldsymbol {\Gamma} _ {x} ^ {- 1}\right) = \mathbf {W} + \frac {2 \eta}{T} \left(\mathbf {Y} \mathbf {X} ^ {\top} - \boldsymbol {\Lambda} ^ {- 2} \mathbf {W} \mathbf {X} \operatorname {d i a g} \left(\mathbf {Y} ^ {\top} \mathbf {Y}\right) \mathbf {X} ^ {\top}\right), \tag {15} +$$ + +$$ +\mathbf {M} \leftarrow \mathbf {M} + \frac {\eta}{\tau} \left(\frac {1}{T} \mathbf {Y} \mathbf {Y} ^ {\top} - \mathbf {I} _ {d}\right). \tag {16} +$$ + +Here $\tau > 0$ is the ratio between the learning rates for $\mathbf{W}$ and $\mathbf{M}$ , and $\eta \in (0, \tau)$ is the learning rate for $\mathbf{W}$ , ensuring that $\mathbf{M}$ remains positive definite given a positive definite initialization. + +# 4.3 Online algorithm + +We now solve the min-max objective (9) in the online setting. At each time step, $t$ , we minimize over the output, $\mathbf{y}_t$ , by repeating the following gradient descent steps until convergence: + +$$ +\mathbf {y} _ {t} \leftarrow \mathbf {y} _ {t} + \gamma \left(\mathbf {c} _ {t} - \mathbf {M y} _ {t}\right), \tag {17} +$$ + +where $\gamma$ is a small step size, and we have defined the projection $\mathbf{c}_t\coloneqq \mathbf{W}\mathbf{x}_t$ , with biological interpretation described in Sec 5. As in (11), the dynamics converge to $\mathbf{y}_t = \mathbf{M}^{-1}\mathbf{c}_t$ . We now take stochastic gradient descent-ascent steps in $\mathbf{W}$ and $\mathbf{M}$ . We thus replace the averages in Eqs. (15)-(16) with their online approximations + +$$ +\frac {1}{T} \mathbf {Y} \mathbf {X} ^ {\top} \rightarrow \mathbf {y} _ {t} \mathbf {x} _ {t} ^ {\top}; \frac {1}{T} \mathbf {Y} \mathbf {Y} ^ {\top} \rightarrow \mathbf {y} _ {t} \mathbf {y} _ {t} ^ {\top}; \frac {1}{T} \boldsymbol {\Lambda} ^ {- 2} \mathbf {W} \mathbf {X} \mathrm {d i a g} (\mathbf {Y} ^ {\top} \mathbf {Y}) \mathbf {X} ^ {\top} \rightarrow \| \mathbf {y} _ {t} \| ^ {2} \boldsymbol {\Lambda} ^ {- 2} \mathbf {c} _ {t} \mathbf {x} _ {t} ^ {\top}. +$$ + +This yields our online ICA algorithm (Algorithm 1) and the NN, see Section 5. + +# 5 Biological interpretation and neural implementation + +We now show that our online ICA algorithm (Algorithm 1) maps onto an NN with local, activity-dependent synaptic update rules, which emulate aspects of synaptic plasticity observed experimentally. + +Algorithm 1 A similarity-preserving algorithm for Independent Component Analysis. +input data $\{\mathbf{x}_1,\dots ,\mathbf{x}_T\}$ ; dimension $d$ +output $\{\mathbf{y}_1,\dots ,\mathbf{y}_T\}$ ; dimension $d$ estimated sources initialize the matrix W, and positive definite matrix M. +for $t = 1,2,\ldots ,T$ do $\mathbf{c}_t\gets \mathbf{W}\mathbf{x}_t$ . projection of inputs run the following until convergence: $\frac{dy_t(\gamma)}{d\gamma} = \mathbf{c}_t - \mathbf{My}_t(\gamma)$ . neural dynamics $\mathbf{W}\leftarrow \mathbf{W} + 2\eta (\mathbf{y}_t - \| \mathbf{y}_t\| ^2\boldsymbol {\Lambda}^{-2}\mathbf{c}_t)\mathbf{x}_t^\top$ . $\mathbf{M}\leftarrow \mathbf{M} + \frac{\eta}{\tau} (\mathbf{y}_t\mathbf{y}_t^\top -\mathbf{I}_d)$ synaptic updates end for + +# 5.1 Neural architecture and dynamics + +Our algorithm can be implemented by a biologically plausible NN presented in Fig. 1B. The network consists of an input layer of $d$ neurons, representing the input data to be separated into independent components, and an output layer of $d$ neurons, with separate dendritic and somatic compartments, estimating the unknown sources. The network includes a set of feedforward synapses between the inputs and the dendrites of the output neurons as well as a set of lateral synapses between the output somas Fig. 1B. + +Although two-compartment neurons have not been common in machine learning, in neuroscience, they are often used to model pyramidal cells - the most numerous neuron type in the neocortex. Such neuron consists of an apical dendritic compartment, as well as a somatic compartment, which have distinct membrane potentials [56, 57, 58, 59]. Recently, such two-compartment neurons appeared in bio-inspired machine learning algorithms [60, 61, 62, 51, 63, 64]. + +At each time step $t$ , the network computes in two phases. First, the mixture $\mathbf{x}_t$ , represented in the input neurons, is multiplied by the weight matrix $\mathbf{W}$ encoded by the feedforward synapses connecting the input neurons to the output neurons. This yields the projection $\mathbf{c}_t = \mathbf{W}\mathbf{x}_t$ computed in the dendritic compartments of the output neurons and then propagated to their somatic compartments. + +Second, the $d$ -dimensional output signal $\mathbf{y}_t$ is computed as somatic activity in the output neurons and corresponds to the estimated sources. This is accomplished by the fast recurrent neural dynamics in lateral connection, Eq. (17), converging to the equilibrium value assignment of $\mathbf{y}_t$ in Algorithm 1. The lateral synapses in Fig. 1B implement only the off-diagonal elements of $\mathbf{M}$ . Whereas diagonal elements of $\mathbf{M}$ would correspond to autapses (self-coupling of neurons), such Hebbian/ani-Hebbian networks can be designed without them [44, 45]. + +# 5.2 Synaptic plasticity rules + +To highlight the locality of our learning rules, we rewrite the element-wise synaptic updates for $\mathbf{W}$ and $\mathbf{M}$ in Algorithm 1 using sub-/super-scripts: + +$$ +W _ {i j} \leftarrow W _ {i j} + 2 \eta \left(y _ {t} ^ {i} x _ {t} ^ {j} - \| \mathbf {y} _ {t} \| ^ {2} \frac {c _ {t} ^ {i}}{\lambda_ {i} ^ {2}} x _ {t} ^ {j}\right); M _ {i j} \leftarrow M _ {i j} + \frac {\eta}{\tau} \left(y _ {t} ^ {i} y _ {t} ^ {j} - \delta_ {i j}\right), 1 \leq i, j \leq d. \tag {18} +$$ + +In Eqs. (18), $x_{t}^{j}$ is the activity of the $j^{th}$ input neuron, $y_{t}^{i}$ is the activity of the $i^{th}$ output neuron, and $c_{t}^{j}$ is the dendritic current of the $j^{th}$ output neuron, all at time $t$ . Furthermore, the influence of the dendritic current $c_{j}^{t}$ on a synapse's strength is modulated by the term $\| \mathbf{y}_t\| ^2$ , representing the overall activity of the output neurons. + +How could total output neuronal activity be signaled to each feedforward synapse in the network? There are several diffusible molecules in the brain which may affect synaptic plasticity and whose concentration may depend on the overall neural activity. These include extracellular calcium [33], GABA[29, 65], dopamine [30, 66, 67], noradrenaline [31, 68], D-Serin [32, 69, 70] or nitric oxide (NO), although its range of action is contested [35, 36, 37]. Finally, local field potential can also affect synaptic plasticity [34]. For the learning rule to function in the online setting signaling must be fast, a requirement favoring local field potential and extracellular calcium out of the above candidates. + +The learning rule (18) for feedforward synaptic weights, $\mathbf{W}$ , simplifies significantly near the optimum of the objective, $\mathbf{M} \approx \mathbf{I}_d$ , and for the converged output activity, $\mathbf{c}_t = \mathbf{W}\mathbf{x}_t = \mathbf{M}\mathbf{y}_t$ : + +$$ +\Delta \mathbf {W} = \eta_ {t} \left(\mathbf {I} - \| \mathbf {y} _ {t} \| ^ {2} \boldsymbol {\Lambda} ^ {- 2} \mathbf {M}\right) \mathbf {y} _ {t} \mathbf {x} _ {t} ^ {\top} \approx \eta_ {t} \left(\mathbf {I} - \| \mathbf {y} _ {t} \| ^ {2} \boldsymbol {\Lambda} ^ {- 2}\right) \mathbf {y} _ {t} \mathbf {x} _ {t} ^ {\top}. \tag {19} +$$ + +Such an update is a nonlinearly modulated Hebbian learning rule where the sign of plasticity changes with the total output activity. For low total output activity, $\| \mathbf{y}_t\|^2 < \lambda_i^2$ , the update is Hebbian, i.e., long-term potentiation (LTP) for correlated inputs and outputs. For high output activity, $\| \mathbf{y}_t\|^2 > \lambda_i^2$ , the update is anti-Hebbian, i.e., long-term depression (LTD) for correlated inputs and outputs. We compare and contrast this global activity-dependent modulation of plasticity with the Bienenstock, Cooper, and Munro (BCM) rule in subsection 5.3. + +Whereas three-factor learning has been invoked in multiple computational, especially reward-based, models [71, 72, 73, 74], our model is the first to propose such learning in the fully normative approach for ICA. + +# 5.3 Comparison with existing rules + +To understand the distinctive features of our model versus existing approaches, we compare and contrast it with three existing models: 1. Oja's learning rule, 2. BCM learning rule [75], and 3. error-gated Hebbian rule (EGHR) [69]. + +1. Nonlinear Oja's learning rule. [76, 19] generalized the original Oja's rule, Eq. (3), with a component-wise nonlinear function $g(\cdot)$ as $\Delta \mathbf{W} = g(\mathbf{y}_t)\mathbf{x}_t^\top - g(\mathbf{y}_t)g(\mathbf{y}_t)^\top \mathbf{W}$ . However, this model and follow-up work inherited the main drawbacks of the standard Oja's rule, i.e., they require pre-whitening of the data and rely on non-local learning rules. Indeed, the last term of the learning rules of nonlinear Oja implies that updating the weight of a synapse requires precise knowledge of output activities of all other neurons which are not available to the synapse (cf. [77] for details on standard PCA rules and networks of nonlinear neurons [78]). + +2. BCM learning rule. Switching of the sign of plasticity depending on the total output activity Eq. (19) is reminiscent of the BCM rule. It was initially postulated and later connected to an objective function [79, 80] characterizing the deviation from Gaussian distribution but mainly focusing on skewness rather than kurtosis as in our model. For correlated input and output, the BCM rule induces LTD for "sub-threshold" responses and LTP for "super-threshold" responses, with the threshold being a function of average output activity. Unfortunately, multiple output BCM neurons respond to the same dominant feature, producing an incomplete, highly redundant code [79, 80]. In contrast, our network has lateral inhibitory connections whose weights are updated via anti-Hebbian rule Eq. (18) leading to the recovery of multiple sources. Although experimental evidence has validated BCM-like plasticity in parts of the visual cortex and the hippocampus, other brain areas have yet to show similar behavior. Interestingly, an "inverse" BCM rule, similar to ours has been proposed in the cerebellum [81, 82, 83]. + +3. Modulated Hebbian rules. Recent neural implementations of ICA [69, 74, 70] also introduced modulated Hebbian rules: $\Delta \mathbf{W} = (E_0 - E(\mathbf{y}_t))g(\mathbf{y}_t)\mathbf{x}_t^\top$ , with $E_0$ a constant, $E(\cdot)$ a nonlinear function of the total activity, and $g(\cdot)$ a component-wise nonlinear function. This learning rule shares many similarities with ours. The term $E_0$ is a constant characterizing the source distributions, which could identify with our $\lambda_i$ terms, and the function $E(\cdot)$ resembles our $\|\mathbf{y}_t\|^2$ but is model dependent in their approach. This is where the similarities end as their objective function is inspired by the information-theoretic framework [12, 7] and ours - by the insight from the FOBI procedure [27, 84] and spectral methods from the SM method [44]. + +Their model can be considered partly normative since the neural architecture is predetermined and uses a hand-designed error-computing neuron to determine the global modulating factor rather than having been derived from an optimization problem. Interestingly, their model does not use lateral connections for output decorrelation resulting in a model without direct interaction between outputs. The presence of pairwise inhibitory interaction is crucial for our algorithm, leading to a globally optimal solution when the sources have distinct kurtosis. Numerical and theoretical analysis of the performance of the EGHR algorithm relies on the source distributions being the same and resulting in several equivalent optima. + +# 6 Numerical simulations + +In this section, we verify our theoretical results in numerical experiments. We use our model to perform ICA on both synthetic and real-world datasets. We designed three sets of experiments to illustrate the performance of our algorithm. In the first set, Fig. 2A, we used as sources artificially generated signals, in the second - natural speech signals, Fig. 2B, and in the third - natural scene images, Fig. 2C. According to the generative model, Eq. (1), we then used random full rank square mixing matrices, $\mathbf{A}$ , to generate the observed mixed signals, $\mathbf{x}_t$ . From $\mathbf{x}_t$ , we aimed to recover the original sources. We show that our algorithm recovers sources regardless of sub- or super-Gaussianity of the kurtosis, which is essential for natural datasets. For details on the parameters used, see Appendix C. + +Synthetic data. We first evaluate our algorithm on a synthetic dataset generated by independent and identically distributed samples. The data are generated from periodic signals, i.e., square-periodic, sine-wave, saw-tooth, and Laplace random noise. The data were chosen with the purpose of including both super- and sub-Gaussian distribution known respectively as leptokurtic ("spiky", e.g., the Laplace distribution) and platykurtic ("flat-topped", the three other source signal). We show in Fig. 2A the mixed signals in black, on the left plots. We show on the right plot the recovered sources, in red, overlapped with the original sources, in blue, and the residual in green. We also show the histogram of each signal on the right side of each plot. Results are shown for 300 samples. We observe that the recovered and true sources nearly perfectly overlap, explaining the low value of the residual, which shows the almost perfect reconstruct performed by our algorithm. + +In Appendix D, we provide a numerical comparison of the performance of our algorithm with competing models, namely, Herault-Jutten algorithm [85], EASI algorithm [86, 87], Bell and Sejnowski's algorithm [12], the Amari algorithm [13], and finally nonlinear Oja algorithm [88, 76]. These models were designed with NNs in mind and are seminal works on neural ICA algorithms. However, like nonlinear Oja algorithm, which is mentioned in Section 5.3.1, these models suffer from biological implausibility. In brief, our model either outperforms or is competitive with the models mentioned above. These results also confirm that our algorithm can deal with combinations of sub- and super-Gaussian sources, with or without pre-whitening of the data. + +Real-world data: Speech signals. For the audio separation task, we used speech recordings from the freely available TSP data set $[89]^{1}$ , recorded at $16\mathrm{kHz}$ . The first source we use was obtained from a male speaker (MA02 04.wav), the second source from a female speaker (FA01 03.wav), and the third source synthetically generated from a uniform noise, as was previously used in the literature [90]. We show our results in Fig. 2B. We show the mixtures, the true sources, the recovered sources, and the residual. It is clear from the figure that our algorithm's outputs recover the true sources similarly to the synthetic dataset. + +Real-world data: Natural scene images. We finally applied our algorithm to the task of recovering images from their mixtures, on data already used for BSS tasks [7, 91, 23]², as shown in Fig. 2C. Here, we show separately the original sources, top images, the mixtures, middle images, and the recovered sources, bottom images of Fig. 2C. We considered three grayscale images of size $256 \times 512$ pixels (shifted and scaled to have zero-mean and unit variance), such that each image is treated as one source, with the pixel intensities representing the samples. We again observe in Fig. 2C that the recovered sources are nearly identical to the original sources. We can also see that the histograms of the recovered sources nearly match the histograms of the original sources, up to their sign. + +# 7 Discussion + +We proposed a new single-layer ICA NN with biologically plausible local learning rules. The normative nature of our approach makes the biologically realistic features of our NNs readily interpretable. In particular, our NN uses neurons with two separate compartments and is trained with extended Hebbian learning rules. The changes in synaptic strength are modulated by the total output neuronal activity, equivalent to performing gradient optimization of our objective function. We demonstrated that the proposed rule reliably converges to the correct solution over a wide range of mixing matrices, synthetic, and natural datasets. The broad applicability and easy implementation + +![](images/4ff6ecd8cac488f9bfcb83a746d55c5617d87f52f5d2ace91464c43eddd38e90.jpg) +Figure 2: Our ICA algorithm recovers independent sources from synthetic and real-world mixtures. A. Synthetic data, B. Natural speech data, C. Natural image data. In A-B, mixed signals are shown in black, the recovered signals - in red, the true sources - in blue, and their residual difference - in blue. We also show the associated distributions. C. The sources, mixture, and recovered sources, in top, middle and bottom rows respectively. + +![](images/e0eca0f13dbe076197ece39a286f0279ba2dc6991c16e0fcab7a338d02429d17.jpg) + +![](images/028a3ad32f28cc73779ad73850d15e8de5a6831df90d29435634c9ff24c4aeb5.jpg) + +of our NN and learning rules could further advance neuromorphic computation [92, 93, 94] and may reveal the principle underlying BSS computation in the brain. + +Recent work on canonical correlation analysis [95, 96, 97], slow feature analysis [98], and ICA-like algorithms have led to biologically plausible NNs [99, 100, 101, 102], some of which rely on two-compartment neurons [103, 51]. These NNs could, in principle, be used for popular BSS tasks known as second-order blind identification [104, 105, 106, 107] or in the context of kernel ICA [108, 109]. This suggests the existence of a single model of two-compartment neurons and non-trivial local learning rules for BS. In future work, we aim at proposing such a model, including high-order statistics, temporal correlation, and diversity of views. + +One limitation of our approach is the inability of the model to separate sources with the same kurtosis. Yet, as long as sources possess some distinct even-order moments, our scaling rule can be altered to separate the sources [27]. Another limitation is the well-known sensitivity of kurtosis to outliers. This limitation could be overcome if scaling varies as a sublinear function of the total activity [40]. These changes do not affect the neural architecture nor the locality of the learning rules. + +Clarifying the limitations of our model leads us to ask various follow-up questions left for future work. How can we further generalize the solution beyond the choice of nonlinearity and beyond the task of linear ICA? We could envision considering more than two covariance matrices as in the JADE algorithm [110, 111, 112], which effectively performs joint-diagonalization of arbitrarily many matrices. A neural solution was proposed in [113] but again relies on non-local Oja-based rules. Ongoing work on nonlinear ICA [114, 115] is of great interest to us since it might be a perfect candidate for multi-layered architectures. + +Recently, several works proposed biologically plausible supervised learning algorithms [61, 62, 63, 53, 116]. Combining these with ICA and unsupervised learning algorithms in general would provide a more comprehensive description of cognitive processes. + +# Acknowledgments and Disclosure of Funding + +Y.B. is grateful to Romain Cosentino, and Claudia Skok Gibbs for insightful discussions related to this work and feedback on this manuscript. We also thank the members of the Neural Circuits and Algorithms Group at the Flatiron Institute for providing feedback on an early version of this work. + +The authors did not receive any third party funding for the completion of this project. + +# References + +[1] Robert Desimone and John Duncan. Neural mechanisms of selective visual attention. Annual Review of Neuroscience, 18(1):193-222, 1995. +[2] Rachel I Wilson and Zachary F Mainen. Early events in olfactory processing. Annual Review of Neuroscience, 29:163-201, 2006. +[3] Mark A Bee and Christophe Micheyl. The cocktail party problem: what is it? how can it be solved? and why should animal behaviorists study it? Journal of comparative psychology, 122(3):235, 2008. +[4] Josh H McDermott. The cocktail party problem. Current Biology, 19(22):R1024-R1027, 2009. +[5] Pierre Comon and Christian Jutten. Handbook of Blind Source Separation: Independent component analysis and applications. Academic press, 2010. +[6] Pierre Comon. Independent component analysis, a new concept? Signal processing, 36(3):287-314, 1994. +[7] Aapo Hyvarinen and Erkki Oja. Independent component analysis: algorithms and applications. Neural Networks, 13(4-5):411-430, 2000. +[8] Anthony Bell and Terrence J Sejnowski. Edges are the 'independent components' of natural scenes. Advances in Neural Information Processing Systems, 9:831-837, 1996. +[9] Anthony J Bell and Terrence J Sejnowski. The "independent components" of natural scenes are edge filters. Vision research, 37(23):3327-3338, 1997. +[10] Michael S Lewicki. Efficient coding of natural sounds. Nature neuroscience, 5(4):356-363, 2002. +[11] Jitendra Sharma, Alessandra Angelucci, and Mriganka Sur. Induction of visual orientation modules in auditory cortex. Nature, 404(6780):841-847, 2000. +[12] Anthony J Bell and Terrence J Sejnowski. An information-maximization approach to blind separation and blind deconvolution. Neural Computation, 7(6):1129-1159, 1995. +[13] Shun-Ichi Amari, Andrzej Cichocki, and Howard Yang. A new learning algorithm for blind signal separation. Advances in Neural Information Processing Systems, 8:757-763, 1995. +[14] Dinh Tuan Pham and Philippe Garat. Blind separation of mixture of independent sources through a maximum likelihood approach. In In proc. eusipco. Citeseer, 1997. +[15] Te-Won Lee. Independent component analysis. In Independent component analysis, pages 27-66. Springer, 1998. +[16] Te-Won Lee, Mark Girolami, Anthony J Bell, and Terrence J Sejnowski. A unifying information-theoretic framework for independent component analysis. Computers & Mathematics with Applications, 39(11):1-21, 2000. +[17] Juha Karhunen, Erkki Oja, Liuyue Wang, Ricardo Vigario, and Jyrki Joutsensalo. A class of neural networks for independent component analysis. IEEE Transactions on Neural Networks, 8(3):486-504, 1997. + +[18] Shun-Ichi Amari and Andrzej Cichocki. Adaptive blind signal processing-neural network approaches. Proceedings of the IEEE, 86(10):2026-2048, 1998. +[19] Aapo Hyvarinen and Erkki Oja. Independent component analysis by general nonlinear Hebbian-like learning rules. Signal Processing, 64(3):301-313, 1998. +[20] Andrzej Cichocki, Juha Karhunen, Wlodzimierz Kasprzak, and Ricardo Vigario. Neural networks for blind separation with unknown number of sources. Neurocomputing, 24(1-3):55-93, 1999. +[21] Peter Földiak. Forming sparse representations by local anti-Hebbian learning. Biological Cybernetics, 64(2):165–170, 1990. +[22] Ralph Linsker. A local learning rule that enables information maximization for arbitrary input distributions. Neural Computation, 9(8):1661-1665, 1997. +[23] Cengiz Pehlevan, Sreyas Mohan, and Dmitri B Chklovskii. Blind nonnegative source separation using biological neural networks. Neural Computation, 29(11):2925-2954, 2017. +[24] David Lipshutz and Dmitri B Chklovskii. Bio-NICA: A biologically inspired single-layer network for nonnegative independent component analysis. arXiv preprint arXiv:2010.12632, 2020. +[25] Berfin Simsek and Alper T Erdogan. Online bounded component analysis: A simple recurrent neural network with local update rule for unsupervised separation of dependent and independent sources. In 2019 53rd Asilomar Conference on Signals, Systems, and Computers, pages 1639-1643. IEEE, 2019. +[26] Alper T. Erdogan and Cengiz Pehlevan. Blind bounded source separation using neural networks with local learning rules. In ICASSP 2020-2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 3812-3816. IEEE, 2020. +[27] J-F Cardoso. Source separation using higher order moments. In ICASSP, pages 2109-2112. IEEE, 1989. +[28] Jari Miettinen, Sara Taskinen, Klaus Nordhausen, and Hannu Oja. Fourth moments and independent component analysis. Statistical Science, 30(3):372-390, 2015. +[29] Tatsuya Hayama, Jun Noguchi, Satoshi Watanabe, Noriko Takahashi, Akiko Hayashi-Takagi, Graham CR Ellis-Davies, Masanori Matsuzaki, and Haruo Kasai. GABA promotes the competitive selection of dendritic spines by controlling local ca 2+ signaling. Nature neuroscience, 16(10):1409, 2013. +[30] John NJ Reynolds, Brian I Hyland, and Jeffery R Wickens. A cellular mechanism of reward-related learning. Nature, 413(6851):67-70, 2001. +[31] Humberto Salgado, Georg Körhr, and Mario Trevino. Noradrenergic 'tone' determines dichotomous control of cortical spike-timing-dependent plasticity. Scientific reports, 2(1):1-7, 2012. +[32] Christian Henneberger, Thomas Papouin, Stéphane HR Oliet, and Dmitri A Rusakov. Long-term potentiation depends on release of d-serine from astrocytes. Nature, 463(7278):232-236, 2010. +[33] OJMD Coenen, DM Eagleman, V Mitsner, TM Bartol, AJ Bell, and TJ Sejnowski. Cerebellar glomeruli: Does limited extracellular calcium direct a new kind of plasticity. In Society for Neuroscience Abstracts, volume 27, 2001. +[34] Matti Weckström and Simon Laughlin. Extracellular potentials modify the transfer of information at photoreceptor output synapses in the blowfly compound eye. Journal of Neuroscience, 30(28):9557-9566, 2010. +[35] Emily P Huang. Synaptic plasticity: a role for nitric oxide in LTP. *Current Biology*, 7(3):R141–R143, 1997. + +[36] Christian Holscher. Nitric oxide, the enigmatic neuronal messenger: its role in synaptic plasticity. Trends in neurosciences, 20(7):298-303, 1997. +[37] Neil Hardingham, James Dachtler, and Kevin Fox. The role of nitric oxide in pre-synaptic plasticity and homeostasis. Frontiers in cellular neuroscience, 7:190, 2013. +[38] Karl Pearson. On lines and planes of closest fit to systems of points in space. The London, Edinburgh, and Dublin Philosophical Magazine and Journal of Science, 2(11):559-572, 1901. +[39] Ian T Jolliffe. Principal Component Analysis and Factor Analysis, volume 1. Springer, 1986. +[40] Kun Zhang and Lai-Wan Chan. ICA by PCA approach: relating higher-order statistics to second-order moments. In International Conference on Independent Component Analysis and Signal Separation, pages 311-318. Springer, 2006. +[41] Erkki Oja. Principal components, minor components, and linear neural networks. Neural Networks, 5(6):927-935, 1992. +[42] A-J Van Der Veen, ED F Deprettere, and A Lee Swindlehurst. Subspace-based signal analysis using singular value decomposition. Proceedings of the IEEE, 81(9):1277-1308, 1993. +[43] Cengiz Pehlevan and Dmitri Chklovskii. A normative theory of adaptive dimensionality reduction in neural networks. In Advances in Neural Information Processing Systems, pages 2269-2277, 2015. +[44] Cengiz Pehlevan, Anirvan M Sengupta, and Dmitri B Chklovskii. Why do similarity matching objectives lead to Hebbian/anti-Hebbian networks? Neural Computation, 30(1):84–124, 2017. +[45] Victor Minden, Cengiz Pehlevan, and Dmitri B Chklovskii. Biologically plausible online principal component analysis without recurrent neural dynamics. In 2018 52nd Asilomar Conference on Signals, Systems, and Computers, pages 104-111. IEEE, 2018. +[46] Cengiz Pehlevan and Dmitri B Chklovskii. A Hebbian/anti-Hebbian network derived from online non-negative matrix factorization can cluster and discover sparse features. In 2014 48th Asilomar Conference on Signals, Systems and Computers, pages 769–775. IEEE, 2014. +[47] Yanis Bahroun, Eugénie Hunsicker, and Andrea Soltoggio. Neural networks for efficient nonlinear online clustering. In International Conference on Neural Information Processing, pages 316-324. Springer, 2017. +[48] Anirvan Sengupta, Cengiz Pehlevan, Mariano Tepper, Alexander Genkin, and Dmitri Chklovskii. Manifold-tiling localized receptive fields are optimal in similarity-preserving neural networks. In Advances in Neural Information Processing Systems, volume 31, 2018. +[49] Yanis Bahroun, Dmitri Chklovskii, and Anirvan Sengupta. A similarity-preserving network trained on transformed images recapitulates salient features of the fly motion detection circuit. In Advances in Neural Information Processing Systems, volume 32, 2019. +[50] Cengiz Pehlevan, Xinyuan Zhao, Anirvan M Sengupta, and Dmitri Chklovskii. Neurons as canonical correlation analyzers. Frontiers in Computational Neuroscience, 14:55, 2020. +[51] David Lipshutz, Yanis Bahroun, Siavash Golkar, Anirvan M Sengupta, and Dmitri B Chklovskii. A biologically plausible neural network for multichannel canonical correlation analysis. Neural Computation, 33(9):2309-2352, 2021. +[52] Yanis Bahroun and Andrea Soltoggio. Online representation learning with single and multi-layer Hebbian networks for image classification. In International Conference on Artificial Neural Networks, pages 354-363. Springer, 2017. +[53] Shanshan Qin, Nayantara Mudur, and Cengiz Pehlevan. Contrastive similarity matching for supervised learning. Neural Computation, 33(5):1300-1328, 2021. +[54] Yanis Bahroun and Dmitri B Chklovskii. A neural network with local learning rules for minor subspace analysis. arXiv preprint arXiv:2102.05501, 2021. + +[55] Kantilal V Mardia, John T Kent, and John M Bibby. Multivariate Analysis (probability and mathematical statistics). Academic Press London, 1980. +[56] Paul F Pinsky and John Rinzel. Intrinsic and network rhythmogenesis in a reduced Traub model for CA3 neurons. Journal of computational neuroscience, 1(1):39-60, 1994. +[57] Sonia Gasparini and Jeffrey C Magee. State-dependent dendritic computation in hippocampal CA1 pyramidal neurons. Journal of Neuroscience, 26(7):2088-2100, 2006. +[58] Nelson Spruston. Pyramidal neurons: dendritic structure and synaptic integration. Nature Reviews Neuroscience, 9(3):206-221, 2008. +[59] Yael Katz, Vilas Menon, Daniel A Nicholson, Yuri Geinisman, William L Kath, and Nelson Spruston. Synapse distribution suggests a two-stage model of dendritic integration in CA1 pyramidal neurons. Neuron, 63(2):171-177, 2009. +[60] Jordan Guerguiev, Timothy P Lillicrap, and Blake A Richards. Towards deep learning with segregated dendrites. *Elife*, 6:e22901, 2017. +[61] João Sacramento, Rui Ponte Costa, Yoshua Bengio, and Walter Senn. Dendritic cortical microcircuits approximate the backpropagation algorithm. Advances in Neural Information Processing Systems, 31:8721-8732, 2018. +[62] Blake A Richards and Timothy P Lillicrap. Dendritic solutions to the credit assignment problem. Current opinion in neurobiology, 54:28-36, 2019. +[63] Siavash Golkar, David Lipshutz, Yanis Bahroun, Anirvan Sengupta, and Dmitri Chklovskii. A simple normative network approximates local non-hebbian learning in the cortex. Advances in Neural Information Processing Systems, 33, 2020. +[64] Spyridon Chavlis and Panayiota Poirazi. Drawing inspiration from biological dendrites to empower artificial neural networks. Current Opinion in Neurobiology, 70:1-10, 2021. +[65] Vincent Paille, Elodie Fino, Kai Du, Teresa Morera-Herreras, Sylvie Perez, Jeanette Hellgren, Kotaleski, and Laurent Venance. GABAergic circuits control spike-timing-dependent plasticity. Journal of Neuroscience, 33(22):9353-9363, 2013. +[66] Ji-Chuan Zhang, Pak-Ming Lau, and Guo-Qiang Bi. Gain in sensitivity and loss in temporal contrast of stdp by dopaminergic modulation at hippocampal synapses. Proceedings of the National Academy of Sciences, 106(31):13028-13033, 2009. +[67] Sho Yagishita, Akiko Hayashi-Takagi, Graham CR Ellis-Davies, Hidetoshi Urakubo, Shin Ishii, and Haruo Kasai. A critical time window for dopamine actions on the structural plasticity of dendritic spines. Science, 345(6204):1616-1620, 2014. +[68] Joshua P Johansen, Lorenzo Diaz-Mataix, Hiroki Hamanaka, Takaaki Ozawa, Edgar Ycu, Jenny Koivumaa, Ashwani Kumar, Mian Hou, Karl Deisseroth, Edward S Boyden, et al. Hebbian and neuromodulatory mechanisms interact to trigger associative memory formation. Proceedings of the National Academy of Sciences, 111(51):E5584-E5592, 2014. +[69] Takuya Isomura and Taro Toyoizumi. A local learning rule for independent component analysis. Scientific Reports, 6(1):1-17, 2016. +[70] Takuya Isomura and Taro Toyoizumi. Error-gated Hebbian rule: A local learning rule for principal and independent component analysis. Scientific Reports, 8(1):1-11, 2018. +[71] Richard S Sutton. Learning to predict by the methods of temporal differences. Machine learning, 3(1):9-44, 1988. +[72] Pietro Mazzoni, Richard A Andersen, and Michael I Jordan. A more biologically plausible learning rule for neural networks. Proceedings of the National Academy of Sciences, 88(10):4433-4437, 1991. +[73] Ronald J Williams. Simple statistical gradient-following algorithms for connectionist reinforcement learning. Machine learning, 8(3-4):229-256, 1992. + +[74] Lukasz Kusmierz, Takuya Isomura, and Taro Toyoizumi. Learning with three factors: modulating Hebbian plasticity with errors. Current Opinion in Neurobiology, 46:170-177, 2017. +[75] Elie L Bienenstock, Leon N Cooper, and Paul W Munro. Theory for the development of neuron selectivity: orientation specificity and binocular interaction in visual cortex. Journal of Neuroscience, 2(1):32-48, 1982. +[76] Erkki Oja. The nonlinear PCA learning rule in independent component analysis. Neurocomputing, 17(1):25-45, 1997. +[77] Cengiz Pehlevan and Dmitri B Chklovskii. Neuroscience-inspired online unsupervised learning algorithms: Artificial neural networks. IEEE Signal Processing Magazine, 36(6):88-96, 2019. +[78] Bruno A Olshausen and David J Field. Emergence of simple-cell receptive field properties by learning a sparse code for natural images. Nature, 381(6583):607-609, 1996. +[79] Nathan Intrator and Leon N Cooper. Objective function formulation of the bcm theory of visual cortical plasticity: Statistical connections, stability conditions. Neural Networks, 5(1):3-17, 1992. +[80] GC Castellani, N Intrator, H Shouval, and LN Cooper. Solutions of the bcm learning rule in a network of lateral interacting nonlinear neurons. Network: Computation in Neural Systems, 10(2):111-121, 1999. +[81] Michiel Coesmans, John T Weber, Chris I De Zeeuw, and Christian Hansel. Bidirectional parallel fiber plasticity in the cerebellum under climbing fiber control. Neuron, 44(4):691-700, 2004. +[82] Henrik Jörntell and Christian Hansel. Synaptic memories upside down: bidirectional plasticity at cerebellar parallel fiber-purkinje cell synapses. *Neuron*, 52(2):227-238, 2006. +[83] Kaspar E Vogt and Marco Canepari. On the induction of postsynaptic granule cell-Purkinje neuron LTP and LTD. The Cerebellum, 9(3):284-290, 2010. +[84] Lucas Parra and Paul Sajda. Blind source separation via generalized eigenvalue decomposition. Journal of Machine Learning Research, 4:1261-1269, 2003. +[85] Christian Jutten and Jeanny Herault. Blind separation of sources, part i: An adaptive algorithm based on neuromimetic architecture. Signal processing, 24(1):1-10, 1991. +[86] Beate Laheld and Jean-Francois Cardoso. Adaptive source separation with uniform performance. In Proc. EUSIPCO, volume 1, pages 183-186. CiteSeer, 1994. +[87] J-F Cardoso and Beate H Laheld. Equivariant adaptive source separation. IEEE Transactions on signal processing, 44(12):3017-3030, 1996. +[88] Juha Karhunen, Liuyue Wang, and Ricardo Vigario. Nonlinear pca type approaches for source separation and independent component analysis. In Proceedings of ICNN'95-International Conference on Neural Networks, volume 2, pages 995-1000. IEEE, 1995. +[89] Peter Kabal. TSP speech database. McGill University, Database Version, 1(0):09-02, 2002. +[90] Philemon Brakel and Yoshua Bengio. Learning independent features with adversarial nets for non-linear ICA. arXiv preprint arXiv:1710.05050, 2017. +[91] Aapo Hyvarinen and Patrik Hoyer. Emergence of phase-and shift-invariant features by decomposition of natural images into independent feature subspaces. Neural computation, 12(7):1705-1720, 2000. +[92] Jussi H Poikonen and Mika Laiho. Online linear subspace learning in an analog array computing architecture. In CNNA 2016; 15th International Workshop on Cellular Nanoscale Networks and their Applications, pages 1-2. VDE, 2016. +[93] Mohammed E Fouda, Emre Neftci, Ahmed Eltawil, and Fadi Kurdistan. Independent component analysis using RRAMs. IEEE Transactions on Nanotechnology, 18:611-615, 2018. + +[94] Cengiz Pehlevan. A spiking neural network with local learning rules derived from nonnegative similarity matching. In ICASSP 2019-2019 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pages 7958-7962. IEEE, 2019. +[95] J. D. Carroll. Generalization of canonical correlation analysis to three or more sets of variables. Proc. APA, pages 227-228, 1968. +[96] David R Hardoon, Sandor Szedmak, and John Shawe-Taylor. Canonical correlation analysis: An overview with application to learning methods. Neural Computation, 16(12):2639-2664, 2004. +[97] Lucas C. Parra. Multiset canonical correlation analysis simply explained. arXiv preprint arXiv:1802.03759, 2018. +[98] Laurenz Wiskott and Terrence J Sejnowski. Slow feature analysis: Unsupervised learning of invariances. Neural Computation, 14(4):715-770, 2002. +[99] Joel Zylberberg, Jason Timothy Murphy, and Michael Robert DeWeese. A sparse coding model with synaptically local plasticity and spiking neurons can account for the diverse shapes of V1 simple cell receptive fields. PLoS computational biology, 7(10):e1002250, 2011. +[100] Paul D King, Joel Zylberberg, and Michael R DeWeese. Inhibitory interneurons decorrelate excitatory cells to drive sparse code formation in a spiking model of V1. Journal of Neuroscience, 33(13):5475-5485, 2013. +[101] Sophie Denève, Alireza Alemi, and Ralph Bourdoukan. The brain as an efficient and robust adaptive learner. Neuron, 94(5):969-977, 2017. +[102] Wieland Brendel, Ralph Bourdoukan, Pietro Vertechi, Christian K Machens, and Sophie Denéve. Learning to represent signals spike by spike. PLoS computational biology, 16(3):e1007692, 2020. +[103] David Lipshutz, Charles Windolf, Siavash Golkar, and Dmitri Chklovskii. A biologically plausible neural network for slow feature analysis. In Advances in Neural Information Processing Systems, volume 33, pages 14986-14996, 2020. +[104] James V Stone. Blind source separation using temporal predictability. Neural Computation, 13(7):1559-1574, 2001. +[105] Hailin Liu and Yiuming Cheung. A learning framework for blind source separation using generalized eigenvalues. In International Symposium on Neural Networks, pages 472-477. Springer, 2005. +[106] Tobias Blaschke, Pietro Berkes, and Laurenz Wiskott. What is the relation between slow feature analysis and independent component analysis? Neural Computation, 18(10):2495-2508, 2006. +[107] Claudia Clopath, André Longtin, and Wulfram Gerstner. An online Hebbian learning rule that performs independent component analysis. In J. Platt, D. Koller, Y. Singer, and S. Roweis, editors, Advances in Neural Information Processing Systems, volume 20. Curran Associates, Inc., 2008. +[108] Francis R Bach and Michael I Jordan. Kernel independent component analysis. Journal of Machine Learning Research, 3(Jul):1-48, 2002. +[109] Yi-Ou Li, Tulay Adali, Wei Wang, and Vince D Calhoun. Joint blind source separation by multiset canonical correlation analysis. IEEE Transactions on Signal Processing, 57(10):3918-3929, 2009. +[110] Jean-Francois Cardoso and Antoine Souloumiac. Blind beamforming for non-Gaussian signals. IEEE Proceedings F (Radar and Signal Processing), 140(6):362-370, 1993. +[111] Hannu Oja, Seija Sirkiä, and Jan Eriksson. Scatter matrices and independent component analysis. Austrian Journal of Statistics, 35(2&3):175-189, 2006. + +[112] Esa Ollila, Hannu Oja, and Visa Koivunen. Complex-valued ICA based on a pair of generalized covariance matrices. Computational Statistics & Data Analysis, 52(7):3789-3805, 2008. +[113] Ch Ziegaus and Elmar Wolfgang Lang. A neural implementation of the JADE algorithm (nJADE) using higher-order neurons. Neurocomputing, 56:79-100, 2004. +[114] Aapo Hyvarinen, Hiroaki Sasaki, and Richard Turner. Nonlinear ICA using auxiliary variables and generalized contrastive learning. In The 22nd International Conference on Artificial Intelligence and Statistics, pages 859–868. PMLR, 2019. +[115] Ilyes Khemakhem, Diederik Kingma, Ricardo Monti, and Aapo Hyvarinen. Variational autoencoders and nonlinear ICA: A unifying framework. In International Conference on Artificial Intelligence and Statistics, pages 2207-2217. PMLR, 2020. +[116] Alexandre Payeur, Jordan Guerguiev, Friedemann Zenke, Blake A Richards, and Richard Naud. Burst-dependent synaptic plasticity can coordinate learning in hierarchical circuits. Nature neuroscience, pages 1-10, 2021. \ No newline at end of file diff --git a/anormativeandbiologicallyplausiblealgorithmforindependentcomponentanalysis/images.zip b/anormativeandbiologicallyplausiblealgorithmforindependentcomponentanalysis/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..9058814307d5b56d8bff6be1295f5d47112575d5 --- /dev/null +++ b/anormativeandbiologicallyplausiblealgorithmforindependentcomponentanalysis/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e0ec817dcdc26a44d1e31eceb5f82921fde1ce93d51a56527ae0f1f43feae337 +size 391496 diff --git a/anormativeandbiologicallyplausiblealgorithmforindependentcomponentanalysis/layout.json b/anormativeandbiologicallyplausiblealgorithmforindependentcomponentanalysis/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..6f17360fb8c77da066fe5c4a8fa81211b23c2bd4 --- /dev/null +++ b/anormativeandbiologicallyplausiblealgorithmforindependentcomponentanalysis/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:520a6e5cc50fecf07946a94e4f84cd32645afd3dd8e9183e587d2fe575d5bb4d +size 581353 diff --git a/anoteonsparsegeneralizedeigenvalueproblem/39ae661b-011d-421a-803d-3c40fcd22e2c_content_list.json b/anoteonsparsegeneralizedeigenvalueproblem/39ae661b-011d-421a-803d-3c40fcd22e2c_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..f4a5523582fe561eb727b72c4afce38b2eb46047 --- /dev/null +++ b/anoteonsparsegeneralizedeigenvalueproblem/39ae661b-011d-421a-803d-3c40fcd22e2c_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3738117abdc007c53dd06b38838f9161512e9b9ed8637530c842b8b9e4edb577 +size 92944 diff --git a/anoteonsparsegeneralizedeigenvalueproblem/39ae661b-011d-421a-803d-3c40fcd22e2c_model.json b/anoteonsparsegeneralizedeigenvalueproblem/39ae661b-011d-421a-803d-3c40fcd22e2c_model.json new file mode 100644 index 0000000000000000000000000000000000000000..cf90936f065b879d9820c38422aaa7008bed1cf7 --- /dev/null +++ b/anoteonsparsegeneralizedeigenvalueproblem/39ae661b-011d-421a-803d-3c40fcd22e2c_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28a8b02219f3f017e0e395a18a91b21b48a66c777bc41e9f8de69a7f3afb2756 +size 112509 diff --git a/anoteonsparsegeneralizedeigenvalueproblem/39ae661b-011d-421a-803d-3c40fcd22e2c_origin.pdf b/anoteonsparsegeneralizedeigenvalueproblem/39ae661b-011d-421a-803d-3c40fcd22e2c_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fe46e521f5ef99f390b6441ef09f74c310652016 --- /dev/null +++ b/anoteonsparsegeneralizedeigenvalueproblem/39ae661b-011d-421a-803d-3c40fcd22e2c_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e242fd864129ded7930ee9ed09b4bce0a893d5b5953b5e0f003039fb4f0adaa6 +size 415923 diff --git a/anoteonsparsegeneralizedeigenvalueproblem/full.md b/anoteonsparsegeneralizedeigenvalueproblem/full.md new file mode 100644 index 0000000000000000000000000000000000000000..137d95402ea3ace415cdaba359447f907627adf7 --- /dev/null +++ b/anoteonsparsegeneralizedeigenvalueproblem/full.md @@ -0,0 +1,445 @@ +# A Note on Sparse Generalized Eigenvalue Problem + +Yunfeng Cai, Guanhua Fang, Ping Li + +Cognitive Computing Lab + +Baidu Research + +No. 10 Xibeiwang East Road, Beijing 100193, China + +10900 NE 8th St. Bellevue, Washington 98004, USA + +{yunfengcai, guanhuafang, liping11}@baidu.com + +# Abstract + +The sparse generalized eigenvalue problem (SGEP) aims to find the leading eigenvector with sparsity structure. SGEP plays an important role in statistical learning and has wide applications including, but not limited to, sparse principal component analysis, sparse canonical correlation analysis and sparse Fisher discriminant analysis, etc. Due to the sparsity constraint, the solution of SGEP entails interesting properties from both numerical and statistical perspectives. In this paper, we provide a detailed sensitivity analysis for SGEP and establish the rate-optimal perturbation bound under the sparse setting. Specifically, we show that the bound is related to the perturbation/noise level and the recovery of the true support of the leading eigenvector as well. We also investigate the estimator of SGEP via imposing a non-convex regularization. Such estimator can achieve the optimal error rate and can recover the sparsity structure as well. Extensive numerical experiments corroborate our theoretical findings via using alternating direction method of multipliers (ADMM)-based computational method. + +# 1 Introduction + +The sparse generalized eigenvalue problem (SGEP) is to solve the following constrained optimization problem: + +$$ +\max _ {\mathbf {x} \in \mathbb {R} ^ {p}} \frac {\mathbf {x} ^ {\mathrm {T}} \widetilde {A} \mathbf {x}}{\mathbf {x} ^ {\mathrm {T}} \widetilde {B} \mathbf {x}}, \quad \text {s u b j e c t t o} \quad \| \mathbf {x} \| _ {0} \leq k, \tag {1} +$$ + +where $\widetilde{A}$ , $\widetilde{B}$ are both $p$ -by- $p$ symmetric matrices and $\widetilde{B}$ is (semi) positive definite; $\|\mathbf{x}\|_0$ denotes the $\ell_0$ -norm of $\mathbf{x}$ , i.e., the number of nonzero entries of $\mathbf{x}$ ; $k$ is an integer which may be much smaller than $p$ . For a fixed $k$ , we let $\mathbf{x}_*$ be the solution to (1). Moreover, matrices $\widetilde{A}$ and $\widetilde{B}$ usually have the following decomposition: + +$$ +\widetilde {A} = A + E, \quad \widetilde {B} = B + F, \tag {2} +$$ + +where $A, B$ are underlying symmetric matrices and $B$ is positive definite. However, $A$ and $B$ are unobserved in practice and they can be contaminated by some noise/perturbation matrices $E$ and $F$ , respectively. Let $\lambda_{1}$ be the largest generalized eigenvalue of matrix pair $(A, B)$ and $\mathbf{u}_{1}$ be its corresponding eigenvector which is also known as the leading eigenvector. In addition, $\mathbf{u}_{1}$ is always assumed to be sparse, i.e., $\| \mathbf{u}_1\|_0 \ll p$ . Therefore, the SGEP is essentially to find an approximation of $\mathbf{u}_{1}$ based on observation $(\widetilde{A}, \widetilde{B})$ . + +The SGEP is challenging due to the following aspects. First, the sparsity constraint optimization problem (1) is NP-hard, since it is essentially a subset selection problem [19, 20]. To recover the underlying sparsity structure, we need to try different $k$ which is computationally expensive. + +Second, due to insufficient number of samples, $\widetilde{A}$ and $\widetilde{B}$ can be both ill-conditioned or even share an approximate common null space, and perturbations $E$ and $F$ can be large. As a result, the leading eigenvector of pair $(\widetilde{A},\widetilde{B})$ may not be a good approximation of $\mathbf{u}_1$ . + +Though challenging, especially when there is a limited number of data samples, SGEP and related problems have received more and more attention in the past decade and various numerical methods are proposed to solve the SGEP. For example, in [24], the SGEP is framed as a d.c. (difference of convex functions) program and is solved as a sequence of convex programs by invoking the majorization-minimization method. In [23], the $\ell_0$ norm constraint is approximated by a continuous surrogate function, an algorithm inspired by the majorization-minimization method is developed via iteratively majorizing the surrogate function by a quadratic separable function, and a systematic way based on smoothing is proposed to deal with the singularity issue. [9] proposes a semidefinite programming method for sparse canonical correlation analysis which is one of important SGEP applications. In [30], a two-stage computational framework is proposed to solve the SGEP, in which the first stage computes an initial guess via convex relaxation, and the second stage solves a nonconvex optimization via a fixed step size steepest ascent method, and followed by the simple truncation. In [22], a general framework called sparse estimation with linear programming is proposed for sparse canonical correlation analysis. Combining the idea of $\ell_1$ -penalized adaptive normalized quasi-Newton algorithm with nested orthogonal complement structure, an algorithm is proposed in [32] to solve the SGEP. [13] solves the SGEP by modifying the standard generalized orthogonal iteration with a sparsity-inducing penalty for the eigenvectors. For more comprehensive review of computations in the SGEP, please see [3, 42] and references therein. + +Despite the efforts mentioned above, there is very little work investigating the optimal estimation error and no work provides theoretical guarantees whether the underlying sparsity structure of the leading eigenvector of SGEP can be recovered. In this paper, we bridge the theoretical gap in the literature. First, we provide both upper and lower bounds of the approximation error given noisy observations in the sparse generalized eigenvalue problem setting. To be specific, we prove that the difference between $\mathbf{u}_1$ and $\mathbf{x}_{*}$ is bounded by two parts, the perturbation error and error of not recovering the true support of $\mathbf{u}_1$ . Furthermore, we show that the error bound we obtained is rate optimal. That is, the lower bound matches the upper bound up to a multiplicative constant. Second, we consider a family of non-convex penalty functions and reformulate (1) into a regularization problem. We show that such regularized estimator enjoys the merits of sparsity and nearly unbiasedness. With these nice properties, the estimator can be shown to achieve the optimal estimation error rate and can recover the true support of leading eigenvector as well. In addition, we also present a new computational algorithm. The estimation procedure adopts the Alternating Direction Method of Multipliers (ADMM, [37, 21]) and can recover the sparsity structure well under mild conditions. Local convergence theory is established for the proposed method. + +The rest of paper is organized as follows. In Section 2, we introduce the sparse generalized eigenvalue problem with its applications and technical tools. In Section 3, we provide a sensitivity analysis for SGEP and establish its upper and lower perturbation bounds. In Section 4, we propose a regularized estimator via using non-convex penalization method and established the estimation bound. We also propose a computational method, non-convex SGEP algorithm (NC-SGEP), to tackle with the estimation issues. Multiple numerical results are given in Section 5 and corroborate our theory. The concluding remark is given in Section 6. + +Notations: The calligraphic letters $\mathcal{I}$ , $\mathcal{J}$ , $\mathcal{K}$ , and $\mathcal{S}$ are usually used to denote index sets. $|\mathcal{I}|$ denotes the cardinality of $\mathcal{I}$ , e.g., $\mathcal{I} = \{i_1, i_2, \ldots, i_s\}$ , where $i_1, i_2, \ldots, i_s$ are distinct integers, then $|\mathcal{I}| = s$ . We use $\mathbf{x}$ to denote a generic vector in $\mathbb{R}^p$ and $\mathbf{x}^{\mathrm{T}}$ to denote its transpose. $\mathbf{x}[j]$ is the $j$ th element in $\mathbf{x}$ . $\mathbf{x}[\mathcal{I}]$ stands for the subvector of $\mathbf{x}$ with indices in set $\mathcal{I}$ . We use $A$ to denote a matrix in $\mathbb{R}^{p \times p}$ . $A[i, j]$ is the entry in the $i$ th row and the $j$ th column. $A[\mathcal{I}, \mathcal{J}]$ stands for the submatrix of $A$ with row indices in set $\mathcal{I}$ and column indices in set $\mathcal{J}$ . If $\mathcal{I} = \mathcal{J}$ , $A[\mathcal{I}, \mathcal{I}]$ is also denoted by $A_{\mathcal{I}}$ . We also let $(\mathcal{I}, \mathcal{J})$ be the union of sets $\mathcal{I}$ and $\mathcal{J}$ . For $\mathbf{x} \in \mathbb{R}^p$ , $\operatorname{supp}(\mathbf{x})$ denotes the index set of all nonzero entries of $\mathbf{x}$ . For matrix $A$ , $\operatorname{supp}(A)$ denotes the index set of all nonzero rows of $A$ . $I_p$ is the $p \times p$ identity matrix. $\operatorname{diag}(d_1, \ldots, d_p)$ represents a diagonal matrix with $d_1, \ldots, d_p$ being its diagonal elements. $\| \mathbf{x} \|_0$ represents the number of non-zero entries in $\mathbf{x}$ ; $\| \mathbf{x} \|_2 := \sqrt{\sum_j \mathbf{x}^2[j]}$ ; $\| A \|_2$ denotes the largest singular value of $A$ ; $\| A \|_F$ and $\| A \|_*$ is the Frobenius norm and nuclear norm of matrix $A$ respectively. $\| A \|_{\infty} := \max_{i,j} |A[i,j]|$ . We write $a \gg b$ ( $a \ll b$ ) if $a \geq Kb$ ( $a \leq b / K$ ) for some sufficiently large number $K$ . + +# 2 Preliminary + +Applications Sparse generalized eigenvalue problem has a wide application. Many high-dimensional multivariate statistical problems can be formulated as special instances of (1). + +Example 1 [Sparse Principal Component Analysis [44, 5, 1, 35, 36]] Given $n$ observations with $p$ features, sparse principal component analysis (SPCA) seeks the best low dimensional projection of the observed data for increasing interpretability, minimizing information loss and achieving sparsity structure. Let $\widetilde{\Sigma}$ be the empirical covariance matrix. SPCA aims to solve + +$$ +\max _ {\mathbf {x} \in \mathbb {R} ^ {p}} \mathbf {x} ^ {\mathrm {T}} \widetilde {\Sigma} \mathbf {x}, \text {s u b j e c t t o} \| \mathbf {x} \| _ {0} \leq k, \| \mathbf {x} \| _ {2} = 1. \tag {3} +$$ + +Such problem is a special case of SGEP where $\widetilde{A} = \widetilde{\Sigma}$ and $\widetilde{B} = I$ . + +Example 2 [Sparse Fisher's Discriminant Analysis [31, 12, 17, 14, 16]] Given $n$ observations with $p$ features from $K$ different classes, Fisher's discriminant analysis seeks a projection for mapping observations to the low dimensional space on which the between-class variance $\Sigma_{b}$ is large while the within-class variance $\Sigma_{w}$ is small. Let $\widetilde{\Sigma}_{b}$ and $\widetilde{\Sigma}_{w}$ be the sample estimates of $\Sigma_{b}$ and $\Sigma_{w}$ , respectively. To obtain the sparse leading discriminant vector, one can solve + +$$ +\max _ {\mathbf {x} \in \mathbb {R} ^ {p}} \mathbf {x} ^ {\mathrm {T}} \widetilde {\Sigma} _ {b} \mathbf {x}, \text {s u b j e c t t o} \mathbf {x} ^ {\mathrm {T}} \widetilde {\Sigma} _ {w} \mathbf {x} = 1, \| \mathbf {x} \| _ {0} \leq k. \tag {4} +$$ + +Such a problem can be formulated as an SGEP with $\widetilde{A} = \widetilde{\Sigma}_b$ and $\widetilde{B} = \widetilde{\Sigma}_w$ . + +Example 3 [Sparse Canonical Correlation Analysis [39, 9, 10, 41]] Given two random vectors $X \in \mathbb{R}^p$ , $Y \in \mathbb{R}^p$ , let $\Sigma_{xx}, \Sigma_{yy}, \Sigma_{xy}$ be the covariance matrices for $X$ , $Y$ , and the cross-covariance matrix between $X$ and $Y$ , respectively. Let $\widetilde{\Sigma}_{xx}, \widetilde{\Sigma}_{yy}, \widetilde{\Sigma}_{xy}$ be estimators (constructed from samples) for $\Sigma_{xx}, \Sigma_{yy}, \Sigma_{xy}$ , respectively. Sparse canonical correlation analysis (SCCA) aims to solve the constrained optimization problem: + +$$ +\begin{array}{l} \max _ {\mathbf {u} _ {x}, \mathbf {u} _ {y}} \mathbf {u} _ {x} ^ {\mathrm {T}} \widetilde {\boldsymbol {\Sigma}} _ {x y} \mathbf {u} _ {y}, s u b j e c t t o \mathbf {u} _ {x} ^ {\mathrm {T}} \widetilde {\boldsymbol {\Sigma}} _ {x x} \mathbf {u} _ {x} = 1, \mathbf {u} _ {y} ^ {\mathrm {T}} \widetilde {\boldsymbol {\Sigma}} _ {y y} \mathbf {u} _ {y} = 1, \\ \| \mathbf {u} _ {x} \| _ {0} \leq k _ {x}, \| \mathbf {u} _ {y} \| _ {0} \leq k _ {y}, \\ \end{array} +$$ + +where $k_x$ and $k_y$ are two small integers. Such a problem can be recast as an SGEP with + +$$ +\widetilde {A} = \left[ \begin{array}{c c} 0 & \widetilde {\Sigma} _ {x y} \\ \widetilde {\Sigma} _ {x y} ^ {\mathrm {T}} & 0 \end{array} \right], \quad \widetilde {B} = \left[ \begin{array}{c c} \widetilde {\Sigma} _ {x x} & 0 \\ 0 & \widetilde {\Sigma} _ {y y} \end{array} \right], \quad \mathbf {u} _ {1} = \left[ \begin{array}{c} \mathbf {u} _ {x} \\ \mathbf {u} _ {y} \end{array} \right]. +$$ + +Strictly speaking, two problems are not exactly equivalent, because $\| \mathbf{u}\| _0\leq k_x + k_y$ does not necessarily imply $\| \mathbf{u}_x\| _0\leq k_x$ and $\| \mathbf{u}_y\| _0\leq k_y$ + +Technical preparation We first introduce some useful terminologies for describing the generalized eigenvalue problem (GEP). Let $A \in \mathbb{R}^{p \times p}$ be a symmetric matrix and $B \in \mathbb{R}^{p \times p}$ be a symmetric and positive definite matrix. Then GEP for the matrix pair $(A, B)$ is defined as + +$$ +A \mathbf {u} _ {i} = \lambda_ {i} B \mathbf {u} _ {i}; i = 1, \dots , p. +$$ + +Without loss of generality, we can always assume that $\lambda_1 \geq \dots \geq \lambda_p$ . Here $\mathbf{u}_i$ is $i$ th eigenvector and $\lambda_i$ is $i$ th eigenvalue; $(\lambda_i, \mathbf{u}_i)$ is called $i$ th eigenpair of $(A, B)$ . Notice that $\mathbf{u}_i$ is only determined up to a scale. In this paper, we always assume that $\| \mathbf{u}_i \|_2 = 1$ . The perturbation analysis of generalized eigenvalue problem has been extensively studied since 1970s and many perturbation bounds have been developed [25, 27, 28, 33]. For reader convenience, we present several existing fundamental results before moving to our main theory immediately. + +Definition 1 The angle between $\mathbf{x},\mathbf{y}(\neq \mathbf{0})\in \mathbb{R}^p$ is defined as $\theta (\mathbf{x},\mathbf{y}):= \arccos \frac{|\mathbf{x}^{\mathrm{T}}\mathbf{y}|}{\|\mathbf{x}\|_2\|\mathbf{y}\|_2}$ + +We assume $\mathbf{x}$ and $\mathbf{y} \in \mathbb{R}^p$ have unit $l_2$ norms and let $[\mathbf{x}, X_2]$ be an orthogonal matrix. Then it holds + +$$ +| \sin \theta (\mathbf {x}, \mathbf {y}) | = \| X _ {2} ^ {\mathrm {T}} \mathbf {y} \| _ {2}. \tag {5} +$$ + +Furthermore, it can be checked that $|\sin \theta(\mathbf{x},\mathbf{y})| \leq \| \mathbf{x} - \mathbf{y}\|_2 \leq \sqrt{2} |\sin \theta(\mathbf{x},\mathbf{y})|$ . Thus $|\sin \theta(\mathbf{x},\mathbf{y})|$ is a measure to quantify the distance between two vectors. In generalized eigenvalue problem, Crawford number is an important quantity for characterizing the perturbation bound. + +Definition 2 The Crawford number of a symmetric matrix pair $(A,B)$ is defined as + +$$ +c (A, B) := \min _ {\| \mathbf {x} \| _ {2} = 1} \sqrt {(\mathbf {x} ^ {\mathrm {T}} A \mathbf {x}) ^ {2} + (\mathbf {x} ^ {\mathrm {T}} B \mathbf {x}) ^ {2}}. +$$ + +A symmetric matrix pair $(A,B)$ is referred to as "definite" if $c(A,B) > 0$ + +Obviously, the symmetric matrix pair $(A,B)$ is definite for any positive definite $B$ . By [25], it is known that the Crawford number is continuous with respect to the matrix pair. + +# 3 Understanding of Perturbation Bound + +# 3.1 On the General Setting + +In order to understand the difference between the solution of (1) and the true leading eigenvector, we first describe the perturbation results without considering the sparsity. The following lemma is from [29] and is a generalization of the Davis-Kahn's sin $\Theta$ theorem in [6] (also see [26, 15]). It gives an upper bound for $|\sin \theta (\mathbf{u}_1,\widetilde{\mathbf{u}}_1)|$ , where $\widetilde{\mathbf{u}}_1$ is the leading eigenvector of $(\tilde{A},\tilde{B})$ . + +Lemma 1 Suppose $(A,B)$ , $(\widetilde{A},\widetilde{B}) = (A + E,B + F)$ are both symmetric-definite pairs, and their eigenvalues satisfy $\lambda_1 \geq \dots \geq \lambda_p \geq 0$ and $\widetilde{\lambda}_1 \geq \dots \geq \widetilde{\lambda}_p \geq 0$ , respectively. Let $\phi_1 = \arctan \lambda_1 > \widetilde{\phi}_2 = \arctan \widetilde{\lambda}_2$ , $\mathbf{u}_1$ , $\widetilde{\mathbf{u}}_1$ be the eigenvectors corresponding to $\lambda_1$ , $\widetilde{\lambda}_1$ , respectively. Denote + +$$ +C _ {u} = \frac {\sqrt {2 (\| A \| _ {2} ^ {2} + \| B \| _ {2} ^ {2})}}{c (A , B)}, \xi = \frac {\sqrt {\| E \mathbf {u} _ {1} \| _ {2} ^ {2} + \| F \mathbf {u} _ {1} \| _ {2} ^ {2}}}{c (\widetilde {A} , \widetilde {B})}, +$$ + +then + +$$ +\left| \sin \theta \left(\mathbf {u} _ {1}, \widetilde {\mathbf {u}} _ {1}\right) \right| \leq \frac {C _ {u} \xi}{\sin \left(\phi_ {1} - \widetilde {\phi} _ {2}\right)}. +$$ + +Therefore, it holds asymptotically that + +$$ +| \sin \theta (\mathbf {u} _ {1}, \widetilde {\mathbf {u}} _ {1}) | \lesssim \frac {C _ {u} \epsilon}{c (A , B) \sin \left(\phi_ {1} - \phi_ {2}\right)}. \tag {6} +$$ + +Although perturbation upper bound has been studied extensively, there are few results on lower bound especially in algebra literature. Next we establish the perturbation lower bound. That is, given any symmetric definite matrix pair $(A,B)$ with $\lambda_{1} > \lambda_{2}$ and any sufficiently small constant $\epsilon >0$ , we can always find a matrix pair $(E,F)$ satisfying $\sqrt{\|E\|_2^2 + \|F\|_2^2} < \epsilon$ such that the distance between $\mathbf{u}_1$ and $\widetilde{\mathbf{u}}_1$ is lower bounded by a quantity in the same order of the bound in Lemma 1. The result is stated in the next lemma. + +Lemma 2 Follow the notations in Lemma 1. For any small positive constant $\epsilon$ , it holds that + +$$ +\sup _ {(E, F) \in \mathcal {F} _ {\epsilon}} | \sin \theta (\mathbf {u} _ {1}, \widetilde {\mathbf {u}} _ {1}) | \gtrsim \frac {C _ {l} \epsilon}{c (A , B) \sin \left(\phi_ {1} - \phi_ {2}\right)}, \tag {7} +$$ + +where $C_l = \frac{c(A,B)}{\sqrt{2(\|A\|_2^2 + \|B\|_2^2)\kappa^{\frac{3}{2}}}}$ with $\kappa \coloneqq \| B\| _2\| B^{-1}\| _2,\mathcal{F}_\epsilon \coloneqq \{(E,F)|\sqrt{\|E\|_2^2 + \|F\|_2^2}\leq \epsilon \}$ . + +Comparing (6) and (7) and noticing that $C_u, C_l$ are two constants, we can see that upper and lower bounds of approximation error only differ up to a multiplicative constant when condition number $\kappa$ is assumed to be bounded. Quantity $\epsilon / c(A, B)$ can be seen as the relative perturbation and $\frac{1}{\sin(\phi_1 - \phi_2)}$ is a monotonically decreasing function of the gap $\phi_1 - \phi_2$ . The upper and lower bounds are both proportional to $\frac{\epsilon}{c(A, B) \sin(\phi_1 - \phi_2)}$ . Thus, we declare that the perturbation bound for the leading eigenvector $\mathbf{u}_1$ is rate-optimal. + +# 3.2 On the Sparse Setting + +Now we are ready to present the upper and lower perturbation bounds under the sparse setting. Throughout the rest of this section, the following assumptions are assumed. + +A1 For any $\mathcal{K} \supset \operatorname{supp}(\mathbf{u}_1)$ with $|\mathcal{K}| \leq s + k$ , it holds + +$$ +\frac {\sqrt {\| \widetilde {A} _ {\mathcal {K}} - A _ {\mathcal {K}} \| _ {2} ^ {2} + \| \widetilde {B} _ {\mathcal {K}} - B _ {\mathcal {K}} \| _ {2} ^ {2}}}{c (A _ {\mathcal {K}} , B _ {\mathcal {K}})} < 1, +$$ + +where $c(A_{\mathcal{K}},B_{\mathcal{K}})$ is the Crawford number of $(A_{\mathcal{K}},B_{\mathcal{K}})$ and $s = |\operatorname {supp}(\mathbf{u}_1)|$ + +A2 For any $\mathcal{K} \supset \operatorname{supp}(\mathbf{u}_1)$ with $|\mathcal{K}| \leq s + k$ , $\widetilde{A}_{\mathcal{K}}$ and $\widetilde{B}_{\mathcal{K}}$ are positive definite. + +Assumption A1 requires that the perturbation within a small superset of $\mathbf{u}_1$ is tiny. It says that one can get a good approximation for $\mathbf{u}_1$ (according to Lemma 1 and 2) when a small superset of $\mathbf{u}_1$ is available. It is, in fact, a necessary condition for computing a good approximation for $\mathbf{u}_1$ . Assumption A2 is a technical requirement to ensure positive definiteness for submatrices of $\tilde{B}$ . + +We further adopt the following notations. We let $S \coloneqq \operatorname{supp}(\mathbf{u}_1)$ and define the perturbation level + +$$ +\epsilon := \max _ {\mathcal {K}: \mathcal {K} \supset \mathcal {S}; | \mathcal {K} | \leq s + k} \sqrt {\| \widetilde {A} _ {\mathcal {K}} - A _ {\mathcal {K}} \| _ {2} ^ {2} + \| \widetilde {B} _ {\mathcal {K}} - B _ {\mathcal {K}} \| _ {2} ^ {2}}, +$$ + +the perturbation set $\mathcal{F}_{\epsilon ,l}\coloneqq \{(E,F)|\sqrt{\|E_{\mathcal{K}}\|_2^2 + \|F_{\mathcal{K}}\|_2^2}\leq \epsilon$ for any subset $\kappa$ with size less than $l\}$ Upper Bound of $|\sin \theta (\mathbf{u}_1,\mathbf{x}_*)|$ + +Theorem 1 Let $\mathcal{J} = \mathrm{supp}(\mathbf{x}_*)$ , $\mathcal{K} = \mathcal{S} \cup \mathcal{J}$ and $= \mathcal{K} \setminus \mathcal{J}$ . Denote $\rho_* = \frac{\mathbf{x}_*^{\mathrm{T}}\widetilde{A}\mathbf{x}_*}{\mathbf{x}_*^{\mathrm{T}}\widetilde{B}\mathbf{x}_*}$ , $c_{\mathcal{K}} = c(A_{\mathcal{K}}, B_{\mathcal{K}})$ and $\widetilde{c}_{\mathcal{K}} = c(\widetilde{A}_{\mathcal{K}}, \widetilde{B}_{\mathcal{K}})$ . Let $\delta = \frac{\|\widetilde{A}_{(\cdot,\mathcal{J})}[\mathbf{x}_*]\|_{\mathcal{J}} - \rho_*\widetilde{B}_{(\cdot,\mathcal{J})}[\mathbf{x}_*]\|_2}{\widetilde{c}_{\mathcal{K}}}$ . If $\delta < \sqrt{1 + \rho_*^2}$ and + +$$ +\arctan \rho_ {*} > \arctan \mu_ {2} + \arctan \epsilon + \arctan \frac {\delta}{\sqrt {1 + \rho_ {*} ^ {2}}}, \tag {8} +$$ + +then + +$$ +| \sin \theta (\mathbf {u} _ {1}, \mathbf {x} _ {*}) | \leq \frac {1}{\widetilde {c} _ {\mathcal {K}}} \Big (\frac {\epsilon C _ {\epsilon}}{c (A _ {\mathcal {K}} , B _ {\mathcal {K}}) \sin (\phi_ {1} - \widetilde {\phi} _ {2})} + \frac {\delta C _ {\delta}}{\sin (\phi_ {*} - \widetilde {\phi} _ {2})} \Big), +$$ + +where $\phi_{*} = \arctan \rho_{*}$ , $\mu_{2}$ is the second largest eigenvalue for $(A_{\mathcal{K}}, B_{\mathcal{K}})$ , $C_{\epsilon}$ and $C_{\delta}$ are some constants. + +Remark: The upper bound has two terms. The first term is due to the perturbation, which is approximately proportional to the perturbation level $\epsilon$ . The second term is due to the failure in finding the true support set of $\mathbf{u}_1$ . If $\mathrm{supp}(\mathbf{u}_1) \subset \mathrm{supp}(\mathbf{x}_*)$ , then $\delta = 0$ , consequently, the second term vanishes. Therefore, it holds asymptotically that + +$$ +\left| \sin \theta \left(\mathbf {u} _ {1}, \mathbf {x} _ {*}\right) \right| \leq \frac {C _ {u , \mathcal {K}} \epsilon}{c \left(A _ {\mathcal {K}} , B _ {\mathcal {K}}\right) \sin \left(\phi_ {1} - \phi_ {2}\right)} \tag {9} +$$ + +with $C_{u,\mathcal{K}} = \frac{\sqrt{2(\|A_{\mathcal{K}}\|_2^2 + \|B_{\mathcal{K}}\|_2^2)}}{c(A_{\mathcal{K}},B_{\mathcal{K}})}$ , when $\mathrm{supp}(\mathbf{x}_*) \supset \mathrm{supp}(\mathbf{u}_1)$ and $\epsilon$ is sufficiently small. + +Lower Bound of $|\sin \theta(\mathbf{u}_1, \mathbf{x}_*)|$ Next we present the lower bound for $|\sin \theta(\mathbf{u}_1, \mathbf{x}_*)|$ . It follows immediately from the proofs of Theorem 1 and Lemma 2. + +Theorem 2 Follow the notations and assumptions in Theorem 1. Then the following result holds. + +Case (a) If $\delta = 0$ , then + +$$ +\max _ {(E, F) \in \mathcal {F} _ {\epsilon , s + k}} | \sin \theta (\mathbf {u} _ {1}, \mathbf {x} _ {*}) | \gtrsim \frac {C _ {l , \mathcal {K}} \epsilon}{c (A _ {\mathcal {K}} , B _ {\mathcal {K}}) \sin (\phi_ {1} - \phi_ {2})}, +$$ + +where $C_{l,\mathcal{K}} = \frac{c(A_{\mathcal{K}},B_{\mathcal{K}})}{\sqrt{2(\|A_{\mathcal{K}}\|_2^2 + \|B_{\mathcal{K}}\|_2^2)\kappa_\kappa^{\frac{3}{2}}(B_{\mathcal{K}})}}$ + +Case (b) If $\epsilon = 0$ , then + +$$ +\max _ {(E, F) \in \mathcal {F} _ {\epsilon , s + k}} | \sin \theta (\mathbf {u} _ {1}, \mathbf {x} _ {*}) | \gtrsim \frac {1}{\sqrt {2} \kappa_ {2} ^ {\frac {3}{2}} (B _ {\mathcal {K}})} \frac {\widehat {\xi} _ {\mathcal {K}}}{\sin (\phi_ {*} - \phi_ {2})}, +$$ + +where $\widehat{\xi}_{\mathcal{K}} = \sqrt{\frac{\|\widehat{E}[u_1]_{\mathcal{K}}\|_2^2 + \|\widehat{F}[u_1]_{\mathcal{K}}\|_2^2}{\|A\|_2^2 + \|B\|_2^2}}$ , and $\widehat{E}$ , $\widehat{F} \in \mathbb{R}^{|\mathcal{K}| \times |\mathcal{K}|}$ are some matrices controlled by $\delta$ . + +Note that Crawford and condition number is well bounded on submatrix pair $(\mathcal{A}_{\mathcal{K}},\mathcal{B}_{\mathcal{K}})$ . Therefore, in Case (a), we can see that the lower bound is at the same order of the first term of the upper bound in Theorem 1; In Case (b), $\widehat{\xi}_{\mathcal{K}} = \mathcal{O}(\delta)$ , then the lower bound is at the same order of the second term of the upper bound in Theorem 1. We may declare that our perturbation bounds are rate-optimal. + +Connection to the literature Although we do not make any statistical assumptions on $E$ and $F$ , we still make connections to the statistical literature here. First, it can be computed that + +$$ +\sin (\phi_ {1} - \phi_ {2}) = \frac {\lambda_ {1} - \lambda_ {2}}{\sqrt {\lambda_ {1} ^ {2} + 1} \sqrt {\lambda_ {2} ^ {2} + 1}}. +$$ + +When $B = I$ is an identity matrix, $C_{u,\mathcal{K}} = O(\sqrt{\lambda_1^2 + 1})$ and $C_{l,\mathcal{K}} = \Omega (\frac{1}{\sqrt{\lambda_1^2 + 1}})$ . Thus our lower bound can be simplified to $\frac{\sqrt{\lambda_2^2 + 1}}{\lambda_1 - \lambda_2}\epsilon$ . In sparse PCA [36], it has been established that the minimax lower bound $\inf_{\tilde{\mathbf{u}}_1}\sup_{\mathcal{M}}(\mathbb{E}\| \mathbf{u}_1 - \tilde{\mathbf{u}}_1\| _2^2)^{1 / 2}$ is $\Theta (\frac{\sqrt{\lambda_1\lambda_2}}{\lambda_1 - \lambda_2}\epsilon)$ with $\epsilon = \sqrt{\frac{s\log p}{n}}$ and $\mathcal{M}$ is the model space where covariance matrix $A$ satisfies that its principle singular vector is $s$ -sparse and $\lambda_{1}$ is larger than $\lambda_{2}$ by certain margin. When $\lambda_{1},\lambda_{2}$ and $\lambda_{1} / \lambda_{2}$ are bounded constants, this minimax rate matches ours. In [2], they provide the minimax perturbation bound for singular subspace of non-symmetric matrices. The minimax rate of $\| \tilde{\mathbf{u}}_1 - \mathbf{u}_1\| _2$ is + +$$ +\Theta (\frac {\alpha z _ {2 1} + \beta z _ {1 2}}{\alpha^ {2} + \beta^ {2} - \min \{z _ {1 2} ^ {2} , z _ {2 1} ^ {2} \}}), +$$ + +where the detailed definitions of $\alpha$ , $\beta$ , $z_{12}$ , $z_{21}$ can be found accordingly in [2]. Especially, for symmetric $A$ and $\tilde{A}$ , the above bound can be simplified to $\frac{\epsilon}{\lambda_1 - \lambda_2}$ when $\epsilon \ll \lambda_1 - \lambda_2$ . Again, when $\lambda_1$ and $\lambda_2$ are bounded constants, the rate is consistent with ours. + +# 4 Understanding of Estimation Quality + +In order to estimate the sparse leading eigenvector, it is straightforward to solve (1). It can be seen that the sparsity of solution to (1) depends on the choice of $k$ , which may not be easily tuned. It is also computationally expensive to find the optimal solution to (1). Alternatively, such problem can be solved via regularization method. For example, [23] uses a smooth surrogate function to replace $\| \cdot \|_0$ penalty for solving SGEP. + +A good estimator should have the following properties, 1. sparsity, 2. nearly unbiasedness, and 3. stability. In high dimensional statistical problem, $\tilde{B}$ is always singular when the sample size is smaller than the number of features. In order to obtain a good approximation of $\mathbf{u}_1$ , we consider the following restricted problem + +$$ +(P 1 ^ {\prime}) \min _ {\mathbf {x} \in \mathbb {R} ^ {p}, \| \mathbf {x} \| _ {0} \leq s _ {n}} - \mathbf {x} ^ {\mathrm {T}} \widetilde {A} \mathbf {x} + p _ {\lambda} (\mathbf {x}) \quad s. t. \mathbf {x} ^ {\mathrm {T}} \widetilde {B} \mathbf {x} \leq 1, \tag {10} +$$ + +where $p_{\lambda}(\mathbf{x}) \coloneqq \sum_{j=1}^{p} p_{\lambda}(\mathbf{x}[j])$ and $p_{\lambda}(x)$ is some univariate non-convex function, and $s_n$ is the restricted dimension. In practice, $s_n$ need not be a small number and it can grow with sample size $n$ . The restriction $\| \mathbf{x} \|_0 \leq s_n$ is imposed for enforcing the solution to be nearly low-dimensional. Along with $p_{\lambda}$ , the estimator can recover the sparsity structure. This reformulation can be viewed as the counterpart of two stage methods [30, 9], where they need to find a good approximation of $\mathbf{u}_1$ in the first stage. + +# 4.1 Penalization Function + +For the choice of $p_{\lambda}$ , we consider a family of special non-convex penalties: + +$$ +\mathcal {P} _ {\lambda} = \left\{p _ {\lambda} (x): p _ {\lambda} (x) \text {s a t i s f i e s} (\mathrm {a} 1) - (\mathrm {a} 3) \right\}, \tag {11} +$$ + +where (a1) Function $p_{\lambda}(x)$ is an even function, i.e., $p_{\lambda}(x) = p_{\lambda}(-x)$ ; (a2) The derivative of $p_{\lambda}(x)$ , $p_{\lambda}'(x)$ , exists in $(0,\infty)$ ; $\lim_{x\downarrow 0}p_{\lambda}'(x) = \lambda$ and $p_{\lambda}'(x)\equiv 0$ if $x\geq \gamma \lambda$ for some constant $\gamma$ ; (a3) On $(0,\infty)$ , $p_{\lambda}'(x)$ is monotone decreasing and Lipschitz continuous, i.e., there exists a constant $\kappa$ such that $0\leq \frac{p_{\lambda}'(x_1) - p_{\lambda}'(x_2)}{x_2 - x_1}\leq \kappa$ for any $0 < x_{1} < x_{2}$ . + +Here (a1) requires $p_{\lambda}(x)$ to be symmetric; (a2) specifies the local property of derivatives of $p_{\lambda}(x)$ around 0 and assumes the flatness of $p_{\lambda}(x)$ for larger $x$ ; (a3) puts continuity constraints on $p_{\lambda}'(x)$ . Many popular penalty functions are included in $\mathcal{P}_{\lambda}$ , for example, smoothly clipped absolute deviation (SCAD, [7]), minimax concave penalty (MCP, [43]), etc. Based on the definitions, we can see that any $p_{\lambda}(x) \in \mathcal{P}_{\lambda}$ is similar to $\ell_1$ -norm locally around the origin. On the other hand, $p_{\lambda}(x)$ puts a smaller penalization on the signal compared with $\ell_1$ penalty. They do not give the penalization to those large values. Intuitively speaking, the regularized estimator with non-convex penalty may outperform the $\ell_1$ -norm-based estimator since it is nearly unbiased. + +# 4.2 Support Recovery + +In this section, we provide the error bound and oracle properties of the non-convex estimator under suitable conditions. Some additional notations are introduced as follows. We define $\hat{\mathbf{u}}_1$ as $\arg \max_{\mathbf{x}:\| \mathbf{x}\| _0\leq s_n,\mathbf{x}^{\mathrm{T}}\widetilde{B}_{\mathbf{x}}\leq 1}\mathbf{x}^{\mathrm{T}}\tilde{A}\mathbf{x}$ and denote $\tilde{\rho} = \hat{\mathbf{u}}_1^{\mathrm{T}}\tilde{A}\hat{\mathbf{u}}_1$ . Vector $\hat{\mathbf{u}}_1$ can be viewed as the best approximation of the leading eigenvector in the restricted space. We define $c(A,B,s_n)\coloneqq \max_{|\mathcal{K}|\leq s_n}c(A_{\mathcal{K}},B_{\mathcal{K}})$ and $c(\tilde{A},\tilde{B},s_n)\coloneqq \max_{|\mathcal{K}|\leq s_n}c(\widetilde{A}_{\mathcal{K}},\widetilde{B}_{\mathcal{K}})$ . We also define $N(A,B,s_n)\coloneqq \max_{|\mathcal{K}|\leq s_n}\sqrt{\|A_{\mathcal{K}}^2 + B_{\mathcal{K}}^2\|_2}$ . We define $\epsilon_s\coloneqq \max_{\mathcal{K}:\| \mathcal{K}\| _0\leq s_n}\{\| E_{\mathcal{K}}\| _2,\| F_{\mathcal{K}}\| _2\}$ . A different set of assumptions is stated as follows. + +B0 (Regularity) $\lambda_1 - \lambda_2$ is positive; $\| B\|$ , $\| B^{-1}\|$ are bounded by some constant. +B1 (Signal) $\min \{| \mathbf{u}_1[j] | : j \in \operatorname{supp}(\mathbf{u}_1) \}\gg \sqrt{S} \lambda.$ +B2 (Penalization) $\lambda \gg \epsilon_s \cdot C_F$ , where $C_F$ is a constant depending on $c(A, B, s_n)$ , $c(\tilde{A}, \tilde{B}, s_n)$ and $N(A, B, s_n)$ . +B3 (Support size) $|\mathcal{S}|\lambda^2 \ll 1$ . +B4 (Identifiability) $\max_{\mathcal{K}:\| \mathcal{K}\| _0\leq s_n,S\not\subset\mathcal{K}}\lambda_1(A_{\mathcal{K}},B_{\mathcal{K}}) < \lambda_1 - 2\epsilon .$ + +Condition B0 ensures that the leading eigenvector is unique and underlying matrix $B$ is well-behaved. Condition B1 requires that the absolute values of entries in the true support is not too small so that $S$ can be identified. Condition B2 specifies the relationship between penalty level $\lambda$ and noise level $\epsilon$ . That is, penalty level $\lambda$ should be at least larger than the noise level up to a multiplicative constant. Condition B3 makes sure that the support size is not too large, i.e., $\mathbf{u}_1$ should be sparse. The following theorem guarantees that the estimator is not far away from the re-scaled leading eigenvector. Condition B4 is for the identifiability of $|S|$ to ensure that the support of $\mathbf{u}_1$ could be still identified after perturbation. Without loss of generality, we always assume $s_n \geq |S|$ . Then we have the following results. + +Theorem 3 Let $\widehat{\mathbf{x}}$ be the optimizer of Problem (P1'). Under Conditions B0 - B4, it holds that + +$$ +\min_{\substack{\operatorname {sgn}\in \{-1,1\}}}\| \operatorname {sgn}\cdot \widehat{\mathbf{x}} -\mathbf{u}_{1s}\|_{2}\leq C_{1}\sin (\theta (\hat{\mathbf{u}}_{1},\mathbf{u}_{1})) + C_{2}\epsilon_{s}, +$$ + +for some constants $C_1$ and $C_2$ . + +Here $\mathbf{u}_{1s} = \mathbf{u}_1(\mathbf{u}_1^{\mathrm{T}}B\mathbf{u}_1)^{-1 / 2}$ is the re-scaled leading eigenvector. Furthermore, we can recover the support of $\mathbf{u}_1$ under this restricted problem. + +Theorem 4 Under the same conditions in Theorem 3, it holds that + +$$ +\operatorname {s u p p} (\widehat {\mathbf {x}}) = \operatorname {s u p p} \left(\mathbf {u} _ {1}\right). \tag {12} +$$ + +Based on Theorem 4, we actually have even stronger results. When all required conditions are met, the proposed estimator is equal to the oracle estimator which is the one estimated when the true support $S$ is known to us. Therefore, the estimator achieves the optimal error bound which matches the one obtained in Theorem 1. Specifically, the proposed estimator achieves the optimal error rate $\left( \frac{|S| \log p}{n} \right)^{1/2}$ in sparse PCA and sparse CCA problems. + +Theorem 5 Under the same set of conditions in Theorem 4, we have that + +$$ +| \sin \theta (\hat {\mathbf {x}}, \mathbf {u} _ {1}) | \leq C _ {u, \mathcal {S}} \frac {\epsilon}{c (A _ {\mathcal {S}} , B _ {\mathcal {S}}) \sin (\phi_ {1} - \phi_ {2})}, \tag {13} +$$ + +with $C_{u,S} = C\frac{\sqrt{2(\|A_S\|_2^2 + \|B_S\|_2^2)}}{c(A_S,B_S)}$ ( $C$ is a universal constant). + +Remark 1 To achieve the optimal statistical error rate $\left(\frac{|S| \log p}{n}\right)^{1/2}$ , most existing methods are two-stage based. For example, [38] studies sparse PCA problem and propose a "sparse orthogonal iteration pursuit" (SOAP) algorithm which involves "relax" and "tighten" stages; [9] considers sparse CCA problem and adopt the two-stage regularization approach with L1 penalty for the first stage and group LASSO penalty for the second stage. By comparison, our current estimator does not require convex relaxation in the first stage. + +# 4.3 Computation + +For computational purpose, we consider to solve (P1') by using the alternating direction method of multipliers (ADMM, [37, 21]). Specifically, we relax the problem (P1') by reformulating it to + +$$ +\min _ {\mathbf {x}, \mathbf {y}, \mathbf {z}} \mathcal {L} (\mathbf {x}, \mathbf {z}, \mathbf {y}), \quad s. t. \mathbf {x} ^ {\mathrm {T}} \widetilde {B} \mathbf {x} = 1, \| \mathbf {x} \| _ {0} \leq s _ {n}, \tag {14} +$$ + +where + +$$ +\mathcal {L} (\mathbf {x}, \mathbf {z}, \mathbf {y}) = - \mathbf {x} ^ {\mathrm {T}} \tilde {A} \mathbf {x} + p _ {\lambda} (\mathbf {z}) + \mathbf {y} ^ {\mathrm {T}} (\mathbf {x} - \mathbf {z}) + \frac {\eta}{2} \| \mathbf {x} - \mathbf {z} \| _ {2} ^ {2}. +$$ + +In (14), we introduce several auxiliary variables for the following reasons. We construct a new vector $\mathbf{z}$ which is a copy of $\mathbf{x}$ . It can help us to split the original problem to two simple separate sub-problems. $\mathbf{y}$ is the dual variable for the constraint $\mathbf{x} = \mathbf{z}$ . + +By formulation (14), we can optimize the objective function with respect to each variable iteratively. The steps for updating $\mathbf{x},\mathbf{y},\mathbf{z}$ are described as follows. + +i Update $\mathbf{x}$ : At $(t + 1)$ -th iteration, we aim to find $\mathbf{x}^{(t + 1)}$ which is + +$$ +\arg \min _ {\mathbf {x} \in \mathcal {D}} \quad \frac {\eta}{2} \| \mathbf {x} - \mathbf {z} ^ {(t)} \| _ {2} ^ {2} + \left(\mathbf {y} ^ {(t)}\right) ^ {\mathrm {T}} (\mathbf {x} - \mathbf {z} ^ {(t)}) - \mathbf {x} ^ {\mathrm {T}} \tilde {A} \mathbf {x}, \tag {15} +$$ + +where $\mathcal{D} = \{\mathbf{x}:\mathbf{x}^{\mathrm{T}}\widetilde{B}\mathbf{x} = 1,\| \mathbf{x}\| \leq s_n\}$ . Solve sub-problem (15) to get $\mathbf{x}^{(t + 1)}$ . + +ii Update $\mathbf{z}$ : We know that $\mathbf{z}^{(t + 1)} = \arg \min_{\mathbf{z}}\frac{\eta}{2}\| \mathbf{z} - \mathbf{x}^{(t)}\|_2^2 + (\mathbf{y}^{(t)})^\mathrm{T}(\mathbf{x}^{(t + 1)} - \mathbf{z}) + p_\lambda (\mathbf{z})$ . Each entry of $\mathbf{z}$ can be optimized separately. Specifically, if we take $p_\lambda$ as the MCP penalty, then $\mathbf{z}^{(t + 1)}$ has the following analytical form, + +$$ +\mathbf {z} ^ {(t + 1)} [ j ] = \left\{ \begin{array}{l l} \check {\mathbf {z}} ^ {(t)} & \text {i f} | \check {\mathbf {z}} ^ {(t)} | > \gamma \lambda , \\ \frac {\operatorname {s g n} (\check {\mathbf {z}} ^ {(t)} [ j ]) (| \check {\mathbf {z}} ^ {(t)} [ j ] | - \frac {\lambda}{\eta}) _ {+}}{1 - \frac {1}{\eta \gamma}} & \text {i f} | \check {\mathbf {z}} ^ {(t)} | \leq \gamma \lambda , \end{array} \right. +$$ + +where $\check{\mathbf{z}}^{(t)}\coloneqq \mathbf{x}^{(t + 1)} + \frac{\mathbf{y}^{(t)}}{\eta}$ + +iii Update $\mathbf{y}$ : By dual variable update in [21], we have $\mathbf{y}^{(t + 1)} = \mathbf{y}^{(t)} + \eta (\mathbf{x}^{(t + 1)} - \mathbf{z}^{(t + 1)})$ . + +We call the above procedure as non-convex-SGEP (NC-SGEP) algorithm. Such proposed algorithm works on matrix-vector product and eigen-decomposition for submatrices of $\tilde{B}$ , which is computationally efficient. Compared with other truncation methods, we do not need to make efforts to choose best $s_n$ due to the existence of non-convex regularization term. Thanks to the penalization term, our method can give a sparse estimator with a very wide range to choose the restricted dimension $s_n$ . + +Here we propose a projection-based method for solving sub-problem (15). At $(t + 1)$ -th iteration, we aim to find $\mathbf{x}^{(t + 1)}$ which is the minimizer of (15). We construct the active set $S_{t}$ and consider the following recursive formula, + +$$ +\mathbf {b} _ {m} ^ {(t + 1)} = \mathbf {z} ^ {(t)} - \frac {\mathbf {y} ^ {(t)} - \tilde {A} \mathbf {x} _ {m - 1} ^ {(t + 1)}}{\eta}, \tag {16} +$$ + +$$ +\mathbf {x} _ {m} ^ {(t + 1)} [ \mathcal {S} _ {t} ] = (\beta_ {m} ^ {(t + 1)} \widetilde {B} _ {\mathcal {S} _ {t}} + I) ^ {- 1} \mathbf {b} _ {m} ^ {(t + 1)} [ \mathcal {S} _ {t} ], +$$ + +where $\mathbf{x}_0^{(t + 1)} = \mathbf{x}^{(t)}$ and index $m\in \{1,2,\ldots \}$ . Scalar $\beta_{m}^{(t + 1)}$ satisfies $1 = \sum_{j}\frac{d_{j}(\widetilde{\mathbf{b}}_{m}^{(t + 1)}[j])^{2}}{(\beta_{m}^{(t + 1)}d_{j} + 1)^{2}}$ with $\widetilde{\mathbf{b}}_m^{(t + 1)} = U^{\mathrm{T}}\mathbf{b}_m^{(t + 1)}[\mathcal{S}_t]$ ; $\widetilde{B}_{\mathcal{S}_t} = UDU^{\mathrm{T}}$ and $D = \mathrm{diag}(d_1,\dots,d_{s_n})$ . Such recursive formula is valid due to the following two observations (Propositions 1 - 2). + +Proposition 1 Let $\check{\mathbf{y}}$ be the projection of $\mathbf{y}$ on to the ellipsoid $\{\mathbf{x} \mid \mathbf{x}^{\mathrm{T}} B \mathbf{x} = 1\}$ . Then $\check{\mathbf{y}}$ has the following form + +$$ +\breve {\mathbf {y}} = (\beta B + I) ^ {- 1} \mathbf {y}, +$$ + +where $\beta$ is a scalar which is the solution to the equation $1 = \sum_{j}\frac{d_j(\widetilde{\mathbf{y}}[j])^2}{(\beta d_j + 1)^2}$ , where $\widetilde{\mathbf{y}} = U^{\mathrm{T}}\mathbf{y}$ , $B = UDU^{\mathrm{T}}$ and $D = \mathrm{diag}(d_1,\ldots ,d_p)$ . + +Proposition 2 The limiting point returned by (16) is the stationary point of (15). + +Proposition 1 gives the explicit formula to project an arbitrary vector $\mathbf{y}$ to the convex body $\{\mathbf{x}|\mathbf{x}^{\mathrm{T}}B\mathbf{x} = 1\}$ . By contrast, it may lead to worse performance, if we just do the naive rescaling method, i.e., $\check{\mathbf{y}} = \mathbf{y}(\mathbf{y}^{\mathrm{T}}B\mathbf{y})^{-1 / 2}$ . Since (15) is highly non-convex, Proposition 2 only guarantees a way to find a stationary solution but not necessarily a optimal solution. + +In this paper, we consider the following two possible constructions of active set $S_{t}$ . + +(C1) $S_{t}$ is the set of indices corresponding to first $s_n$ largest absolute values of entries in $\mathbf{b}_1^{(t + 1)}$ (see (16)). +(C2) $S_{t}$ is the set of indices corresponding to first $s_n$ largest absolute values of entries in $\mathbf{x}^{(t)}$ . + +The following theorem gives the local convergence of NC-SGEP algorithm under additional assumptions. In general, ADMM-based method is extremely hard to analyze especially in highly non-convex problem. It remains an open question whether the global convergence result could be established. + +Theorem 6 For the active set construction (C2), we take a large $\eta$ value, set the initial support of $\mathbf{x}^{(0)}$ includes $\mathrm{supp}(\mathbf{u}_1)$ and let $\mathbf{z}^{(0)} = \mathbf{x}^{(0)},\mathbf{y}^{(0)} = \mathbf{0}$ . Then it holds + +$$ +T (\epsilon) \leq \frac {C \left(\mathcal {L} \left(\mathbf {x} ^ {(0)} , \mathbf {z} ^ {(0)} , \mathbf {y} ^ {(0)}\right) - \bar {f}\right)}{\epsilon}, +$$ + +where $T(\epsilon) = \min \{t: \| \mathbf{x}^{(t)} - \mathbf{z}^{(t)} \| \leq \epsilon\}$ and $\bar{f} = \min_{\mathbf{x}} \mathcal{L}(\mathbf{x}, \mathbf{x}, \mathbf{y})$ for some constant $C$ which may depend on $\eta$ and $\max_{\mathcal{S}:|S| \leq s_n} \| (B_{\mathcal{S}})^{-1/2} A_{\mathcal{S}} (B_{\mathcal{S}})^{-1/2} \|_2$ . Moreover, $\mathrm{supp}(\mathbf{x}^{(T(\epsilon))}) = \mathrm{supp}(\mathbf{u}_1)$ if $\epsilon = o(\epsilon_s)$ . + +For construction method (C1), the same local convergence result also holds with an extra assumption that $\tilde{B}$ is diagonal. + +# 4.4 Remarks + +In practice, we find that construction (C1) has higher probabilities to find the global optimum compared with construction (C2). Especially in the application of sparse principle component analysis, construction (C1) is very efficient to recover the sparsity structure of leading component. Theorem 6 gives a local convergence result, which requires the initial value $\mathbf{x}^{(0)}$ contains the support of true leading eigenvector $\mathbf{u}_1$ . Such a good initial candidate of leading eigenvector could be obtained via using semidefinite programming (SDP)-based methods [35, 36, 9]. In other words, our proposed method can be easily merged to a two-stage-type method. The proposed algorithm only requires $O(s_{n}p + s_{n}^{3})$ operations per iteration, while SDP-based methods have $O(p^3)$ computational complexity. More discussions about SDP-based methods can be found in the supplemental material. + +# 5 Numerical Experiments + +# 5.1 Validation of Perturbation Bounds + +We conduct perturbation analyses of proposed estimator under different settings. The matrix pair is set as $A = 4\mathbf{u}_1\mathbf{u}_1^{\mathrm{T}} + I - P_{\mathbf{u}_1}$ , $B = I$ . We sample $n$ data which follows $N(0, A)$ and sample another $n$ data which follows $N(0, B)$ . The $\tilde{A}$ and $\tilde{B}$ are constructed based on the sample covariance correspondingly. The leading eigenvector $\mathbf{u}_1$ has unit norm and has non-zero entries in first $|\mathcal{S}|$ positions. We fixed dimension $p \equiv 100$ and let number of samples $(n)$ and support size $(|\mathcal{S}|)$ vary. Each setting is repeated for 100 times with fixed choice of $\lambda = 0.3$ , $\eta = 1$ , $s_n = 25$ . The mean and + +Table 1: Estimation error $\left\| \hat{\mathbf{x}} - \mathbf{u}_1 \right\|_2$ under different perturbation and sparsity level. "Oracle" / "Est": with / without knowing support $S$ . "Sd" is the standard deviation of "Est". + +
n100200400800160032006400
|S|\(\sqrt{\frac{\log p}{n}}\)0.2300.1620.1150.0810.0570.0410.029
2Oracle0.0560.0360.0290.0190.0130.0100.007
Est0.1400.0470.0430.0240.0190.0120.008
Sd(0.190)(0.034)(0.030)(0.022)(0.013)(0.009)(0.006)
4Oracle0.1070.0730.0570.0370.0280.0190.014
Est0.2250.1310.0770.0430.0320.0220.017
Sd(0.244)(0.061)(0.036)(0.028)(0.017)(0.011)(0.009)
8Oracle0.1730.1180.0870.0620.0440.0300.022
Est0.2770.1910.1100.0820.0580.0430.028
Sd(0.279)(0.156)(0.066)(0.039)(0.031)(0.022)(0.012)
+ +standard deviation of $\| \hat{\mathbf{x}} -\mathbf{u}_1\| _2$ are reported. We also compute the oracle estimator which is the best $\hat{\mathbf{x}}$ when true support $S$ is known. From Table 1, when noise level $\sqrt{\log p / n}$ is small, we can see that the estimation error is quite close to the optimal (oracle) error. In addition, we can see that estimation error is proportional to $\sqrt{|S|}$ and $\sqrt{\log p / n}$ . This indicates that our method can achieve the theoretical optimal error rate, i.e., $O(\sqrt{\frac{|S|\log p}{n}})$ . + +# 5.2 Validation of Sparsity Recovery + +The underlying matrix pair is set as $A = 3\mathbf{u}_1\mathbf{u}_1^{\mathrm{T}} + I - P_{\mathbf{u}_1}$ , $B = I$ . Thus, we naturally take $\widetilde{B} = B = I$ and $\widetilde{A}$ as the sample covariance of data. We let dimension $p$ grow from 16 to 256, fix the sample size $n = 100$ and set $\lambda = 0.5$ , $\eta = 1$ and $s_n = 50$ . We compare the proposed method with the semidefinite programming method [34, 18, 40, SDP] with $\ell_1$ (SDP_L1) and MCP (SDP_MCP) penalty. The estimation error and percentage of support recovery are reported in Table 2. We can see that the proposed method can have a slightly better performance. This is because NC-SGEP optimizes objective within space $\mathbb{R}^p$ unlike those SDP methods work on space $\mathbb{R}^{p\times p}$ . In addition, the proposed method can recover the sparsity structure pretty well, while SDP methods can never recover the true support set. + +Table 2: Estimation accuracy for sparse canonical correlation analysis. + +
p163264128256
||x̂xT - u1u1T ||∞NC-SGEP0.074 (0.056)0.076 (0.068)0.072 (0.059)0.081(0.054)0.084 (0.054)
SDP_L10.071 (0.046)0.080 (0.041)0.095 (0.049)0.094 (0.039)0.100 (0.041)
SDP_MCP0.070 (0.045)0.079 (0.040)0.093 (0.048)0.093 (0.038)0.096 (0.039)
Recovery of |S|NC-SGEP93 %82 %68 %59 %49 %
SDP_L1-----
SDP_MCP-----
+ +# 6 Conclusion + +In this paper, we establish the upper and lower bounds for perturbation analysis of sparse generalized eigenvalue problem. We also consider a new statistical estimation method. The proposed method gives a sparse, nearly unbiased and stable solution to SGEP. We show that the proposed estimator can achieve the optimal estimation error rate. We further present a non-convex SGEP (NC-SGEP) algorithm to solve a non-convex regularization problem with guarantee of local convergence. Multiple numerical results validate our theories and also show the superior performance of the proposed method. In the future work, on the theoretical side, we may focus on extending the current results to the problem of finding multiple leading sparse eigenvectors and establishing the corresponding new lower bound theory. On the computational side, even though computing leading vectors one by one seems straightforward, it is not an easy problem since it requires the orthogonalization procedure. The computational complexity may require a special care. + +# References + +[1] Aharon Birnbaum, Iain M Johnstone, Boaz Nadler, and Debashis Paul. Minimax bounds for sparse pca with noisy high-dimensional data. Annals of statistics, 41(3):1055, 2013. +[2] T Tony Cai and Anru Zhang. Rate-optimal perturbation bounds for singular subspaces with applications to high-dimensional statistics. Annals of Statistics, 46(1):60-89, 2018. +[3] Yunfeng Cai and Ping Li. An inverse-free truncated rayleigh-ritz method for sparse generalized eigenvalue problem. In Proceedings of the 23rd International Conference on Artificial Intelligence and Statistics (AISTATS), pages 3460–3470, Online [Palermo, Sicily, Italy], 2020. +[4] Emmanuel J Candès, Justin K Romberg, and Terence Tao. Stable signal recovery from incomplete and inaccurate measurements. Communications on Pure and Applied Mathematics, 59(8):1207-1223, 2006. +[5] Alexandre d'Aspremont, Francis R. Bach, and Laurent El Ghaoui. Optimal solutions for sparse principal component analysis. J. Mach. Learn. Res., 9:1269-1294, 2008. +[6] Chandler Davis and William Morton Kahan. The rotation of eigenvectors by a perturbation. III. SIAM J. Numer. Anal., 7(1):1-46, 1970. +[7] Jianqing Fan and Runze Li. Variable selection via nonconcave penalized likelihood and its oracle properties. Journal of the American statistical Association, 96(456):1348-1360, 2001. +[8] Ky Fan. On a theorem of Weyl concerning eigenvalues of linear transformations I. Proceedings of the National Academy of Sciences of the United States of America, 35(11):652, 1949. +[9] Chao Gao, Zongming Ma, and Harrison H Zhou. An efficient and optimal method for sparse canonical correlation analysis. ArXiVe-prints, 1409, 2014. +[10] Chao Gao, Zongming Ma, and Harrison H Zhou. Sparse cca: Adaptive estimation and computational barriers. Annals of Statistics, 45(5):2074-2101, 2017. +[11] Rong Ge, Chi Jin, Sham M. Kakade, Praneeth Netrapalli, and Aaron Sidford. Efficient algorithms for large-scale generalized eigenvector computation and canonical correlation analysis. In Proceedings of the 33nd International Conference on Machine Learning (ICML), pages 2741-2750, New York City, NY, 2016. +[12] Yaqian Guo, Trevor Hastie, and Robert Tibshirani. Regularized linear discriminant analysis and its application in microarrays. Biostatistics, 8(1):86-100, 2007. +[13] Sungkyu Jung, Jeongyoun Ahn, and Yongho Jeon. Penalized orthogonal iteration for sparse estimation of generalized eigenvalue problem. Journal of Computational and Graphical Statistics, 28(3):710-721, 2019. +[14] Mladen Kolar and Han Liu. Optimal feature selection in high-dimensional discriminant analysis. IEEE Trans. Inf. Theory, 61(2):1063-1083, 2015. +[15] Ren-Cang Li. Matrix perturbation theory. In L. Hogben, R. Brualdi, and G. W. Stewart, editors, Handbook of Linear Algebra, chapter 21. CRC Press, Boca Raton, FL, 2nd edition, 2014. +[16] Qing Mai, Yi Yang, and Hui Zou. Multiclass sparse discriminant analysis. Statistica Sinica, 29(1):97-111, 2019. +[17] Qing Mai, Hui Zou, and Ming Yuan. A direct approach to sparse discriminant analysis in ultra-high dimensions. Biometrika, 99(1):29-42, 2012. +[18] Jérôme Malick, Janez Povh, Franz Rendl, and Angelika Wiegele. Regularization methods for semidefinite programming. SIAM J. Optim., 20(1):336-356, 2009. +[19] Baback Moghaddam, Yair Weiss, and Shai Avidan. Spectral bounds for sparse PCA: exact and greedy algorithms. In Advances in Neural Information Processing Systems (NIPS), pages 915-922, Vancouver, Canada], 2005. + +[20] Baback Moghaddam, Yair Weiss, and Shai Avidan. Generalized spectral bounds for sparse LDA. In Proceedings of the Twenty-Third International Conference (ICML), pages 641–648, Pittsburgh, PA, 2006. +[21] Neal Parikh and Stephen P. Boyd. Proximal algorithms. Found. Trends Optim., 1(3):127-239, 2014. +[22] Sandra E Safo, Jeongyoun Ahn, Yongho Jeon, and Sungkyu Jung. Sparse generalized eigenvalue problem with application to canonical correlation analysis for integrative analysis of methylation and gene expression data. Biometrics, 74(4):1362-1371, 2018. +[23] Junxiao Song, Prabhu Babu, and Daniel Pérez Palomar. Sparse generalized eigenvalue problem via smooth optimization. IEEE Trans. Signal Process., 63(7):1627-1642, 2015. +[24] Bharath K, Striperumbudur, David A Torres, and Gert RG Lanckriet. A majorization-minimization approach to the sparse generalized eigenvalue problem. Mach. Learn., 85(1-2):3-39, 2011. +[25] Gilbert W Stewart. Perturbation bounds for the definite generalized eigenvalue problem. Linear Algebra and Its Applications, 23:69-85, 1979. +[26] Gilbert W Stewart and Ji-Guang Sun. Matrix Perturbation Theory. Academic Press, Boston, 1990. +[27] Ji-Guang Sun. The perturbation bounds of generalized eigenvalues of a class of matrix-pairs. Math. Numer. Sinica, 4(1):23-29, 1982. +[28] Ji-Guang Sun. Perturbation analysis for the generalized eigenvalue and the generalized singular value problem. In Matrix Pencils, pages 221-244. Springer, 1983. +[29] Ji-guang Sun. The perturbation bounds for eigenspaces of a definite matrix-pair. Numer. Math., 41(3):321-343, 1983. +[30] Kean Ming Tan, Zhaoran Wang, Han Liu, and Tong Zhang. Sparse generalized eigenvalue problem: Optimal statistical rates via truncated rayleigh flow. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 80(5):1057-1086, 2018. +[31] Robert Tibshirani, Trevor Hastie, Balasubramanian Narasimhan, and Gilbert Chu. Class prediction by nearest shrunken centroids, with applications to dna microarrays. Statistical Science, pages 104-117, 2003. +[32] Kengo Uchida and Isao Yamada. A nested $\ell_1$ -penalized adaptive normalized quasi-Newton algorithm for sparsity-aware generalized eigen-subspace extraction. In 2018 Asia-Pacific Signal and Information Processing Association Annual Summit and Conference (APSIPA ASC), pages 212-217. IEEE, 2018. +[33] Charles F Van Loan and Gene H Golub. Matrix Computations. Johns Hopkins University Press, Baltimore, MD, 4th edition, 2013. +[34] Lieven Vandenberghe and Stephen P. Boyd. Semidefinite programming. SIAM Rev., 38(1):49-95, 1996. +[35] Vincent Q. Vu, Juhee Cho, Jing Lei, and Karl Rohe. Fantope projection and selection: A near-optimal convex relaxation of sparse PCA. In Advances in Neural Information Processing Systems (NIPS), pages 2670-2678, Lake Tahoe, NV, 2013. +[36] Vincent Q Vu, Jing Lei, et al. Minimax sparse principal subspace estimation in high dimensions. Annals of Statistics, 41(6):2905-2947, 2013. +[37] Bo Wahlberg, Stephen Boyd, Mariette Annergren, and Yang Wang. An admm algorithm for a class of total variation regularized estimation problems. IFAC Proceedings Volumes, 45(16):83-88, 2012. +[38] Zhaoran Wang, Huanran Lu, and Han Liu. Nonconvex statistical optimization: Minimax-optimal sparse pca in polynomial time. arXiv preprint arXiv:1408.5352, 2014. + +[39] Daniela M Witten, Robert Tibshirani, and Trevor Hastie. A penalized matrix decomposition, with applications to sparse principal components and canonical correlation analysis. Biostatistics, 10(3):515-534, 2009. +[40] Henry Wolkowicz, Romesh Saigal, and Lieven Vandenberghe. Handbook of semidefinite programming: theory, algorithms, and applications, volume 27. Springer Science & Business Media, 2012. +[41] Zhiqiang Xu and Ping Li. Towards practical alternating least-squares for cca. In NeurIPS, pages 14737-14746, 2019. +[42] Zhiqiang Xu and Ping Li. A practical riemannian algorithm for computing dominant generalized eigenspace. In Conference on Uncertainty in Artificial Intelligence, pages 819-828. PMLR, 2020. +[43] Cun-Hui Zhang. Nearly unbiased variable selection under minimax concave penalty. Annals of Statistics, 38(2):894-942, 2010. +[44] Hui Zou, Trevor Hastie, and Robert Tibshirani. Sparse principal component analysis. Journal of computational and graphical statistics, 15(2):265-286, 2006. \ No newline at end of file diff --git a/anoteonsparsegeneralizedeigenvalueproblem/images.zip b/anoteonsparsegeneralizedeigenvalueproblem/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e0cb108a2d872a58ac112c6acda2eb55ebbecff6 --- /dev/null +++ b/anoteonsparsegeneralizedeigenvalueproblem/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ee5edb185821d709c0eda9f4b27256fedf8e6f02d4aeccade7e16eb1f9bbc3a4 +size 321496 diff --git a/anoteonsparsegeneralizedeigenvalueproblem/layout.json b/anoteonsparsegeneralizedeigenvalueproblem/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..fec8600bf73120e561fb6f79a5aabd9cd2066a41 --- /dev/null +++ b/anoteonsparsegeneralizedeigenvalueproblem/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:36d03762c1eb20a8bfdac3560dc247949fba140194290714891d6d06b284f0b9 +size 722349 diff --git a/anovelnotionofbarycenterforprobabilitydistributionsbasedonoptimalweakmasstransport/e41b9ba2-cfe3-4563-a237-0dacd031141e_content_list.json b/anovelnotionofbarycenterforprobabilitydistributionsbasedonoptimalweakmasstransport/e41b9ba2-cfe3-4563-a237-0dacd031141e_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..85f9b71a2e28652206b8a2a7fa7cef432195580f --- /dev/null +++ b/anovelnotionofbarycenterforprobabilitydistributionsbasedonoptimalweakmasstransport/e41b9ba2-cfe3-4563-a237-0dacd031141e_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:769461d47b930da8ff37eff62669953314f57715f8d264554fba15a84dda5642 +size 83978 diff --git a/anovelnotionofbarycenterforprobabilitydistributionsbasedonoptimalweakmasstransport/e41b9ba2-cfe3-4563-a237-0dacd031141e_model.json b/anovelnotionofbarycenterforprobabilitydistributionsbasedonoptimalweakmasstransport/e41b9ba2-cfe3-4563-a237-0dacd031141e_model.json new file mode 100644 index 0000000000000000000000000000000000000000..9cb2d723485fa402a581a42f401ff4f0cb95b930 --- /dev/null +++ b/anovelnotionofbarycenterforprobabilitydistributionsbasedonoptimalweakmasstransport/e41b9ba2-cfe3-4563-a237-0dacd031141e_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:315417a447031acd1ff65697d464a00908863e4250cb184bcc0700252b216f73 +size 100426 diff --git a/anovelnotionofbarycenterforprobabilitydistributionsbasedonoptimalweakmasstransport/e41b9ba2-cfe3-4563-a237-0dacd031141e_origin.pdf b/anovelnotionofbarycenterforprobabilitydistributionsbasedonoptimalweakmasstransport/e41b9ba2-cfe3-4563-a237-0dacd031141e_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0d1e49b2d75d1b57476c3c8abb81ebd7a662f285 --- /dev/null +++ b/anovelnotionofbarycenterforprobabilitydistributionsbasedonoptimalweakmasstransport/e41b9ba2-cfe3-4563-a237-0dacd031141e_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58adc41de6d54ffb4da0ea84a4dac45762349dc375d72320b56c900ce2003f1e +size 954831 diff --git a/anovelnotionofbarycenterforprobabilitydistributionsbasedonoptimalweakmasstransport/full.md b/anovelnotionofbarycenterforprobabilitydistributionsbasedonoptimalweakmasstransport/full.md new file mode 100644 index 0000000000000000000000000000000000000000..6ec088f6d3dc4d09b8a18479d5ada9fbc9fd2509 --- /dev/null +++ b/anovelnotionofbarycenterforprobabilitydistributionsbasedonoptimalweakmasstransport/full.md @@ -0,0 +1,397 @@ +# A novel notion of barycenter for probability distributions based on optimal weak mass transport + +Elsa Cazelles +IRIT, Université de Toulouse, CNRS +elsa.cazelles@irit.fr + +Felipe Tobar +IDIA & CMM, Universidad de Chile +ftobar@dim.uchile.cl + +# quin Fontbona + +CMM, Universidad de Chile + +fontbona@dim.uchile.cl + +# Abstract + +We introduce weak barycenters of a family of probability distributions, based on the recently developed notion of optimal weak transport of mass [26], [9]. We provide a theoretical analysis of this object and discuss its interpretation in the light of convex ordering between probability measures. In particular, we show that, rather than averaging the input distributions in a geometric way (as the Wasserstein barycenter based on classic optimal transport does) weak barycenters extract common geometric information shared by all the input distributions, encoded as a latent random variable that underlies all of them. We also provide an iterative algorithm to compute a weak barycenter for a finite family of input distributions, and a stochastic algorithm that computes them for arbitrary populations of laws. The latter approach is particularly well suited for the streaming setting, i.e., when distributions are observed sequentially. The notion of weak barycenter and our approaches to compute it are illustrated on synthetic examples, validated on 2D real-world data and compared to standard Wasserstein barycenters. + +# 1 Introduction + +Optimal transport (OT) [41] has had a tremendous impact in the machine learning (ML) community recently, as it provides meaningful and implementable distances between probability distributions [34], thus advancing many aspects in the field, see e.g. [7, 43, 33]. The space of probability measures on $\mathbb{R}^d$ with finite second moment can be metrised with the Wasserstein-2 distance, the computation of which amounts to finding a transport plan that minimises the quadratic average cost of transporting mass from a source probability measure onto a target one. In this context, a natural method for averaging a finite family of probability measures is to compute their Fréchet mean, with respect to the Wasserstein-2 distance, which corresponds to the Wasserstein barycenter introduced in [1]. + +The goal of the present work is to explore theoretical features and potential applications to ML of barycenters of probability measures analogously defined in terms of optimal weak transport (OWT, see [26]) or more precisely quadratic barycentric transport costs. In a nutshell, for a source measure $\mu$ and a target measure $\nu$ , the OWT problem aims to transport mass so that the conditional spatial mean of target support points $y$ , given their source support points $x$ , is close to $x$ in average. This amounts to finding an intermediate measure $\eta$ , possibly more concentrated than $\nu$ in the sense of convex ordering of probability measures, which is close to $\mu$ with respect to the Wasserstein-2 distance. + +The main motivation of our work is to investigate the effect and meaning of combining a family of probability measures using OWT instead of OT. To that end, we will define the weak barycenter of + +this family through an optimisation problem, and discuss some of its properties. Importantly, we will see that, rather than averaging the input distributions in a metric sense, solving a weak barycenter problem corresponds to finding probability measures that encode geometric or shape information shared across all of them. In fact, the weak barycenter problem will be interpreted as finding a latent random variable common to all the input distributions. Implications of this latent variable interpretation, in terms of robustness to outliers, will also be drawn in our work. + +A second motivation for our work is to develop and implement computational methods for weak barycenters, capitalising on the fact that the optimal weak coupling between any pair of distributions, with finite second moments, is always realised by a unique optimal map. This property is in sharp contrast to standard OT, where the absolute continuity with respect to the Lebesgue measure of the source or target measure is typically needed to grant the existence and uniqueness of a map—the so-called Monge map—realising the optimal coupling between them. This map is often required in different ways to compute Wasserstein barycenters (see [5], [44] or [35]). + +Similarly to the Wasserstein barycenter problem, we will develop a fixed-point formulation of the weak barycenter problem, based on OWT plans. This allows us to, following [5, 44], construct an iterative procedure to compute a weak barycenter for a finite family of distributions and analyse its convergence properties. We will also define and study the so-called weak population barycenters, that deal with a population of probability measures distributed according to a given law $\mathbb{Q}$ supported on the Wasserstein-2 space, as in [30] for the OT case. Extending ideas from [10], we will then propose an iterative stochastic algorithm for online computation of the weak population barycenter, from a stream of probability measures sampled from $\mathbb{Q}$ . We will then provide numerical simulations using this proposed method, in order to illustrate the geometric meaning of the weak barycenter, and we will compare it with related objects obtained with standard OT or its entropy-regularised counterpart. + +Organisation of the paper. Sec. 2 documents the background on OWT and the assumptions underlying our work. Sec. 3 analyses the weak barycenter problem, interprets it in the light of convex ordering and a latent variable model and addresses the case of an infinite population of distributions. Sec. 4 introduces two algorithms for computing the weak barycenter in the finite or population settings. Sec. 5 and 6 present the experimental setting and validation of our proposal respectively. Lastly, Sec. 7 discusses our findings and future research questions. The Appendix contains all the proofs, additional details or our simulations and the code of our experiments. + +# 2 Background: optimal weak transport and Wasserstein barycenter + +The optimal transport (OT) problem [42] aims to find the lowest cost to transfer the mass from one probability measure onto another. Therefore, OT is a natural way to compare two probability distributions in terms of their geometric information. In particular, the Wasserstein- $p$ distance $W_{p}$ , associated with the Euclidean cost in $\mathbb{R}^d$ , metrises the space $\mathcal{P}_p(\mathbb{R}^d)$ of probability measures on $\mathbb{R}^d$ with finite $p$ -moment. Precisely, for $\mu, \nu \in \mathcal{P}_p(\mathbb{R}^d)$ , + +$$ +W _ {p} (\mu , \nu) = \left(\min _ {\pi \in \Pi (\mu , \nu)} \int_ {\mathbb {R} ^ {d} \times \mathbb {R} ^ {d}} \| x - y \| ^ {p} \mathrm {d} \pi (x, y)\right) ^ {1 / p}, \tag {1} +$$ + +where $\pi$ is a transport plan between $\mu$ and $\nu$ , that is, an element of the set $\Pi(\mu, \nu)$ of probability measures on the product space $\mathbb{R}^d \times \mathbb{R}^d$ with marginals $\mu$ and $\nu$ . For $p = 2$ and $\mu$ absolutely continuous (a.c.), the unique optimal plan is concentrated on the graph of a measurable map called Monge map such that $\nu = T\# \mu$ , see eq. (14) in Appendix A.1. + +Optimal weak transport. We consider here the optimal weak transport (OWT) problem introduced in [26] and in particular the special case of barycentric transport costs. The OWT problem is then defined for $\mu, \nu \in \mathcal{P}_2(\mathbb{R}^d)$ by + +$$ +V (\mu | \nu) = \inf _ {\pi \in \Pi (\mu , \nu)} \int_ {\mathbb {R} ^ {d}} \| x - \int_ {\mathbb {R} ^ {d}} y \mathrm {d} \pi_ {x} (y) \| ^ {2} \mathrm {d} \mu (x), \tag {2} +$$ + +where $\pi_x$ is the disintegration of the transport plan $\pi$ with respect to the first marginal $\mu$ , i.e. $\pi (\mathrm{d}x\mathrm{d}y) = \pi_x(\mathrm{d}y)\mu (\mathrm{d}x)$ . As our work strongly leans on OWT theory, we recall in Appendix A.2, Th. 6, that $V$ is continuous with respect to the Wasserstein metric [9]. Additionally, the two following results from [8] (stated for our specific setting) lay the ground for our proposed weak barycenters. + +# Theorem 1 ([8], Theorem 1.2). The problem (2) admits a unique minimiser. + +This first result strongly differs from the classical OT setting, for which the uniqueness of an optimal transport plan is not guaranteed for arbitrary measures. The optimisation problem in Eq. (2) can also be reformulated thanks to the Brenier-Strassen theorem [25], [8], through the notion of convex ordering. We denote by $\eta \leq_{c}\nu$ the convex order of measures, meaning that $\int \phi \mathrm{d}\eta \leq \int \phi \mathrm{d}\nu$ for any convex function $\phi$ that is nonnegative or integrable with respect to $\eta +\nu$ . By Strassen's theorem [40], two distributions are in convex order if and only if there exists a martingale coupling between them. The following theorem is a generalisation of the result originally proved in [25], Th. 1.2. + +Theorem 2 ([8], Theorem 1.4). Let $\mu \in \mathcal{P}_2(\mathbb{R}^d)$ and $\nu \in \mathcal{P}_1(\mathbb{R}^d)$ . There exists a unique $\eta^* \leq_c \nu$ such that + +$$ +W _ {2} ^ {2} (\mu , \eta^ {*}) = \inf _ {\eta \leq c \nu} W _ {2} ^ {2} (\mu , \eta) = V (\mu | \nu). \tag {3} +$$ + +Moreover, there exists a convex function $\psi : \mathbb{R}^d \to \mathbb{R}$ of class $C^1$ with $\nabla \psi$ being 1-Lipschitz, such that $\nabla \psi \# \mu = \eta^*$ . Finally, the optimal coupling $\pi^{\mu, \nu} \in \Pi(\mu, \nu)$ verifies $\int y d\pi_x^{\mu, \nu}(y) = \nabla \psi(x) \mu$ -a.s. + +The measurable map, or barycentric projection, $S_{\mu}^{\nu}(x) \coloneqq \int_{\mathbb{R}^{d}} y \mathrm{d}\pi_{x}^{\mu,\nu}(y)$ associated to the plan $\pi^{\mu,\nu}$ achieving the minimum in Eq. (2) is consequently uniquely defined and will be called optimal barycentric projection. From this notation, we can write the OWT cost in terms of an OT cost according to $V(\mu|\nu) = W_{2}^{2}(\mu, S_{\mu}^{\nu}\# \mu)$ . We emphasise that $S_{\mu}^{\nu}$ is directly related to the optimisation problem (2), whereas applied works such as [38, 36] make use of a barycentric projection constructed from a transport plan solving an OT problem between $\mu$ and $\nu$ (often regularised) as a substitute for the Monge map, which may not exist (more details on $S_{\mu}^{\nu}$ are displayed in Appendix A.3). + +Last, let us note that OWT is somehow also related to the martingale OT problem developed in the stochastic finance community [13, 2, 27], which puts the focus on the optimal transfer of mass between distributions assumed to be in convex order themselves. + +Wasserstein barycenter. The classical Wasserstein barycenter problem for a set of probability measures $\nu_{1},\ldots ,\nu_{n}\in \mathcal{P}_{2}(\mathbb{R}^{d})$ with weights $\lambda_1,\dots ,\lambda_n$ in the simplex (i.e. $\lambda_{i}\geq 0$ and $\sum_{i = 1}^{n}\lambda_{i} = 1)$ is defined [1] by + +$$ +\underset {\mu \in \mathcal {P} _ {2} (\mathbb {R} ^ {d})} {\arg \min } \sum_ {i = 1} ^ {n} \lambda_ {i} W _ {2} ^ {2} (\mu , \nu_ {i}). \tag {4} +$$ + +The Wasserstein barycenter has been extensively studied both theoretically and numerically [30, 44, 5, 15]. Regarding the numerical part, [39] focuses on the computation of Wasserstein barycenters for a fixed number of measures and a stream of observations per measure; additionally, [32] proposed an entropy-regularised alternative via stochastic optimisation for computing the Wasserstein barycenter of a.c. distributions only from observations. Constrained by their assumption of a.c., [44] computes the Wasserstein barycenter by smoothing the observed empirical distributions. Furthermore, [21] compares the complexity of both the sample Wasserstein barycenter and a stochastic approximation to estimate a population barycenter (discrete measures and entropic regularisation). Finally, the authors of [3] recently proposed an algorithm to compute the barycenters in polynomial time. + +# 3 Optimal weak transport barycenters and latent variable interpretation + +# 3.1 Definition and basic properties + +In a similar fashion, based on the weak transport cost in Eq. (2), we propose the following variant: + +Definition 1. The set of weak barycenters of a finite family of measures $\{\nu_i\}_{i = 1,\dots,n}\in \mathcal{P}_2(\mathbb{R}^d)$ with weights $\{\lambda_i\}_{i = 1,\dots,n}$ in the simplex is defined as + +$$ +\underset {\mu \in \mathcal {P} _ {2} (\mathbb {R} ^ {d})} {\arg \min } \sum_ {i = 1} ^ {n} \lambda_ {i} V (\mu | \nu_ {i}). \tag {5} +$$ + +Thus, a weak barycenter averages, with respect to the Wasserstein metric, an optimally chosen set of probability measures $\{\eta_1,\dots ,\eta_n\}$ which are more concentrated than the corresponding $\nu_{i}$ , in the sense that $\eta_{i}\leq_{c}\nu_{i}$ for each $1\leq i\leq n$ . The existence of a solution is established as follows: + +Proposition 1. The weak barycenter problem in Eq. (5) admits a minimiser $\mu \in \mathcal{P}_2(\mathbb{R}^d)$ . + +See Sec. B of the Appendix for the proof of the above Proposition (which relies on Prokhorov's theorem) and all the proofs for this Section. Uniqueness is in general not granted: we next show that the set of solutions is indeed an interval, with respect to the partial order of convex ordering of probability measures. + +In the following, we denote by $X$ and $Y_{i}$ random variables with respective laws $\mu$ and $\nu_{i}$ , for $1\leq i\leq n$ , and $\delta_{a}$ the Dirac measure supported on $a\in \mathbb{R}^d$ . + +Lemma 1. If $\mu$ is a weak barycenter of $\{\nu_i\}_{i = 1\dots ,n}$ and $\mu^{\prime}\leq_{c}\mu$ , then $\mu^\prime$ also is a weak barycenter. In particular, the Dirac measure supported on $\mathbb{E}_{\mu}(X)$ is always a weak barycenter. Moreover, a Dirac distribution $\delta_{\bar{\omega}}$ is a weak barycenter if and only if $\bar{\omega} = \sum_{i = 1}^{n}\lambda_{i}\mathbb{E}_{\nu_{i}}(Y_{i})$ . + +A consequence of the above lemma is that for any weak barycenter $\mu$ + +$$ +\mathbb {E} _ {\mu} (X) = \sum_ {i = 1} ^ {n} \lambda_ {i} \mathbb {E} _ {\nu_ {i}} \left(Y _ {i}\right), \tag {6} +$$ + +and the value of the weak barycenter problem is given by + +$$ +\inf _ {\mu \in \mathcal {P} _ {2} (\mathbb {R} ^ {d})} \sum_ {i = 1} ^ {n} \lambda_ {i} V (\mu | \nu_ {i}) = \sum_ {i = 1} ^ {n} \lambda_ {i} \| \mathbb {E} (Y _ {i}) \| ^ {2} - \| \sum_ {i = 1} ^ {n} \lambda_ {i} \mathbb {E} (Y _ {i}) \| ^ {2}. \tag {7} +$$ + +We can also derive the following characterisation on the set of weak barycenters: + +Proposition 2. A measure $\mu \in \mathcal{P}(\mathbb{R}^d)$ is a weak barycenter of $\{\nu_i\}_{i = 1\dots n}$ if and only if its mean satisfies (6) and $\hat{\mu}\leq_{c}\hat{\nu}_{i}$ holds for all $1\leq i\leq n$ , where $\hat{\nu}$ denotes the centered version of a law $\nu$ + +For instance, in the case of one dimensional Gaussian distributions $\nu_{i} = \mathcal{N}(m,\sigma_{i}^{2})$ , the set of weak barycenters includes $\{\mu = \mathcal{N}(m,\sigma^2)\mid 0\leq \sigma^2\leq \min_{1\leq i\leq n}\sigma_i^2\}$ . + +A natural question is whether a "maximal" weak barycenter exists, in the sense of convex ordering (up to translation by the mean). For $d = 1$ , the answer is affirmative. When the means $\mathbb{E}(Y_i)$ are equal, this follows from the complete lattice property of the set of probability measures with respect to the convex ordering (see [29]); the general case can then be reduced to the latter using Proposition 2. For $d \geq 2$ , this property is in general not true and the answer depends on the family $\{\nu_i\}_{i=1,\dots,n}$ . + +In the particular case of a.c. input measures, we can bound the distance between the Wasserstein and weak barycenters by the variances of the distributions $(\nu_{i})_{1\leq i\leq n}$ . The barycenters are then closer the more concentrated each $\nu_{i}$ is. + +Lemma 2. Let $\nu_{1},\ldots ,\nu_{n}\in \mathcal{P}_{2}(\mathbb{R}^{d})$ be a.c., at least one of them with bounded density. Let $\bar{\mu}$ and $\tilde{\mu}$ respectively denote the weak and the Wasserstein barycenters. Then + +$$ +W _ {2} ^ {2} (\bar {\mu}, \tilde {\mu}) \leq 2 \sum_ {i = 1} ^ {n} \lambda_ {i} \left(\mathbb {E} \| Y _ {i} \| ^ {2} - \| \mathbb {E} Y _ {i} \| ^ {2}\right). +$$ + +# 3.2 Weak barycenters as latent variables + +The weak barycenter encodes common geometric information present in all the input measures considered, therefore, it can be intuitively and rigorously interpreted as being the distribution of a latent variable underlying the realisations of random variables of laws $\nu_{i}$ for all $1\leq i\leq n$ + +Theorem 3. Let $\mu$ be a weak barycenter of $\{\nu_i\}_{i = 1\dots ,n}$ . Then, for each $1\leq i\leq n$ , a random variable $Y_{i}\sim \nu_{i}$ can be realised as + +$$ +Y _ {i} = X + \left(\mathbb {E} Y _ {i} - \mathbb {E} X\right) + \bar {Y} _ {i}, +$$ + +where $X \sim \mu$ and $\bar{Y}_i = Y_i - \mathbb{E}(Y_i|X)$ is centered conditionally on $X$ . Moreover, one has $S_{\mu}^{\nu}(X) = X + (\mathbb{E}Y_i - \mathbb{E}X)$ for all $i = 1, \ldots, n$ . Finally, we have $\mathbb{E}(Y_i - \mathbb{E}Y_i|X - \mathbb{E}X) = X - \mathbb{E}X$ or equivalently, $\hat{\mu} \leq_c \hat{\nu}_i$ , with $\hat{\mu}$ and $\hat{\nu}_i$ the laws of $X - \mathbb{E}X$ and $Y_i - \mathbb{E}Y_i$ respectively. + +That is to say, each $Y_{i} \sim \nu_{i}$ can be realised by sampling a random variable $X$ common to all $i = 1, \dots, n$ and distributed according to the weak barycenter $\mu$ , translating that value by $\mathbb{E}Y_{i} - \mathbb{E}X$ and adding a cluster-specific component $\bar{Y}_{i}$ or idiosyncratic noise, centered conditionally on $X$ . + +Remark 1. The observations of each class (i.e. input measure) can be interpreted as outliers with respect to the (translated) law of the weak barycenter, which are statistically different and are thus left aside of its support. This way, the weak barycenter is robust to outliers, as it tends to discard them, by construction. Furthermore, this "robustness" property results in the stability of weak barycenter upon perturbation of a class with larger noise (or more scattered, outlying values). More precisely, if a class is corrupted in such a way that their observations result in a stochastically larger distribution than the original one, a weak barycenter computed in terms of the original (stochastically smaller) class will still be a weak barycenter in the new corrupted setting. An intuitive and simple way to illustrate this point follows by considering a weak barycenter $\mu$ of a one-dimensional and centered family of input distributions $\{\nu_i\}_{i = 1,\dots ,n}$ . By Proposition 2, $\mu$ must verify $\mu \leq_{c}\nu_{i}$ for all $i = 1,\ldots ,n$ . In particular, from Theorem 3.A.1. in [37], we have that $\int_x^\infty \mathbb{P}(X > u)du\leq \int_x^\infty \mathbb{P}(Y_i > u)du$ for all $x\in \mathbb{R}$ , where $X\sim \mu$ and $Y_{i}\sim \nu_{i}$ . Therefore, $\mu$ is likely to avoid outliers. Another supportive intuition in terms of robustness is that a maximal weak barycenter would be one that includes the most possible points of all classes (or distributions) in its support (all this, after re-centering) and leaves out only "outliers". A non-maximal weak barycenter is then more conservative, meaning that it counts on fewer points and leaves out more possible outliers. + +# 3.3 Extension for the population barycenter + +The population Wasserstein barycenter introduced in [30] and [4] extends the definition of Wasserstein barycenter for an infinite number of measures. This formulation is particularly relevant for the construction of an iterative algorithm to compute the barycenter for the streaming case, that is, when the measures are received online. The proofs are reported in Section C of the Appendix. + +Let us consider a probability measure $\mathbb{Q} \in \mathcal{P}_2(\mathcal{P}_2(\mathbb{R}^d))$ , meaning that $\mathbb{Q}$ is supported on a set of measures with finite moments of order 2, such that for some (and thus all) $\mu \in \mathcal{P}_2(\mathbb{R}^d)$ , we have that $\int_{\mathcal{P}_2(\mathbb{R}^d)} W_2^2(\mu, \nu) \mathrm{d}\mathbb{Q}(\nu) < \infty$ . + +Definition 2. We define the set of weak population barycenters of a distribution $\mathbb{Q}\in \mathcal{P}_2(\mathcal{P}_2(\mathbb{R}^d))$ as + +$$ +\underset {\mu \in \mathcal {P} _ {2} (\mathbb {R} ^ {d})} {\arg \min } \int_ {\mathcal {P} _ {2} (\mathbb {R} ^ {d})} V (\mu | \nu) d \mathbb {Q} (\nu). \tag {8} +$$ + +The following lemma guarantees that the map $(x,\nu)\mapsto S_{\mu}^{\nu}(x)$ appearing in Eq. (8) through $V(\mu |\nu) = \int \| x - S_{\mu}^{\nu}(x)\|^{2}\mathrm{d}\mu (x)$ is well defined. + +Lemma 3. The function $(\mu, \nu) \in (\mathcal{P}_2(\mathbb{R}^d))^2 \mapsto \pi^{\mu, \nu} \in \mathcal{P}_2(\mathbb{R}^{2d})$ mapping $(\mu, \nu)$ to the unique optimal plan $\pi^{\mu, \nu}$ realising $V(\mu|\nu)$ in Eq. (2) is continuous. As a consequence, for each $\mu \in \mathcal{P}_2(\mathbb{R}^d)$ the function $(x, \nu) \in \mathbb{R}^d \times \mathcal{P}_2(\mathbb{R}^d) \mapsto S_\mu^\nu(x)$ is measurable. + +Using similar arguments as those of Proposition 1 and the fact that any probability measure can be approximated by a sequence of probability measures with finite support, the following proposition confirms that the weak population barycenter problem is also well defined. + +Proposition 3. The minimisation problem in Eq. (8) admits a solution. + +# 4 Algorithms via fixed-point representations + +# 4.1 Weak barycenter + +For the Wasserstein barycenter problem in Eq. (4), the authors in [1] proved that if at least one of the measures $\nu_{1},\ldots ,\nu_{n}$ is a.c., the Wasserstein barycenter is unique. Furthermore, if all the $\nu_{i}$ 's are a.c., and at least one of them has a bounded density, then the unique Wasserstein barycenter is also a.c. and verifies a fixed-point equation. This last property has been thoroughly studied by [5] and [44] and leveraged to compute an approximation of the barycenter via an iterative algorithm based on Monge maps, whose existence and uniqueness are guaranteed by the a.c. of the measures involved. + +Akin to the fixed-point methodology in the classical Wasserstein scenario, we define an iterative procedure based on the barycentric projection computed in the optimal weak transport problem in Eq. (2), that is valid for arbitrary distributions. Therefore, we consider the following iterative rule for + +probability measures $\nu_{1},\ldots ,\nu_{n}\in \mathcal{P}_{2}(\mathbb{R}^{d})$ .. + +$$ +\mu_ {k + 1} = G \left(\mu_ {k}\right), \text {w i t h} G (\mu) = \left(\sum_ {i = 1} ^ {n} \lambda_ {i} S _ {\mu} ^ {\nu_ {i}}\right) \# \mu , \tag {9} +$$ + +where for each $i = 1,\dots ,n$ the optimal barycentric projection is given by $S_{\mu}^{\nu_i}:x\mapsto \int y\mathrm{d}\pi_x^{\mu ,\nu_i}(y)$ for $\pi^{\mu ,\nu_i}\in \Pi (\mu ,\nu_i)$ achieving the minimum in the OWT problem in Eq. (2). The proposed iterative procedure is presented in Algorithm 1. + +A fundamental difference between the fixed-point computation of the Wasserstein barycenter [5] and a weak barycenter is that the optimal Monge map $T_{\mu}^{\nu}$ in the OT problem verifies $T_{\mu}^{\nu} \# \mu = \nu$ , whereas the pushforward measure $S_{\mu}^{\nu} \# \mu$ in the OWT setting still depends on $\mu$ . We will then prove that the iterative algorithm in Eq. (9), based on the maps $S_{\mu}^{\nu_i}$ , admits converging subsequences. A convenient result is the continuity of the functional $G$ in Eq. (9), which can be proven using Arzela-Ascoli theorem on a set of barycentric projections as well as the Skorohod's representation theorem. + +Theorem 4. The function $\mu \mapsto G(\mu)$ defined in Eq. (9) is $W_{2}$ -continuous from $\mathcal{P}_2(\mathbb{R}^d)$ to $\mathcal{P}_2(\mathbb{R}^d)$ . + +Using an approach similar to [5] for the Wasserstein barycenter, we can state the following results for the proposed fixed-point procedure. + +Proposition 4. If $\mu$ is a weak-barycenter, that is a solution of problem (5), then $G(\mu) = \mu$ i.e. $x = \sum_{i=1}^{n} \lambda_i S_\mu^{\nu_i}(x), \mu(x)$ -a.s. + +The inverse implication of Proposition 4 is not necessarily true, that is, some fixed points may not be weak barycenters. However, a Dirac delta $\delta_{\omega}, \omega \in \mathbb{R}^d$ , that meets the fixed-point condition $\delta_{\omega} = G(\delta_{\omega})$ , is a weak barycenter (see Lemma 1). + +Proposition 5. Let $(\mu_k)_k$ be the sequence defined by the iterative procedure $\mu_{k + 1} = G(\mu_k)$ and starting from $\mu_0\in \mathcal{P}_2(\mathbb{R}^d)$ . Then $(\mu_k)_k$ is tight and every converging subsequence must converge to a fixed point of $G$ . + +We observe that these results also hold for the classical Wasserstein barycenter of a.c. measures $\{\nu_i\}_{i = 1\dots ,n}$ such that at least one of them has a bounded density. Moreover, the inverse implication, namely if $\mu$ is a fixed-point then it is a barycenter, is not straightforward even in the Wasserstein barycenter case, for which one considers the fixed-point equation given by $\mu = (\sum_{i = 1}^{n}\lambda_{i}T_{\mu}^{\nu_{i}})\# \mu$ , with $T_{\mu}^{\nu_{i}}$ the Monge map verifying $\nu_{i} = T_{\mu}^{\nu_{i}}\# \mu$ . Indeed, [1] prove that if $\mu$ checks $x = \sum_{i = 1}^{n}\lambda_{i}T_{\mu}^{\nu_{i}}(x)$ for every $x\in \mathbb{R}^d$ , not only $\mu$ -almost everywhere, then $\mu$ is a Wasserstein barycenter. Also, [44, Theorem 2] provide additional conditions for this to be true by essentially invoking more smoothness on the distributions $\{\nu_i\}_{i = 1\dots ,n}$ . Additionally, they only conjecture that under the same assumptions, the fixed-point is unique. Our method, however, includes arbitrary probability measures. Therefore, we do not expect to obtain similar results as in the Wasserstein barycenter case, for which smoothness is required. + +# 4.2 Weak population barycenter + +Based on [10], we construct a stochastic iterative algorithm for computing the weak population barycenter in Eq. (8). We clarify that [10] is constrained to probability measures $\mathbb{Q}$ supported on distributions that are a.c., whereas in our setting these distributions only need to belong to $\mathcal{P}_2(\mathbb{R}^d)$ . Let us notice that our algorithms can be interpreted as geodesic gradient descent as in [10] and [17], however, OWT is not a metric and its potential geodesic structure is so far unknown. Therefore, the proposed algorithm only aims to mimic Riemannian gradient descent. Our fixed-point result for the weak population barycenter problem is stated in the following Lemma: + +Lemma 4. If $\mu$ is a weak population barycenter of $\mathbb{Q}$ , then $x = \int S_{\mu}^{\nu}(x)d\mathbb{Q}(\nu), \mu(x)$ -a.s. + +As in the finite case, the inverse implication is difficult to obtain. In particular, this has not been proven for the classical population Wasserstein barycenter in [10], where it boils down to prove the uniqueness of an absolutely continuous fixed point of $\mu \mapsto (\int T_{\mu}^{\nu}\mathrm{d}\mathbb{Q}(\nu))\# \mu$ , where $T_{\mu}^{\nu}$ is the Monge map between $\mu$ and $\nu$ . As explained in [10], the uniqueness of such fixed points has also been studied under some strong assumptions in [15] by considering parametric classes of random probability measures with compact support. This result is expected to be true by again invoking more smoothness on the distributions at hand. As our method focuses (in particular) on discrete probability measures, + +the conditions under which the inverse implication holds are beyond the scope of our work. However, from the experimental results in Section 6, we believe our method presents practical advantages. + +We next present an iterative scheme converging towards a distribution $\mu$ verifying the fixed-point equation in Lemma 4. This scheme is illustrated below in Algorithm 2. To prove its convergence, we will need a technical assumption on $\mathbb{Q}$ : + +(A) There exists $\epsilon > 0$ and $R > 0$ such that $\mathbb{Q}$ gives full measure to the set + +$$ +K _ {\mathbb {Q}} := \{\mu \in \mathcal {P} _ {2} (\mathbb {R} ^ {d}): \int | x | ^ {2 + \epsilon} \mathrm {d} \mu (x) \leq R \}. +$$ + +Definition 3. Let $\mu_0\in K_{\mathbb{Q}},\nu^{k}\stackrel {i.i.d.}{\sim}\mathbb{Q}$ and $\gamma_k > 0$ . We define the following iterative procedure: + +$$ +\mu_ {k + 1} = \left[ \left(1 - \gamma_ {k}\right) \mathrm {i d} + \gamma_ {k} S _ {\mu_ {k}} ^ {\nu^ {k}} \right] \# \mu_ {k}, k \geq 0, \tag {10} +$$ + +where $S_{\mu_k}^{\nu^k}$ is the optimal barycentric projection between $\mu_k$ and $\nu^k$ and id is the identity operator. + +The following standard conditions on the steps $\gamma_{k}$ will also be assumed: + +$$ +\sum_ {k = 1} ^ {\infty} \gamma_ {k} ^ {2} < \infty \quad \text {a n d} \quad \sum_ {k = 1} ^ {\infty} \gamma_ {k} = \infty , \tag {11} +$$ + +Theorem 5. Assume Conditions in Eq. (11), (A) and moreover that every measure verifying the fixed-point equation $x = \int S_{\mu}^{\nu}(x)d\mathbb{Q}(\nu)$ , $\mu(x)$ -a.s. is a weak barycenter. Then the sequence $(\mu_k)_k$ in Eq. (10) is a.s. relatively compact w.r.t. $W_2$ and every limit point is a weak barycenter. + +The proof, provided in the supplementary material, is inspired by the standard Wasserstein barycenter case studied in [10], [35]. Assumption (A) grants that the sequence in Eq. (10) remains in some compact set, and can be replaced by more general conditions (see Remark 2 in Appendix). + +Algorithm 1: Weak barycenter +Input: distributions $\nu_{1},\dots ,\nu_{n}$ #steps $K$ +initialisation: $\mu_0 = \nu_1$ +for $k = 0,1,\ldots ,K$ do for $i = 1,2,\ldots ,n$ do Solve the OWT problem between $\mu_{k}$ and $\nu_{i}$ to obtain $\pi^{\mu_k,\nu_i}$ $S_{i} = \int y\mathrm{d}\pi_{x}^{\mu_{k},\nu_{i}}(y)$ end $\mu_{k + 1} = (\sum_{i = 1}^{n}\lambda_{i}S_{i})\# \mu_{k}$ +end + +Algorithm 2: Weak population barycenter +Input: number of steps $K$ +initialise distribution $\mu_0\sim \mathbb{Q}$ +for $k = 0,1,\ldots ,K$ do + Sample $\nu^k\sim \mathbb{Q}$ + Update $\gamma_{k}$ + Solve the OWT problem to obtain $\pi^{\mu_k,\nu^k}S_k = \int y\mathrm{d}\pi_x^{\mu_k,\nu^k}(y);$ $\mu_{k + 1} = [(1 - \gamma_k)\mathrm{id} + \gamma_kS_k]\# \mu_k;$ +end + +# 5 Computational aspects + +Setting and computation of OWTs. Both Algorithms 1 and 2 require the computation of the optimal barycentric projection associated to the OWT problem in Eq. (2). For two discrete measures $\mu = \sum_{i=1}^{r} a_i \delta_{x_i}$ and $\nu = \sum_{j=1}^{m} b_j \delta_{y_j}$ , this boils down to solving the following quadratic programming problem + +$$ +\min _ {\pi \in \mathbb {R} ^ {r \times m}} \left\{\sum_ {i = 1} ^ {r} a _ {i} \left\| x _ {i} - \left(\frac {\pi \mathbf {y}}{\mathbf {a}}\right) _ {i} \right\| ^ {2}, \pi_ {i j} \geq 0, \pi \mathbb {1} = a, \pi^ {T} \mathbb {1} = b \right\}, \tag {12} +$$ + +which can be solved using a solver such as cvxpy. We also propose to solve the OWT problem in Eq. (12) with a proximal algorithm. The optimal barycentric projection is then constructed as $\frac{\pi\mathbf{y}}{\mathbf{a}}$ . The details and examples are presented in Appendix E.1. + +Comparison setting. In the next section, we compare our proposed computation for weak barycenters in Definition 2 (Algorithm 2) to the classic Wasserstein barycenter in particular for a stream of a.c. measures. Namely, we will run Algorithm 2 by, following [19, 36], replacing optimal barycentric + +![](images/c4b00271bac1cdaf6d58623d5ba6cc5f85a1cac44e89b7b6cbaa5e48129a262d.jpg) +Figure 1: (left) Empirical Gaussian distributions and their OWT (black) and OT (red) barycenters for Gaussian observations (crosses) and corrupted observations (dots). (right) Empirical distributions supported on two ellipses and their OWT (black) and OT (red) barycenters. + +![](images/c4f8aa66ef52b42879e0edcfd7f13c9ccace0e0004fb9e101ff512b6c2502739.jpg) + +![](images/1c9505c4ba15a2522d78a13d8d2a94ad42d3d852d95ff38d006a6d29853c90e9.jpg) + +![](images/b8acd6a743a7a55c75674e706b15ad920eb7d2089b33859b89de8ae35d223286.jpg) + +projections by the barycentric projections associated either to i) an optimal plan in the Kantorovich problem (1), or ii) the optimal Sinkhorn plan in the entropy regularised OT problem [18] given by + +$$ +\underset {\pi \in \Pi (\mu , \nu)} {\arg \min } \int \| x - y \| ^ {2} \mathrm {d} \pi (x, y) + \varepsilon K L (\pi | \mu \otimes \nu), \tag {13} +$$ + +where KL denotes the Kullback-Leibler divergence. The associated barycenters will be referred to as OT barycenter and OT Sinkhorn barycenter respectively. The optimal plans for OT and regularised OT problem were computed using POT toolbox [23]. Notice that what we call OT barycenter (resp. OT Sinkhorn barycenter) is not solving a Wasserstein barycenter problem (resp. a regularised Wasserstein barycenter problem). Therefore, our method for barycentric computation differs from previous ones in the literature (see Section 2) in that it i) can process a stream of an unknown number of measures, ii) does not require the measures to be a.c., and iii) does not appeal to additional regularisation of the measures or the Wasserstein metric. + +# 6 Experimental results + +This section is devoted to the empirical validation of our proposal on both synthetic and real-world data. We first focused on Algorithm 2 since multiple algorithms to compute a Wasserstein barycenter for a fixed number of distributions are already available [19, 39]. We present two robustness to outliers experiments, then we validate our OWT barycenter on synthetic dataset and real-world ones. The overall conclusion of our experiments is that the weak barycenter is more likely to maintain the common (or shared) geometric features of the measures involved, as expected from Theorem 3. Additional experiments are presented in Appendix E.2, including the comparison of the energy for the computed weak barycenter in Algorithm 1 against the approximated optimal energy (using Eq.(7) and the plug-in estimator). + +# 6.1 Robustness to outliers + +OT's sensitivity to outliers is a well-known problem that can be addressed e.g. with unbalanced OT [11]. We observed that OWT also allows to deal with outliers, which is coherent with the latent variable interpretation (see Remark 1). We illustrate this with two experiments. In Fig. 1 (left), we consider 50 sets of $20 - 30$ observations from different 2D Gaussian measures, where each observation may be corrupted by random translations (Bernoulli $p = 0.05$ ) thus producing outliers. We show the resulting barycenters (dots), and barycenters without outliers (crosses) for Wasserstein barycenter (red) and weak barycenter (black), which shows robustness to outliers. In Fig. 1 (right), we consider two distributions supported on pair-of-ellipses, and 120 observations per distribution. Again, each observation may be corrupted by random translations (Bernoulli $p = 0.05$ ). The weak barycenter (black) shows a better preservation of the shapes than the Wasserstein barycenter (red), in particular, the red dots are more often located outside the ellipses. + +# 6.2 Synthetic distributions + +We implemented the proposed sequential computation of weak barycenters (Algorithm 2) on two examples of synthetic distributions: Gaussians and spirals. In each case, we sampled $r$ observations from a random distribution at each step, and considered $K$ steps (and thus $K$ measures for each case). + +2D Gaussians $(r = 100\& K = 15)$ . We considered distributions $\mathcal{N}(m,I)$ , with $m$ uniformly distributed on $(-3,3)\times (-5, - 5)$ and $I$ the identity matrix. Fig. 2 (left) shows the empirical distributions together with the OWT and OT barycenters, the weak barycenter being the less spread out as expected. The three remaining plots illustrate the behaviour of the barycenters constructed as stated in Sec. 5. For a small regularisation parameter $\varepsilon$ in Eq. (13), the OT and OT Sinkhorn barycenters are similar, however, as $\varepsilon$ increases the OT Sinkhorn (OTS) barycenter becomes closer to the weak barycenter and thus even more concentrated, meaning that its samples tend to be closer to each other. Critically, for a very large $\varepsilon$ , as the entropy tends to spread the mass in the regularised optimal plan, the associated barycentric projection will roughly move the mass to the spatial mean of the target distribution's support. + +![](images/70fcb62fb3a795b75fe1bc063ac55f1a3c277a117da78c77eb4887b8356ef819.jpg) +Figure 2: (left) Empirical Gaussian distributions and their OWT (black) and OT (red) barycenters computed with Algorithm 2. Illustration of the weak (black), OT (red) and OT Sinkhorn (blue) barycenters for different values of $\varepsilon = 0.1, 1, 5$ . + +![](images/e103f95a7afb93b5a677515617f96a387f4216d4ff3f7f2434f03aa3180d4609.jpg) + +![](images/c712455a7f459c3a160daae183bb038237fa582a3a248d5bd16b672520f5417d.jpg) + +![](images/1fcebd965e1163020e3ff79855cdcde35233f873c1f691213c92e6b6fd2b8d83.jpg) + +Spiral distributions. $(r\in (200,225)$ & $K = 10$ ). In this experiment, we considered distributions supported on a spiral see Fig.3 (left), with random ratio in (0,3). The OT and OWT barycenters are presented in Fig. 3 (right). Again, the weak barycenter seems to better preserve the shape of the spiral than the OT barycenter. + +![](images/6c45e387f4975a52b1e68a9a9f1572dc09a700f1d82651975c80abe709541421.jpg) +Figure 3: (left) Distributions supported on spiral. (right) OWT (black) and OT (red) barycenters computed with Algorithm 2. + +![](images/f52ba1a5812a8e3380e83ffca65400e17223c0075affbd55d02934f44a44af77.jpg) + +# 6.3 Real-world dataset + +MNIST dataset. We considered the well-known MNIST dataset [31] of grayscale images of handwritten digits. The images, of size $28 \times 28$ pixels, can be normalised and thus be interpreted as discrete probability measures supported on a two-dimensional grid of size $28 \times 28$ . We computed the barycenters with 30 steps of Algorithm 1 between two digits "8", that are noisy versions of the same digit with the aim to produce a more stable barycenter. To produce noisy data, we randomly (Bernoulli $p = 0.1$ ) move pixels of the prototype digit displayed in Fig. 4 (left). Fig. 4 (right) shows the barycenters using the OWT, OT, and entropic-OT (for $\varepsilon = 1$ ). This example illustrates how OWT reduces dispersion, so that weak barycenter provides the best uniformly spread results among the barycenters considered, with the two loops of the "8" well shaped. + +Cytometry dataset. In biotechnology, flow cytometry is measured through intracellular markers of single cells in a biological sample with the objective of recognising common features across patients. However, these measurements are often disrupted by acquisition, rather than biological artefacts [28], thus hindering the identification of common features. To address this challenge, we compute the weak barycenter for the forward-scattered light (FSC) and side-scattered light (SSC) cell's markers (using the flowStats package of Bioconductor [24]). We considered $K = 15$ patients and a variable number of cells per patient between 88 and 2185. Fig. 5 shows the 15 distributions (left) and the computed barycenters (right), thus confirming the ability of the weak barycenter to resolve the alignment of the dataset, while maintaining the expected diamond-shape. Moreover, the advantage of our proposed streaming procedure is fully exploited in this setting, since data from one or several patient can arrive + +Prototype "8" + +1st noisy "8" + +2nd noisy "8" + +![](images/a1cce00fe065925a85f108f82c1629028088f003cf186033f507d0adfe2c792a.jpg) +Figure 4: Digit "8" (MNIST). From left to right: Prototype "8", first and second noisy versions of the prototype by randomly (Bernoulli $p = 0.1$ ) moving pixels, three barycenters constructed with Algorithm 1 associated to the OWT plan, an OT plan and the entropy regularised OT plan for $\varepsilon = 1$ . + +![](images/b307112c014c95b8abd1acfb11869a57af1b9aa11ee559163ccd8faaa4a2375a.jpg) + +![](images/f4042197b51c76bb563f2001bacfd56a97ca405fdee68f25b813366f2d9d5f73.jpg) + +OWT + +![](images/cbf9b891f14392fc17bff4285ce159d60dd8fe79968f706f72c25f23a499cf9c.jpg) + +OT + +![](images/2fdd83700002b8e40399e5145768083faa767901139dac28abd592ce4b9c1ab9.jpg) + +Regularised OT + +![](images/9245b2c6657fe14833bda97bb1026af2522880b8690566f103ac0508579a5348.jpg) + +sequentially. Though this setting has been addressed with the Wasserstein barycenter in [14], also in Fig. 5, such method required a fixed grid to compute the barycenter unlike our method, thus revealing the computational simplicity of the weak barycenter. + +![](images/37ed8bc038d89b17c488c57e34083077d3248394ccd135c3d7344a1d62cefc6b.jpg) +Figure 5: (left) Cytometry dataset for $n = 15$ patients and FSC vs. SSC cell's marker. (right) The weak-barycenter (black) computed with Algorithm 2 and the OT barycenter (red). The data are represented with the same axis as the figure of barycenters. + +![](images/743bfba1947b69aecd793862d170506105d9301fbaf8da53a48a53d5356a6312.jpg) + +# 7 Discussion + +We have introduced the weak barycenter, which extracts common geometric information of probability measures on $\mathbb{R}^d$ based on optimal weak transport, and showed that it can be interpreted as a latent variable model. From the fixed-point formulation defined in terms of optimal weak transport maps, irrespective of the regularity assumptions on the measures involved, we developed practical computation via an iterative algorithm with guaranteed convergence. In particular, the proposed algorithms do not require a common grid on the sample space, when processing either observed data or samples from distributions. We have also proposed weak barycenters of a possibly infinite population of measures and developed a stochastic procedure for computing it in the streaming data regime where distributions are processes into the weak barycenter as they arrive. This has critical implications for continual-learning methods in the ML community. + +Additional studies will focus on deepen the latent variable interpretation of weak barycenters, and its relationship to the aggregate information represented by the Wasserstein barycenter. Also, we identify two relevant theoretical aspects for further research: i) to exhibit general conditions on the family of input measures (or on the law of the population) for the existence of weak barycenters that are not Dirac masses; and ii) to provide conditions on those input measures for a "maximal" weak barycenter (in terms of convex ordering) to exist when $d \geq 2$ , among all the solutions of the weak barycenter problem (and, if possible, a way of constructing it by regularisation most probably). The statistical behaviour of the weak barycenter can also be investigated, in particular when constructed from large empirical random samples of given distributions. Lastly, the weak population barycenter could also be used to construct a predictive posterior in the context of Bayesian learning, as was done for Wasserstein barycenters in [35]. + +Acknowledgments. We thank Julio Backhoff-Veraguas for his valuable insight during the writing of this paper. This work was funded by ANID grants: AFB170001 & ACE210010 (CMM), FB0008 (AC3E), Fondecyt-Postdoctoral #3190926 and Fondecyt-Regular #1210606. + +# References + +[1] M. Agueh and G. Carlier. Barycenters in the Wasserstein space. SIAM Journal on Mathematical Analysis, 43(2):904-924, 2011. +[2] A. Alfonsi, J. Corbetta, and B. Jourdain. Sampling of probability measures in the convex order and approximation of martingale optimal transport problems. Available at SSRN 3072356, 2017. +[3] Jason M Altschuler and Enric Boix-Adsera. Wasserstein barycenters can be computed in polynomial time in fixed dimension. J. Mach. Learn. Res., 22:44–1, 2021. +[4] P.C. Alvarez-Esteban, E Del Barrio, J.A. Cuesta-Albertos, and C. Matrán. Wide consensus for parallelized inference. arXiv: 1511.05350, 2015. +[5] P.C. Álvarez-Esteban, E. Del Barrio, J.A. Cuesta-Albertos, and C. Matrán. A fixed-point approach to barycenters in Wasserstein space. Journal of Mathematical Analysis and Applications, 441(2):744-762, 2016. +[6] L. Ambrosio, N. Gigli, and G. Savaré. Gradient flows: in metric spaces and in the space of probability measures. Springer Science & Business Media, 2008. +[7] M. Arjovsky, S. Chintala, and L. Bottou. Wasserstein generative adversarial networks. In Proceedings of the 34th International Conference on Machine Learning, volume 70, pages 214–223. PMLR, 2017. +[8] J. Backhoff-Veraguas, M. Beigböck, and G. Pammer. Existence, duality, and cyclical monotonicity for weak transport costs. *Calculus of Variations and Partial Differential Equations*, 58(6):203, 2019. +[9] J. Backhoff-Veraguas, M. Beigböck, and G. Pammer. Weak monotone rearrangement on the line. Electronic Communications in Probability, 25, 2020. +[10] J. Backhoff-Veraguas, J. Fontbona, G. Rios, and F. Tobar. Stochastic gradient descent in Wasserstein space. arXiv preprint arXiv: 2201.04232, 2022. +[11] Y. Balaji, R. Chellappa, and S. Feizi. Robust optimal transport with applications in generative modeling and domain adaptation. arXiv:2010.05862, 2020. +[12] A. Beck and M. Teboulle. A fast iterative shrinkage-thresholding algorithm for linear inverse problems. SIAM journal on imaging sciences, 2(1):183-202, 2009. +[13] M. Beiglöck, P. Henry-Labordere, and F. Penkner. Model-independent bounds for option prices—a mass transport approach. Finance and Stochastics, 17(3):477-501, 2013. +[14] J. Bigot, E. Cazelles, and N. Papadakis. Data-driven regularization of Wasserstein barycenters with an application to multivariate density registration. Information and Inference: A Journal of the IMA, 8(4):719-755, 2019. +[15] J. Bigot and T. Klein. Characterization of barycenters in the Wasserstein space by averaging optimal transport maps. *ESAIM: Probability and Statistics*, 22:35-57, 2018. +[16] M.W. Botsko. An elementary proof of Lebesgue's differentiation theorem. The American Mathematical Monthly, 110(9):834-838, 2003. +[17] S. Chewi, T. Maunu, P. Rigollet, and A.J. Stromme. Gradient descent algorithms for Bures-Wasserstein barycenters. arXiv: 2001.01700, 2020. +[18] M. Cuturi. Sinkhorn distances: Lightspeed computation of optimal transport. In Advances in Neural Information Processing Systems 26, pages 2292-2300. 2013. +[19] M. Cuturi and A. Doucet. Fast computation of Wasserstein barycenters. Proceedings of the 31st International Conference on Machine Learning, 32(2):685-693, 2014. +[20] A. Dessein, N. Papadakis, and J.-L. Rouas. Regularized optimal transport and the ROT mover's distance. The Journal of Machine Learning Research, 19(1):590-642, 2018. +[21] D. Dvinskikh. Stochastic approximation versus sample average approximation for population Wasserstein barycenters. arXiv e-prints, pages arXiv-2001, 2020. +[22] E.A. Feinberg, P.O. Kasyanov, and Y. Liang. Fatou's lemma in its classical form and Lebesgue's convergence theorems for varying measures with applications to Markov decision processes. Theory of Probability & Its Applications, 65(2):270-291, 2020. + +[23] R. Flamary, N. Courty, A. Gramfort, M.Z. Alaya, A. Boisbunon, S. Chambon, L. Chapel, A. Corenflos, K. Fatras, N. Fournier, L. Gautheron, N. T.H. Gayraud, H. Janati, A. Rakotomamonjy, I. Redko, A. Rolet, A. Schutz, V. Seguy, D.J. Sutherland, R. Tavenard, A. Tong, and T. Vayer. Pot: Python optimal transport. Journal of Machine Learning Research, 22(78):1-8, 2021. +[24] R.C. Gentleman, V.J. Carey, D.M. Bates, B. Bolstad, M. Dettling, S. Dudoit, B. Ellis, L. Gautier, Y. Ge, J. Gentry, et al. Bioconductor: open software development for computational biology and bioinformatics. Genome biology, 5(10):R80, 2004. +[25] N. Gozlan and N. Juillet. On a mixture of Brenier and Strassen theorems. Proceedings of the London Mathematical Society, 120(3):434-463, 2020. +[26] N. Gozlan, C. Roberto, P.-M. Samson, and P. Tetali. Kantorovich duality for general transport costs and applications. Journal of Functional Analysis, 273(11):3327-3405, 2017. +[27] J. Guyon and P. Henry-Labordere. Nonlinear option pricing. CRC Press, 2013. +[28] F. Hahne, A.H. Khodabakhshi, A. Bashashati, C.-J. Wong, R.D. Gascoyne, A.P. Weng, V. Seyfert-Margolis, K. Bourcier, A. Asare, T. Lumley, et al. Per-channel basis normalization methods for flow cytometry data. Cytometry Part A: The Journal of the International Society for Advancement of Cytometry, 77(2):121-131, 2010. +[29] R.P. Kertz and U. Rosler. Complete lattices of probability measures with applications to martingale theory. Lecture Notes-Monograph Series, pages 153-177, 2000. +[30] T. Le Gouic and J.-M. Loubes. Existence and consistency of Wasserstein barycenters. Probability Theory and Related Fields, 168(3-4):901-917, 2017. +[31] Y. LeCun. The MNIST database of handwritten digits. http://yann.lecun.com/exdb/mnist/, 1998. +[32] L. Li, A. Genevay, M. Yurochkin, and J. Solomon. Continuous regularized Wasserstein barycenters. arXiv preprint arXiv:2008.12534, 2020. +[33] X. Nguyen. Convergence of latent mixing measures in finite and infinite mixture models. The Annals of Statistics, 41(1):370-400, 2013. +[34] G. Peyré and M. Cuturi. Computational optimal transport. Foundations and Trends® in Machine Learning, 11(5-6):355–607, 2019. +[35] G. Rios, J. Backhoff-Veraguas, J. Fontbona, and F. Tobar. Bayesian learning with Wasserstein barycenters. arXiv preprint arXiv:1805.10833v4, 2018. +[36] V. Seguy, B.B. Damodaran, R. Flamary, N. Courty, A. Rolet, and M. Blondel. Large-scale optimal transport and mapping estimation. In International Conference on Learning Representations (ICLR), 2018. +[37] Moshe Shaked and J George Shanthikumar. Stochastic orders. Springer Science & Business Media, 2007. +[38] J. Solomon, F. De Goes, G. Peyre, M. Cuturi, A. Butscher, A. Nguyen, T. Du, and L. Guibas. Convolutional Wasserstein distances: Efficient optimal transportation on geometric domains. ACM Transactions on Graphics (TOG), 34(4):1-11, 2015. +[39] M. Staib, S. Claici, J. Solomon, and S. Jegelka. Parallel streaming wasserstein barycenters. In Advances in Neural Information Processing Systems, pages 2647–2658, 2017. +[40] V. Strassen. The existence of probability measures with given marginals. Annals of Mathematical Statistics, 36(2):423-439, 1965. +[41] C. Villani. Topics in Optimal Transportation. Number 58. American Mathematical Soc., 2003. +[42] C. Villani. Optimal Transport: Old and New. Springer Berlin Heidelberg, 2008. +[43] J. Ye, P. Wu, J. Z. Wang, and J. Li. Fast discrete distribution clustering using Wasserstein barycenter with sparse support. IEEE Transactions on Signal Processing, 65(9):2317-2332, 2017. +[44] Y. Zemel and V. Panaretos. Fréchet means and Procrustes analysis in Wasserstein space. Bernoulli, 25(2):932-976, 2019. \ No newline at end of file diff --git a/anovelnotionofbarycenterforprobabilitydistributionsbasedonoptimalweakmasstransport/images.zip b/anovelnotionofbarycenterforprobabilitydistributionsbasedonoptimalweakmasstransport/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..7003fd6f4444dd9b03cb30cd940dd8659f2bd369 --- /dev/null +++ b/anovelnotionofbarycenterforprobabilitydistributionsbasedonoptimalweakmasstransport/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:72ff5bf874b3e9e18ff78a14894ce3e2d11db9fd85af9e7d53030dfc6bd62907 +size 284405 diff --git a/anovelnotionofbarycenterforprobabilitydistributionsbasedonoptimalweakmasstransport/layout.json b/anovelnotionofbarycenterforprobabilitydistributionsbasedonoptimalweakmasstransport/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..5f8e7b2d784ebb6238229f1ba7efff8aa472e8d6 --- /dev/null +++ b/anovelnotionofbarycenterforprobabilitydistributionsbasedonoptimalweakmasstransport/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0da3c5e2103f797150e46daeab4f358d9183f72ba654cb3e2eb970af581aff40 +size 545828 diff --git a/apacbayesanalysisofadversarialrobustness/333b1ea8-8c49-4628-9bca-1e0352e55992_content_list.json b/apacbayesanalysisofadversarialrobustness/333b1ea8-8c49-4628-9bca-1e0352e55992_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..167965c3ad18e985a0ecb82e843a0aa912dd8b2c --- /dev/null +++ b/apacbayesanalysisofadversarialrobustness/333b1ea8-8c49-4628-9bca-1e0352e55992_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:281400d7cadbf2893518d78d10e11fc803841c70e2bc08097029691448c9ea73 +size 89721 diff --git a/apacbayesanalysisofadversarialrobustness/333b1ea8-8c49-4628-9bca-1e0352e55992_model.json b/apacbayesanalysisofadversarialrobustness/333b1ea8-8c49-4628-9bca-1e0352e55992_model.json new file mode 100644 index 0000000000000000000000000000000000000000..ecb1df76b81681e71cf4ccd41fd7192694694fc6 --- /dev/null +++ b/apacbayesanalysisofadversarialrobustness/333b1ea8-8c49-4628-9bca-1e0352e55992_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c87dd67f829edbf625e9b996335e67460af5704dd67a0cf802e1aa68367e871c +size 107238 diff --git a/apacbayesanalysisofadversarialrobustness/333b1ea8-8c49-4628-9bca-1e0352e55992_origin.pdf b/apacbayesanalysisofadversarialrobustness/333b1ea8-8c49-4628-9bca-1e0352e55992_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fc8eb31991f532f65246cfcee175c1425a87c908 --- /dev/null +++ b/apacbayesanalysisofadversarialrobustness/333b1ea8-8c49-4628-9bca-1e0352e55992_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1707c9cd795e7b7708615b66cac4449f3e3b101249d0eed187517def2ba4cd82 +size 1017162 diff --git a/apacbayesanalysisofadversarialrobustness/full.md b/apacbayesanalysisofadversarialrobustness/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a9b4d924ff21048c9d3211fb07d47635b87faf74 --- /dev/null +++ b/apacbayesanalysisofadversarialrobustness/full.md @@ -0,0 +1,362 @@ +# A PAC-Bayes Analysis of Adversarial Robustness + +Paul Vialard1*, Guillaume Vidot23*, Amaury Habrard1, Emilie Morvant1 + +1 Univ Lyon, UJM-Saint-Etienne, CNRS, Institut d'Optique Graduate School, Laboratoire Hubert Curien UMR 5516, F-42023, SAINT-ETIENNE, France + +2 Airbus Opération S.A.S + +3 University of Toulouse, Institut de Recherche en Informatique de Toulouse, France + +# Abstract + +We propose the first general PAC-Bayesian generalization bounds for adversarial robustness, that estimate, at test time, how much a model will be invariant to imperceptible perturbations in the input. Instead of deriving a worst-case analysis of the risk of a hypothesis over all the possible perturbations, we leverage the PAC-Bayesian framework to bound the averaged risk on the perturbations for majority votes (over the whole class of hypotheses). Our theoretically founded analysis has the advantage to provide general bounds $(i)$ that are valid for any kind of attacks (i.e., the adversarial attacks), $(ii)$ that are tight thanks to the PAC-Bayesian framework, $(iii)$ that can be directly minimized during the learning phase to obtain a robust model on different attacks at test time. + +# 1 Introduction + +While machine learning algorithms are able to solve a huge variety of tasks, Szegedy et al. [2014] pointed out a crucial weakness: the possibility to generate samples similar to the originals (i.e., with no or insignificant change recognizable by the human eyes) but with a different outcome from the algorithm. This phenomenon, known as "adversarial examples", contributes to the impossibility to ensure the safety of machine learning algorithms for safety-critical applications such as aeronautic functions (e.g., vision-based navigation), autonomous driving, or medical diagnosis (see, e.g., Huang et al. [2020]). Adversarial robustness is thus a critical issue in machine learning that studies the ability of a model to be robust or invariant to perturbations of its input. A perturbed input that fools the model is usually called an adversarial example. In other words, an adversarial example can be defined as an example that has been modified by an imperceptible noise (or that does not exceed a threshold) but which leads to a misclassification. One line of research is referred to as adversarial robustness verification [e.g., Gehr et al., 2018, Huang et al., 2017, Singh et al., 2019, Tsuzuki et al., 2018], where the objective is to formally check whether the neighborhood of each sample does not contain any adversarial examples. This kind of method comes with some limitations such as scalability or overapproximation [Gehr et al., 2018, Katz et al., 2017, Singh et al., 2019]. In this paper we stand in another setting called adversarial attack/defense [e.g., Papernot et al., 2016, Goodfellow et al., 2015, Madry et al., 2018, Carlini and Wagner, 2017, Zantedeschi et al., 2017, Kurakin et al., 2017]. An adversarial attack consists in finding perturbed examples that defeat machine learning algorithms while the adversarial defense techniques enhance their adversarial robustness to make the attacks useless. While a lot of methods exist, adversarial robustness suffers from a lack of general theoretical understandings (see Section 2.2). + +To tackle this issue, we propose in this paper to formulate the adversarial robustness through the lens of a well-founded statistical machine learning theory called PAC-Bayes and introduced by Shawe-Taylor and Williamson [1997], McAllester [1998]. This theory has the advantage to provide tight + +generalization bounds in average over the set of hypotheses considered (leading to bounds for a weighted majority vote over this set), in contrast to other theories such as VC-dimension or Rademacher-based approaches that give worst-case analysis, i.e., for all the hypotheses. We start by defining our setting called adversarially robust PAC-Bayes. The idea consists in considering an averaged adversarial robustness risk which corresponds to the probability that the model misclassifies a perturbed example (this can be seen as an averaged risk over the perturbations). This measure can be too optimistic and not enough informative since for each example we sample only one perturbation. Thus we also define an averaged-max adversarial risk as the probability that there exists at least one perturbation (taken in a set of sampled perturbations) that leads to a misclassification. These definitions, based on averaged quantities, have the advantage $(i)$ of still being suitable for the PAC-Bayesian framework and majority vote classifiers and $(ii)$ to be related to the classical adversarial robustness risk. Then, for each of our adversarial risks, we derive a PAC-Bayesian generalization bound that can are valid to any kind of attack. From an algorithmic point of view, these bounds can be directly minimized in order to learn a majority vote robust in average to attacks. We empirically illustrate that our framework is able to provide generalization guarantees with non-vacuous bounds for the adversarial risk while ensuring efficient protection to adversarial attacks. + +Organization of the paper. Section 2 recalls basics on usual adversarial robustness. We state our new adversarial robustness PAC-Bayesian setting along with our theoretical results in Section 3 and we empirically show its soundness in Section 4. All the proofs of the results are deferred in Appendix. + +# 2 Basics on adversarial robustness + +# 2.1 General setting + +We tackle binary classification tasks with the input space $X = \mathbb{R}^d$ and the output/label space $Y = \{-1, +1\}$ . We assume that $D$ is a fixed but unknown distribution on $X \times Y$ . An example is denoted by $(x, y) \in X \times Y$ . Let $S = \{(x_i, y_i)\}_{i=1}^m$ be the learning sample consisted of $m$ examples i.i.d. from $D$ ; we denote the distribution of such $m$ -sample by $D^m$ . Let $\mathcal{H}$ be a set of real-valued functions from $X$ to $[-1, +1]$ called voters or hypotheses. Usually, given a learning sample $S \sim D^m$ , a learner aims at finding the best hypothesis $h$ from $\mathcal{H}$ that commits as few errors as possible on unseen data from $D$ . One wants to find $h \in \mathcal{H}$ that minimizes the true risk $R_D(h)$ on $D$ defined as + +$$ +R _ {D} (h) = \underset {(x, y) \sim D} {\mathbb {E}} \ell (h, (x, y)), \tag {1} +$$ + +where $\ell : \mathcal{H} \times X \times Y \to \mathbb{R}^+$ is the loss function. In practice since $D$ is unknown we cannot compute $R_{D}(h)$ , we usually deal with the empirical risk $R_{S}(h)$ estimated on $S$ and defined as + +$$ +R _ {S} (h) = \frac {1}{m} \sum_ {i = 1} ^ {m} \ell \left(h, \left(x _ {i}, y _ {i}\right)\right). +$$ + +From a classic ideal machine learning standpoint, we are able to learn a well-performing classifier with strong guarantees on unseen data, and even to measure how much the model will be able to generalize on $D$ (e.g., with generalization bounds). + +However, in real-life applications at classification time, an imperceptible perturbation of the input (e.g., due to a malicious attack or a noise) can have a bad influence on the classification performance on unseen data [Szegedy et al., 2014]: the usual guarantees do not stand anymore. Such imperceptible perturbation can be modeled by a (relatively small) noise in the input. Let $b > 0$ and $\| \cdot \|$ be an arbitrary norm (the most used norms are the $\ell_1$ , $\ell_2$ and $\ell_{\infty}$ -norms), the set of possible noises $B$ is defined by + +$$ +B = \left\{\epsilon \in \mathbb {R} ^ {d} \mid \| \epsilon \| \leq b \right\}. +$$ + +The learner aims to find an adversarial robust classifier that is robust in average to all noises in $B$ over $(x,y)\sim D$ . More formally, one wants to minimize the adversarial robust true risk $R_{D}^{\mathrm{ROB}}(h)$ defined as + +$$ +R _ {D} ^ {\mathrm {R O B}} (h) = \underset {(x, y) \sim D} {\mathbb {E}} \max _ {\epsilon \in B} \ell \left(h, (x + \epsilon , y)\right). \tag {2} +$$ + +Similarly as in the classic setting, since $D$ is unknown, $R_D^{\mathrm{ROB}}(h)$ cannot be directly computed, and then one usually deals with the empirical adversarial risk + +$$ +R _ {S} ^ {\mathsf {R O B}} (h) = \frac {1}{m} \sum_ {i = 1} ^ {m} \max _ {\epsilon \in B} \ell \left(h, \left(x _ {i} + \epsilon , y _ {i}\right)\right). +$$ + +That being said, a learned classifier $h$ should be robust to adversarial attacks that aim at finding an adversarial example $x + \epsilon^{*}(x,y)$ to fool $h$ for given example $(x,y)$ , where $\epsilon^{*}(x,y)$ is defined as + +$$ +\epsilon^ {*} (x, y) \in \operatorname {a r g m a x} _ {\epsilon \in B} \ell (h, (x + \epsilon , y)). \tag {3} +$$ + +In consequence, adversarial defense mechanisms often rely on the adversarial attacks by replacing the original examples with the adversarial ones during the learning phase; This procedure is called adversarial training. Even if there are other defenses, adversarial training appears to be one of the most efficient defense mechanisms [Ren et al., 2020]. + +# 2.2 Related works + +Adversarial Attacks/Defenses. Numerous methods exist to solve-or approximate-the optimization of Equation (3). Among them, the Fast Gradient Sign Method (FGSM Goodfellow et al., 2015) is an attack consisting in generating a noise $\epsilon$ in the direction of the gradient of the loss function with respect to the input $x$ . [Kurakin et al., 2017] introduced IFGSM, an iterative version of FGSM: at each iteration, one repeats FGSM and adds to $x$ a noise, that is the sign of the gradient of the loss with respect to $x$ . Following the same principle as IFGSM, [Madry et al., 2018] proposed a method based on Projected Gradient Descent (PGD) that includes a random initialization of $x$ before the optimization. Another technique known as the Carlini and Wagner Attack [Carlini and Wagner, 2017] aims at finding adversarial examples $x + \epsilon^{*}(x,y)$ that are as close as possible to the original $x$ , i.e., they want an attack being the most imperceptible as possible. However, producing such imperceptible perturbation leads to a high-running time in practice. Contrary to the most popular techniques that look for a model with a low adversarial robust risk (Equation (2)), our work stands in another line of research where the idea is to relax this worst-case risk measure by considering an averaged adversarial robust risk over the noises instead of a max-based formulation [see, e.g., Zantedeschi et al., 2017, Hendrycks and Dietterich, 2019]. Our averaged formulation is introduced in the Section 3. + +Generalization Bounds. Recently, few generalization bounds for adversarial robustness have been introduced [e.g. Khim and Loh, 2018, Yin et al., 2019, Montasser et al., 2019, 2020, Cohen et al., 2019, Salman et al., 2019]. Khim and Loh and Yin et al.'s results are Rademacher complexity-based bounds. The former makes use of a surrogate of the adversarial risk; The latter provides bounds in the specific case of neural networks and linear classifiers, and involves an unavoidable polynomial dependence on the dimension of the input. Montasser et al. study robust PAC-learning for PAC-learnable classes with finite VC-dimension for unweighted majority votes that have been "robustified" with a boosting algorithm. However, their algorithm requires to consider all possible adversarial perturbations for each example which is intractable in practice, and their bound suffers also from a large constant as indicated at the end of the Montasser et al. [Theorem 3.1 2019] 's proof. Cohen et al. provide bounds that estimate what is the minimum noise to get an adversarial example (in the case of perturbations expressed as Gaussian noise) while our results give the probability to be fooled by an adversarial example. Salman et al. leverage Cohen et al.'s method and adversarial training in order to get tighter bounds. Moreover, Farnia et al. present margin-based bounds on the adversarial robust risk for specific neural networks and attacks (such as FGSM or PGD). While they made use of a classical PAC-Bayes bound, their result is not a PAC-Bayesian analysis and stands in the family of uniform-convergence bounds [see Nagarajan and Kolter 2019, Ap. J for details]. In this paper, we provide PAC-Bayes bounds for general models expressed as majority votes, their bounds are thus not directly comparable to ours. + +# 3 Adversarily robust PAC-Bayes + +Although few theoretical results exist, the majority of works come either without theoretical guarantee or with very specific theoretical justifications. In the following, we aim at giving a different point of view on adversarial robustness based on the so-called PAC-Bayesian framework. By leveraging this framework, we derive a general generalization bound for adversarial robustness based on an averaged notion of risk that allows us to learn robust models at test time. We introduce below our new setting referred to as adversially robust PAC-Bayes. + +# 3.1 Adversarily robust majority vote + +The PAC-Bayesian framework provides practical and theoretical tools to analyze majority vote classifiers. Assuming the voters set $\mathcal{H}$ and a learning sample $S$ as defined in Section 2, our goal is not anymore to learn one classifier from $\mathcal{H}$ but to learn a well-performing weighted combination of the voters involved in $\mathcal{H}$ , the weights being modeled by a distribution $\mathcal{Q}$ on $\mathcal{H}$ . This distribution is called the posterior distribution and is learned from $S$ given a prior distribution $\mathcal{P}$ on $\mathcal{H}$ . The learned weighted combination is called a $\mathcal{Q}$ -weighted majority vote and is defined by + +$$ +\forall x \in X, \quad H _ {\mathcal {Q}} (x) = \operatorname {s i g n} \left[ \underset {h \sim \mathcal {Q}} {\mathbb {E}} h (x) \right]. \tag {4} +$$ + +In the rest of the paper, we consider the 0-1 loss function classically used for majority votes in PAC-Bayes and defined as $\ell(h, (x, y)) = \mathbf{I}(h(x) \neq y)$ with $\mathbf{I}(a) = 1$ if $a$ is true, and 0 otherwise. In this context, the adversarial perturbation related to Equation (3) becomes + +$$ +\epsilon^ {*} (x, y) \in \operatorname {a r g m a x} _ {\epsilon \in B} \mathbf {I} \left(H _ {\mathcal {Q}} (x + \epsilon) \neq y\right). \tag {5} +$$ + +Optimizing this problem is intractable due to the non-convexity of $H_{\mathcal{Q}}$ induced by the sign function. Note that the adversarial attacks of the literature (like PGD or IFGSM) aim at finding the optimal perturbation $\epsilon^{*}(x,y)$ , but, in practice one considers an approximation of this perturbation. + +Hence, instead of searching for the noise that maximizes the chance of fooling the algorithm, we propose to model the perturbation according to an example-dependent distribution. First let us define $\omega_{(x,y)}$ a distribution, on the set of possible noises $B$ , that is dependent on an example $(x,y) \in X \times Y$ . Then we denote as $\mathbf{D}$ the distribution on $(X \times Y) \times B$ defined as $\mathbf{D}((x,y),\epsilon) = D(x,y) \cdot \omega_{(x,y)}(\epsilon)$ which further permits to generate perturbed examples. To estimate our risks (defined below) for a given example $(x_i, y_i) \sim D$ , we consider a set of $n$ perturbations sampled from $\omega_{(x_i,y_i)}$ denoted by $\mathcal{E}_i = \{\epsilon_j^i\}_{j=1}^n$ . Then we consider as a learning set the $m \times n$ -sample $\mathbf{S} = \{((x_i, y_i), \mathcal{E}_i)\}_{i=1}^m \in (X \times Y \times B^n)^m$ . In other words, each $((x_i, y_i), \mathcal{E}_i) \in \mathbf{S}$ is sampled from a distribution that we denote by $\mathbf{D}^n$ such that + +$$ +\mathbf {D} ^ {n} ((x _ {i}, y _ {i}), \boldsymbol {\mathcal {E}} _ {i}) = D (x _ {i}, y _ {i}) \cdot \prod_ {j = 1} ^ {n} \omega_ {(x _ {i}, y _ {i})} (\epsilon_ {j} ^ {i}). +$$ + +Then, inspired by the works of [Zantedeschi et al.][2017], Hendrycks and Dietterich [2019], we define our robustness averaged adversarial risk as follows. + +Definition 1 (Averaged Adversarial Risk). For any distribution $\mathbf{D}$ on $(X\times Y)\times B$ , for any distribution $\mathcal{Q}$ on $\mathcal{H}$ , the averaged adversarial risk of $H_{\mathcal{Q}}$ is defined as + +$$ +\begin{array}{l} R _ {\mathbf {D}} (H _ {\mathcal {Q}}) = \operatorname * {P r} _ {((x, y), \epsilon) \sim \mathbf {D}} \left(H _ {\mathcal {Q}} (x + \epsilon) \neq y\right) \\ = \underset {((x, y), \epsilon) \sim \mathbf {D}} {\mathbb {E}} \mathbf {I} (H _ {\mathcal {Q}} (x + \epsilon) \neq y). \\ \end{array} +$$ + +The empirical averaged adversarial risk is computed on a $m \times n$ -sample $\mathbf{S} = \{( (x_i, y_i), \pmb{\varepsilon}_i) \}_{i=1}^m$ is + +$$ +R _ {\mathbf {S}} (H _ {\mathcal {Q}}) = \frac {1}{m n} \sum_ {i = 1} ^ {m} \sum_ {j = 1} ^ {n} \mathbf {I} (H _ {\mathcal {Q}} (x _ {i} + \epsilon_ {j} ^ {i}) \neq y _ {i}). +$$ + +As we will show in Proposition 3, the risk $R_{\mathbf{D}}(H_{\mathcal{Q}})$ can be considered an optimistic regarding $\epsilon^{*}(x,y)$ of Equation (5). Indeed, instead of taking the $\epsilon$ maximizing the loss, a unique $\epsilon$ is drawn from a distribution. Hence, it can lead to a non-informative risk regarding the occurrence of adversarial examples. To overcome this, we propose an extension that we refer as averaged-max adversarial risk. + +Definition 2 (Averaged-Max Adversarial Risk). For any distribution $\mathbf{D}$ on $(X\times Y)\times B$ , for any distribution $\mathcal{Q}$ on $\mathcal{H}$ , the averaged-max adversarial risk of $H_{\mathcal{Q}}$ is defined as + +$$ +A _ {\mathbf {D} ^ {n}} (H _ {\mathcal {Q}}) = \operatorname * {P r} _ {((x, y), \boldsymbol {\mathcal {E}}) \sim \mathbf {D} ^ {n}} \left(\exists \epsilon \in \boldsymbol {\mathcal {E}}, H _ {\mathcal {Q}} (x + \epsilon) \neq y\right). +$$ + +The empirical averaged-max adversarial risk computed on a $m \times n$ -sample $\mathbf{S} = \{(x_i, y_i), \mathcal{E}_i\}_{i=1}^m$ is + +$$ +A _ {\mathbf {S}} (H _ {\mathcal {Q}}) = \frac {1}{m} \sum_ {i = 1} ^ {m} \max _ {\epsilon \in \boldsymbol {\varepsilon} _ {i}} \mathbf {I} (H _ {\mathcal {Q}} (x _ {i} + \epsilon) \neq y _ {i}). +$$ + +For an example $(x,y)\sim D$ , instead of checking if one perturbed example $x + \epsilon$ is adversarial, we sample $n$ perturbed examples $x + \epsilon_{1},\ldots ,x + \epsilon_{n}$ and we check if at least one example is adversarial. + +# 3.2 Relations between the adversarial risks + +Proposition below shows the intrinsic relationships between the classical adversarial risk $R_{D}^{\mathsf{ROB}}(H_{\mathcal{Q}})$ and our two relaxations $R_{\mathbf{D}}(H_{\mathcal{Q}})$ and $A_{\mathbf{D}^n}(H_{\mathcal{Q}})$ . In particular, Proposition shows that the larger $n$ , the number of perturbed examples, the higher is the chance to get an adversarial example and then to be close to the adversarial risk $R_{D}^{\mathsf{ROB}}(H_{\mathcal{Q}})$ . + +Proposition 3. For any distribution $\mathbf{D}$ on $(X\times Y)\times B$ , for any distribution $\mathcal{Q}$ on $\mathcal{H}$ , for any $(n,n^{\prime})\in \mathbb{N}^{2}$ , with $n\geq n^{\prime}\geq 1$ , we have + +$$ +R _ {\mathbf {D}} \left(H _ {\mathcal {Q}}\right) \leq A _ {\mathbf {D} ^ {n ^ {\prime}}} \left(H _ {\mathcal {Q}}\right) \leq A _ {\mathbf {D} ^ {n}} \left(H _ {\mathcal {Q}}\right) \leq R _ {D} ^ {\mathrm {R O B}} \left(H _ {\mathcal {Q}}\right). \tag {6} +$$ + +The left-hand side of Equation (6) confirms that the averaged adversarial risk $R_{\mathbf{D}}(H_{\mathcal{Q}})$ is optimistic regarding the classical $R_{D}^{\mathrm{ROB}}(H_{\mathcal{Q}})$ . Proposition 4 estimates how close $R_{\mathbf{D}}(H_{\mathcal{Q}})$ can be to $R_{D}^{\mathrm{ROB}}(H_{\mathcal{Q}})$ . + +Proposition 4. For any distribution $\mathbf{D}$ on $(X\times Y)\times B$ , for any distribution $\mathcal{Q}$ on $\mathcal{H}$ , we have + +$$ +R _ {D} ^ {\mathrm {R O B}} \left(H _ {\mathcal {Q}}\right) - \operatorname {T V} \left(\Pi \| \Delta\right) \leq R _ {\mathbf {D}} \left(H _ {\mathcal {Q}}\right), +$$ + +where $\Delta$ and $\Pi$ are distributions on $X\times Y$ , and $\Delta (x^{\prime},y^{\prime})$ , respectively $\Pi (x^{\prime},y^{\prime})$ , corresponds to the probability of drawing a perturbed example $(x + \epsilon)$ with $((x,y),\epsilon)\sim \mathbf{D}$ , respectively an adversarial example $(x + \epsilon^{*}(x,y),y)$ with $(x,y)\sim D$ . We have + +$$ +\Delta \left(x ^ {\prime}, y ^ {\prime}\right) = \Pr_ {\left((x, y), \epsilon\right) \sim \mathbf {D}} \left[ x + \epsilon = x ^ {\prime}, y = y ^ {\prime} \right], \quad a n d \quad \Pi \left(x ^ {\prime}, y ^ {\prime}\right) = \Pr_ {\left(x, y\right) \sim D} \left[ x + \epsilon^ {*} (x, y) = x ^ {\prime}, y = y ^ {\prime} \right], \tag {7} +$$ + +and $\mathrm{TV}(\Pi \| \Delta) = \underset {(x',y')\sim \Delta}{\mathbb{E}}\frac{1}{2}\left|\frac{\Pi(x',y')}{\Delta(x',y')} -1\right|$ , is the Total Variation (TV) distance between $\Pi$ and $\Delta$ . + +Note that $\epsilon^{*}(x,y)$ depends on $\mathcal{Q}$ , and hence $\Pi$ depends on $\mathcal{Q}$ . From Equation (7), $R_{D}^{\mathrm{ROB}}(H_{\mathcal{Q}})$ and $R_{\mathbf{D}}(H_{\mathcal{Q}})$ can be rewritten (see Lemmas 8 and 9 in Appendix B) respectively with $\Delta$ and $\Pi$ as + +$$ +R _ {\mathbf {D}} (H _ {\mathcal {Q}}) = \operatorname * {P r} _ {(x ^ {\prime}, y ^ {\prime}) \sim \Delta} \left[ H _ {\mathcal {Q}} (x ^ {\prime}) \neq y ^ {\prime} \right], \quad \text {a n d} \quad R _ {D} ^ {\mathtt {R O B}} (H _ {\mathcal {Q}}) = \operatorname * {P r} _ {(x ^ {\prime}, y ^ {\prime}) \sim \Pi} \left[ H _ {\mathcal {Q}} (x ^ {\prime}) \neq y ^ {\prime} \right]. +$$ + +Finally, Propositions 3 and 4 relate the adversarial risk $R_{\mathbf{D}}(H_{\mathcal{Q}})$ to the "standard" adversarial risk $R_{D}^{\mathrm{ROB}}(H_{\mathcal{Q}})$ . Indeed, by merging the two propositions we obtain + +$$ +R _ {D} ^ {\mathrm {R O B}} \left(H _ {\mathcal {Q}}\right) - \operatorname {T V} \left(\Pi \| \Delta\right) \leq R _ {\mathbf {D}} \left(H _ {\mathcal {Q}}\right) \leq A _ {\mathbf {D} ^ {n}} \left(H _ {\mathcal {Q}}\right) \leq R _ {D} ^ {\mathrm {R O B}} \left(H _ {\mathcal {Q}}\right). \tag {8} +$$ + +Hence, the smaller the TV distance $\mathrm{TV}(\Pi \| \Delta)$ , the closer the averaged adversarial risk $R_{\mathbf{D}}(H_{\mathcal{Q}})$ is from $R_{D}^{\mathsf{ROB}}(H_{\mathcal{Q}})$ and the more probable an example $((x,y),\epsilon)$ sampled from $\mathbf{D}$ would be adversarial, i.e., when our "averaged" adversarial example looks like a "specific" adversarial example. Moreover, Equation 8 justifies that the PAC-Bayesian point of view makes sense for adversarial learning with theoretical guarantees: the PAC-Bayesian guarantees we derive in the next section for our adversarial risks also give some guarantees on the "standard risk" $R_{D}^{\mathsf{ROB}}(H_{\mathcal{Q}})$ . + +# 3.3 PAC-Bayesian bounds on the adversarially robust majority vote + +First of all, since $R_{\mathbf{D}}(H_{\mathcal{Q}})$ and $A_{\mathbf{D}^n}(H_{\mathcal{Q}})$ risks are not differentiable due to the indicator function, we propose to use a common surrogate in PAC-Bayes (known as the Gibbs risk): instead of considering the risk of the $\mathcal{Q}$ -weighted majority vote, we consider the expectation over $\mathcal{Q}$ of the individual risks of the voters involved in $\mathcal{H}$ . In our case, we define the surrogates with the linear loss as + +$$ +\overline {{R _ {\bf D}}} (H _ {\mathcal {Q}}) = \underset {((x, y), \epsilon) \sim {\bf D}} {\mathbb {E}} \frac {1}{2} \left[ 1 - y \underset {h \sim {\mathcal {Q}}} {\mathbb {E}} h (x + \epsilon) \right], +$$ + +$$ +\text {a n d} \quad \overline {{A _ {\mathbf {D} ^ {n}}}} (H _ {\mathcal {Q}}) = \underset {((x, y), \mathcal {E}) \sim \mathbf {D} ^ {n}} {\mathbb {E}} \frac {1}{2} \left[ 1 - \underset {\epsilon \in \mathcal {E}} {\min } \left(y \underset {h \sim \mathcal {Q}} {\mathbb {E}} h (x + \epsilon)\right) \right]. +$$ + +The next theorem relates these surrogates to our risks, implying that a generalization bound for $\overline{R_{\mathbf{D}}}(H_{\mathcal{Q}})$ , resp. for $\overline{A_{\mathbf{D}^n}}(H_{\mathcal{Q}})$ , leads to a generalization bound for $R_{\mathbf{D}}(H_{\mathcal{Q}})$ , resp. $A_{\mathbf{D}^n}(H_{\mathcal{Q}})$ . + +Theorem 5. For any distributions $\mathbf{D}$ on $(X\times Y)\times B$ and $\mathcal{Q}$ on $\mathcal{H}$ , for any $n > 1$ , we have + +$$ +R _ {\mathbf {D}} \left(H _ {\mathcal {Q}}\right) \leq 2 \overline {{R _ {\mathbf {D}}}} \left(H _ {\mathcal {Q}}\right), \quad a n d \quad A _ {\mathbf {D} ^ {n}} \left(H _ {\mathcal {Q}}\right) \leq 2 \overline {{A _ {\mathbf {D} ^ {n}}}} \left(H _ {\mathcal {Q}}\right). +$$ + +Theorem below presents our PAC-Bayesian generalization bounds for $\overline{R_{\mathbf{D}}}(H_{\mathcal{Q}})$ . Before that, it is important to mention that the empirical counterpart of $\overline{R_{\mathbf{D}}}(H_{\mathcal{Q}})$ is computed on $\mathbf{S}$ which is composed of non identically independently distributed samples, meaning that a "classical" proof technique is not applicable. The trick here is to make use of a result of Ralaivola et al. [2010] that provides a chromatic PAC-Bayes bound, i.e., a bound which supports non-independent data. + +Theorem 6. For any distribution $\mathbf{D}$ on $(X\times Y)\times B$ , for any set of voters $\mathcal{H}$ , for any prior $\mathcal{P}$ on $\mathcal{H}$ for any $n$ , with probability at least $1 - \delta$ over $\mathbf{S}$ , for all posteriors $\mathcal{Q}$ on $\mathcal{H}$ , we have + +$$ +\operatorname {k l} \left(\overline {{R _ {\mathbf {S}}}} \left(H _ {\mathcal {Q}}\right) \| \overline {{R _ {\mathbf {D}}}} \left(H _ {\mathcal {Q}}\right)\right) \leq \frac {1}{m} \left[ \operatorname {K L} \left(\mathcal {Q} \| \mathcal {P}\right) + \ln \frac {m + 1}{\delta} \right], \tag {9} +$$ + +$$ +a n d \quad \overline {{R _ {\mathbf {D}}}} (H _ {\mathcal {Q}}) \leq \overline {{R _ {\mathbf {S}}}} (H _ {\mathcal {Q}}) + \sqrt {\frac {1}{2 m} \left[ \mathrm {K L} (\mathcal {Q} \| \mathcal {P}) + \ln \frac {m + 1}{\delta} \right]}, \tag {10} +$$ + +$$ +w h e r e \quad \overline {{R _ {\mathbf {S}}}} (H _ {\mathcal {Q}}) = \frac {1}{m n} \sum_ {i = 1} ^ {m} \sum_ {j = 1} ^ {n} \frac {1}{2} \left[ 1 - y _ {i} \underset {h \sim \mathcal {Q}} {\mathbb {E}} h (x _ {i} + \epsilon_ {j} ^ {i}) \right], +$$ + +$\mathrm{kl}(a\| b) = a\ln \frac{a}{b} +(1 - a)\ln \frac{1 - a}{1 - b},$ and $\mathrm{KL}(\mathcal{Q}\| \mathcal{P}) = \underset {h\sim \mathcal{P}}{\mathbb{E}}\ln \frac{\mathcal{P}(h)}{\mathcal{Q}(h)}$ the KL-divergence between $\mathcal{P}$ and $\mathcal{Q}$ . + +Surprisingly, this theorem states bounds that do not depend on the number of perturbed examples $n$ but only on the number of original examples $m$ . The reason is that the $n$ perturbed examples are inter-dependent (see the proof in Appendix). Note that Equation (9) is expressed as a [Seeger [2002]]'s bound and is tighter but less interpretable than Equation (10) expressed as a [McAllester [1998]]'s bound; These bounds involve the usual trade-off between the empirical risk $\overline{R_{\mathbf{S}}} (H_{\mathcal{Q}})$ and $\mathrm{KL}(\mathcal{Q}\| \mathcal{P})$ . + +We now state a generalization bound for $\overline{A_{\mathbf{D}^n}}(H_{\mathcal{Q}})$ . Since this value involves a minimum term, we cannot use the same trick as for Theorem 6. To bypass this issue, we use the TV distance between two "artificial" distributions on $\pmb{\varepsilon}_i$ . Given $((x_i,y_i),\pmb {\varepsilon}_i)\in \mathbf{S}$ , let $\pi_i$ be an arbitrary distribution on $\pmb{\varepsilon}_i$ , and given $h\in \mathcal{H}$ , let $\rho_i^h$ be a Dirac distribution on $\pmb{\varepsilon}_i$ such that $\rho_i^h (\epsilon) = 1$ if $\epsilon = \mathrm{argmax}_{\epsilon \in \pmb{\varepsilon}_i}\frac{1}{2}\left[1 - y_ih(x_i + \epsilon)\right]$ (i.e., if $\epsilon$ is maximizing the linear loss), and 0 otherwise. + +Theorem 7. For any distribution $\mathbf{D}$ on $(X\times Y)\times B$ , for any set of voters $\mathcal{H}$ , for any prior $\mathcal{P}$ on $\mathcal{H}$ for any $n$ , with probability at least $1 - \delta$ over $\mathbf{S}$ , for all posteriors $\mathcal{Q}$ on $\mathcal{H}$ , for all $i\in \{1,\ldots ,m\}$ , for all distributions $\pi_{i}$ on $\pmb{\varepsilon}_{i}$ independent from a voter $h\in \mathcal{H}$ , we have + +$$ +\begin{array}{l} \overline {{A _ {\mathbf {D} ^ {n}}}} (H _ {\mathcal {Q}}) \leq \frac {1}{m} \underset {h \sim \mathcal {Q}} {\mathbb {E}} \sum_ {i = 1} ^ {m} \max _ {\epsilon \in \mathcal {E} _ {i}} \frac {1}{2} \left(1 - y _ {i} h \left(x _ {i} + \epsilon\right)\right) + \sqrt {\frac {1}{2 m} \left[ \mathrm {K L} (\mathcal {Q} \| \mathcal {P}) + \ln \frac {2 \sqrt {m}}{\delta} \right]} (11) \\ \leq \overline {{A _ {\mathbf {S}}}} (H _ {\mathcal {Q}}) + \frac {1}{m} \sum_ {i = 1} ^ {m} \underset {h \sim \mathcal {Q}} {\mathbb {E}} \operatorname {T V} \left(\rho_ {i} ^ {h} \| \pi_ {i}\right) + \sqrt {\frac {1}{2 m} \left[ \mathrm {K L} (\mathcal {Q} \| \mathcal {P}) + \ln \frac {2 \sqrt {m}}{\delta} \right]}, (12) \\ \end{array} +$$ + +$$ +\text {w h e r e} \overline {{A _ {\mathbf {S}}}} (H _ {\mathcal {Q}}) = \frac {1}{m} \sum_ {i = 1} ^ {m} \frac {1}{2} \left[ 1 - \min _ {\epsilon \in \boldsymbol {\mathcal {E}} _ {i}} \left(y _ {i} \underset {h \sim \mathcal {Q}} {\operatorname {E}} h (x _ {i} + \epsilon)\right) \right], \text {a n d} \mathrm {T V} (\rho \| \pi) = \underset {\epsilon \sim \pi} {\mathbb {E}} \frac {1}{2} \left| \left[ \frac {\rho (\epsilon)}{\pi (\epsilon)} \right] - 1 \right|. +$$ + +To minimize the true average-max risk $\overline{A_{\mathbf{D}^n}(H_\mathcal{Q})}$ from Equation (11), we have to minimize a trade-off between $\mathrm{KL}(\mathcal{Q}\| \mathcal{P})$ (i.e., how much the posterior weights are close to the prior ones) and the empirical risk $\frac{1}{m}\mathbb{E}_{h\sim \mathcal{Q}}\sum_{i = 1}^{m}\max_{\epsilon \in \pmb{\varepsilon}_i}\frac{1}{2}\left(1 - y_i h(x_i + \epsilon)\right)$ . However, to compute the empirical risk, the loss for each voter and each perturbation has to be calculated and can be time-consuming. With Equation (12), we propose an alternative, which can be efficiently optimized using $\frac{1}{m}\sum_{i = 1}^{m}\mathbb{E}_{h\sim \mathcal{Q}}\mathrm{TV}(\rho_i^h\| \pi_i)$ and the empirical average-max risk $\overline{A_{\mathbf{S}}}(H_{\mathcal{Q}})$ . Intuitively, Equation (12) can be seen as a trade-off between the empirical risk, which reflects the robustness of the majority vote, and two penalization terms: the KL term and the TV term. The KL-divergence $\mathrm{KL}(\mathcal{Q}\| \mathcal{P})$ controls how much the posterior $\mathcal{Q}$ can differ from the prior ones $\mathcal{P}$ . While the TV term $\mathbb{E}_h\mathrm{TV}(\rho_i^h\| \pi_i)$ controls the diversity of the voters, i.e., the ability of the voters to be fooled on the same adversarial example. From an algorithmic view, an interesting behavior is that the bound of Equation (12) stands for all distributions $\pi_i$ on $\pmb{\varepsilon}_i$ . This suggests that given $(x_i,y_i)$ , we want to find $\pi_i$ minimizing $\mathbb{E}_{h\sim \mathcal{Q}}\mathrm{TV}(\rho_i^h\| \pi_i)$ . Ideally, + +this term tends to 0 when $\pi_i$ is close to $\rho_i^h$ and all voters have their loss maximized by the same perturbation $\epsilon \in \mathcal{E}_i$ . + +To learn a well-performing majority vote, one solution is to minimize the right-hand side of the bounds, meaning that we would like to find a good trade-off between a low empirical risk $\overline{R_{\mathbf{S}}}(H_{\mathcal{Q}})$ or $\overline{A_{\mathbf{S}}}(H_{\mathcal{Q}})$ and a low divergence between the prior weights and the learned posterior ones $\mathrm{KL}(\mathcal{Q}\| \mathcal{P})$ . + +# 4 Experimental evaluation on differentiable decision trees + +In this section, we illustrate the soundness of our framework in the context of differentiable decision trees learning. First of all, we describe our learning procedure designed from our theoretical results. + +# 4.1 From the bounds to an algorithm + +We consider a finite voters set $\mathcal{H}$ consisting of differentiable decision trees [Kontschieder et al., 2016] where each $h\in \mathcal{H}$ is parametrized by a weight vector $\pmb{w}^{h}$ . Inspired by [Masegosa et al., 2020], we learn the decision trees of $\mathcal{H}$ and a data-dependent prior distribution $\mathcal{P}$ from a first learning set $S^{\prime}$ (independent from $\mathcal{S}$ ); This is a common approach in PAC-Bayes [Parrado-Hernandez et al., 2012, Lever et al., 2013, Dziugaite and Roy, 2018, Dziugaite et al., 2021]. Then, the posterior distribution is learned from the second learning set $\mathcal{S}$ by minimizing the bounds. This means we need to minimize the risk and the KL-divergence term. Our two-step learning procedure is summarized in Algorithm 1 + +Step 1. Starting from an initial prior $\mathcal{P}_0$ and an initial set of voters $\mathcal{H}_0$ , where each voter $h$ is parametrized by a weight vector $\boldsymbol{w}_0^h$ , the objective of this step is to construct the hypothesis set $\mathcal{H}$ and the prior distribution $\mathcal{P}$ to give as input to Step 2 for minimizing the bound. To do so, at each epoch $t$ of the Step 1, we learn from $\mathcal{S}'$ an "intermediate" prior $\mathcal{P}_t$ on an "intermediate" hypothesis set $\mathcal{H}_t$ consisting of voters $h$ parametrized by the weights $\boldsymbol{w}_t^h$ ; Note that the optimization in Line 9 is done with respect to $\boldsymbol{w}_t = \{\boldsymbol{w}_t^h\}_{h \in \mathcal{H}_t}$ . At each iteration of the optimizer, from Lines 4 to 7, for each $(x,y)$ of the current batch $\mathbb{S}'$ , we attack the majority vote $H_{\mathcal{P}_t}$ to obtain a perturbed example $x + \epsilon$ . Then, in Lines 8 and 9, we perform a forward pass in the majority vote with the perturbed examples and update the weights $\boldsymbol{w}_t$ and the prior $\mathcal{P}_t$ according to the linear loss. To sum up, from Lines 11 to 20 at the end of Step 1, the prior $\mathcal{P}$ and the hypothesis set $\mathcal{H}$ constructed for Step 2 are the ones associated to the best epoch $t^* \in \{1,\dots,T'\}$ that permits to minimize $\overline{R_{\mathcal{S}_t}}(H_{\mathcal{P}_t})$ , where $\mathcal{S}_t = \{\text{attack}(x,y) | (x,y) \in \mathcal{S}\}$ is the perturbed set obtained by attacking the majority vote $H_{\mathcal{P}_t}$ . + +Step 2. Starting from the prior $\mathcal{P}$ on $\mathcal{H}$ and the learning set $S$ , we perform the same process as in Step 1 except that the considered objective function corresponds to the desired bound to optimize (Line 30, denoted $\mathtt{B}(\cdot)$ ). For the sake of readability, we deferred in Appendix G the definition of $\mathtt{B}(\cdot)$ for Equations (9) and (12). Note that the "intermediate" priors do not depend on $S$ , since they are learned from $S'$ : the bounds are then valid. + +# 4.2 Experiments + +In this section, we empirically illustrate that our PAC-Bayesian framework for adversarial robustness is able to provide generalization guarantees with non-vacuous bounds for the adversarial risk. + +Setting. We stand in a white-box setting meaning that the attacker knows the voters set $\mathcal{H}$ , the prior distribution $\mathcal{P}$ , and the posterior one $\mathcal{Q}$ . We empirically study 2 attacks with the $\ell_2$ -norm and $\ell_{\infty}$ -norm: the Projected Gradient Descent (PGD, Madry et al. [2018]) and the iterative version of FGSM (IFGSM, Kurakin et al. [2017]). We fix the number of iterations at $k = 20$ and the step size at $\frac{b}{k}$ for PGD and IFGSM (where $b = 1$ for $\ell_2$ -norm and $b = 0.1$ for $\ell_{\infty}$ -norm). One specificity of our setting is that we deal with the perturbation distribution $\omega_{(x,y)}$ . We propose $\mathrm{PGD_U}$ and $\mathrm{IFGSM_U}$ , two variants of PGD and IFGSM. To attack an example with $\mathrm{PGD_U}$ or $\mathrm{IFGSM_U}$ we proceed with the following steps: (1) We attack the prior majority vote $H_{\mathcal{P}}$ with the attack PGD or IFGSM: we will obtain a first perturbation $\epsilon'$ ; (2) We sample $n$ uniform noises $\eta_1, \ldots, \eta_n$ between $-10^{-2}$ and $+10^{-2}$ ; (3) We set + +Algorithm 1 Average Adversarial Training with Guarantee +Require: $S, S'$ : disjoint learning sets $-T, T'$ : number of epochs - $\mathcal{P}_0$ : initial prior - $\mathcal{H}_0$ (with $\boldsymbol{w}_0$ ): initial hypothesis set - attack(): the attack function - $\mathsf{B}(\cdot)$ : the objective function associated to a bound +Step 1 - prior and voters' set construction Step 2 - bound minimization +1: for $t$ from 1 to $T'$ do 21: $(\mathcal{P}, \mathcal{H}) \leftarrow$ Output of Step 1 +2: $\mathcal{P}_t \gets \mathcal{P}_{t-1}$ and $\mathcal{H}_t \gets \mathcal{H}_{t-1}$ ( $w_t \gets w_{t-1}$ ) 22: $\mathcal{Q}_0 \gets \mathcal{P}$ +3: for all batches $\mathbb{S}'$ (from $\mathcal{S}'$ ) do 23: for $t$ from 1 to $T$ do +4: for all $(x, y) \in \mathbb{S}'$ do 24: for all batches $\mathbb{S}$ (from $\mathcal{S}$ ) do +5: $(x + \epsilon, y) \gets \text{attack}(x, y)$ 25: $\mathcal{Q}_t \gets \mathcal{Q}_{t-1}$ +6: $\mathbb{S}' \gets (\mathbb{S}' \setminus \{(x, y)\}) \cup \{(x + \epsilon, y)\}$ 26: for all $(x, y) \in \mathbb{S}$ do +7: end for 27: $(x + \epsilon, y) \gets \text{attack}(x, y)$ +8: Update $\mathcal{P}_t$ with $\nabla_{\mathcal{P}_t} \overline{\mathbb{R}_{\mathcal{S}'}}(H_{\mathcal{P}_t})$ 28: $\mathbb{S} \gets (\mathbb{S} \setminus \{(x, y)\}) \cup \{(x + \epsilon, y)\}$ +9: Update $w_t$ with $\nabla_{w_t} \overline{\mathbb{R}_{\mathcal{S}'}}(H_{\mathcal{P}_t})$ 29: end for +10: end for 30: Update $\mathcal{Q}_t$ with $\nabla_{\mathcal{Q}_t} B_{\mathbb{S}}(H_{\mathcal{Q}_t})$ +11: $S_t \gets \emptyset$ 31: end for +12: for all $(x, y) \in S$ do 32: $S_t \gets \emptyset$ +13: $(x + \epsilon, y) \gets \text{attack}(x, y)$ 33: for all $(x, y) \in S$ do +14: $S_t \gets S_t \cup \{(x + \epsilon, y)\}$ 34: $(x + \epsilon, y) \gets \text{attack}(x, y)$ +15: end for 35: $S_t \gets S_t \cup \{(x + \epsilon, y)\}$ +16: $t^* \gets \operatorname*{argmin}_{t' \in \{1, ..., t\}} R_{S_{t'}}(H_{\mathcal{P}_{t'}})$ 36: end for +17: $P \gets P_{t^*}$ 37: $t^* \gets \operatorname*{argmin}_{t' \in \{1, ..., t\}} B_{S_{t'}}(H_{\mathcal{Q}_{t'}})$ +18: $H \gets H_{t^*}$ 38: $Q \gets Q_{t^*}$ +19: end for 39: end for +20: return ( $\mathcal{P}, \mathcal{H}$ ) 40: return ( $\mathcal{Q}, \mathcal{H}$ ) + +the $i$ -th perturbation as $\epsilon_{i} = \epsilon' + \eta_{i}$ . Note that, for $\mathrm{PGD_U}$ and $\mathrm{IFGSM_U}$ , after one attack we end up with $n = 100$ perturbed examples. We set $n = 1$ when these attacks are used as a defense mechanism in Algorithm $\boxed{1}$ . Indeed since the adversarial training is iterative, we do not need to sample numerous perturbations for each example: we sample a new perturbation each time the example is forwarded through the decision trees. We also consider a naive defense referred to as UNIF that only adds a noise uniformly such that the $\ell_p$ -norm of the added noise is lower than $b$ . + +We study the following scenarios of defense/attack. These scenarios correspond to all the pairs (Defense, Attack) belonging to the set $\{\text{一},\text{UNIF,PGD,IFGSM}\} \times \{\text{一,PGD,IFGSM}\}$ for the baseline, and $\{\text{一,UNIF,PGD_U,IFGSM_U}\} \times \{\text{一,PGD_U,IFGSM_U}\}$ , where “—” means that we do not defend, i.e., the attack returns the original example (note that $\mathrm{PGD_U}$ and $\mathrm{IFGSM_U}$ when “Attack without U” refers to PGD and IFGSM for computing the classical adversarial risk $R^{\mathrm{ROB}}()$ + +Datasets and algorithm description. We perform our experiment on six binary classification tasks from MNIST [LeCun et al., 1998] (1vs7, 4vs9, 5vs6) and Fashion MNIST [Xiao et al., 2017] (Coat vs Shirt, Sandal vs Ankle Boot, Top vs Pullover). We decompose the learning set into two disjoint subsets $S'$ of around 7,000 examples (to learn the prior and the voters) and $S$ of exactly 5,000 examples (to learn the posterior). We keep as test set $T$ the original test set that contains around 2,000 examples. Moreover, we need a perturbed test set, denoted by $\mathbf{T}$ , to compute our averaged(-max) adversarial risks. Depending on the scenario, $\mathbf{T}$ is constructed from $T$ by attacking the prior model $H_{\mathcal{P}}$ with $PGD_U$ or $IFGSM_U$ with $n = 100$ (more details are given in Appendix). We run our Algorithm [1] for Equation [9] (Theorem [6], respectively Equation [12] (Theorem [7], and we compute our risk $R_{\mathbf{T}}(H_{\mathcal{Q}})$ , respectively $A_{\mathbf{T}}(H_{\mathcal{Q}})$ , the bound value and the usual adversarial risk associated to the model learned $R_{T}^{ROB}(H_{\mathcal{Q}})$ . Note that, during the evaluation of the bounds, we have to compute our relaxed adversarial risks $R_{\mathbf{S}}(H_{\mathcal{Q}})$ and $A_{\mathbf{S}}(H_{\mathcal{Q}})$ on $S$ . For Step 1, the initial prior $P_0$ is fixed to the uniform distribution, the initial set of voters $\mathcal{H}_0$ is constructed with weights initialized with Xavier Initializer [Glorot and Bengio, 2010] and bias initialized at 0 (more details are given in Appendix). During Step 2, to optimize the bound, we fix the confidence parameter $\delta = 0.05$ , and we consider as the set of voters $\mathcal{H}$ two settings: $\mathcal{H}$ as it is output by Step 1, and the set $\mathcal{H}^{\mathrm{SIGN}} = \{h'(\cdot) = \mathrm{sign}(h(\cdot)) | h \in \mathcal{H}\}$ for which the theoretical results are still valid (we will see that in this latter situation we are able to better minimize the TV term of Theorem [7]). For the two steps, we use Adam optimizer [Kingma and Ba, 2015] for $T = T' = 20$ epochs with a learning rate at $10^{-2}$ and a batch size at 64. + +Table 1: Test risks and bounds for MNIST 1vs7 with $n = 100$ perturbations for all pairs (Defense, Attack) with the two voters' set $\mathcal{H}$ and $\mathcal{H}^{\mathrm{SIGN}}$ . The results in bold correspond to the best values between results for $\mathcal{H}$ and $\mathcal{H}^{\mathrm{SIGN}}$ . To quantify the gap between our risks and the classical definition we put in italic the risk of our models against the classical attacks: we replace $\mathrm{PGD_U}$ and $\mathrm{IFGSM_U}$ by PGD or IFGSM (i.e., we did not sample from the uniform distribution). Since Eq. (12) upper-bounds Eq. (11) thanks to the TV term, we compute the two bound values of Theorem 7. + +
l2-normb=1Algo1 with Eq. 9Algo1 with Eq. 12
Attack without URT(HQ)Th.6Attack without URT(HQ)A_T(H_Q)Th.7-Eq. (12)
DefenseAttackHSIGNHHSIGNHHSIGNHHSIGNHHSIGNHHSIGNHHSIGNH
.005.005.005.005.017.019.005.005.005.005.005.0990.100.099
PGDU.245.255.263.276.577.448.315.313.325.326.8011.667.684.515
IFGSMU.084.086.066.080.170.185.117.113.106.110.3561.431.286.251
UNIF.005.005.005.005.018.019.005.005.005.005.0990.100.099.100
UNIFPGDU.151.146.151.158.355.292.183.178.190.189.5311.620.454.355
UNIFIFGSMU.063.061.031.035.088.114.071.070.056.054.2481.405.200.186
PGDU.006.007.006.007.023.024.006.007.006.007.1020.103.102.103
PGDUPGDU.028.030.021.025.065.064.028.029.025.028.1431.389.137.136
PGDUIFGSMU.021.022.013.016.043.045.022.022.018.019.1251.362.121.119
IFGSMU.006.007.006.007.019.021.006.007.006.007.1000.102.100.102
IFGSMUPGDU.040.041.033.035.086.094.040.039.040.038.1841.368.166.163
IFGSMUIFGSMU.021.022.013.014.039.049.021.022.018.021.1311.329.122.123
+ +![](images/56963d61554a7d86b470898addfdf57a091181026c6ebaaa2a3a3fb23d5a9c07.jpg) +Figure 1: Visualization of the impact of the TV term in Equation (12). The left, respectively the right, bar plot show the bounds for the set of voters $\mathcal{H}^{\mathrm{SIGN}}$ , respectively $\mathcal{H}$ . We plot the bounds for all the scenarios of Table 1 that use the TV distance, i.e., all except the pairs $(\cdot, -)$ . In orange we represent the value of the TV term while in blue we represent all the remaining terms of the bound. + +![](images/45f9c3c5c154826debcf6b1caa9f75214b71c52f6db21c0115ea7f4711006007.jpg) + +Analysis of the results. For the sake of readability, we exhibit the detailed results for one task (MNIST:1vs7) and all the pairs (Defense,Attack) with $\ell_2$ -norm in Table 1 and we report in Figure 1 the influence of the TV term in the bound of Theorem 7 (Equation (12)). The detailed results on the other tasks are reported in Appendix; We provide in Figure 2 an overview of the results we obtained on all the tasks for the pairs (Defense,Attack) where "Defense=Attack" and with $\mathcal{H}^{\mathrm{SIGN}}$ . + +First of all, from Table 1 the bounds of Theorem 6 are tighter than the ones of Theorem 7: this is an expected result since we showed that the averaged-max adversarial risk $A_{\mathbf{D}^n}(H_{\mathcal{Q}})$ is more pessimistic than its averaged counterpart $R_{\mathbf{D}}(H_{\mathcal{Q}})$ . Note that the bound values of Equation (11) are tighter than the ones of Equation (12). This is expected since Equation (11) is a lower bound on Equation (12). + +Second, the bounds with $\mathcal{H}^{\mathrm{SIGN}}$ are all informative (lower than 1) and give insightful guarantees for our models. For Theorem [7] (Equation [12]) with $\mathcal{H}$ , while the risks are comparable to the risks obtained with $\mathcal{H}^{\mathrm{SIGN}}$ , the bound values are greater than 1, meaning that we have no more guarantee on the model learned. As we can observe in Figure [1], this is due to the TV term involved in the bound. Considering $\mathcal{H}^{\mathrm{SIGN}}$ when optimizing $A(\cdot)$ helps to control the TV term. Even if the bounds are non-vacuous for Theorem [6] with $\mathcal{H}$ , the best models with the best guarantees are obtained with $\mathcal{H}^{\mathrm{SIGN}}$ . This is confirmed by the columns $R_{\mathcal{T}}^{\mathrm{ROB}}(H_{\mathcal{Q}})$ that are always worse than $R_{\mathbf{T}}(H_{\mathcal{Q}})$ and mostly worse than $A_{\mathbf{T}}(H_{\mathcal{Q}})$ with $\mathcal{H}^{\mathrm{SIGN}}$ . The performance obtained with $\mathcal{H}^{\mathrm{SIGN}}$ can be explained by the fact that the sign "saturates" the output of the voters which makes the majority vote more robust to noises. Thus, we focus the rest of the analysis on results obtained with $\mathcal{H}^{\mathrm{SIGN}}$ . + +Third, we observe that the naive defense UNIF is able to improve the risks $R_{\mathbf{T}}(H_{\mathcal{Q}})$ and $A_{\mathbf{T}}(H_{\mathcal{Q}})$ , but the improvement with the defenses based on $\mathrm{PGD_U}$ and $\mathrm{IFGSM_U}$ is much more significant specifically against a $\mathrm{PGD_U}$ attack (up to 13 times better). We observe the same phenomenon for both bounds + +![](images/b2249c39072ad3ebb32f7d09e0aed4b663c583a041595a5efc4d36e9a3fdbeab.jpg) +Figure 2: Visualization of the risk and bound values when "Defense=Attack" when the set of voters is $\mathcal{H}^{\mathrm{SIGN}}$ . Results obtained with the $\mathrm{PGD_U}$ , respectively IFGSMU, defense are represented by a star $\star$ , respectively a circle $\bullet$ (reminder: $R_{\mathcal{T}}^{\mathrm{ROB}}(H_{\mathcal{Q}})$ is computed with a PGD, respectively IFGSM, attack). The dashed line corresponds to bisecting line $y = x$ . For $R_{\mathbf{T}}(H_{\mathcal{Q}})$ and $A_{\mathbf{T}}(H_{\mathcal{Q}})$ , the closer the datasets are to the bisecting line, the more accurate our relaxed risk is compared to the classical adversarial risk $R_{\mathcal{T}}^{\mathrm{ROB}}(H_{\mathcal{Q}})$ . For the bounds, the closer the datasets are to the bisecting line, the tighter the bound. + +(Theorems 6 and 7). This is an interesting fact because this behavior confirms that we are able to learn models that are robust against the attacks tested with theoretical guarantees. + +Lastly, from Figure 2 and Table 1 it is important to notice that the gap between the classical risk and our relaxed risks is small, meaning that our relaxation are not too optimistic. Despite the pessimism of the classical risk $R_{\mathcal{T}}^{\mathrm{ROB}}(H_{\mathcal{Q}})$ , it remains consistent with our bounds, i.e., it is lower than the bounds. In other words, in addition to giving upper bounds for our risks $R_{\mathbf{T}}(H_{\mathcal{Q}})$ and $A_{\mathbf{T}}(H_{\mathcal{Q}})$ , our bounds give non-vacuous guarantees on the classical risks $R_{\mathcal{T}}^{\mathrm{ROB}}(H_{\mathcal{Q}})$ . + +# 5 Conclusion + +To the best of our knowledge, our work is the first one that studies from a general standpoint adversarial robustness through the lens of the PAC-Bayesian framework. We have started by formalizing a new adversarial robustness setting (for binary classification) specialized for models that can be expressed as a weighted majority vote; we referred to this setting as Adversarially Robust PAC-Bayes. This formulation allowed us to derive PAC-Bayesian generalization bounds on the adversarial risk of general majority votes. We illustrated the usefulness of this setting on the training of (differentiable) decision trees. Our contribution is mainly theoretical and it does not appear to directly lead to potentially negative social impact. + +This work gives rise to many interesting questions and lines of future research. Some perspectives will focus on extending our results to other classification settings such as multiclass or multilabel. Another line of research could focus on taking advantage of other tools of the PAC-Bayesian literature. Among them, we can make use of other bounds on the risk of the majority vote that take into consideration the diversity between the individual voters; For example, the C-bound [Lacasse et al., 2006], or more recently the tandem loss [Masegosa et al., 2020]. Another very recent PAC-Bayesian bound for majority votes that needs investigation in the case of adversarial robustness is the one proposed by Zantedeschi et al. [2021] that has the advantage to be directly optimizable with the 0-1 loss. Last but not least, in real-life applications, one often wants to combine different input sources (from different sensors, cameras, etc). Being able to combine these sources in an effective way is then a key issue. We believe that our new adversarial robustness setting can offer theoretical guarantees and well-founded algorithms when the model we learn is expressed as a majority vote, whether for ensemble methods with weak voters [e.g. Roy et al., 2011; Lorenzen et al., 2019], or for fusion of classifiers [e.g. Morvant et al., 2014], or for multimodal/multiview learning [e.g. Sun et al., 2017; Goyal et al., 2019]. + +# Acknowledgments and Disclosure of Funding + +This work was partially funded supported by the French Project APRIORI ANR-18-CE23-0015. G. Vidot is supported by the ANRT with the convention "CIFRE" N°2019/0507. We also thank all anonymous reviewers for their constructive comments, and the time they took to review our work. + +# References + +Nicholas Carlini and David Wagner. Towards Evaluating the Robustness of Neural Networks. In IEEE Symposium on Security and Privacy, 2017. +Jeremy Cohen, Elan Rosenfeld, and Zico Kolter. Certified Adversarial Robustness via Randomized Smoothing. In ICML, 2019. +Gintare Karolina Dziugaite and Daniel Roy. Data-dependent PAC-Bayes priors via differential privacy. In NeurIPS, 2018. +Gintare Karolina Dziugaite, Kyle Hsu, Waseem Gharbieh, Gabriel Arpino, and Daniel Roy. On the role of data in PAC-Bayes. In AISTATS, 2021. +Farzan Farnia, Jesse Zhang, and David Tse. Generalizable Adversarial Training via Spectral Normalization. In ICLR, 2019. +Timon Gehr, Matthew Mirman, Dana Drachsler-Cohen, Petar Tsankov, Swarat Chaudhuri, and Martin Vechev. AI2: Safety and Robustness Certification of Neural Networks with Abstract Interpretation. In IEEE Symposium on Security and Privacy, 2018. +Pascal Germain, Alexandre Lacasse, François Laviolette, Mario Marchand, and Jean-Francis Roy. Risk Bounds for the Majority Vote: From a PAC-Bayesian Analysis to a Learning Algorithm. JMLR, 2015. +Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In AISTATS, 2010. +Ian Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and Harnessing Adversarial Examples. In *ICLR*, 2015. +Anil Goyal, Emilie Morvant, Pascal Germain, and Massih-Reza Amini. Multiview Boosting by Controlling the Diversity and the Accuracy of View-specific Voters. Neurocomputing, 2019. +Dan Hendrycks and Thomas Dietterich. Benchmarking Neural Network Robustness to Common Corruptions and Perturbations. In ICLR, 2019. +Xiaowei Huang, Marta Kwiatkowska, Sen Wang, and Min Wu. Safety Verification of Deep Neural Networks. In CAV, 2017. +Xiaowei Huang, Daniel Kroening, Wenjie Ruan, James Sharp, Youcheng Sun, Emese Thamo, Min Wu, and Xinping Yi. A survey of safety and trustworthiness of deep neural networks: Verification, testing, adversarial attack and defence, and interpretability. Computer Science Review, 2020. +Guy Katz, Clark Barrett, David Dill, Kyle Julian, and Mykel Kochenderfer. Reluplex: An Efficient SMT Solver for Verifying Deep Neural Networks. In CAV, 2017. +Justin Khim and Po-Ling Loh. Adversarial Risk Bounds for Binary Classification via Function Transformation. CoRR, 2018. +Diederik Kingma and Jimmy Ba. Adam: A Method for Stochastic Optimization. In ICLR, 2015. +Peter Kontschieder, Madalina Fiterau, Antonio Criminisi, and Samuel Rota Bulò. Deep Neural Decision Forests. In *IJCAI*, 2016. +Alexey Kurakin, Ian Goodfellow, and Samy Bengio. Adversarial Machine Learning at Scale. In ICLR, 2017. + +Alexandre Lacasse, François Laviolette, Mario Marchand, Pascal Germain, and Nicolas Usunier. PAC-Bayes Bounds for the Risk of the Majority Vote and the Variance of the Gibbs Classifier. In NIPS, 2006. +Yann LeCun, Corinna Cortes, and Christopher Burges. THE MNIST DATASET of handwritten digits, 1998. URL http://yann.lecun.com/exdb/mnist/. +Guy Lever, François Laviolette, and John Shawe-Taylor. Tighter PAC-Bayes bounds through distribution-dependent priors. Theoretical Computer Science, 2013. +Stephan Sloth Lorenzen, Christian Igel, and Yevgeny Seldin. On PAC-Bayesian bounds for random forests. Machine Learning, 2019. +Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards Deep Learning Models Resistant to Adversarial Attacks. In ICLR, 2018. +Andrés Masegosa, Stephan Sloth Lorenzen, Christian Igel, and Yevgeny Seldin. Second Order PAC-Bayesian Bounds for the Weighted Majority Vote. In NeurIPS, 2020. +David McAllester. Some PAC-Bayesian Theorems. In $COLT$ , 1998. +Omar Montasser, Steve Hanneke, and Nathan Srebro. VC Classes are Adversarily Robustly Learnable, but Only Improperly. In $COLT$ , 2019. +Omar Montasser, Steve Hanneke, and Nathan Srebro. Reducing Adversarially Robust Learning to Non-Robust PAC Learning. In NeurIPS, 2020. +Emilie Morvant, Amaury Habrard, and Stéphane Ayache. Majority Vote of Diverse Classifiers for Late Fusion. In S+SSPR, 2014. +Vaishnavh Nagarajan and J. Zico Kolter. Uniform convergence may be unable to explain generalization in deep learning. In NeurIPS, 2019. +Yuki Ohnishi and Jean Honorio. Novel Change of Measure Inequalities with Applications to PAC-Bayesian Bounds and Monte Carlo Estimation. In AISTATS, 2021. +Nicolas Papernot, Patrick McDaniel, Somesh Jha, Matt Fredrikson, Z. Berkay Celik, and Ananthram Swami. The Limitations of Deep Learning in Adversarial Settings. In IEEE EuroS&P, 2016. +Emilio Parrado-Hernández, Amiran Ambroladze, John Shawe-Taylor, and Shiliang Sun. PAC-bayes bounds with data dependent priors. JMLR, 2012. +Liva Ralaivola, Marie Szafranski, and Guillaume Stempfel. Chromatic PAC-Bayes Bounds for Non-IID Data: Applications to Ranking and Stationary $\beta$ -Mixing Processes. JMLR, 2010. +David Reeb, Andreas Doerr, Sebastian Gerwinn, and Barbara Rakitsch. Learning Gaussian Processes by Minimizing PAC-Bayesian Generalization Bounds. In NeurIPS, 2018. +Kui Ren, Tianhang Zheng, and Xue Liu. Adversarial Attacks and Defenses in Deep Learning. Engineering, 2020. +Jean-Francis Roy, François Laviolette, and Mario Marchand. From PAC-Bayes Bounds to Quadratic Programs for Majority Votes. In ICML, 2011. +Hadi Salman, Jerry Li, Ilya Razenshteyn, Pengchuan Zhang, Huan Zhang, Sébastien Bubeck, and Greg Yang. Provably Robust Deep Learning via Adversarially Trained Smoothed Classifiers. In NeurIPS, 2019. +Edward Scheinerman and Daniel Ullman. *Fractional Graph Theory: A Rational Approach to the Theory of Graphs*. Courier Corporation, 2011. +Matthias Seeger. PAC-Bayesian Generalisation Error Bounds for Gaussian Process Classification. JMLR, 2002. +John Shawe-Taylor and Robert Williamson. A PAC Analysis of a Bayesian Estimator. In $COLT$ , 1997. + +Gagandeep Singh, Timon Gehr, Markus Puschel, and Martin Vechev. Boosting Robustness Certification of Neural Networks. In ICLR, 2019. +Shiliang Sun, John Shawe-Taylor, and Liang Mao. PAC-Bayes analysis of multi-view learning. Inf. Fusion, 2017. +Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In *ICLR*, 2014. +Yusuke Tsuzuki, Issei Sato, and Masashi Sugiyama. Lipschitz-Margin Training: Scalable Certification of Perturbation Invariance for Deep Neural Networks. In NeurIPS, 2018. +Han Xiao, Kashif Rasul, and Roland Vollgraf. Fashion-MNIST: a Novel Image Dataset for Benchmarking Machine Learning Algorithms. CoRR, 2017. +Dong Yin, Kannan Ramchandran, and Peter Bartlett. Rademacher Complexity for Adversarially Robust Generalization. In ICML, 2019. +Valentina Zantedeschi, Maria-Irina Nicolae, and Ambrish Rawat. Efficient Defenses Against Adversarial Attacks. In ACM Workshop on Artificial Intelligence and Security, AISec@CCS, 2017. +Valentina Zantedeschi, Paul Viallard, Emilie Morvant, Rémi Emonet, Amaury Habrard, Pascal Germain, and Benjamin Guedj. Learning Stochastic Majority Votes by Minimizing a PAC-Bayes Generalization Bound. In NeurIPS, 2021. \ No newline at end of file diff --git a/apacbayesanalysisofadversarialrobustness/images.zip b/apacbayesanalysisofadversarialrobustness/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..7251e947f37885b97e7934c5eeabe0cd005642dc --- /dev/null +++ b/apacbayesanalysisofadversarialrobustness/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:659c74c53d866d14172d6f4bbfb872f042d0c29c4a910dcf589f02eab88222ab +size 362783 diff --git a/apacbayesanalysisofadversarialrobustness/layout.json b/apacbayesanalysisofadversarialrobustness/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..299c25df88997886d2d60917261cc757dfdf7d77 --- /dev/null +++ b/apacbayesanalysisofadversarialrobustness/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:509534b8e9055bdcbbacc50d56e5d21f79469941af2d3b97d6a84e9cb70e22d4 +size 685298 diff --git a/aprobabilisticstatespacemodelforjointinferencefromdifferentialequationsanddata/806d04c6-16f2-467d-a135-7832b65a045b_content_list.json b/aprobabilisticstatespacemodelforjointinferencefromdifferentialequationsanddata/806d04c6-16f2-467d-a135-7832b65a045b_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..1be59ca195aba990f2ab57c362eb19e368ea2797 --- /dev/null +++ b/aprobabilisticstatespacemodelforjointinferencefromdifferentialequationsanddata/806d04c6-16f2-467d-a135-7832b65a045b_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ca762ccac4efe7464b400db2d09335a7aee841002e1a91368a33fc0be2f95ba +size 73698 diff --git a/aprobabilisticstatespacemodelforjointinferencefromdifferentialequationsanddata/806d04c6-16f2-467d-a135-7832b65a045b_model.json b/aprobabilisticstatespacemodelforjointinferencefromdifferentialequationsanddata/806d04c6-16f2-467d-a135-7832b65a045b_model.json new file mode 100644 index 0000000000000000000000000000000000000000..9cff331624e04302962f5ed4a7683245c0883ba2 --- /dev/null +++ b/aprobabilisticstatespacemodelforjointinferencefromdifferentialequationsanddata/806d04c6-16f2-467d-a135-7832b65a045b_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:23a1582adce7b06cd4ce55550298ade8cededb0063a187ef2fc70f2254fed4cb +size 87985 diff --git a/aprobabilisticstatespacemodelforjointinferencefromdifferentialequationsanddata/806d04c6-16f2-467d-a135-7832b65a045b_origin.pdf b/aprobabilisticstatespacemodelforjointinferencefromdifferentialequationsanddata/806d04c6-16f2-467d-a135-7832b65a045b_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..29ea5e4446221962dc5040a3d4d37df8abeb6e11 --- /dev/null +++ b/aprobabilisticstatespacemodelforjointinferencefromdifferentialequationsanddata/806d04c6-16f2-467d-a135-7832b65a045b_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1a858089075f819d88baa65d3d49a9a094da731c9ceb1607c23ff1d1dfd29f78 +size 740766 diff --git a/aprobabilisticstatespacemodelforjointinferencefromdifferentialequationsanddata/full.md b/aprobabilisticstatespacemodelforjointinferencefromdifferentialequationsanddata/full.md new file mode 100644 index 0000000000000000000000000000000000000000..80118d1275a68244b082dca675a66e02ea606130 --- /dev/null +++ b/aprobabilisticstatespacemodelforjointinferencefromdifferentialequationsanddata/full.md @@ -0,0 +1,308 @@ +# A Probabilistic State Space Model for Joint Inference from Differential Equations and Data + +Jonathan Schmidt + +University of Tübingen + +Tübingen, Germany + +jonathan.schmidt@uni-tuebingen.de + +Nicholas Kramer + +University of Tübingen + +Tübingen, Germany + +nicholas.kraemer@uni-tuebingen.de + +Philipp Hennig + +University of Tübingen + +Max Planck Institute for Intelligent Systems + +Tübingen, Germany + +philipp.hennig@uni-tuebingen.de + +# Abstract + +Mechanistic models with differential equations are a key component of scientific applications of machine learning. Inference in such models is usually computationally demanding, because it involves repeatedly solving the differential equation. The main problem here is that the numerical solver is hard to combine with standard inference techniques. Recent work in probabilistic numerics has developed a new class of solvers for ordinary differential equations (ODEs) that phrase the solution process directly in terms of Bayesian filtering. We here show that this allows such methods to be combined very directly, with conceptual and numerical ease, with latent force models in the ODE itself. It then becomes possible to perform approximate Bayesian inference on the latent force as well as the ODE solution in a single, linear complexity pass of an extended Kalman filter / smoother — that is, at the cost of computing a single ODE solution. We demonstrate the expressiveness and performance of the algorithm by training, among others, a non-parametric SIRD model on data from the COVID-19 outbreak. + +# 1 Introduction + +Mechanistic models based on ordinary differential equations (ODEs) are popular across a wide range of scientific disciplines. To increase the descriptive power of such models, it is common to consider parametrized versions of ODEs and find a set of parameters such that the dynamics reproduce empirical observations as accurately as possible. Algorithms for this purpose typically involve repeated forward simulations in the context of, e.g., Markov-chain Monte Carlo or optimization. The need for iterated computation of ODE solutions may demand simplifications in the model to meet limits in the computational budget. + +This work describes an algorithm that merges mechanistic knowledge in the form of an ODE with a non-parametric model over the parameters controlling the ODE - a latent + +![](images/ab9286e4f316a0839227272ca7336a84d12cafab5ecbfa57acdcbbe4bd9fa975.jpg) + +![](images/94507c06bc083db772d6a53fbb2f99c3d1f7ee6026be8fcf979793ab6c029ace.jpg) +Figure 1: Inferring an unknown function with a Gaussian Process and different sources of information. + +force that represents quantities of interest. The algorithm then infers a trajectory that is informed + +by the observations but also follows sensible dynamics, as defined by the ODE, in the absence of observations (Figure 1). The main insight enabling this approach is that if probabilistic ODE solvers use the language of (extended) Kalman filters, conditioning on observations and solving the ODE itself is possible in one and the same process of Bayesian filtering and smoothing. Instead of iterated computation of ODE solutions, a posterior distribution arises from a single forward simulation, which has complexity equivalent to numerically computing an ODE solution, once, with a filtering-based, probabilistic ODE solver [32]. Intuitively, one can think of this as opening up the black box ODE solver and acknowledging that each task - solving the ODE and discovering a latent force - is probabilistic inference in a state-space model. + +The main contribution of this work is formalizing this intuition. Several experiments empirically prove the efficiency and the expressivity of the resulting algorithm. In particular, a practical model for the dynamics of the COVID-19 pandemic is considered, in which a non-parametric latent force captures the effect of policy measures that continuously change the contact rate among the population. + +# 2 Problem setting + +Let $x:[t_0,t_{\mathrm{max}}]\to \mathbb{R}^d$ be a process that is observed at a discrete set of points $\mathcal{T}_N^{\mathrm{OBS}}\coloneqq (t_0^{\mathrm{OBS}},\dots ,t_N^{\mathrm{OBS}})$ through a sequence of measurements $y_{0:N}\coloneqq (y_0,\ldots ,y_N)\in \mathbb{R}^{(N + 1)\times k}$ . Assume that these measurements are subject to additive i.i.d. Gaussian noise, according to the observation model + +$$ +y _ {n} = H x \left(t _ {n}\right) + \epsilon_ {n}, \quad \epsilon_ {n} \sim \mathcal {N} (0, R), \tag {1} +$$ + +for $n = 0,\dots ,N$ and matrices $H\in \mathbb{R}^{k\times d}$ and $R\in \mathbb{R}^{k\times k}$ . Further suppose that $x(t)$ solves the ODE + +$$ +\dot {x} (t) = f (x (t); u (t)), \tag {2} +$$ + +and satisfies the initial condition $x(t_0) = x_0 \in \mathbb{R}^d$ . The vector field $f: \mathbb{R}^d \times \mathbb{R}^\ell \to \mathbb{R}^d$ is assumed to be autonomous, which is no loss of generality (e.g. [19]) but simplifies the notation. The latent force $u: [t_0, t_{\max}] \to \mathbb{R}^\ell$ parametrizes $f$ and shall be unknown. + +![](images/1b6de5ee974b334e96473d69dc6ae9be4e011c29564e92343d55370862d83f55.jpg) +Figure 2: SIRD dynamics. + +SIR-type models (e.g. [7]) are a common choice to describe the evolution of the COVID-19 pandemic. In SIR-type models, a population partitions into a discrete set of compartments. The differential equation then describes the transition of counts of individuals between these compartments. For example, the SIRD model [10] formulates the transitions between susceptible, infectious, recovered, and deceased people as + +$$ +\begin{array}{l l} \dot {S} (t) = - \beta (t) S (t) I (t) / P, & \dot {R} (t) = \gamma I (t), \\ \dot {I} (t) = \beta (t) S (t) I (t) / P - \gamma I (t) - \eta I (t), & \dot {D} (t) = \eta I (t), \end{array} \tag {3} +$$ + +governed by contact rate $\beta(t): [t_0, t_{\max}] \to [0,1]$ , recovery rate $\gamma \in [0,1]$ , and mortality rate $\eta \in [0,1]$ (Figure 2). $S$ , $I$ , $R$ , and $D$ evolve over time, but the total population $P$ (as the sum of the compartments) + +is assumed to remain constant. In this context, the contact rate $\beta(t)$ is the latent force and varies over time (in the notation from Eq. (2), $\beta$ is $u$ ). A time-varying contact rate provides a model for the impact of governmental measures on the dynamics of the pandemic. The experiments in Section 5 isolate the impact of the contact rate on the course of the infection counts, by assuming that $\gamma$ and $\eta$ are fixed and known. The method is by no means restricted to inference over a single latent force, as will also be shown in Section 5.1. In this SIRD setting, the goal is to infer an (approximate) joint posterior over $\beta(t)$ and the dynamics of $S(t)$ , $I(t)$ , $R(t)$ , and $D(t)$ as well as to use the reconstructed dynamics to extrapolate into the future. Section 3 explains the conceptual details, Section 4 distinguishes the method from related work, and Section 5 evaluates the performance. + +# 3 Method + +This section explains how to infer the unknown process $u(t)$ and the ODE solution $x(t)$ in a single forward solve. Section 3.1 defines the prior model, Section 3.2 describes the probabilistic numerical ODE inference setup, and Section 3.3 describes approximate Gaussian filtering and smoothing in this context. Section 3.4 summarizes the resulting algorithm. The exposition of classic concepts here is necessarily compact. In-depth introductions can be found, e.g., in the book by Särkkä and Solin [28]. + +# 3.1 Gauss-Markov prior + +Let $\nu \in \mathbb{N}$ . Define two independent Gauss-Markov processes $\mathrm{U}:[t_0,t_{\max}]\to \mathbb{R}^{\ell}$ and $\mathrm{X}:[t_0,t_{\max}]\to \mathbb{R}^{d(\nu +1)}$ that solve the linear, time-invariant stochastic differential equations [25], + +$$ +\mathrm {d} \mathrm {U} (t) = F _ {\mathrm {U}} \mathrm {U} (t) \mathrm {d} t + L _ {\mathrm {U}} \mathrm {d W} _ {\mathrm {U}} (t), \quad \mathrm {d X} (t) = F _ {\mathrm {X}} \mathrm {X} (t) \mathrm {d} t + L _ {\mathrm {X}} \mathrm {d W} _ {\mathrm {X}} (t), \tag {4} +$$ + +with drift matrices $F_{\mathrm{U}} \in \mathbb{R}^{\ell \times \ell}$ and $F_{\mathrm{X}} \in \mathbb{R}^{d(\nu + 1) \times d(\nu + 1)}$ , as well as dispersion matrices $L_{\mathrm{U}} \in \mathbb{R}^{\ell \times s}$ and $L_{\mathrm{X}} \in \mathbb{R}^{d(\nu + 1) \times d}$ . $\mathrm{W_U}: [t_0, t_{\max}] \to \mathbb{R}^s$ and $\mathrm{W_X}: [t_0, t_{\max}] \to \mathbb{R}^d$ are Wiener processes. U and X satisfy the Gaussian initial conditions, + +$$ +\mathrm {U} \left(t _ {0}\right) \sim \mathcal {N} \left(m _ {\mathrm {U}}, P _ {\mathrm {U}}\right), \quad \mathrm {X} \left(t _ {0}\right) \sim \mathcal {N} \left(m _ {\mathrm {X}}, P _ {\mathrm {X}}\right), \tag {5} +$$ + +defined by $m_{\mathrm{U}} \in \mathbb{R}^{\ell}$ , $P_{\mathrm{U}} \in \mathbb{R}^{\ell \times \ell}$ , $m_{\mathrm{X}} \in \mathbb{R}^{d(\nu + 1)}$ , and $P_{\mathrm{U}} \in \mathbb{R}^{d(\nu + 1) \times d(\nu + 1)}$ . $\mathrm{U}(t)$ models the unknown function $u(t)$ and can be any Gauss-Markov process that admits a representation as the solution of a linear SDE with Gaussian initial conditions. $\mathrm{X}(t) = (\mathrm{X}^{(0)}(t), \dots, \mathrm{X}^{(\nu)}(t)) \in \mathbb{R}^{d(\nu + 1)}$ models the ODE dynamics, in light of which we require $\mathrm{X}^{(i)}(t) = \frac{\mathrm{d}^i}{\mathrm{d}t^i}\mathrm{X}^{(0)}(t) \in \mathbb{R}^d$ , $i = 0, \dots, \nu$ . In other words, the first element in $\mathrm{X}(t)$ is an estimate for $x(t)$ , the second element is an estimate for $\frac{\mathrm{d}}{\mathrm{d}t} x(t)$ , et cetera. Encoding that the state $\mathrm{X}$ consists of a model for $x(t)$ as well as its first $\nu$ derivatives imposes structure on $F_{\mathrm{X}}$ and $L_{\mathrm{X}}$ (see e.g. [18]). Examples include the Matérn, integrated Ornstein-Uhlenbeck, and integrated Wiener processes; the canonical choice for probabilistic ODE solvers would be integrated Wiener processes [29, 32, 4, 19]. + +The class of Gauss-Markov priors inherits its wide generalizability from Gaussian process models; recall that Gauss-Markov processes like U and X are Gaussian processes with the Markov property. While not every Gaussian process with one-dimensional input space is Markovian, a large number of descriptions of Gauss-Markov processes emerge by translating a covariance function into an (approximate) SDE representation [28, Chapter 12]. For example, this applies to (quasi-)periodic, squared-exponential, or rational quadratic kernels; in particular, sums and products of Gauss-Markov processes admit a state-space representation [30, 28]. Recent research has considered approximate SDE representations of general Gaussian processes in one dimension [20]. With these tools, prior knowledge over U or X can be encoded straightforwardly into the model. + +# 3.2 Two likelihoods: for observations and for the ordinary differential equation + +A functional relationship between the processes $\mathrm{U}(t)$ , $\mathrm{X}(t)$ and the data $y_{0:N}$ emerges by combining two likelihood functions: one for the observations $y_{0:N}$ (recall Equation (1)), and one for the ordinary differential equation. The present section formalizes both. Let $\mathcal{T} = \mathcal{T}_N^{\mathrm{OBS}} \cup \mathcal{T}_M^{\mathrm{ODE}}$ be the union of the observation-grid $\mathcal{T}_N^{\mathrm{OBS}}$ , which has been introduced in Section 2, and an ODE-grid $\mathcal{T}_M^{\mathrm{ODE}} := (t_0^{\mathrm{ODE}}, \dots, t_M^{\mathrm{ODE}})$ . The name "ODE-grid" expresses that this grid contains the locations on which the ODE information will enter the inference problem, as described below. + +$T_{N}^{\mathrm{obs}}$ contains the locations of $y_{0:N}$ , in light of which the first of two observation models is + +$$ +\mathrm {Y} _ {n} \mid \mathrm {X} \left(t _ {n} ^ {\mathrm {o b s}}\right) \sim \mathcal {N} \left(H \mathrm {X} ^ {(0)} \left(t _ {n} ^ {\mathrm {o b s}}\right), R\right), \tag {6} +$$ + +for $n = 0,\ldots ,N$ . This is a reformulation of the relationship between process $x$ and observations $y_{0:N}$ in Eq. (1) in terms of $\mathrm{X}$ (instead of $x$ , which is modeled by $\mathrm{X}^{(0)})$ ). Including this first measurement model ensures that the inferred solution remains close to the data points. $\mathcal{T}_M^{\mathrm{ODE}}$ contains the locations on which $\mathrm{U}(t)$ connects to $\mathrm{X}(t)$ through the ODE. Specifically, the set of random variables $Z_{0:M}\in \mathbb{R}^{(M + 1)\times d}$ , defined as + +$$ +\left. \mathrm {Z} _ {m} \mid \mathrm {X} \left(t _ {m} ^ {\mathrm {O D E}}\right), \mathrm {U} \left(t _ {m} ^ {\mathrm {O D E}}\right) \sim \delta \left(\mathrm {X} ^ {(1)} \left(t _ {m} ^ {\mathrm {O D E}}\right) - f \left(\mathrm {X} ^ {(0)} \left(t _ {m} ^ {\mathrm {O D E}}\right); \mathrm {U} \left(t _ {m} ^ {\mathrm {O D E}}\right)\right)\right), \right. \tag {7} +$$ + +where $\delta$ is the Dirac delta, describes the discrepancy between the current estimate of the derivative of the ODE solution (i.e. $\mathrm{X}^{(1)}$ ) and its desired value (i.e. $f(\mathrm{X}^{(0)};\mathrm{U})$ ), as prescribed by the vector field $f$ . If the random variables $\mathrm{Z}_{0:M}$ realize small values everywhere, $X^{(0)}$ solves the ODE as parametrized by $U$ . This motivates introducing artificial data points $z_{0:M} \in \mathbb{R}^{(M+1)\times d}$ that are equal to zero, $z_m = 0 \in \mathbb{R}^d$ , $m = 0,\dots,M$ . Conditioning the stochastic processes $\mathrm{X}$ and $\mathrm{U}$ on attaining this (artificial) zero data ensures that the inferred solution follows ODE dynamics throughout the domain. Figure 3 shows the discretized state-space model. + +![](images/7f441c170bd42715b70060b11e46f094a3af9ac23b5a0a29052ca71a2c3a69c0.jpg) +Figure 3: Instance of the described state-space model, visualized as a directed graphical model. Shaded variables are observed. Either only data, only mechanistic knowledge, or both sources of information can be conditioned on during inference (recall Figure 1). + +# 3.3 Approximate inference with an extended Kalman filter + +Both $\mathrm{X}$ and $\mathrm{U}$ enter the likelihood in Eq. (7) through a possibly non-linear vector field $f$ . Therefore, the posterior distribution (recall $z_{0:M} = 0$ ) + +$$ +p \left(\mathrm {U} (t), \mathrm {X} (t) \mid \mathrm {Z} _ {0: M} = z _ {0: M}, \mathrm {Y} _ {0: N} = y _ {0: N}\right) \tag {8} +$$ + +is intractable, but can be approximated efficiently. Even though the problem is discretized, the posterior distribution is continuous [28, Chapter 10]. There are mainly two approaches to computing a tractable approximation of the intractable posterior distribution in Eq. (8): approximate Gaussian filtering and smoothing [27], which computes a cheap, Gaussian approximation of this posterior, and sequential Monte Carlo methods [24], whose approximate posterior may be more descriptive, but also more expensive to compute. Like the literature on probabilistic ODE solvers [32, 4], this work uses approximate Gaussian filtering and smoothing techniques for their low computational complexity. + +The continuous-discrete state-space model inherits its non-linearity from the ODE vector field $f$ . Linearizing $f$ with a first-order Taylor series expansion creates a tractable inference problem; more specifically, it gives rise to the extended Kalman filter (EKF) [13, 22]. Loosely speaking, if the random variable $Z$ is large in magnitude, then $X$ and $U$ are poor estimates for the ODE and its parameter. An EKF update, based on the first-order linearization of $f$ , approximately corrects this misalignment. If sufficiently many ODE measurements $z_{0:M}$ are available, a sequence of such updates preserves sensible ODE dynamics over time. An alternative to a Taylor-series linearization is the unscented transform, which yields the unscented Kalman filter [34, 15]. The computational complexity of both algorithms is linear in the number of grid points and cubic in the dimension of the state-space. Detailed implementation schemes can be found, for instance, in the book by Särkkä [27]. + +The EKF approximates the filtering distribution + +$$ +p \left(\mathrm {U} (t), \mathrm {X} (t) \mid \mathrm {Z} _ {0: m} = z _ {0: m}, \mathrm {Y} _ {0: n} = y _ {0: n}, \text {s u c h t h a t} t _ {m} ^ {\mathrm {O D E}}, t _ {n} ^ {\mathrm {O B S}} \leq t\right). \tag {9} +$$ + +It describes the current state of the system given all the previous measurements and allows updates in an online fashion as soon as new observations emerge. If desired, the Rauch-Tung-Striebel smoother turns the filtering distribution into an approximation of the full (smoothing) posterior (in Eq. (8)). In doing so, all observations – that is, measurements according to both Eq. (6) and Eq. (7) – are taken into account for the posterior distribution at each location $t$ . As special cases, this setup recovers: (i) a Kalman filter/Rauch-Tung-Striebel smoother [16] if the ODE likelihood (Eq. (7)) is omitted; (ii) an ODE solver [32], if the data likelihood (Eq. (6)) is omitted. In the present setting, however, both likelihoods play an important role. + +# 3.4 Algorithm and implementation + +The procedure is summarized in Algorithm 1. The prediction step is determined by the prior and is available in closed-form (Appendix A.2). At times at which data is observed according to the linear Gaussian measurement model in Eq. (6), the update step follows the rules of the standard Kalman filter. Before updating on pseudo-observations according to the ODE likelihood (Eq. (7)), the non-linear measurement model is linearized at the predicted mean. More details are provided + +Algorithm 1 Compute the filtering distribution by conditioning on both $y_{0:N}$ and $z_{0:M}$ . +Input: data $y_{0:N}$ , time grid $\mathcal{T} = \mathcal{T}_N^{\mathrm{OBS}}\cup \mathcal{T}_M^{\mathrm{ODE}}$ , vector field $f,m_{\mathrm{X}},P_{\mathrm{X}},m_{\mathrm{U}},P_{\mathrm{U}}$ +Output: Filtering distribution [Eq. (9)] +Initialize $\mathrm{X_0} = \mathcal{N}(m_{\mathrm{X}},P_{\mathrm{X}})$ and $\mathrm{U_0} = \mathcal{N}(m_{\mathrm{U}},P_{\mathrm{U}})$ [Eq. (5)] +for $t_j\in \mathcal{T}$ do Predict $\mathrm{X}_j$ from $\mathrm{X}_{j - 1}$ and predict $\mathrm{U}_j$ from $\mathrm{U}_{j - 1}$ if $t_j\in \mathcal{T}_N^{\mathrm{OBS}}$ then update $X_{j}$ on $y_{j}$ end if [Eq. (6)] if $t_j\in \mathcal{T}_M^{\mathrm{ODE}}$ then linearize measurement model and update $X_{j}$ and $\mathrm{U}_j$ on $z_{j}$ end if [Eq. (7)] +end for + +in Appendix A. The filtering distribution can be turned into a smoothing posterior by running a backwards-pass with a Rauch-Tung-Striebel smoother (e.g. [27]). + +The computational cost of obtaining either, the filtering or the smoothing posterior, are both linear in the number of grid points and cubic in the dimension of the state-space, i.e. $\mathcal{O}((N + M)(d^3\nu^3 +\ell^3))$ . Only a single forward-backward pass is required. If desired, the approximate Gaussian posterior can be refined iteratively by means of posterior linearization and iterated Gaussian filtering and smoothing, which yields the maximum-a-posteriori (MAP) estimate [2, 31]. The experiments presented in Section 5 show how a single forward-backward pass already approximates the MAP estimate accurately. + +# 4 Related work + +Latent forces and ODE solvers: The explained method closely relates to probabilistic ODE solvers and latent force models [37], especially the kind of latent force model that exploits the state-space formulation of the prior [9]. The difference is that, in the spirit of probabilistic numerical algorithms, the mechanistic knowledge in the form of an ODE is injected through the likelihood function instead of the prior. A similar approach of linking observations to mechanistic constraints has previously been used in the literature on constrained Gaussian processes [14] and gradient matching [5, 36]. Probabilistic ODE solvers have been used by Kersting et al. [17] for efficient ODE inverse problem algorithms, but their approach is different to the present algorithm, in which the need for iterated optimization or sampling is avoided altogether. + +Monte Carlo methods: (Markov-chain) Monte Carlo methods are also able to infer a time-dependent ODE latent force from a set of state observations. Options that are compatible with a setup similar to the present work would include sequential Monte Carlo techniques [24], elliptical slice sampling [23], or Hamiltonian Monte Carlo [3] (for instance realized as the No-U-Turn sampler [12]). The shared disadvantage of Monte Carlo methods applied to the resulting ODE inverse problem is that the complexity of obtaining a single Monte Carlo sample is of the same order of magnitude as computing the full Gaussian approximation of the posterior distribution. In Appendix B we show results from a parametric version of the SIRD-latent force model (using the No-U-Turn sampler as provided by NumPyro [26]). This sampler requires thousands of numerical ODE solutions, compared to the single solve of our method. This fact is also reflected in the wall-clock time needed for both types of inference. While the MCMC experiment in Appendix B takes in the order of hours, each experiment with our approach takes under one minute to complete. In other words, the algorithm in the present work poses an efficient yet expressive alternative to Monte Carlo methods for approximate inference with dynamical systems. + +# 5 Experiments + +This section describes three blocks of experiments. The implementation is based on ProbNum [35] and all experiments use a conventional, consumer-level CPU. First, a range of artificial datasets is generated by sampling ODE parameters from a prior state-space model and simulating a solution of the corresponding ODE. Inference in such a controlled environment allows comparing to the ground truth, thereby assessing the quality of the approximate inference. We consider three ODE models to this end. Second, a COVID-19 dataset will probe the predictive performance of the probabilistic model and the resulting approximate posterior distribution. Third, some changes to the model from the COVID-19 experiments, for instance, ensuring that the number of case counts must be positive, + +will improve the interpretability (for example, of the credible intervals). Controlling the range of values that the prior state-space can realize introduces additional non-linearity into the model – which can also be locally approximated by the EKF – and makes the solution more physically meaningful. + +# 5.1 Simulated environments + +As a first test for the capabilities of the proposed method, we consider three simulated environments. To this end, the training data is generated as follows. The starting point is always an initial value problem with dynamics defined by a vector field $f$ and a Gauss-Markov prior over the dynamics $x$ and the unknown parameters $u$ of the vector field. Then, (i) we sample the time-varying parameter trajectories from the Gauss-Markov prior; (ii) we solve the ODE, as parametrized by the sampled trajectories from (i), using LSODA [11] with adaptive step sizes using SciPy [33]; (iii) we subsample the ground-truth solution on a uniform grid (which will become $\mathcal{T}_N^{\mathrm{OBS}}$ ) to generate artificial state observations $y_{0:N}$ ; (iv) we add Gaussian i.i.d. noise to the observations. + +The procedure described above generates both a ground truth to compare to and a noisy, artificially observed data set. Given such a set of observations, Algorithm 1 computes a posterior distribution over the true trajectories under appropriate model assumptions. In this posterior, we look for the proximity of the mean estimate to the underlying ground truth; the closer, the better. We measure this proximity in the root-mean-square error. Furthermore, the width of the posterior (expressed by the posterior covariance) should deliver an appropriate quantification of the mismatch. We report the $\chi^2$ -statistic [1], which suggests that the posterior distribution is well-calibrated if the $\chi^2$ -statistic is close to the dimension $d$ of the ground truth. Three mechanistic models serve as examples. + +Vander-Pol: The first of three test problems is the van-der-Pol oscillator [8]. It has one parameter $\mu$ (sometimes referred to as a stiffness constant, because for large $\mu$ , the van-der-Pol system is stiff). As a prior over the dynamics we choose a twice-integrated Wiener process with diffusion intensity $\sigma_{\mathrm{X}}^{2} = 300$ . The stiffness parameter $\mu$ is modeled as a Matérn- $3 / 2$ process with lengthscale $\ell_{\mathrm{U}} = 10$ and diffusion intensity $\sigma_{\mathrm{U}}^{2} = 0.3$ . The posterior is computed on a grid from $t_0 = 0$ to $t_{\max} = 25$ units of time with step size $\Delta t = 0.025$ . + +Lotka-Volterra: The Lotka-Volterra equations [21] describe the change in the size of two populations, predators and prey. There are four parameters, which we call $a$ , $b$ , $c$ , and $d$ , which describe the interaction and death/reproduction rates of the populations. As a prior over the dynamics we choose a twice-integrated Wiener process with diffusion intensity $\sigma_{\mathrm{X}}^{2} = 10$ . The four parameters are modeled as Matérn-3/2 processes with lengthscales $\ell_{\mathrm{U}_a} = \ell_{\mathrm{U}_b} = \ell_{\mathrm{U}_c} = \ell_{\mathrm{U}_d} = 40$ . The diffusion intensities are $\sigma_{\mathrm{U}_a}^2 = \sigma_{\mathrm{U}_c}^2 = 0.01$ and $\sigma_{\mathrm{U}_b}^2 = \sigma_{\mathrm{U}_d}^2 = 0.001$ . The posterior is computed on a grid from $t_0 = 0$ to $t_{\max} = 60$ units of time with step size $\Delta t = 0.1$ . + +SIRD: As detailed in Section 2, the SIRD model is governed by a contact rate $\beta(t)$ . Recall that we assume a time-dependent $\beta$ to account for governmental measures in reaction to the spread of COVID-19. The recovery rate $\gamma$ and fatality rate $\eta$ are fixed at $\gamma = 0.06$ and $\eta = 0.002$ , like they will be in the experiments with real data in Sections 5.2 and 5.3 below. As a prior over the dynamics we choose a twice-integrated Wiener process with diffusion intensity $\sigma_{\mathrm{X}}^{2} = 50$ . The contact rate $\beta$ is modeled as a Matérn- $3/2$ process with lengthscale $\ell_{\mathrm{U}} = 14$ and diffusion intensity $\sigma_{\mathrm{U}}^{2} = 0.1$ . The posterior is computed on a grid from $t_0 = 0$ to $t_{\max} = 100$ units of time with step size $\Delta t = 0.1$ . + +The model allows for straightforward restriction of parameter values by using link functions. The natural support for the SIRD-contact rate is the interval $[0,1]$ , but $\mathrm{U}(t)$ , as a Gauss-Markov process, takes values on the real line. A change in the basis of $\beta(t)$ with a logistic sigmoid function $\vartheta$ before it enters the likelihood fixes this misspecification. Similarly, the Lotka-Volterra parameters are inferred in log-space to ensure positivity. It is an appealing aspect of the EKF that these non-linear transformations do not require significant adaptation of the algorithm. Instead, the EKF treats it as merely another level of linearization of Eq. (7). Section 5.3 extends this to the state dynamics. + +The results are shown in Figure 4. On all test problems, the algorithm recovers the true states and the true latent force accurately. The recovery is not exact, which shows how the Gaussian posterior is only an approximation of the true posterior. The $\chi^2$ -statistic for the van-der-Pol stiffness parameter $\mu$ is 1.11, which lies in (0.0039, 3.8415), the $90\%$ confidence interval of the $\chi^2$ distribution with 1 degree of freedom. The root-mean-square error (RMSE) to the truth is 0.14. The $\chi^2$ -statistic for the Lotka-Volterra parameters is 8.06, which lies in (0.7107, 9.4877), the $90\%$ confidence interval of the $\chi^2$ distribution with 4 degrees of freedom. The RMSE to the truth is 0.04 in log space and 0.018 in + +![](images/6c589dc7090465a6142d87a201f028e3b29692f1a233529ccad70b9473916ce8.jpg) + +![](images/a02276f0b4f2faeeffc945c7cd44cbf439a46681eb832b2c05a980453ecc68c6.jpg) + +![](images/244bea71b72ec82adcd6dc06d3758fcc1307d9f5d089e11cbbad786e7f466d96.jpg) + +![](images/baeae7d64dff5e8816f6c1cfc462e5f43d25ab428a8551c5e8be311ee102f85c.jpg) + +![](images/39e2bc57c2a77825b4bd2d1d8f9b76a8caf37f73c954a96c823beaf9c60b1385.jpg) +Figure 4: State recovery in simulated environments. The stiffness parameter of the van-der-Pol oscillator (top row) and the Lotka-Volterra parameters (middle row) are inferred accurately with appropriately high certainty. For the SIRD experiment (bottom row), the uncertainty is high, where low case counts provide little information about the latent contact rate. With more fluctuations in the observed counts, the approximated contact rate displays more certainty. + +![](images/aba7f0095d2d71babfc69433cfa2a059cf80f1b0785c3e5f0cad1ae9392c6a1d.jpg) + +linear space. The $\chi^2$ -statistic for the contact rate $\beta$ is 0.91, which lies in (0.0039, 3.8415), the $90\%$ confidence interval of the $\chi^2$ distribution with 1 degree of freedom. The RMSE to the truth is 0.2 in logit space and 0.033 in linear space. + +# 5.2 COVID-19 data + +We continue with the SIRD model introduced in Eq. (3), now using data collected in Germany over the period from January 22, 2020, to May 27, 2021. Throughout the pandemic, the German government has imposed mitigation measures of varying severity. Together with seasonal effects, summer vacations, etc., they caused a continual change in the contact rate. The next experiments aim to recover said contact rate (and the SIRD counts) from the German dataset. + +The Center for Systems Science and Engineering at the Johns Hopkins University publishes daily counts of confirmed $(y_{n}^{\mathrm{confirmed}})$ , recovered $(y_{n}^{\mathrm{recovered}})$ , and deceased $(y_{n}^{\mathrm{deceased}})$ individuals [6]. One can transform this data to suit the SIRD model + +$$ +I _ {n} := y _ {n} ^ {\text {c o n f i r m e d}} - R _ {n} - D _ {n}, \quad R _ {n} := y _ {n} ^ {\text {r e c o v e r e d}}, \quad D _ {n} := y _ {n} ^ {\text {d e c e a s e d}}. \tag {10} +$$ + +The counts $I_{n}$ , $R_{n}$ , and $D_{n}$ are available for each day, starting with January 22, 2020. Assuming a constant population over time, the numbers of susceptible individuals $S_{n}$ are always evident from the other quantities, thus left out of the visualizations. We fix the population at $P = 83783945$ , based on public record. We rescale the data to cases per one thousand people (CPT). + +As a prior over $\mathrm{X}(t)$ , due to its popularity in constructing probabilistic ODE solvers [32], we assume a twice-integrated Wiener process. $\beta(t)$ is modelled as a Matérn-3/2 process with length scale $\ell_q = 75$ and diffusion intensity $\sigma_q^2 = 0.05$ . The state-space model is straightforwardly extendable to sums and products of (more) processes [30, 28]. Inferring parameters that are constant over time, however, is not straightforward due to potentially singular transition models [27, Section 12.3.1]. + +As described in Section 5.1, the contact rate is inferred in logit space. We shift the logistic sigmoid function such that it fulfills $\vartheta(0) = 0.1$ in which case the stationary mean $\overline{\mathbf{U}} = 0$ translates to a stationary mean $\vartheta(\overline{\mathbf{U}}) = \overline{\beta} = 0.1$ of the Matérn process that models the contact rate. The recovery + +![](images/39625d170716652008078e1105d35474597854a8c3468c2c5e809008770fd733.jpg) +Figure 5: Estimated counts of infectious cases and contact rate based on real COVID-19 data. The case counts of infectious people are scaled to cases per thousand (cpt). The uncertainty over the contact rate increases when the case counts are low. After a single forward solve, the inferred mean is already close to the MAP estimate. The shaded areas show the $95\%$ credible interval and the dotted black lines are samples from the posterior. + +Table 1: List of selected governmental measures imposed in Germany with the aim to contain the spread of COVID-19. These events are depicted in Figures 5 and 6 (see column 'Mark'). Links to the sources are provided in Appendix C. + +
MarkGovernmental Measures
1Stringent contact restrictions, partial shutdown of public life
2-3Continual relaxations of measures
4Partial shutdown of public life ('lockdown light')
5Hard lockdown, stringent contact restrictions
6First nationwide decree of restrictions, increased intensification of measures
+ +rate and mortality rate are considered known and fixed at $\gamma = 0.06$ and $\eta = 0.002$ to isolate the effect of the inference procedure on recovering the evolution of the contact rate $\mathrm{U}(t) = \beta (t)$ . We set the mean of the Gaussian initial conditions to the first data point that is available. The diffusion intensity of the prior process $\mathrm{X}(t)$ is set to $\sigma_{\mathrm{X}}^{2} = 10$ . The latent process $\mathrm{U}$ and all derivatives are initialized at zero. Note that due to the logistic sigmoid transform, an initial value $\mathrm{U}_0 = 0$ amounts to an initial contact rate $\beta_0 = 0.1$ . + +In the present scenario, we cannot take the SIRD model as an accurate description of the underlying data but merely as a tool that aids the inference engine in recovering physically meaningful states and forces. In order to account for this model mismatch, the Dirac likelihood from Eq. (7) is relaxed towards a Gaussian likelihood with measurement noise $\lambda^2 = 0.01$ . This equals the data observation noise and thus balances the respective impact of either (misspecified) source of information. Intuitively, adding ODE measurement noise reduces how strictly the vector field dynamics are enforced during inference and therefore avoids overconfident estimates of $\beta(t)$ . + +The mesh-size of the ODE is $\Delta t = 1/24$ days, i.e. ODE updates are computed on an hourly basis. The final 14 observations are excluded from the training set to serve as validation data for evaluating the extrapolation behavior of the proposed method. Figure 5 shows the results. The mean of the state X estimates the case counts accurately in both interpolation and extrapolation tasks. The estimated contact rate rapidly decreases around late March, remains low until fall, increases momentarily, and is dampened again soon after. This aligns with a set of political measures imposed by the government (compare Figure 5 to Table 1). The uncertainty over the estimated contact rate is high in the early beginning when the case counts are still low. It then increases again in summer and with the beginning of the extrapolation phase. + +If the experiment is taken as-is, the credibility intervals of the posterior over $\mathrm{X}(t)$ include negative numbers (mostly where the case counts are low and the uncertainty high, and when extrapolating). Of course, in a system that models counts of people in different stages of a disease, negative numbers should be excluded altogether. The proposed method provides straightforward means to address this issue. Section 5.3 explains the details. + +![](images/50e131c9b730dfdabd69a5c5eb1e9a67a2c556d2c61dee25aad6fadcb5f9809a.jpg) +Figure 6: Estimated case counts and contact rate, inferred in the logarithmic basis on real COVID-19 and vaccination data. The case counts of infectious people are scaled to cases per thousand (cpt). Again, the uncertainty of the contact rate increases where the case counts are low. Now, the posterior credible interval is restricted to the positive reals. The shaded areas show the $95\%$ credible interval and the dotted black lines are samples from the posterior. + +# 5.3 Non-negative state estimates + +The following experiment evaluates how the proposed method performs in combination with a state-space model that constrains the support of the dynamics. Concretely, let $\mathrm{X}(t)$ model the logarithm of the SIRD dynamics and the respective derivatives. With a slight abuse of notation, we will continue writing "X" even though it lives in a different space than in the previous sections. The structure of the dynamic model is the same. The diffusion intensity of the prior process $\mathrm{X}(t)$ is $\sigma_{\mathrm{X}}^{2} = 0.05$ . The diffusion is not comparable to the value in the previous section because the state dynamics moved to log-space. Using $\frac{\mathrm{d}}{\mathrm{d}t}\exp (x(t)) = \exp (x(t))\dot{x} (t)$ , the ODE likelihood becomes + +$$ +\left. \mathrm {Z} _ {m} \mid X _ {m} ^ {\mathrm {O D E}}, U _ {m} ^ {\mathrm {O D E}}, \sim \mathcal {N} \left(\zeta_ {1} - f \left(\zeta_ {2}; \zeta_ {3}\right), \lambda^ {2} I _ {d}\right), \right. \tag {11} +$$ + +with auxiliary quantities (recall the logistic sigmoid $\vartheta$ ) + +$$ +\zeta_ {1} := \exp \left(\mathrm {X} ^ {(0)} \left(t _ {m} ^ {\mathrm {O D E}}\right)\right) \mathrm {X} ^ {(1)} \left(t _ {m} ^ {\mathrm {O D E}}\right), \quad \zeta_ {2} := \exp \left(\mathrm {X} ^ {(0)} \left(t _ {m} ^ {\mathrm {O D E}}\right)\right), \quad \zeta_ {3} := \vartheta \left(\mathrm {U} \left(t _ {m} ^ {\mathrm {O D E}}\right)\right). \tag {12} +$$ + +The exponential function introduces an additional non-linearity into the state-space model, which necessitates smaller step-sizes for the ODE measurements (see below). + +The observed case count data $y_{0:N}$ is transformed into the log-space, too, in which we assume additive, i.i.d. Gaussian noise. On the one hand, transforming the measurements into log-space implies that the measurement model for the counts remains linear; on the other hand, it imposes a log-normal noise model (if viewed back in "linear space"). Log-normal noise underlines how the estimated states cannot be negative. Again, we scale the counts to cases per thousand. + +As depicted in Figure 6, the reconstruction of the driving processes in this setting yields results that at first glance, look similar to the previous experiment. The states match the data points well. However, the extrapolation is more realistic in that the credible intervals encode that negative values are impossible (which is due to the log-transform). The mean of the recovered contact rate closely resembles the estimate of the previous experiment. Again, upon implementation of strict governmental measures, the uncertainty decreases, whereas in the context of relaxations, the uncertainty is high. + +# 6 Statement on Societal Impact + +This work performs methods research to develop an efficient numerical algorithm to infer latent forces governing ordinary differential equations. As a testbed, we use data from the COVID-19 pandemic. We do so to motivate and visualize the practical value of our methods. The results of this + +algorithm, however, should not be taken as policy advice. The model used in the paper is deliberately simplistic. The presented work therefore should not be misunderstood as epidemiological research. The machine learning community has, over time, frequently used data of contemporary societal concern to motivate and test new algorithmic concepts (well-known examples from the UCI collection include the Wisconsin Breast Cancer Dataset, the mushroom classification dataset, and the German credit data set). Our work follows in this line. Of course, if this algorithm, or any competitor, is used to derive policy advice, the underlying differential equation and latent states must be carefully considered by domain experts, which we are not. + +# 7 Conclusion + +By coupling mechanistic and data-driven inference so directly, the algorithm builds on the core premise of probabilistic numerics – that computation itself is a data source that does not differ, formally, from observational data. Information from observations and mechanistic knowledge (in the form of an ODE) can thus be described in the same language of Bayesian filtering and smoothing. This removes the need for an outer loop over multiple forward solves and thus drastically reduces the computational cost. Our experimental evaluation corroborates that the resulting approximate posterior is close to the ground truth and drastically reduces computational cost over Monte Carlo alternatives. It faithfully captures multiple sources of uncertainty from the data, numerical (discretization) error, and epistemic uncertainty about the mechanism. We hope this framework helps empower practitioners, not just by reducing computational burden but also by providing a more flexible modelling platform. + +# Acknowledgements + +The authors gratefully acknowledge financial support by the European Research Council through ERC StG Action 757275 / PANAMA; the DFG Cluster of Excellence "Machine Learning - New Perspectives for Science", EXC 2064/1, project number 390727645; the German Federal Ministry of Education and Research (BMBF) through the Tübingen AI Center (FKZ: 01IS18039A); and funds from the Ministry of Science, Research and Arts of the State of Baden-Württemberg. The authors thank the International Max Planck Research School for Intelligent Systems (IMPRS-IS) for supporting N. Kramer. Moreover, the authors thank Nathanael Bosch and Marvin Pförtner for valuable discussions. + +# References + +[1] Y. Bar-Shalom, X. R. Li, and T. Kirubarajan. Estimation With Applications to Tracking and Navigation: Theory Algorithms and Software. John Wiley & Sons, 2004. +[2] B. M. Bell. The iterated Kalman smoother as a Gauss-Newton method. SIAM Journal on Optimization, 4(3):626-636, 1994. +[3] M. Betancourt. A conceptual introduction to Hamiltonian Monte Carlo. arXiv:1701.02434, 2017. +[4] N. Bosch, P. Hennig, and F. Tronarp. Calibrated adaptive probabilistic ODE solvers. In International Conference on Artificial Intelligence and Statistics, 2021. +[5] B. Calderhead, M. Girolami, and N. Lawrence. Accelerating Bayesian inference over nonlinear differential equations with Gaussian processes. In Advances in Neural Information Processing Systems, 2009. +[6] E. Dong, H. Du, and L. Gardner. An interactive web-based dashboard to track COVID-19 in real time. The Lancet Infectious Diseases, 20(5):533-534, 2020. +[7] G. Giordano, F. Blanchini, R. Bruno, P. Colaneri, A. Di Filippo, A. Di Matteo, and M. Colaneri. Modelling the COVID-19 epidemic and implementation of population-wide interventions in Italy. Nature Medicine, pages 1–6, 2020. +[8] J. Guckenheimer. Dynamics of the van der Pol equation. IEEE Transactions on Circuits and Systems, 27(11):983-989, 1980. + +[9] J. Hartikainen, M. Seppänen, and S. Särkkä. State-space inference for non-linear latent force models with application to satellite orbit prediction. In International Conference on Machine Learning, 2012. +[10] H. W. Hethcote. The mathematics of infectious diseases. SIAM Review, 42(4):599-653, 2000. +[11] A. Hindmarsh and L. Petzold. LSODA, ordinary differential equation solver for stiff or non-stiff system. 2005. +[12] M. D. Hoffman and A. Gelman. The No-U-Turn sampler: adaptively setting path lengths in Hamiltonian Monte Carlo. Journal of Machine Learning Research, 15(1):1593-1623, 2014. +[13] A. H. Jazwinski. Stochastic Processes and Filtering Theory. Academic Press, 1970. +[14] C. Jidling, N. Wahlström, A. Wills, and T. B. Schön. Linearly constrained gaussian processes. In Advances in Neural Information Processing Systems, 2017. +[15] S. J. Julier and J. K. Uhlmann. Unscented filtering and nonlinear estimation. Proceedings of the IEEE, 92(3):401-422, 2004. +[16] R. E. Kalman. A new approach to linear filtering and prediction problems. Transactions of the ASME-Journal of Basic Engineering, 82(Series D):35-45, 1960. +[17] H. Kersting, N. Kramer, M. Schiegg, C. Daniel, M. Tiemann, and P. Hennig. Differentiable likelihoods for fast inversion of 'likelihood-free' dynamical systems. In International Conference on Machine Learning, 2020. +[18] H. Kersting, T. J. Sullivan, and P. Hennig. Convergence rates of Gaussian ODE filters. Statistics and Computing, 30(6):1791-1816, 2020. +[19] N. Kramer and P. Hennig. Stable implementation of probabilistic ODE solvers. arXiv:2012.10106, 2020. +[20] J. Loper, D. M. Blei, J. P. Cunningham, and L. Paninski. General linear-time inference for Gaussian processes on one dimension. arXiv:2003.05554, 2020. +[21] A. J. Lotka. The growth of mixed populations: two species competing for a common food supply. In *The Golden Age of Theoretical Ecology: 1923–1940*, pages 274–286. Springer, 1978. +[22] P. S. Maybeck. Stochastic Models, Estimation, and Control. Academic Press, 1982. +[23] I. Murray, R. Adams, and D. MacKay. Elliptical slice sampling. In International Conference on Artificial Intelligence and Statistics, 2010. +[24] C. A. Naesseth, F. Lindsten, and T. B. Schön. Elements of sequential Monte Carlo. Foundations and Trends® in Machine Learning, 12(3):307-392, 2019. +[25] B. Øksendal. Stochastic Differential Equations. Springer, 2003. +[26] D. Phan, N. Pradhan, and M. Jankowiak. Composable effects for flexible and accelerated probabilistic programming in NumPyro. arXiv:1912.11554, 2019. +[27] S. Särkkä. Bayesian Filtering and Smoothing. Cambridge University Press, 2013. +[28] S. Särkkä and A. Solin. Applied Stochastic Differential Equations. Cambridge University Press, 2019. +[29] M. Schober, S. Särkkä, and P. Hennig. A probabilistic model for the numerical solution of initial value problems. Statistics and Computing, 29:99-122, 2019. +[30] A. Solin and S. Särkkä. Explicit link between periodic covariance functions and state space models. In International Conference on Artificial Intelligence and Statistics, 2014. +[31] F. Tronarp, Á. F. García-Fernández, and S. Särkkä. Iterative filtering and smoothing in nonlinear and non-Gaussian systems using conditional moments. IEEE Signal Processing Letters, 25(3): 408-412, 2018. + +[32] F. Tronarp, H. Kersting, S. Särkkä, and P. Hennig. Probabilistic solutions to ordinary differential equations as nonlinear Bayesian filtering: a new perspective. Statistics and Computing, 29(6): 1297-1315, 2019. +[33] P. Virtanen, R. Gommers, T. E. Oliphant, M. Haberland, T. Reddy, D. Cournapeau, E. Burovski, P. Peterson, W. Weckesser, J. Bright, et al. SciPy 1.0: fundamental algorithms for scientific computing in Python. Nature Methods, 17(3):261-272, 2020. +[34] E. A. Wan and R. Van Der Merwe. The unscented Kalman filter for nonlinear estimation. In IEEE 2000 Adaptive Systems for Signal Processing, Communications, and Control Symposium, pages 153-158, 2000. +[35] J. Wenger, N. Kramer, M. Pförtner, J. Schmidt, N. Bosch, N. Effenberger, J. Zenn, A. Gessner, T. Karvonen, F.-X. Briol, et al. ProbNum: Probabilistic numerics in Python. arXiv preprint arXiv:2112.02100, 2021. +[36] P. Wenk, G. Abbati, M. A. Osborne, B. Schölkopf, A. Krause, and S. Bauer. ODIN: ODE-informed regression for parameter and state inference in time-continuous dynamical systems. AAAI Conference on Artificial Intelligence, 34(04):6364–6371, 2020. +[37] M. Álvarez, D. Luengo, and N. D. Lawrence. Latent force models. In International Conference on Artificial Intelligence and Statistics, 2009. \ No newline at end of file diff --git a/aprobabilisticstatespacemodelforjointinferencefromdifferentialequationsanddata/images.zip b/aprobabilisticstatespacemodelforjointinferencefromdifferentialequationsanddata/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..4f53c01c87c8ff6448f09860bc76294a4e162c19 --- /dev/null +++ b/aprobabilisticstatespacemodelforjointinferencefromdifferentialequationsanddata/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:763f2134bd9d2a0f8e0cf92fed585754a79621b2561e1494a5a27d127c7fbf07 +size 296437 diff --git a/aprobabilisticstatespacemodelforjointinferencefromdifferentialequationsanddata/layout.json b/aprobabilisticstatespacemodelforjointinferencefromdifferentialequationsanddata/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7b2facf1ac223f954b22c56cd08a8866a244d1bb --- /dev/null +++ b/aprobabilisticstatespacemodelforjointinferencefromdifferentialequationsanddata/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5aeb38e00c55f315c933428a351d10c5f4bb63cb7775f599c30cce002dba5c86 +size 459178 diff --git a/aprototypeorientedframeworkforunsuperviseddomainadaptation/4dc81ca3-befc-4e15-a3a1-5ac086b35701_content_list.json b/aprototypeorientedframeworkforunsuperviseddomainadaptation/4dc81ca3-befc-4e15-a3a1-5ac086b35701_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..321da2b7a815049134c559c0b2ad1cb2bee0c243 --- /dev/null +++ b/aprototypeorientedframeworkforunsuperviseddomainadaptation/4dc81ca3-befc-4e15-a3a1-5ac086b35701_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:84a94b4e3521689ce7a6c1bbd824d6de39c818f98f4080a7bfa87d10b102bb2b +size 92685 diff --git a/aprototypeorientedframeworkforunsuperviseddomainadaptation/4dc81ca3-befc-4e15-a3a1-5ac086b35701_model.json b/aprototypeorientedframeworkforunsuperviseddomainadaptation/4dc81ca3-befc-4e15-a3a1-5ac086b35701_model.json new file mode 100644 index 0000000000000000000000000000000000000000..b1c23a27b83f193cc665738d7e3f61351d96781c --- /dev/null +++ b/aprototypeorientedframeworkforunsuperviseddomainadaptation/4dc81ca3-befc-4e15-a3a1-5ac086b35701_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:29ba64a9d5a9caee71865cba3e3e689f92b6a0d2f6a0e53cc9dfb017e6130c83 +size 115988 diff --git a/aprototypeorientedframeworkforunsuperviseddomainadaptation/4dc81ca3-befc-4e15-a3a1-5ac086b35701_origin.pdf b/aprototypeorientedframeworkforunsuperviseddomainadaptation/4dc81ca3-befc-4e15-a3a1-5ac086b35701_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..448c0cd49ebc515920d9c838118b58d5d137c9df --- /dev/null +++ b/aprototypeorientedframeworkforunsuperviseddomainadaptation/4dc81ca3-befc-4e15-a3a1-5ac086b35701_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d1f25145b69e15614cf13943bd59ccd326776ed5465d23b876eb9a64b5a44e2e +size 1015177 diff --git a/aprototypeorientedframeworkforunsuperviseddomainadaptation/full.md b/aprototypeorientedframeworkforunsuperviseddomainadaptation/full.md new file mode 100644 index 0000000000000000000000000000000000000000..20f1c37fad735c91eabffd470c898e3d41230463 --- /dev/null +++ b/aprototypeorientedframeworkforunsuperviseddomainadaptation/full.md @@ -0,0 +1,297 @@ +# A Prototype-Oriented Framework for Unsupervised Domain Adaptation + +Korawat Tanwisuth\*,1, Xinjie Fan\*,1, Huangjie Zheng\*,1, Shujian Zhang\*, Hao Zhang\*, Bo Chen\*, Mingyuan Zhou\* + +1The University of Texas at Austin 2 Cornell University 3Xidian University korawat.tanwisuth@utexas.edu, mingyuan.zhou@mccombs.utexas.edu + +# Abstract + +Existing methods for unsupervised domain adaptation often rely on minimizing some statistical distance between the source and target samples in the latent space. To avoid the sampling variability, class imbalance, and data-privacy concerns that often plague these methods, we instead provide a memory and computation-efficient probabilistic framework to extract class prototypes and align the target features with them. We demonstrate the general applicability of our method on a wide range of scenarios, including single-source, multi-source, class-imbalance, and source-private domain adaptation. Requiring no additional model parameters and having a moderate increase in computation over the source model alone, the proposed method achieves competitive performance with state-of-the-art methods. + +# 1 Introduction + +In many real-world applications, such as healthcare and autonomous driving, data labeling can be expensive and time-consuming. To make predictions on a new unlabeled dataset, one may naively use an existing supervised model trained on a large labeled dataset. However, even subtle changes in the data-collection conditions, such as lighting or background for natural images, can cause a model's performance to degrade drastically [1]. This shift in the input data distribution is referred to in the literature as covariate shift [2]. By leveraging the labeled samples from the source domain and unlabeled samples from the target domain, unsupervised domain adaptation aims to overcome this issue, making the learned model generalize well in the target domain [3]. + +Ben-David et al. [4, 5] provide an $\mathcal{H}$ -divergence based theoretical upper bound on the target error. Ganin [6] popularizes learning an invariant representation between the source and target domains to minimize this divergence. Numerous prior methods [7-12] follow this trend, focusing on using the source and target samples for feature alignment in the latent space. While this approach can reduce the discrepancy between domains, directly using the source and target samples for feature alignment has the following problems. First, several commonly used methods that can be used to quantify the difference between two empirical distributions, such as maximum mean discrepancy (MMD) [13] and Wasserstein distance [14, 15], are sensitive to outlier samples in a mini-batch when used to match the source and target marginal distributions [16, 17]. We attribute this problem to the sampling variability of both the source and target samples. Second, while we typically assume that the two domains share the same label space, we cannot guarantee that the samples drawn from the source and target domains will cover the same set of classes in each mini-batch. Especially, if the label proportions shift between domains, learning domain invariant representation might not lead to improvements over using the source data alone to train the model [18]. If we pull the support of + +![](images/d0627caba48e52bbd271ed85c712803eba433908b113981034432ba4a160991e.jpg) +Figure 1: This figure exhibits a diagram of Prototype-oriented Conditional Transport (PCT). Unlike existing methods that align the target and source features, our method aligns the target features with class prototypes. The gray arrow indicates that the gradients of the prototypes do not back-propagate through the transport loss. + +the source and target feature representations from different classes closer together, the classifier will be more likely to misclassify those examples. Finally, aligning the target features to source features means that we need access to both the source and target data simultaneously. In applications such as personal healthcare, we may not have access to the source data directly during the adaptation stage; instead, we may only be given access to the target data and the model trained on the source data. + +We propose an algorithm that constructs class prototypes to represent the source domain samples in the latent space. Using the prototypes instead of source features avoids the previously mentioned problems: 1) sampling variability in the source domain, 2) instance class-mismatching in a mini-batch, and 3) source-data privacy concerns. As we expect the classifier to make better predictions on the target data in regions where the source density is sufficiently high [19], it is natural to consider encouraging the feature encoder to map the target data close to these prototypes. Motivated by the cluster assumption [20] (decision boundaries should not cross high-density regions of the data), we provide a method to transport the target features to these class prototypes and vice versa. We further extend our bi-directional transport to address the potential shift in label proportions, a common problem that has been studied [21-25] but that has been often overlooked in prior works [6, 7, 26]. + +Compared to existing methods, the proposed one has several appealing aspects. First, it does not rely on adversarial training to achieve competitive performance, making the algorithm robust and converge much faster. Moreover, learnable prototypes not only avoid expensive computation but also bypass the need to directly access the source data. This attribute makes our algorithm applicable to the settings where preserving the source data privacy is a major concern. Unlike clustering-based approaches that typically require multiple forward passes before an update, our algorithm processes data in mini-batches for each update and is trained in an end-to-end manner. + +We highlight the main contributions of the paper as follows: 1) We utilize the linear classifier's weights as class prototypes and propose a general probabilistic framework to align the target features to these prototypes. 2) We introduce the minimization of the expected cost of a probabilistic bi-directional transport for feature alignment, and illustrate its superior performance over related methods. 3) We test the proposed method under multiple challenging yet practical settings: single-source, multisource, class-imbalance, and source-private domain adaptation. In comparison to state-of-the-art algorithms, the proposed prototype-oriented method achieves highly competitive performance in domain adaptation, while requiring no additional model parameters and only having a moderate increase in computation over the source model alone. + +# 2 Prototype-oriented conditional transport + +In this section, we propose Prototype-oriented Conditional Transport (PCT), a holistic method for domain adaption consisting of three parts: learning class prototypes, aligning the target features with learned prototypes using a probabilistic bi-directional transport framework of Zheng and Zhou + +![](images/3057d11e5e63ca40343d416961b02566e40db1a7a093a1fa819d618bd3aa9d4f.jpg) +Figure 2: Visualization of different methods on a synthetic dataset, where darker points marked with “·” and lighter points marked with “×” denote the source and target samples, respectively, and the red and green colors denote two different classes. For each method, the left plot shows the data space whereas the right plot exhibits the output of the feature encoder in the latent space. Letters A and B correspond to the two class prototypes in the latent space. When there is clear class imbalance, DANN, a representative algorithm whose strategy is to match the marginal feature distributions between the source and target, fails to adapt to the target domain. + +![](images/cd6f36d2f475e40adc94cca684550ea39071f10c710387881ad1d2c20706f800.jpg) + +![](images/5703ea466af1b06917b403c3e0fa5425d89853f66e2fe2a2b542d316cfd6dd86.jpg) + +[27], and estimating the target class proportions. Our method does not introduce additional model parameters for aligning domain features, and the model can be learned in an end-to-end manner. We provide a motivating example of the application of our method on a synthetic dataset in Figure 2. + +In domain adaptation, we are given a labeled dataset from the source domain, $\{(x_i^s,y_i^s)\}_{i = 1}^{n_s}\sim \mathcal{D}_s$ , and an unlabeled dataset from the target domain, $\{\pmb{x}_j^t\}_{j = 1}^{n_t}\sim \mathcal{D}_t^{\pmb{x}}$ . We focus on the closed-category domain adaptation and assume that the source and target domains share the same label space, i.e., $y_{i}^{s},y_{j}^{t}\in \{1,2,\ldots ,K\}$ , where $K$ denotes the number of classes. The goal of domain adaptation is to learn a model with low risk on the target samples. The model typically consists of a feature encoder, $F_{\theta}:\mathcal{X}\to \mathbb{R}^{d_f}$ , parameterized by $\pmb{\theta}$ , and a linear classification layer $C_\mu :\mathbb{R}^{d_f}\rightarrow \mathbb{R}^K$ , parameterized by $\pmb{\mu}$ . In prior works [6, 7, 26], the feature encoder is a pre-trained neural network, and the classifier is a randomly initialized linear layer. To simplify the following notation, we denote $\pmb{f}_i^s = F_\pmb{\theta}(\pmb{x}_i^s)$ and $\pmb{f}_j^t = F_\pmb{\theta}(\pmb{x}_j^t)$ as the feature representations of the source data $\pmb{x}_i^s$ and target data $\pmb{x}_j^t$ , respectively. + +# 2.1 Learning class prototypes + +Most existing works [6, 7, 26] focus on aligning the source and target features in a latent space. By contrast, we propose to characterize the features of each class with a class prototype and align the target features with these class prototypes instead of the source features. This approach has several advantages. First, the feature alignment between two domains would be more robust to outliers in the source domain as we avoid using the source samples directly. Second, we do not need to worry about the missing classes in the sampled mini-batch in the source domain like we do when we align the features of source and target samples. Prototypes ensure that every class is represented for each training update. Last but not least, using the inferred prototypes instead of source features allows adapting to the target domain even without accessing the source data during the adaptation stage, which is an appealing trait when preserving the source data privacy is a concern (see Table 6). + +Previous methods [28-31, 12, 32] construct each class prototype as the average latent feature for that class extracted by the feature encoder, which is computationally expensive due to the forward passing of a large number of training samples. We propose to construct class prototypes in the same latent space but with learnable parameters: $\left[\pmb{\mu}_1,\pmb{\mu}_2,\dots,\pmb{\mu}_K\right]\in \mathbb{R}^{d_f\times K}$ , where the dimension of each prototype, $d_{f}$ , is the same as the hidden dimension after the feature encoder $F_{\theta}$ . This strategy has been successfully applied by Saito et al. [33] in a semi-supervised learning setting. We learn each class prototype in a way that encourages the prototype to be close to the source samples associated with that class in the feature space. In particular, given the prototypes and source samples $\pmb{x}_i^s$ with features $\pmb{f}_i^s$ and labels $y_{i}^{s}$ , we use the cross-entropy loss to learn the prototypes: + +$$ +\mathcal {L} _ {\mathrm {c l s}} = \mathbb {E} _ {\left(\boldsymbol {x} _ {i} ^ {s}, \boldsymbol {y} _ {i} ^ {s}\right) \sim \mathcal {D} _ {s}} \left[ \sum_ {k = 1} ^ {K} - \log p _ {i k} ^ {s} \mathbf {1} _ {\left\{\boldsymbol {y} _ {i} ^ {s} = k \right\}} \right], \quad p _ {i k} ^ {s} := \frac {\exp \left(\boldsymbol {\mu} _ {k} ^ {T} \boldsymbol {f} _ {i} ^ {s} + b _ {k}\right)}{\sum_ {k ^ {\prime} = 1} ^ {K} \exp \left(\boldsymbol {\mu} _ {k ^ {\prime}} ^ {T} \boldsymbol {f} _ {i} ^ {s} + b _ {k ^ {\prime}}\right)}, \tag {1} +$$ + +where $b_{k}$ is a bias term and $p_{ik}^{s}$ is the predictive probability for $x_{i}^{s}$ to be classified to class $k$ . We note that this way of learning the class prototypes is closely connected to learning the standard linear classification layer $C_{\mu}$ on source-only data with the cross-entropy loss. The neural network weights in the classification layer can be interpreted as the class prototypes. Therefore, compared with source-only approaches, constructing prototypes in this way introduce no additional parameters. As we show in Figure 4a, our method requires much fewer parameters than other domain-adaptation methods. Moreover, it requires much less computation than other prototype-based methods by avoiding the need to average the latent features for each class. + +# 2.2 Bi-directional prototype-oriented conditional transport + +In this section, we will discuss how we encourage the feature encoder to align the target data with class prototypes. Our approach is motivated by the cluster assumption, which has been widely adopted in both semi-supervised learning [20, 34, 35] and domain-adaptation literature [36, 37, 31, 38]. The cluster assumption states that the input data distribution consists of separated clusters and that instances belonging to the same cluster tend to have the same class labels. This means that the decision boundaries should not cross data high-density regions. To achieve this goal, we minimize the expected pairwise cost between the target features and prototypes with respect to two differently constructed joint distributions. By minimizing the expected costs under these two different joint distributions, the target feature will be close to the prototypes, far from the decision boundaries. + +# 2.2.1 Moving from target domain to class prototypes + +To define the expected cost of moving from the target domain to the class prototypes, we first use the chain rule to factorize the joint distribution of the class prototype $\pmb{\mu}_k$ and target feature $\pmb{f}_j^t$ as $p(\pmb{f}_j^t)\pi_\theta (\pmb{\mu}_k\mid \pmb{f}_j^t)$ , where drawing from the target feature distribution $p(\pmb{f}_j^t)$ can be realized by selecting a random target sample $\pmb{x}_j^t\sim \mathcal{D}_t^x$ to obtain $\pmb{f}_j^t = F_\theta (\pmb{x}_j^t)$ . The conditional distribution, representing the probability of moving from target feature $\pmb{f}_j^t$ to class prototype $\pmb{\mu}_k$ , is defined as + +$$ +\pi_ {\boldsymbol {\theta}} \left(\boldsymbol {\mu} _ {k} \mid \boldsymbol {f} _ {j} ^ {t}\right) = \frac {p \left(\boldsymbol {\mu} _ {k}\right) \exp \left(\boldsymbol {\mu} _ {k} ^ {T} \boldsymbol {f} _ {j} ^ {t}\right)}{\sum_ {k ^ {\prime} = 1} ^ {K} p \left(\boldsymbol {\mu} _ {k ^ {\prime}}\right) \exp \left(\boldsymbol {\mu} _ {k ^ {\prime}} ^ {T} \boldsymbol {f} _ {j} ^ {t}\right)}, k \in \{1, \dots , K \}, \tag {2} +$$ + +where, through the lens of Bayes' rule, $p(\pmb{\mu}_k)$ is the discrete prior distribution over the $K$ classes for the target domain, and $\exp(\pmb{\mu}_k^T\pmb{f}_j^t)$ plays the role of an unnormalized likelihood term, measuring the similarity between class prototypes and target features. Intuitively, the target features are more likely to be moved to the prototypes which correspond to dominant classes in the target domain or which are closer to the target features (or both). Note that in practice we often do not have access to the target class distribution $p(\pmb{\mu}_k)$ . We can use a uniform prior distribution for $p(\pmb{\mu}_k)$ . However, this could be sub-optimal, especially when classes are seriously imbalanced in the target domain. To address this issue, we propose a way to estimate $\{p(\pmb{\mu}_k)\}_{k=1}^K$ in Section 2.3. + +We now define the expected cost of moving the target features to class prototypes as: + +$$ +\mathcal {L} _ {t \rightarrow \mu} = \mathbb {E} _ {\boldsymbol {x} _ {j} ^ {t} \sim \mathcal {D} _ {t} ^ {\infty}} \mathbb {E} _ {\boldsymbol {\mu} _ {k} \sim \pi_ {\boldsymbol {\theta}} (\boldsymbol {\mu} _ {k} \mid \boldsymbol {f} _ {j} ^ {t})} \left[ c (\boldsymbol {\mu} _ {k}, \boldsymbol {f} _ {j} ^ {t}) \right] = \mathbb {E} _ {\boldsymbol {x} _ {j} ^ {t} \sim \mathcal {D} _ {t} ^ {\infty}} \left[ \sum_ {k = 1} ^ {K} c (\boldsymbol {\mu} _ {k}, \boldsymbol {f} _ {j} ^ {t}) \frac {p (\boldsymbol {\mu} _ {k}) \exp \left(\boldsymbol {\mu} _ {k} ^ {T} \boldsymbol {f} _ {j} ^ {t}\right)}{\sum_ {k ^ {\prime} = 1} ^ {K} p (\boldsymbol {\mu} _ {k ^ {\prime}}) \exp \left(\boldsymbol {\mu} _ {k ^ {\prime}} ^ {T} \boldsymbol {f} _ {j} ^ {t}\right)} \right], \tag {3} +$$ + +where $c(\cdot, \cdot)$ , a point-to-point moving cost, is defined with the cosine dissimilarity as + +$$ +c \left(\boldsymbol {\mu} _ {k}, \boldsymbol {f} _ {j} ^ {t}\right) = 1 - \frac {\boldsymbol {\mu} _ {k} ^ {T} \boldsymbol {f} _ {j} ^ {t}}{\left\| \boldsymbol {\mu} _ {k} \right\| _ {2} \left\| \boldsymbol {f} _ {j} ^ {t} \right\| _ {2}}. \tag {4} +$$ + +We also consider other point-to-point costs and present the results in Section 4.2. With Eq. (3), it is straightforward to obtain an unbiased estimation of $\mathcal{L}_{t\to \mu}$ with a mini-batch from target domain $\mathcal{D}_t^x$ + +In this target-to-prototype direction, we are assigning each target sample to the prototypes according to their similarities and the class distribution. Intuitively, minimizing this expected moving cost encourages each target feature to get closer to neighboring class prototypes, reducing the violation of the cluster assumption. If we think of each prototype as the mode of the distribution of source features for a class, this loss encourages a mode-seeking behavior [27]. Still, this loss alone might lead to sub-optimal alignment. The feature encoder can map most of the target data to only a few prototypes. We connect this loss to entropy minimization to elucidate this point. + +Connection with entropy minimization. The expected cost of moving from the target domain to prototypes can be viewed as a generalization of entropy minimization [20], an effective regularization in many prior domain-adaptation works [39, 33, 40, 17]. If the point-to-point moving cost is defined as $c(\pmb{\mu}_k, \pmb{f}_j^t) = -\log p_{jk}^t = -\log \frac{\exp(\pmb{\mu}_k^T \pmb{f}_j^t)}{\sum_{k'=1}^{K} \exp(\pmb{\mu}_{k'}^T \pmb{f}_j^t)}$ and the conditional probability is $\pi_\theta(\pmb{\mu}_k | \pmb{f}_j^t) = p_{jk}^t = \frac{\exp(\pmb{\mu}_k^T \pmb{f}_j^t)}{\sum_{k'=1}^{K} \exp(\pmb{\mu}_{k'}^T \pmb{f}_j^t)}$ (with a uniform prior), then the expected moving cost becomes: $\mathcal{L}_{t \to \mu} = -\mathbb{E}_{\pmb{x}_j^t \sim \mathcal{D}_t^x} \left[ \sum_{k=1}^{K} p_{jk}^t \log p_{jk}^t \right]$ , which is equivalent to minimizing the entropy on the target samples. Entropy minimization alone also has a mode-seeking behavior and has the same tendency to drop some modes (class prototypes). In other words, one trivial solution is to assign the same one-hot encoding to all the target samples [41, 42]. + +# 2.2.2 Moving from class prototypes to target domain + +To ensure that each prototype has some target features located close by and avoid dropping class prototypes, we propose to add a cost of the opposite direction [27], i.e., moving from the prototypes to target features. Given a mini-batch, $\{\pmb{x}_j^t\}_{j=1}^M$ , of target samples of size $M$ , denoting $\hat{p}(\pmb{f}^t) = \sum_{j=1}^{M} \frac{1}{M} \delta_{\pmb{f}_j^t}$ as the empirical distribution of the target features in this mini-batch, the probabilities of moving from a prototype $\pmb{\mu}_k$ to the $M$ target features is defined as a conditional distribution: + +$$ +\pi_ {\boldsymbol {\theta}} \left(\boldsymbol {f} _ {j} ^ {t} \mid \boldsymbol {\mu} _ {k}\right) = \frac {\hat {p} \left(\boldsymbol {f} _ {j} ^ {t}\right) \exp \left(\boldsymbol {\mu} _ {k} ^ {T} \boldsymbol {f} _ {j} ^ {t}\right)}{\sum_ {j ^ {\prime} = 1} ^ {M} \hat {p} \left(\boldsymbol {f} _ {j ^ {\prime}} ^ {t}\right) \exp \left(\boldsymbol {\mu} _ {k} ^ {T} \boldsymbol {f} _ {j ^ {\prime}} ^ {t}\right)} = \frac {\exp \left(\boldsymbol {\mu} _ {k} ^ {T} \boldsymbol {f} _ {j} ^ {t}\right)}{\sum_ {j ^ {\prime} = 1} ^ {M} \exp \left(\boldsymbol {\mu} _ {k} ^ {T} \boldsymbol {f} _ {j ^ {\prime}} ^ {t}\right)}, \quad \boldsymbol {f} _ {j} ^ {t} \in \left\{\boldsymbol {f} _ {1} ^ {t}, \dots , \boldsymbol {f} _ {M} ^ {t} \right\}. \tag {5} +$$ + +As opposed to the probabilities of moving a target feature to different class prototypes $\pi_{\theta}(\pmb{\mu}_k \mid \pmb{f}_j^t)$ , $\pi_{\theta}(\pmb{f}_j^t \mid \pmb{\mu}_k)$ normalizes the probabilities across the $M$ target samples for each prototype, which ensures that each prototype will be assigned to some target features. Then, the expected cost of moving along this prototype-to-target direction is defined as: + +$$ +\begin{array}{l} \mathcal {L} _ {\mu \rightarrow t} = \mathbb {E} _ {\{\pmb {x} _ {j} ^ {t} \} _ {j = 1} ^ {M}} \mathbb {E} _ {\mathcal {D} _ {t} ^ {\infty}} \mathbb {E} _ {\pmb {\mu} _ {k} \sim p (\pmb {\mu} _ {k})} \mathbb {E} _ {\pmb {f} _ {j} ^ {t} \sim \pi_ {\pmb {\theta}} (\pmb {f} _ {j} ^ {t} \mid \pmb {\mu} _ {k})} \left[ c (\pmb {\mu} _ {k}, \pmb {f} _ {j} ^ {t}) \right] \\ = \mathbb {E} _ {\{\boldsymbol {x} _ {j} ^ {t} \} _ {j = 1} ^ {M} \sim \mathcal {D} _ {t} ^ {\boldsymbol {x}}} \left[ \sum_ {k = 1} ^ {K} p (\boldsymbol {\mu} _ {k}) \sum_ {j = 1} ^ {M} c (\boldsymbol {\mu} _ {k}, \boldsymbol {f} _ {j} ^ {t}) \frac {\exp (\boldsymbol {\mu} _ {k} ^ {T} \boldsymbol {f} _ {j} ^ {t})}{\sum_ {j ^ {\prime} = 1} ^ {M} \exp (\boldsymbol {\mu} _ {k} ^ {T} \boldsymbol {f} _ {j ^ {\prime}} ^ {t})} \right], \tag {6} \\ \end{array} +$$ + +which can be estimated by drawing a mini-batch of $M$ target samples. + +Finally, combining the classification loss in Eq. (1), target-to-prototype moving cost in Eq. (3), and prototype-to-target moving cost in Eq. (6), our loss is expressed as + +$$ +\mathcal {L} _ {\mathrm {c l s}} + \mathcal {L} _ {t \rightarrow \mu} + \mathcal {L} _ {\mu \rightarrow t}. \tag {7} +$$ + +Note that we treat $\mu$ as fixed in both $\mathcal{L}_{t\to \mu}$ and $\mathcal{L}_{\mu \rightarrow t}$ . This strategy allows us to apply our method in the source-data-private setting where we only have access to the source model. We also find empirically that this leads to more stable training. + +# 2.3 Learning class proportions in the target domain + +We propose to infer the class proportions $\{p(\pmb{\mu}_k)\}_{k=1}^K$ in the target domain by maximizing the log-likelihood of the unlabeled target data while fixing the class prototypes $\pmb{\mu}$ . Directly optimizing the marginal likelihood is intractable, so we use the EM algorithm [43-45] to derive the following iterative updates (see the derivation in Appendix B). We first initialize with a uniform prior: $p(\pmb{\mu}_k)^0 = \frac{1}{K}$ , and obtain new estimates at each update step $l$ (starting from 0): + +$$ +p \left(\boldsymbol {\mu} _ {k}\right) ^ {l + 1} = \frac {1}{M} \sum_ {j = 1} ^ {M} \pi_ {\boldsymbol {\theta}} ^ {l} \left(\boldsymbol {\mu} _ {k} \mid \boldsymbol {f} _ {j} ^ {t}\right), \quad \text {w h e r e} \quad \pi_ {\boldsymbol {\theta}} ^ {l} \left(\boldsymbol {\mu} _ {k} \mid \boldsymbol {f} _ {j} ^ {t}\right) = \frac {p \left(\boldsymbol {\mu} _ {k}\right) ^ {l} \exp \left(\boldsymbol {\mu} _ {k} ^ {T} \boldsymbol {f} _ {j} ^ {t}\right)}{\sum_ {k ^ {\prime} = 1} ^ {K} p \left(\boldsymbol {\mu} _ {k ^ {\prime}}\right) ^ {l} \exp \left(\boldsymbol {\mu} _ {k} ^ {T} \boldsymbol {f} _ {j} ^ {t}\right)}. \tag {8} +$$ + +Intuitively, the average predicted probabilities over the target examples for each class are used to estimate the target proportions, with $p(\pmb{\mu}_k)^{l+1}$ shown above providing an estimate based on a single mini-batch of $M$ target samples. To estimate it based on the full dataset, we iteratively update it with $p(\pmb{\mu}_k)^{l+1} \gets (1 - \beta^l)p(\pmb{\mu}_k)^l + \beta^lp(\pmb{\mu}_k)^{l+1}$ , where we follow the decaying schedule of the learning rate of the other parameters to set $\beta^l = \beta_0(1 + \gamma l)^{-\alpha}$ , in which $\gamma = 0.0002$ , $\alpha = 0.75$ . The initial value $\beta_0$ is a hyper-parameter that can be set as either 0 to indicate a uniform prior, or a small value, such as 0.001, to allow the class proportions to be inferred from the data. + +# 3 Related work + +Feature distribution alignment. Most works on domain adaptation with deep learning focus on feature alignment to align either the marginal distributions [46, 6, 8, 47, 48] or the joint distributions [7, 26] of the deep features of neural networks. Early works use adversarial-based objectives, which are equivalent to minimizing the Jensen-Shannon (JS) divergence [49]. When the source and target domains have non-overlapping supports, the JS divergence fails to supply useful gradients [50, 51]. To remedy this issue, researchers propose using the Wasserstein distance, which arises from the optimal transport problem [52]. Courty et al. [9] develop Joint Distribution Optimal Transport (JDOT), defining the transport cost to be the joint cost in the data and prediction spaces. Several works [10, 12] extend this framework for deep neural networks. However, solving for the optimal couplings without + +any relaxation is a linear programming problem, which has a complexity of $\mathcal{O}(M^3\log M)$ [53]. Computing the transport probabilities in our algorithm has a complexity of $\mathcal{O}(d_fMK)$ , which is the same complexity as computing the predictive probabilities that need to be computed by most algorithms. In this category, all the works focus on aligning the target features with source features, whereas we align the target features with prototypes. + +Prototype-based alignment. We make two distinctions to existing works in this area. First, prior domain-adaptation works for classification [29-31] and segmentation [54, 55] utilize prototypes for pseudo-label assignments. By contrast, we use prototypes to behave as representative samples of the source features to define the loss. Second, all of these works use some form of average latent features to construct class prototypes, which is computationally expensive. We instead adopt a parametric approach to learn the prototypes, avoiding that costly computation. + +Learning under shifted class proportions. Although a shift in class proportions between two domains is a common problem in many applications, it is still largely under-explored. Over the years, researchers have viewed the question through different lenses: applying kernel distribution embedding [56, 57, 21], using an EM update [43, 58], placing a meta-prior over the target proportions [59], and casting the problem under causal and anti-causal learning [21-25]. Recently, Tachet des Combes et al. [18] propose aligning the target feature distribution with a re-weighted version of the source feature distribution. While this method achieves consistent improvements over feature-alignment algorithms, it still relies on learning domain-invariant representations. As we have discussed, this approach suffers from the problems of sampling variability and class-mismatching in a mini-batch, whereas the proposed method uses class prototypes and proportion estimation to avoid these issues. + +Source-private adaptation. Finally, the proposed method can also be applied to a source-private setting where without seeing the raw source data, we only have access to the source model and target data while adapting to the target domain [31, 47, 60-63]. Liang et al. [31] introduce a clustering-based approach to generate pseudo-labels for the target data. That approach requires constructing class centers using a weighted average of the latent features. Different from that work, our prototypes behave as class centers and are more amenable to mini-batch stochastic gradient based training. + +# 4 Experiments + +In this section, we evaluate our method under four practical settings: single-source, multi-source, class-imbalance, and source-private domain adaptation. We present the setup, the results, and the analysis of the results in the upcoming sections. + +Datasets. We use the following three datasets of varying sizes in our experiment: 1) Office-31 [3] consists of 4652 images coming from three domains: Amazon (A), Webcam (W), and DSLR (D). The total number of categories is 31. 2) Office-Home [64], a more challenging dataset than Office-31, consists of 15,500 images over 65 classes and four domains: Artistic images (Ar), Clip art (Cl), Product images (Pr), and Real-world (Rw). 3) DomainNet [65] is a large-scale dataset for domain adaptation. It consists of about 569,010 images with 345 categories from six domains: Clipart, Infograph, Painting, Quickdraw, Real, and Sketch. We further perform experiments on Cross-Digits, ImageClef, Office-Caltech, and VisDA datasets and provide the details in Appendix E.2. + +Implementation details. We implement our method on top of the open-source transfer learning library (MIT license) [66], adopting the default neural network architectures for both the feature encoder and linear classifier. For the feature encoder network, we utilize a pre-trained ResNet-50 in all experiments except for multi-source domain adaptation, where we use a pre-trained ResNet-101. We fine-tune the feature encoder and train the linear layers from random initialization. The linear layers have the learning rate of 0.01, 10 times that of the feature encoder. The learning rate follows the following schedule as $\eta_{\mathrm{iter}} = \eta_0(1 + \gamma \mathrm{iter})^{-\alpha}$ , where $\eta_0$ is the initial learning rate. We set $\eta_0$ to 0.01, $\gamma$ to 0.0002, and $\alpha$ to 0.75. We utilize a mini-batch SGD with a momentum of 0.9. We set the batch size for the source data as $N = 32$ and that for the target data as $M = 96$ . We use all the labeled source samples and unlabeled target samples [6, 7, 26]. We set $\beta_0$ to 0 (a uniform prior) in all settings except for the sub-sampled target datasets. We perform a sensitivity analysis (see Appendix E) and set $\beta_0$ empirically to 0.001 for the sub-sampled target version of Office-31 and 0.0001 for that of Office-Home. We report the average accuracy from three independent runs. All experiments are conducted using a single Nvidia Tesla V100 GPU except for the DomainNet experiment, where we use four V100 GPUs. More implementation details can be found in Appendix D. + +# 4.1 Main results + +Single-source setting. We perform single-source domain adaptation on the Office-31 and Office-Home datasets. In each experiment, one domain serves as the source domain and another as the target domain. We consider all permutations, leading to 6 tasks for the Office-31 dataset and 12 tasks for the Office-Home dataset. We compare our algorithm with state-of-the-art algorithms for domain adaptations from three different categories: adversarial-based, divergence-based, and optimal transport-based. We report the results on Office-31 in Table 1. PCT significantly outperforms the baselines, especially on the more difficult transfer tasks (D→A and W→A). Although MDD [67], the best baseline domain-adaptation method, uses a bigger classifier, PCT still has $1.1\%$ higher average accuracy. In Figure 4a, we visualize the number of parameters versus the average accuracy on the Office-31 dataset. While PCT uses fewer parameters than most methods, it still achieves the highest average accuracy. We report the average accuracies on the Office-Home dataset in Table 2. PCT outperforms baseline methods on 10 of the 12 transfer tasks, yielding $3.7\%$ improvement on the average accuracy over MDD. The results in this setting demonstrate that aligning the target features with prototypes is more effective than directly aligning them with the source features. + +Table 1: Accuracy (%) on Office-31 for unsupervised domain adaptation (ResNet-50). + +
CategoryMethodA → WD → WW → DA → DD → AW → AAvg
ResNet-50 [68]68.4 ± 0.296.7 ± 0.199.3 ± 0.168.9 ± 0.262.5 ± 0.360.7 ± 0.376.1
AdversarialDANN [6]82.0 ± 0.496.9 ± 0.299.1 ± 0.179.7 ± 0.468.2 ± 0.467.4 ± 0.582.2
ADDA [47]86.2 ± 0.596.2 ± 0.398.4 ± 0.377.8 ± 0.369.5 ± 0.468.9 ± 0.582.9
CDAN [26]94.1 ± 0.198.6 ± 0.1100.0 ± 0.092.9 ± 0.271.0 ± 0.369.3 ± 0.387.7
MDD [67]94.5 ± 0.398.4 ± 0.1100.0 ± 0.093.5 ± 0.274.6 ± 0.372.2 ± 0.188.9
DivergenceJAN [7]85.4 ± 0.397.4 ± 0.299.8 ± 0.284.7 ± 0.368.6 ± 0.370.0 ± 0.484.3
TPN [29]91.2 ± 0.397.7 ± 0.299.5 ± 0.189.9 ± 0.270.5 ± 0.273.5 ± 0.187.1
OTDeepJDOT [10]88.9 ± 0.398.5 ± 0.199.6 ± 0.288.2 ± 0.172.1 ± 0.470.1 ± 0.486.2
ETD [69]92.1100.0100.088.071.067.886.2
PCT (Ours)94.6 ± 0.598.7 ± 0.499.9 ± 0.193.8 ± 1.877.2 ± 0.576.0 ± 0.990.0
+ +Table 2: Accuracy (%) on Office-Home for unsupervised domain adaptation (ResNet-50). + +
MethodAr → ClAr → PrAr → RwCl → ArCl → PrCl → RwPr → ArPr → ClPr → RwRw → ArRw → ClRw → RwRw → PrAvg
ResNet-50 [68]34.950.058.037.441.946.238.531.260.453.941.259.946.1
DANN [6]45.659.370.147.058.560.946.143.768.563.251.876.857.6
CDAN [26]50.770.676.057.670.070.057.450.977.370.956.781.665.8
MDD [67]54.973.777.860.071.471.861.253.678.172.560.282.368.1
JAN [7]45.961.268.950.459.761.045.843.470.363.952.476.858.3
TPN [29]51.271.276.065.172.972.855.448.976.570.953.480.466.2
DeepJDOT [10]48.269.274.558.569.171.156.346.076.568.052.780.964.3
ETD [69]51.371.985.757.669.273.757.851.279.370.257.582.167.3
PCT (Ours)57.1 ±0.378.3 ±1.281.4 ±0.467.6 ±0.377.0 ±1.276.5 ±0.568.0 ±0.555.0 ±0.681.3 ±0.274.7 ±0.560.0 ±0.585.3 ±0.371.8
+ +Multi-source setting. In this setting, we evaluate our method using Office-Home and DomainNet datasets [65]. For each task, we select one domain as the target domain and use the remaining five domains as the source. We use the same data splitting scheme as the original paper [65]. We compare against source-combined and multi-source algorithms introduced in Venkat et al. [70] for Office-Home and in Peng et al. [65] for DomainNet. Multi-source algorithms use domain labels and a classifier for each source domain, whereas source-combined algorithms combine all the source domains into a single source domain and perform single-source adaptation. We adopt a single classifier and do not use domain labels. Thus, PCT falls under the source-combined category. We report the results in Tables 3 and 4. While PCT is not designed specifically for multi-source domain adaptation, our method still outperforms those multi-source algorithms in both datasets. Since there are more variations of the data in the source domain in this setting, the increase in performance gain verifies our intuition that prototypes help mitigate the problem of sampling variability. + +Table 3: Accuracy (%) on Office-Home for ResNet50-based MSDA methods. + +
CategoryModelsR → ArR → ClR → PrR → RwAvg
Source- +combinedDAN [8]68.559.479.082.572.4
D-CORAL [71]68.158.679.582.772.2
RevGrad [6]68.459.179.582.772.4
Multi-sourceMFSAN [72]72.162.080.381.874.1
SImpAl [70]70.856.380.281.572.2
PCT (Ours)76.3 ± 0.564.1 ± 0.484.9 ± 0.884.3 ± 0.577.4
+ +Table 4: Accuracy (%) on DomainNet for ResNet101-based MSDA methods. + +
CategoryModelsR → ClipartR → InfographR → PaintingR → QuickdrawR → RealR → SketchAvg
Multi-sourceDCTN [73]48.6 ± 0.723.5 ± 0.648.8 ± 0.67.2 ± 0.453.5 ± 0.647.3 ± 0.538.2 ± 0.6
M3SDA [65]57.2 ± 1.024.2 ± 1.251.6 ± 0.45.2 ± 0.561.6 ± 0.949.6 ± 0.641.5 ± 0.7
M3SDA-β [65]58.6 ± 0.526.0 ± 0.952.3 ± 0.66.3 ± 0.662.7 ± 0.549.5 ± 0.842.6 ± 0.6
ML-MSDA [74]61.4 ± 0.826.2 ± 0.451.9 ± 0.219.1 ± 0.357.0 ± 1.050.3 ± 0.744.3 ± 0.6
Source-combinedResNet-101 [24]47.6 ± 0.513.0 ± 0.438.1 ± 0.513.3 ± 0.451.9 ± 0.933.7 ± 0.532.9 ± 0.5
DAN [8]45.4 ± 0.512.8 ± 0.936.2 ± 0.615.3 ± 0.448.6 ± 0.734.0 ± 0.532.1 ± 0.6
RTN [75]44.2 ± 0.612.6 ± 0.735.3 ± 0.614.6 ± 0.848.4 ± 0.731.7 ± 0.731.1 ± 0.7
JAN [7]40.9 ± 0.411.1 ± 0.635.4 ± 0.512.1 ± 0.745.8 ± 0.632.3 ± 0.629.6 ± 0.6
DANN [6]45.5 ± 0.613.1 ± 0.737.0 ± 0.713.2 ± 0.848.9 ± 0.731.8 ± 0.632.6 ± 0.7
ADDAA [47]47.5 ± 0.811.4 ± 0.736.7 ± 0.514.7 ± 0.549.1 ± 0.833.5 ± 0.532.2 ± 0.6
SE [38]24.7 ± 0.33.9 ± 0.512.7 ± 0.47.1 ± 0.522.8 ± 0.59.1 ± 0.516.1 ± 0.4
MCD [76]54.3 ± 0.622.1 ± 0.745.7 ± 0.67.6 ± 0.558.4 ± 0.743.5 ± 0.638.5 ± 0.6
PCT (Ours)67.2 ± 0.526.1 ± 0.255.0 ± 0.216.2 ± 0.267.1 ± 0.253.7 ± 0.647.6 ± 0.1
+ +Sub-sampled setting. In many cases, the label proportions could significantly change from one dataset to another, resulting in a decrease in a model's performance. To test our algorithm under this setting, we follow the experimental protocol in Tachet des Combes et al. [18]. We keep only thirty percent of the first $\lfloor K / 2\rfloor$ classes to simulate class imbalance. We directly take their results for the sub-sampled source data and perform additional experiments using the same sub-sampling scheme on the target data. The baselines in this setting are standard domain adaptation methods (DAN, JAN, and CDAN) and their importance weighted versions introduced in Tachet des Combes et al. [18]. We present the results in Table 5. On the sub-sampled source data, PCT with uniform prior outperforms the second-best method (IWCDAN) by $4 \%$ on Office-31 and $6.6\%$ on Office-Home. Learning the prior distribution on the target domain does not improve the result, as this setting does not have a serious imbalance issue in the target domain. On the sub-sampled target data, PCT with a uniform prior already outperforms the baselines, $1.9\%$ and $5.2\%$ higher average accuracy than IWCDAN's on Office-31 and Office-Home, respectively. Using a learnable prior further improves upon using a uniform prior by $1.0\%$ on Office-31 and by $0.4\%$ on Office-Home. The improvements confirm our intuition that prototypes help with the class imbalance in both the source and target domain while estimating the target proportion further boosts the performance in the target domain sub-sampled setting. We visualize the estimated proportions on the target data in Figure 3, verifying that the proportions are inferred correctly. + +Table 5: Average accuracy (%) on sub-sampled version of Office-31 and Office-Home (ResNet-50). + +
Methodsub-S O-31sub-T O-31sub-S O-Hsub-T O-H
ResNet-50 [68]75.776.151.458.2
DANN [8]76.275.951.858.3
JAN [7]78.278.153.961.4
CDAN [26]81.683.056.363.1
IWDAN [18]82.679.257.658.6
IWJAN [18]82.682.855.962.0
IWCDAN [18]83.983.561.264.6
PCT-Uniform (Ours)87.9 ± 0.485.4 ± 0.367.8 ± 0.369.8 ± 0.2
PCT-Learnable (Ours)87.9 ± 0.486.4 ± 0.267.8 ± 0.370.2 ± 0.2
+ +Source-data-private setting. In many practical applications, practitioners might not directly have access to the source data in the adaptation stage. Instead, a trained model on the source data is provided. In this setting, the goal is to adapt to the target domain while only operating on the given model. We compare our method with Source Hypothesis Transfer (SHOT) [31], a state-of-the-art method proposed specifically for this setting. SHOT contains two losses: an information maximization (IM) loss and a pseudo-labeling loss. We follow their experimental protocol by first training the model on the source data alone. During the adaptation stage, we only use the target data to perform model adaptation. We use the transport losses to update the feature encoder while fixing the prototypes. We report the results in Table 6. From the standard setting where we have access to source data in Table 1, the average accuracy drops by $1.6\%$ for Office-31 and by $0.8\%$ for Office-Home. On the Office-31 dataset, our bi-directional loss outperforms the IM loss by $1.1\%$ and the pseudo label loss by $0.8\%$ . While the average accuracy for our method is $0.2\%$ lower than both of their losses combined, the $p$ -value for the independent two-sample $t$ -test on the accuracies of different runs is 0.32, which is not statistically significant. On the Office-Home dataset, our approach performs $1.9\%$ and $0.5\%$ better than the pseudo label and IM losses, respectively. While their combined loss achieves $0.8\%$ accuracy higher than that of our method, the pseudo-labeling loss in SHOT requires + +![](images/40a5dce6d12dafe108124448c68dcdcb3aeea8ee0ae5ea8a56fbed951729d5f9.jpg) +Figure 3: Visualization of the estimated target proportions versus true class proportions for the task $\mathrm{A} \rightarrow \mathrm{sD}$ on the Office-31 dataset. The dotted line represents a uniform proportion. It is clear that each orange bar (the learned proportions) is close to its adjacent blue bar (the true proportion). To quantify this observation, we measure the L1 loss between the true and learned proportions. The estimated proportions achieve lower L1 loss than the uniform distribution (0.16 vs 0.58), illustrating the effectiveness of our estimation strategy. + +Table 6: Average Accuracy (%) on the source-private Office-31 and Office-Home (ResNet-50). + +
Source Model OnlySHOT-Pseudo Label [31]SHOT-IM [31]SHOT [31]PCT (Ours)
Office-3179.387.6 ±0.587.3 ±0.588.6 ±0.488.4 ±0.6
Office-Home60.269.1 ±0.670.5±0.371.8 ±0.471.0 ±0.6
+ +constructing class centers, which does not scale well with large datasets. Our approach uses the classifier's weights as class prototypes to avoid this issue. + +# 4.2 Analysis of results + +Ablation study. To examine the effect of each component in our framework, we perform ablation studies and present the results in Table 7. 1) Alignment strategy. Next, we present the result using optimal transport as the alignment strategy. We consider two variants of Prototype-oriented Optimal Transport (POT): exact linear program (POT) and Sinkhorn relaxation (POT-Sinkhorn). In each variant, we solve for the optimal couplings using the optimal transport formulation. After obtaining the transport probabilities, we update the feature encoder using the obtained probabilities as the weights for the transport cost. We can see that POT performs $1.7\%$ better than DeepJDOT in Table 1, showing the effectiveness of using prototypes to define the transport costs with the target features. Still, both versions of POT underperforms PCT by $2.1\%$ and $1.7\%$ , respectively. 2) Effect of each loss in PCT. We examine the effect of each loss on the average test accuracy on the Office-31 dataset. We remove each transport loss while keeping the cross-entropy loss. The bi-directional loss leads to the best accuracy, while the drop in accuracy is more significant if we remove $\mathcal{L}_{\mu \rightarrow t}$ . This result is not surprising because, without $\mathcal{L}_{\mu \rightarrow t}$ , the model can map target data to only a few prototypes, leading to a degenerate solution. 3) Gradient stopping. We also show the algorithm's performance without stopping the gradient of $\pmb{\mu}$ in the transport loss. PCT gains an additional $1.0\%$ in accuracy with the gradient stopping strategy. The performance gain is consistent with the finding in recent work by Chen and He [77], where the authors apply the gradient stopping strategy to avoid degenerate solutions in contrastive learning. 4) Cost function. Finally, we explore the cost function inspired by the radial basis kernel. We can see that the cosine distance in PCT gives $3.1\%$ higher average accuracy. In short, the choice of the probabilistic bi-directional transport framework, gradient-stopping strategy, and point-to-point cost function all contribute to the success of the proposed PCT method. + +Table 7: Average accuracy (%) of PCT on Office-31 under different variants (ResNet-50). + +
POTPOT-SinkhornPCT w/o (Lt→μ)PCT w/o (Lμ→t)w/o stop-gradc(μk, ftj) = exp(-μkTfj)PCT (Ours)
87.9 ± 0.888.3 ± 0.988.6 ± 0.284.3 ± 0.989.0 ± 0.386.9 ± 0.490.0 ± 0.5
+ +![](images/70603fb3801dbf3a4ddb8644f83e7ea8d2ee4b937e00f5e17bde7a4ea61df288.jpg) +(a) + +![](images/319fd3fe024a7fdc05316acefe4d2b45edd457ee4958332ca82a314d13ad5617.jpg) +(b) +Figure 4: (a) Analysis of parameter efficiency, (b) comparison of convergence, and (c) a t-SNE visualization of the output of the feature encoder trained with PCT on the task $\mathrm{A} \rightarrow \mathrm{W}$ . In plot (c), prototypes ( $\star$ ), source features ( $\cdot$ ), and target features ( $\times$ ) are tightly clustered together for each class. + +![](images/537c73741d5f07efbb15f8c9a4c272aee70f9976fabdf52ccb6a6260ed5e22a9.jpg) +(c) + +Convergence comparison. We plot test accuracy versus iteration number on the task $(\mathrm{A} \rightarrow \mathrm{W})$ in Figure 4b to compare the convergence rate of different algorithms. We also visualize test accuracy versus convergence time in minutes in Appendix E. In both plots, PCT quickly converges within the first one thousand iterations, and the test accuracy does not fluctuate much thereafter. This phenomenon is not surprising since we use prototypes instead of the source features to align with the target features. We expect the prototypes to behave as representative samples of the source features, making the model converge quickly and stably. + +Visualization. We visualize in Figure 4c the t-SNE plot of the source and target features as well as the prototypes for the task $\mathrm{A} \rightarrow \overline{\mathrm{W}}$ . Figure 4c shows that both the source (dots $\cdot$ ) and target (crosses $\times$ ) features are close to the prototypes (black stars $\star$ ), indicating that our algorithm is learning meaningful prototypes and successfully align the target features with the prototypes. + +# 5 Conclusion + +We offer a holistic framework for unsupervised domain adaptation through the lens of a probabilistic bi-directional transport between the target features and class prototypes. With extensive experiments under various application scenarios of unsupervised domain adaptation, we show that the proposed prototype-oriented alignment method works well on multiple datasets, is robust against class imbalance, and can perform domain adaptation with no direct access to the source data. Without adding additional model parameters, our memory and computation-efficient algorithm achieves competitive performance with state-of-the-art methods on several widely used benchmarks. + +# Acknowledgments + +We thank Camillia Smith Barnes and Georgii Riabov for helpful discussions and feedback on the paper. K. Tanwisuth, X. Fan, H. Zheng, S. Zhang, and M. Zhou acknowledge the support of Grant IIS-1812699 from the U.S. National Science Foundation, the APX 2019 project sponsored by the Office of the Vice President for Research at The University of Texas at Austin, the support of a gift fund from ByteDance Inc., and the Texas Advanced Computing Center (TACC) for providing HPC resources that have contributed to the research results reported within this paper. + +# References + +[1] Ali Farhadi and Mostafa Kamali Tabrizi. Learning to recognize activities from the wrong view point. In European conference on computer vision, pages 154-166. Springer, 2008. +[2] Hidetoshi Shimodaira. Improving predictive inference under covariate shift by weighting the log-likelihood function. Journal of statistical planning and inference, 90(2):227-244, 2000. +[3] Kate Saenko, Brian Kulis, Mario Fritz, and Trevor Darrell. Adapting visual category models to new domains. In European conference on computer vision, pages 213-226. Springer, 2010. +[4] Shai Ben-David, John Blitzer, Koby Crammer, and Fernando Pereira. Analysis of representations for domain adaptation. In B. Schölkopf, J. Platt, and T. Hoffman, editors, Advances in Neural Information Processing Systems, volume 19. MIT Press, 2007. +[5] Shai Ben-David, John Blitzer, Koby Crammer, Alex Kulesza, Fernando Pereira, and Jennifer Vaughan. A theory of learning from different domains. Machine Learning, 79:151-175, 2010. +[6] Yaroslav Ganin and Victor S. Lempitsky. Unsupervised domain adaptation by backpropagation. In Francis R. Bach and David M. Blei, editors, ICML, volume 37 of JMLR Workshop and Conference Proceedings, pages 1180-1189. JMLR.org, 2015. +[7] Mingsheng Long, Han Zhu, Jianmin Wang, and Michael I. Jordan. Deep transfer learning with joint adaptation networks. In Doina Precup and Yee Whye Teh, editors, Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 2208-2217. PMLR, 06-11 Aug 2017. +[8] Mingsheng Long, Yue Cao, Jianmin Wang, and Michael I. Jordan. Learning transferable features with deep adaptation networks. In Proceedings of the 32nd International Conference on Machine Learning, ICML 2015, Lille, France, 6-11 July 2015, pages 97-105, 2015. +[9] Nicolas Courty, Rémi Flamary, Amaury Habrard, and Alain Rakotomamonjy. Joint distribution optimal transportation for domain adaptation. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017. +[10] Bharath Bhushan Damodaran, Benjamin Kellenberger, Rémi Flamary, Devis Tuia, and Nicolas Courty. DeepJDOT: Deep joint distribution optimal transport for unsupervised domain adaptation. CoRR, abs/1803.10081, 2018. +[11] Chen-Yu Lee, Tanmay Batra, Mohammad Haris Baig, and Daniel Ulbricht. Sliced Wasserstein discrepancy for unsupervised domain adaptation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10285-10295, 2019. +[12] Renjun Xu, Pelen Liu, Liyan Wang, Chao Chen, and Jindong Wang. Reliable weighted optimal transport for unsupervised domain adaptation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), June 2020. +[13] Arthur Gretton, Karsten M Borgwardt, Malte J Rasch, Bernhard Schölkopf, and Alexander Smola. A kernel two-sample test. The Journal of Machine Learning Research, 13(1):723-773, 2012. +[14] Leonid V Kantorovich. On the translocation of masses. Journal of Mathematical Sciences, 133 (4):1381-1382, 2006. +[15] Gabriel Peyre and Marco Cuturi. Computational optimal transport. Foundations and Trends in Machine Learning, 11(5-6):355-607, 2019. +[16] Matthieu Lerasle, Zoltán Szabó, Timothée Mathieu, and Guillaume Lecué. Monk outlier-robust mean embedding estimation by median-of-means. In International Conference on Machine Learning, pages 3782–3793. PMLR, 2019. +[17] Yogesh Balaji, Rama Chellappa, and Soheil Feizi. Robust optimal transport with applications in generative modeling and domain adaptation. In Advances in Neural Information Processing Systems, 2020. + +[18] Remi Tachet des Combes, Han Zhao, Yu-Xiang Wang, and Geoff Gordon. Domain adaptation with conditional distribution matching and generalized label shift. In Advances in Neural Information Processing Systems, 2020. +[19] Fredrik D. Johansson, David Sontag, and Rajesh Ranganath. Support and invertibility in domain-invariant representations. In Kamalika Chaudhuri and Masashi Sugiyama, editors, Proceedings of Machine Learning Research, volume 89 of Proceedings of Machine Learning Research, pages 527-536, 16-18 Apr 2019. +[20] Yves Grandvalet, Yoshua Bengio, et al. Semi-supervised learning by entropy minimization. In CAP, pages 281-296, 2005. +[21] Kun Zhang, Bernhard Schölkopf, Krikamol Muandet, and Zhikun Wang. Domain adaptation under target and conditional shift. In International Conference on Machine Learning, pages 819-827. PMLR, 2013. +[22] Bernhard Schölkopf, Dominik Janzing, Jonas Peters, Eleni Sgouritsa, Kun Zhang, and Joris Mooij. On causal and anticausal learning. arXiv preprint arXiv:1206.6471, 2012. +[23] Mingming Gong, Kun Zhang, Tongliang Liu, Dacheng Tao, Clark Glymour, and Bernhard Schölkopf. Domain adaptation with conditional transferable components. In International conference on machine learning, pages 2839-2848. PMLR, 2016. +[24] Zachary Lipton, Yu-Xiang Wang, and Alexander Smola. Detecting and correcting for label shift with black box predictors. In International conference on machine learning, pages 3122-3130. PMLR, 2018. +[25] Kamyar Azizzadenesheli, Anqi Liu, Fanny Yang, and Animashree Anandkumar. Regularized learning for domain adaptation under label shifts. arXiv preprint arXiv:1903.09734, 2019. +[26] Mingsheng Long, Zhangjie Cao, Jianmin Wang, and Michael I Jordan. Conditional adversarial domain adaptation. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018. +[27] Huangjie Zheng and Mingyuan Zhou. Comparing probability distributions with conditional transport. arXiv preprint arXiv:2012.14100, 2020. +[28] Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 4080-4090, 2017. +[29] Yingwei Pan, Ting Yao, Yehao Li, Yu Wang, Chong-Wah Ngo, and Tao Mei. Transferrable prototypical networks for unsupervised domain adaptation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2019. +[30] Guoliang Kang, Lu Jiang, Yi Yang, and Alexander G Hauptmann. Contrastive adaptation network for unsupervised domain adaptation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4893-4902, 2019. +[31] 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, pages 6028-6039. PMLR, 2020. +[32] Xiangyu Yue, Zangwei Zheng, Shanghang Zhang, Yang Gao, Trevor Darrell, Kurt Keutzer, and Alberto Sangiovanni Vincentelli. Prototypical cross-domain self-supervised learning for few-shot unsupervised domain adaptation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 13834-13844, 2021. +[33] 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, pages 8050-8058, 2019. + +[34] Takeru Miyato, Shin-ichi Maeda, Masanori Koyama, and Shin Ishii. Virtual adversarial training: a regularization method for supervised and semi-supervised learning. IEEE transactions on pattern analysis and machine intelligence, 41(8):1979–1993, 2018. +[35] Samuli Laine and Timo Aila. Temporal ensembling for semi-supervised learning. arXiv preprint arXiv:1610.02242, 2016. +[36] Yuan Shi and Fei Sha. Information-theoretical learning of discriminative clusters for unsupervised domain adaptation. arXiv preprint arXiv:1206.6438, 2012. +[37] Rui Shu, Hung H Bui, Hirokazu Narui, and Stefano Ermon. A dirt-t approach to unsupervised domain adaptation. arXiv preprint arXiv:1802.08735, 2018. +[38] Geoffrey French, Michal Mackiewicz, and Mark Fisher. Self-ensembling for visual domain adaptation. arXiv preprint arXiv:1706.05208, 2017. +[39] Tuan-Hung Vu, Himalaya Jain, Maxime Bucher, Matthieu Cord, and Patrick Pérez. Advent: Adversarial entropy minimization for domain adaptation in semantic segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2517-2526, 2019. +[40] Kuniaki Saito, Donghyun Kim, Stan Sclaroff, and Kate Saenko. Universal domain adaptation through self supervision. arXiv preprint arXiv:2002.07953, 2020. +[41] Pietro Morerio, Jacopo Cavazza, and Vittorio Murino. Minimal-entropy correlation alignment for unsupervised deep domain adaptation. arXiv preprint arXiv:1711.10288, 2017. +[42] Xiaofu Wu, Quan Zhou, Zhen Yang, Chunming Zhao, Longin Jan Latecki, et al. Entropy minimization vs. diversity maximization for domain adaptation. arXiv preprint arXiv:2002.01690, 2020. +[43] Marco Saerens, Patrice Latinne, and Christine Decaestecker. Adjusting the outputs of a classifier to new a priori probabilities: a simple procedure. Neural computation, 14(1):21-41, 2002. +[44] Guoliang Kang, Liang Zheng, Yan Yan, and Yi Yang. Deep adversarial attention alignment for unsupervised domain adaptation: the benefit of target expectation maximization. In Proceedings of the European Conference on Computer Vision (ECCV), pages 401-416, 2018. +[45] Amr Alexandari, Anshul Kundaje, and Avanti Shrikumar. Maximum likelihood with bias-corrected calibration is hard-to-beat at label shift adaptation. In International Conference on Machine Learning, pages 222-232. PMLR, 2020. +[46] Eric Tzeng, Judy Hoffman, Ning Zhang, Kate Saenko, and Trevor Darrell. Deep domain confusion: Maximizing for domain invariance. arXiv preprint arXiv:1412.3474, 2014. +[47] Eric Tzeng, Judy Hoffman, Kate Saenko, and Trevor Darrell. Adversarial discriminative domain adaptation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 7167-7176, 2017. +[48] Shujian Zhang, Xinjie Fan, Huangjie Zheng, Korawat Tanwisuth, and Mingyuan Zhou. Alignment attention by matching key and query distributions. In NeurIPS 2021: Neural Information Processing Systems, Dec. 2021. (the first two authors contributed equally). +[49] Ian J Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial networks. arXiv preprint arXiv:1406.2661, 2014. +[50] Martin Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein generative adversarial networks. In International conference on machine learning, pages 214-223. PMLR, 2017. +[51] Soheil Kolouri, Phillip E Pope, Charles E Martin, and Gustavo K Rohde. Sliced Wasserstein auto-encoders. In International Conference on Learning Representations, 2018. +[52] Cédric Villani. Optimal transport: old and new, volume 338. Springer Science & Business Media, 2008. + +[53] Quentin Mérigot and Edouard Oudet. Discrete optimal transport: complexity, geometry and applications. Discrete & Computational Geometry, 55(2):263-283, 2016. +[54] Qiming Zhang, Jing Zhang, Wei Liu, and Dacheng Tao. Category anchor-guided unsupervised domain adaptation for semantic segmentation. arXiv preprint arXiv:1910.13049, 2019. +[55] Shaoan Xie, Zibin Zheng, Liang Chen, and Chuan Chen. Learning semantic representations for unsupervised domain adaptation. In International conference on machine learning, pages 5423-5432. PMLR, 2018. +[56] Martinus Christoffel Du Plessis and Masashi Sugiyama. Semi-supervised learning of class balance under class-prior change by distribution matching. Neural Networks, 50:110-119, 2014. +[57] Tuan Duong Nguyen, Marthinus Christoffel, and Masashi Sugiyama. Continuous target shift adaptation in supervised learning. In Asian Conference on Machine Learning, pages 285-300. PMLR, 2016. +[58] Yee Seng Chan and Hwee Tou Ng. Word sense disambiguation with distribution estimation. In *IJCAI*, volume 5, pages 1010-5. CiteSeer, 2005. +[59] Amos Storkey. When training and test sets are different: Characterizing learning transfer. Dataset shift in machine learning, 30:3-28, 2009. +[60] Rui Li, Qianfen Jiao, Wenming Cao, Hau-San Wong, and Si Wu. Model adaptation: Unsupervised domain adaptation without source data. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9641-9650, 2020. +[61] Vinod K Kurmi, Venkatesh K Subramanian, and Vinay P Namboodiri. Domain impression: A source data free domain adaptation method. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 615-625, 2021. +[62] Jogendra Nath Kundu, Rahul Mysore Venkatesh, Naveen Venkat, Ambareesh Revanur, and R Venkatesh Babu. Class-incremental domain adaptation. In Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part XIII 16, pages 53-69. Springer, 2020. +[63] Jogendra Nath Kundu, Naveen Venkat, R Venkatesh Babu, et al. Universal source-free domain adaptation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 4544-4553, 2020. +[64] Hemanth Venkateswara, Jose Eusebio, Shayok Chakraborty, and Sethuraman Panchanathan. Deep hashing network for unsupervised domain adaptation. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 5018-5027, 2017. +[65] 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, pages 1406-1415, 2019. +[66] Mingsheng Long Junguang Jiang, Bo Fu. Transfer-learning-library. https://github.com/thuml/Transfer-Learning-Library, 2020. +[67] Yuchen Zhang, Tianle Liu, Mingsheng Long, and Michael Jordan. Bridging theory and algorithm for domain adaptation. In International Conference on Machine Learning, pages 7404-7413. PMLR, 2019. +[68] 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, pages 770-778, 2016. +[69] Mengxue Li, Yi-Ming Zhai, You-Wei Luo, Peng-Fei Ge, and Chuan-Xian Ren. Enhanced transport distance for unsupervised domain adaptation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 13936–13944, 2020. + +[70] Naveen Venkat, Jogendra Nath Kundu, Durgesh Kumar Singh, Ambareesh Revanur, and R Venkatesh Babu. Your classifier can secretly suffice multi-source domain adaptation. arXiv preprint arXiv:2103.11169, 2021. +[71] Baochen Sun and Kate Saenko. Deep coral: Correlation alignment for deep domain adaptation. In European conference on computer vision, pages 443-450. Springer, 2016. +[72] Yongchun Zhu, Fuzhen Zhuang, and Deqing Wang. Aligning domain-specific distribution and classifier for cross-domain classification from multiple sources. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 5989-5996, 2019. +[73] Ruijia Xu, Ziliang Chen, Wangmeng Zuo, Junjie Yan, and Liang Lin. Deep cocktail network: Multi-source unsupervised domain adaptation with category shift. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3964-3973, 2018. +[74] Zhenpeng Li, Zhen Zhao, Yuhong Guo, Haifeng Shen, and Jieping Ye. Mutual learning network for multi-source domain adaptation. arXiv preprint arXiv:2003.12944, 2020. +[75] Mingsheng Long, Han Zhu, Jianmin Wang, and Michael I Jordan. Unsupervised domain adaptation with residual transfer networks. arXiv preprint arXiv:1602.04433, 2016. +[76] Kuniaki Saito, Kohei Watanabe, Yoshitaka Ushiku, and Tatsuya Harada. Maximum classifier discrepancy for unsupervised domain adaptation. CoRR, abs/1712.02560, 2017. +[77] Xinlei Chen and Kaiming He. Exploring simple siamese representation learning. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 15750-15758, 2021. +[78] Tatiana Tommasi, Novi Patricia, Barbara Caputo, and Tinne Tuytelaars. A deeper look at dataset bias. In Domain adaptation in computer vision applications, pages 37-55. Springer, 2017. +[79] Boqing Gong, Fei Sha, and Kristen Grauman. Overcoming dataset bias: An unsupervised domain adaptation approach. In NIPS Workshop on Large Scale Visual Recognition and Retrieval, volume 3. CiteSeer, 2012. +[80] Paul S Bradley, Kristin P Bennett, and Ayhan Demiriz. Constrained K-means clustering. *Microsoft Research, Redmond*, 20(0):0, 2000. +[81] Yuki Markus Asano, Christian Rupprecht, and Andrea Vedaldi. Self-labelling via simultaneous clustering and representation learning. arXiv preprint arXiv:1911.05371, 2019. \ No newline at end of file diff --git a/aprototypeorientedframeworkforunsuperviseddomainadaptation/images.zip b/aprototypeorientedframeworkforunsuperviseddomainadaptation/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..91ef1fdd598808afd13473851fdd007c17825545 --- /dev/null +++ b/aprototypeorientedframeworkforunsuperviseddomainadaptation/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:552536016d15102d582d4b1bddf897d22359d7bd511c43affa415258978f46ac +size 560746 diff --git a/aprototypeorientedframeworkforunsuperviseddomainadaptation/layout.json b/aprototypeorientedframeworkforunsuperviseddomainadaptation/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..0dde70c51755f0298c4e2df9e7a0b3dd84cd5ad1 --- /dev/null +++ b/aprototypeorientedframeworkforunsuperviseddomainadaptation/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6e81f76de108ba7425647b06bf243528aa99e3c3ab02e366e7b6ee04f7b1cef8 +size 436167 diff --git a/aprovablyefficientmodelfreeposteriorsamplingmethodforepisodicreinforcementlearning/4012aae2-b8e8-46d7-9754-126a12719425_content_list.json b/aprovablyefficientmodelfreeposteriorsamplingmethodforepisodicreinforcementlearning/4012aae2-b8e8-46d7-9754-126a12719425_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..b57fdf1bdf8da1860733d0dcacec2c609b3c5a54 --- /dev/null +++ b/aprovablyefficientmodelfreeposteriorsamplingmethodforepisodicreinforcementlearning/4012aae2-b8e8-46d7-9754-126a12719425_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:686050f6eb6ee435ea02621db7de4505bc127726e25d64c5396d227292076ca8 +size 81016 diff --git a/aprovablyefficientmodelfreeposteriorsamplingmethodforepisodicreinforcementlearning/4012aae2-b8e8-46d7-9754-126a12719425_model.json b/aprovablyefficientmodelfreeposteriorsamplingmethodforepisodicreinforcementlearning/4012aae2-b8e8-46d7-9754-126a12719425_model.json new file mode 100644 index 0000000000000000000000000000000000000000..6126842184ed6e576847fd0494cadb4682d8b7ba --- /dev/null +++ b/aprovablyefficientmodelfreeposteriorsamplingmethodforepisodicreinforcementlearning/4012aae2-b8e8-46d7-9754-126a12719425_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3915b1598c4513602307e8bdd95fae0653d8aa8135c3edefba63e704b49b2d9f +size 96630 diff --git a/aprovablyefficientmodelfreeposteriorsamplingmethodforepisodicreinforcementlearning/4012aae2-b8e8-46d7-9754-126a12719425_origin.pdf b/aprovablyefficientmodelfreeposteriorsamplingmethodforepisodicreinforcementlearning/4012aae2-b8e8-46d7-9754-126a12719425_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..535b344d25601f9d7519624c8dc9e19252ebd28a --- /dev/null +++ b/aprovablyefficientmodelfreeposteriorsamplingmethodforepisodicreinforcementlearning/4012aae2-b8e8-46d7-9754-126a12719425_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c168b054b6719e7c356f6b0aa286273bc85305c31e56a561c3532700ad3ad4dd +size 315643 diff --git a/aprovablyefficientmodelfreeposteriorsamplingmethodforepisodicreinforcementlearning/full.md b/aprovablyefficientmodelfreeposteriorsamplingmethodforepisodicreinforcementlearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..40dd9a070e5712dacfa0e15e0223746449f3df04 --- /dev/null +++ b/aprovablyefficientmodelfreeposteriorsamplingmethodforepisodicreinforcementlearning/full.md @@ -0,0 +1,406 @@ +# A Provably Efficient Model-Free Posterior Sampling Method for Episodic Reinforcement Learning + +Christoph Dann +Google Research + +Mehryar Mohri +Google Research and NYU + +Tong Zhang +Google Research and HKUST + +Julian Zimmert +Google Research + +# Abstract + +Thompson Sampling is one of the most effective methods for contextual bandits and has been generalized to posterior sampling for certain MDP settings. However, existing posterior sampling methods for reinforcement learning are limited by being model-based or lack worst-case theoretical guarantees beyond linear MDPs. This paper proposes a new model-free formulation of posterior sampling that applies to more general episodic reinforcement learning problems with theoretical guarantees. We introduce novel proof techniques to show that under suitable conditions, the worst-case regret of our posterior sampling method matches the best known results of optimization based methods. In the linear MDP setting with dimension, the regret of our algorithm scales linearly with the dimension as compared to a quadratic dependence of the existing posterior sampling-based exploration algorithms. + +# 1 Introduction + +A key challenge in reinforcement learning problems is to balance exploitation and exploration. The goal is to make decisions that are currently expected to yield high reward and that help identify less known but potentially better alternate decisions. In the special case of contextual bandit problems, this trade-off is well understood and one of the most effective and widely used algorithms is Thompson sampling [Thompson, 1933]. Thompson sampling is a Bayesian approach that maintains a posterior distribution of each arm being optimal for the given context. At each round, the algorithm samples an action from this distribution and updates the posterior with the new observation. The popularity of Thompson sampling stems from strong empirical performance [Li et al., 2010], as well as competitive theoretical guarantees in the form of Bayesian [Russo and Van Roy, 2014] and frequentist regret bounds [Kaufmann et al., 2012]. + +The results in the contextual bandit setting have motivated several adaptations of Thompson sampling to the more challenging Markov decision process (MDP) setting. Most common are model-based adaptations such as PSRL [Strens, 2000, Osband et al., 2013, Agrawal and Jia, 2017] or BOSS [Asmuth et al., 2012], which maintain a posterior distributions over MDP models. These algorithms determine their current policy by sampling a model from this posterior and computing the optimal policy for it. The benefit of maintaining a posterior over models instead of the optimal policy or optimal value function directly is that posterior updates can be more easily derived and algorithms are easier to analyze. However, model-based approaches are limited to small-scale problems where a realizable model class of moderate size is available and where computing the optimal policy of a model is computationally tractable. This rules out many practical problems where the observations are rich, e.g. images or text. + +There are also model-free posterior sampling algorithms that are inspired by Thompson sampling. These aim to overcome the limitation of model-based algorithms by only requiring a value-function class and possibly weaker assumptions on the MDP model. Several algorithms have been proposed [e.g. Osband et al., 2016a, Fortunato et al., 2017, Osband et al., 2018] with good empirical performance but with no theoretical performance guarantees. A notable exception is the randomized least-squares value iteration (RLSVI) algorithm by Osband et al. [2016b] that admits frequentist regret bounds in tabular [Russo, 2019] and linear Markov decision processes [Zanette et al., 2020a]. However, to the best of our knowledge, no such results are available beyond the linear setting. + +In contrast, there has been impressive recent progress in developing and analyzing provably efficient algorithms for more general problem classes based on the OFU (optimism in the face of uncertainty) principle. These works show that OFU-based algorithm can learn a good policy with small sample-complexity or regret as long as the value-function class and MDP satisfies general structural assumptions. Those assumptions include bounded Bellman rank [Jiang et al., 2017], low inherent Bellman error [Zanette et al., 2020b], small Eluder dimension [Wang et al., 2020] or Bellman-Eluder dimension [Jin et al., 2021]. This raises the question of whether OFU-based algorithms are inherently more suitable for such settings or whether it is possible to achieve similar results with a model-free posterior sampling approach. In this work, we answer this question by analyzing a posterior sampling algorithm that works with a Q-function class and admits worst-case regret guarantees under general structural assumptions. Our main contributions are: + +- We derive a model-free posterior sampling algorithm for reinforcement learning in general Markov decision processes and value function classes. +- We introduce a new proof technique for analyzing posterior sampling with optimistic priors. +- We prove that this algorithm achieves near-optimal worst-case regret bounds that match the regret of OFU-based algorithms and improve the best known regret bounds for posterior sampling approaches. + +# 1.1 Further Related Work + +Several extension of TS have been proposed for non-linear function classes in contextual bandits [Zhang et al., 2020, Kveton et al., 2020, Russo and Van Roy, 2014]. For tabular MDPs, Agrawal et al. [2020] improves the regret bounds for RLSVI and Xiong et al. [2021] show that an algorithm with randomized value functions can be optimal. In the same setting, Pacchiano et al. [2020] proposed an optimism based algorithm that uses internal noise, which can be interpreted as a posterior sampling method. Jafarnia-Jahromi et al. [2021] analyzes a posterior sampling algorithm for tabular stochastic shortest path problems. Considering the Bayesian regret, the seminal paper of Osband and Van Roy [2014] provides a general posterior sampling RL method that can be applied to general model classes including linear mixture MDPs. + +# 2 Setting and Notation + +Episodic Markov decision process. We consider the episodic Markov decision process (MDP) setting where the MDP is defined by the tuple $(\mathcal{X},\mathcal{A},H,P,r)$ . Here, $\mathcal{X}$ and $\mathcal{A}$ are state and action spaces. The number $H\in \mathbb{N}$ is the length of each episode and $P = \{P^h\}_{h = 1}^H$ and $R = \{R^{h}\}_{h = 1}^{H}$ are the state transition probability measures and the random rewards. The agent interacts with the MDP in $T$ episodes of length $H$ . In each episode $t\in [T] = \{1,2,\dots,T\}$ , the agent first observes an initial state $x_{t}^{1}\in \mathcal{X}$ and then, for each time step $h\in [H]$ , the agent takes an action $a_{t}^{h}\in \mathcal{A}$ and receives the next state $x_{t}^{h + 1}\sim P^{h}(\cdot |x_{t}^{h},a_{t}^{h})$ and reward $r_t^h\sim R^h (\cdot |x_t^h,a_t^h)$ . To simplify our exposition, we assume that the initial states $x_{t}^{1} = x^{1}$ are identical across episodes. When initial states are stochastic, we can simply add a dummy initial state and increase $H$ by 1 to ensure this. Our approach can also be generalized to adversarial initial states which we discuss in the appendix. We denote by $\pi_t\colon \mathcal{X}\times [H]\to \mathcal{A}$ the agent's policy in the $t$ -th episode, that is, $a_{t}^{h} = \pi_{t}(x_{t}^{h},h)$ . For a given policy $\pi$ , the value functions are defined for all $h\in [H]$ and state-action pairs $(x,a)$ as + +$$ +Q _ {h} ^ {\pi} (x, a) = r ^ {h} (x, a) + \mathbb {E} _ {x ^ {\prime} \sim P ^ {h} (x, a)} \left[ V _ {h + 1} ^ {\pi} \left(x ^ {\prime}\right) \right], \quad V _ {h} ^ {\pi} (x) = Q _ {h} ^ {\pi} (x, \pi (x, h)), +$$ + +where $r^h (x,a) = \mathbb{E}_{r^h\sim R^h (x,a)}[r^h ]\in [0,1]$ is the average immediate reward and $V_{H + 1}^{\pi}(x) = 0$ for convenience. We further denote by $\mathcal{T}_h^\star$ the Bellman optimality operator that maps any state-action + +function $f$ to + +$$ +\left[ \mathcal {T} _ {h} ^ {\star} f \right] (x, a) = r ^ {h} (x, a) + \mathbb {E} _ {x ^ {\prime} \sim P ^ {h} (x, a)} \left[ \max _ {a ^ {\prime} \in \mathcal {A}} f \left(x ^ {\prime}, a ^ {\prime}\right) \right]. +$$ + +The optimal Q-function is given by $Q_{h}^{\star} = \mathcal{T}_{h}^{\star}Q_{h + 1}^{\star}$ for all $h\in [H]$ where again $Q_{H + 1}^{\star} = 0$ + +Value function approximation. We assume the agent is provided with a Q-function class $\mathcal{F} = \mathcal{F}_1 \times \mathcal{F}_2 \times \dots \times \mathcal{F}_H$ of functions $f = \{f^h\}_{h \in [H]}$ where $f^h \colon \mathcal{X} \times \mathcal{A} \to \mathbb{R}$ . For convenience, we also consider $\mathcal{F}_{H+1} = \{\mathbf{0}\}$ which only contains the constant zero function, and we define $f^h(x) = \max_{a \in \mathcal{A}} f^h(x, a)$ . Before each episode $t$ , our algorithm selects a Q-function $f_t \in \mathcal{F}$ and then picks actions in this episode with the greedy policy $\pi_{f_t}$ w.r.t. this function. That is, $a_t^h = \pi_{f_t}(x_t^h, h) \in \arg \max_{a \in \mathcal{A}} f_t^h(x_t^h, a)$ . + +We make the following assumptions on the value-function class: + +Assumption 1 (Realizability). The optimal $Q$ -function is in the class $Q_h^{\star} \in \mathcal{F}_h$ for all $h \in [H]$ . + +Assumption 2 (Boundedness). There exists $b \geq 1$ such that $f^h(x, a) \in [0, b-1]$ for all $x, a \in \mathcal{X} \times \mathcal{A}$ and $f = \{f^h\}_{h \in [H]} \in \mathcal{F}$ . + +Assumption 3 (Completeness). For all $h$ and $f^{h+1} \in \mathcal{F}_{h+1}$ , there is a $f^h \in \mathcal{F}_h$ such that $f^h = T_h^\star f^{h+1}$ . + +Additional notation. For any $f^h \in \mathcal{F}_h$ , we define the short-hand notation $f^h(x) = \max_{a \in \mathcal{A}} f^h(x, a)$ and for any $f \in \mathcal{F}$ , $h \in [H]$ and state-action pair $x, a$ , we define the Bellman residual as + +$$ +\mathcal {E} _ {h} (f; x, a) = \mathcal {E} \left(f ^ {h}, f ^ {h + 1}; x, a\right) = f ^ {h} (x, a) - \mathcal {T} _ {h} ^ {\star} f ^ {h + 1} (x, a). +$$ + +We measure the performance of an algorithm that produces a sequence of policies $\pi_1, \pi_2, \ldots$ , by its regret + +$$ +\operatorname {R e g} (T) = \sum_ {t = 1} ^ {T} \left(V _ {1} ^ {\star} \left(x ^ {1}\right) - V _ {1} ^ {\pi_ {t}} \left(x ^ {1}\right)\right) +$$ + +after $T$ episodes. + +# 3 Conditional Posterior Sampling Algorithm + +We derive our posterior sampling algorithm by first defining the prior over the function class and our likelihood model of an episode given a value function. + +Optimistic prior. We assume that the prior $p_0$ over $\mathcal{F}$ has the form + +$$ +p _ {0} (f) \propto \exp \left(\lambda f ^ {1} \left(x ^ {1}\right)\right) \prod_ {h = 1} ^ {H} p _ {0} ^ {h} \left(f ^ {h}\right) \tag {1} +$$ + +where $p_0^h$ are distributions over each $\mathcal{F}_h$ and $\lambda > 0$ is a parameter. This form assumes that the prior factorizes over time steps and that the prior for the value functions of the first time step prefers large values for the initial state. This optimistic preference helps initial exploration and allows us to achieve frequentist regret bounds. A similar mechanism can be found in existing sampling based algorithms in the form of optimistic value initializations [Osband et al., 2018] or forced initial exploration by default values [Zanette et al., 2020a]. + +Temporal difference error likelihood. Consider a set of observations acquired in $t$ episodes $S_{t} = \{x_{s}^{h},a_{s}^{h},r_{s}^{h}\}_{s\in [t],h\in [H]}$ . To formulate the likelihood of these observations, we make use of the squared temporal difference (TD) error, that for time $h$ , is + +$$ +L ^ {h} (f; S _ {t}) = L ^ {h} \left(f ^ {h}, f ^ {h + 1}; S _ {t}\right) = \sum_ {s = 1} ^ {t} \left(f ^ {h} \left(x _ {s} ^ {h}, a _ {s} ^ {h}\right) - r _ {s} ^ {h} - f ^ {h + 1} \left(x _ {s} ^ {h + 1}\right)\right) ^ {2}. +$$ + +For $h = H$ , we can choose $x_s^{H + 1}$ arbitrarily since by definition $f^{H + 1}(x) = 0$ for all $x$ . We now define the likelihood of $S_t$ given a value function $f \in \mathcal{F}$ as + +$$ +p \left(S _ {t} \mid f\right) \propto \prod_ {h = 1} ^ {H} \frac {\exp \left(- \eta L ^ {h} \left(f ^ {h} , f ^ {h + 1} ; S _ {t}\right)\right)}{\mathbb {E} _ {\tilde {f} ^ {h} \sim p _ {0} ^ {h}} \exp \left(- \eta L ^ {h} \left(\tilde {f} ^ {h} , f ^ {h + 1} ; S _ {t}\right)\right)}, \tag {2} +$$ + +where $\eta > 0$ is a parameter. Readers familiar with model-free reinforcement learning methods likely find the use of squared temporal difference error in the numerator natural as it makes transition samples with small TD error more likely. Most popular model free algorithm such as Q-learning [Watkins and Dayan, 1992] rely on the TD error as their loss function. However, the normalization in the denominator of (2) may seem surprising. This term makes those transitions more likely that have small TD error under the specific $f^h$ , $f^{h+1}$ pair compared to pairs $(\tilde{f}, f^{h+1})$ with $\tilde{f}$ is drawn from the prior. Thus, transitions are encouraged to explain the specific choice of $f^h$ for $f^{h+1}$ . This normalization is one of our key algorithmic innovations. It allows us to relate a small loss $L^h$ to a small bellman error and circumvent the double-sample issue [Baird, 1995, Dann et al., 2014] of the square TD error. + +Combining the prior in (1) and likelihood in (2), we obtain the posterior of our algorithm after $t$ episodes + +$$ +p \left(f \mid S _ {t}\right) \propto \exp \left(\lambda f ^ {1} \left(x ^ {1}\right)\right) \prod_ {h = 1} ^ {H} q \left(f ^ {h} \mid f ^ {h + 1}, S _ {t}\right), \tag {3} +$$ + +where $q(f^{h}|f^{h + 1},S_{t}) = \frac{p_{0}^{h}(f^{h})\exp\left(-\eta L^{h}(f^{h},f^{h + 1};S_{t})\right)}{\mathbb{E}_{\tilde{f}^{h}\sim p_{0}^{h}}\exp\left(-\eta L^{h}(\tilde{f}^{h},f^{h + 1};S_{t})\right)}.$ + +Note that the conditional probability $q(f^h | f^{h+1}, S_t)$ samples $f^h$ using the data $S_t$ and the TD error $L^h(f^h, f^{h+1}; S_t)$ , which mimics the model update process of Q-learning, where we fit the model $f^h$ at each step $h$ to the target computed from $f^{h+1}$ . The optimistic prior encourages exploration, which is needed in our analysis. It was argued that such a term is necessary to achieve the optimal frequentist regret bound for Thompson sampling in the bandit case Zhang [2021]. For the same reason, we employ it for the analysis of posterior sampling in episodic RL. The losses $L^h$ will grow with the number of rounds $t$ and once the effect of the first $\exp(\lambda f^1(x^1))$ factor has become small enough, the posterior essentially performs Bayesian least-squares regression of $f^h$ conditioned on $f^{h+1}$ . We thus call our algorithm conditional posterior sampling. This algorithm, shown in Algorithm 1 simply samples a Q-function $f_t$ from the posterior before the each episode, follows the greedy policy of $f_t$ for one episode and then updates the posterior. + +# Algorithm 1: Conditional Posterior Sampling Algorithm + +Input: value function class $\mathcal{F}$ , learning rate $\eta$ , prior optimism parameter $\lambda$ , number of rounds $T$ for $t = 1,2,\ldots,T$ do +Draw Q-function $f_{t}\sim p(\cdot |S_{t - 1})$ according to posterior (3) Play episode $t$ using the greedy policy $\pi_{f_t}$ and add observations to $S_{t}$ + +We are not aware of a provably computationally efficient sampling procedure for (3). Since the primary focus of our work is statistical efficiency we leave it as an open problem for future work to investigate the empirical feasibility of approximate samplers or to identify function classes that allow for efficient sampling. Another potential improvement is to derive a conditional sampling rule that allows to sample $\left(f_t^h\right)_{h=1}^H$ iteratively instead of jointly from a single posterior. + +# 4 Regret of Conditional Posterior Sampling + +We will now present our main theoretical results for Algorithm 1. As is common with reinforcement learning algorithms that work with general function classes and Markov decision processes, we express our regret bound in terms of two main quantities: the effective size of the value function class $\mathcal{F}$ and a structural complexity measure of the MDP in combination with $\mathcal{F}$ . + +Function Class Term. In machine learning, the gap between the generalization error and the training error can be estimated by an appropriately defined complexity measure of the target function class. The analyses of optimization-based algorithms often assume finite function classes for simplicity and measure their complexity as $|\mathcal{F}|$ [Jiang et al., 2017] or employ some notion of covering number for $\mathcal{F}$ [Wang et al., 2020, Jin et al., 2021]. Since our algorithm is able to employ a prior $p_0$ over $\mathcal{F}$ which allows us to favor certain parts of the function space, our bounds instead depend on the complexity of $\mathcal{F}$ through the following quantity: + +Definition 1. For any function $f' \in \mathcal{F}_{h+1}$ , we define the set $\mathcal{F}_h(\epsilon, f') = \{f \in \mathcal{F}_h : \sup_{x,a} |\mathcal{E}_h(f, f'; x, a)| \leq \epsilon\}$ of functions that have small Bellman error with $f'$ for all state-action pairs. Using this set, we define + +$$ +\kappa (\epsilon) = \sup _ {f \in \mathcal {F}} \sum_ {h = 1} ^ {H} \ln \frac {1}{p _ {0} ^ {h} \left(\mathcal {F} _ {h} \left(\epsilon , f ^ {h + 1}\right)\right)}. +$$ + +The quantity $p_0^h(\mathcal{F}_h(\epsilon, f))$ is the probability assigned by the prior to functions that approximately satisfy the Bellman equation with $f$ in any state-action pair. Thus, the complexity $\kappa(\epsilon)$ is small if the prior is high for any $f$ and $\kappa(\epsilon)$ represents an approximate completeness assumption. In fact, if Assumption 3 holds we expect $\kappa(\epsilon) < \infty$ for all $\epsilon > 0$ . In the simplest case where $\mathcal{F}$ is finite, $p_0^h(f) = \frac{1}{|\mathcal{F}_h|}$ is uniform and completeness holds exactly, we have + +$$ +\kappa (\epsilon) \leq \sum_ {h = 1} ^ {H} \ln | \mathcal {F} _ {h} | = \ln | \mathcal {F} | \quad \forall \epsilon \geq 0. +$$ + +For parametric models, where each $f^h = f_\theta^h$ can be parameterized by a $d$ -dimensional parameter $\theta \in \Omega_h \subset \mathbb{R}^d$ , then a prior $p_0^h(\theta)$ on $\Omega_h$ induces a prior $p_0^h(f)$ on $\mathcal{F}_h(\epsilon, f)$ . If $\Omega_h$ is compact, then we can generally assume that the prior satisfies $\sup_{\theta} \ln \frac{1}{p_0^h(\{\theta' : \| \theta' - \theta \| \leq \epsilon\})} \leq d \ln(c'/\epsilon)$ for an appropriate constant $c' > 0$ that depends on the prior. If further $f^h = f_\theta^h$ is Lipschitz in $\theta$ , then we can assume that $\ln \frac{1}{p_0^h(\mathcal{F}_h(\epsilon, f^{h+1}))} \leq c_0 d \ln(c_1 / \epsilon)$ for constants $c_0 > 0$ and $c_1 > 0$ that depend on the prior and the Lipschitz constants. This implies the following bound for $d$ dimensional parametric models + +$$ +\kappa (\epsilon) \leq c _ {0} H d \ln \left(c _ {1} / \epsilon\right). \tag {4} +$$ + +Structural Complexity Measure In our regret analysis, we need to investigate the trade-off between exploration and exploitation. The difficulty of exploration is measured by the structure complexity of the MDP. Similar to other complexity measures such as Bellman rank [Jiang et al., 2017], inherent Bellman error [Zanette et al., 2020b] or Bellman-Eluder dimension [Jin et al., 2021], we use a complexity measure that depends on the Bellman residuals of the functions $f \in \mathcal{F}$ in our value function class. Our measure online decoupling coefficient quantifies the rate at which the average Bellman residuals can grow in comparison to the cumulative squared Bellman residuals: + +Definition 2 (Online decoupling coefficient). For a given MDP $M$ , value function class $\mathcal{F}$ , time horizon $T$ and parameter $\mu \in \mathbb{R}^{+}$ , we define the online decoupling coefficient $\mathrm{dc}(\mathcal{F}, M, T, \mu)$ as the smallest number $K$ so that for any sequence of functions $\{f_t\}_{t \in \mathbb{N}}$ and their greedy policies $\{\pi_{f_t}\}_{t \in \mathbb{N}}$ + +$$ +\sum_ {h = 1} ^ {H} \sum_ {t = 1} ^ {T} \left[ \mathbb {E} _ {\pi_ {f _ {t}}} [ \mathcal {E} _ {h} (f _ {t}; x ^ {h}, a ^ {h}) ] \right] \leq \mu \sum_ {h = 1} ^ {H} \sum_ {t = 1} ^ {T} \left[ \sum_ {s = 1} ^ {t - 1} \mathbb {E} _ {\pi_ {f _ {s}}} [ \mathcal {E} _ {h} (f _ {t}; x ^ {h}, a ^ {h}) ^ {2} ] \right] + \frac {K}{4 \mu}. +$$ + +The online decoupling coefficient can be bounded for various common settings, including tabular MDPs (by $|\mathcal{X}||\mathcal{A}|HO(\ln T)$ ) and linear MDPs (by $dHO(\ln T)$ where $d$ is the dimension). We defer a detailed discussion of this measure with examples and its relation with other complexity notions to later. + +Main Regret Bound. We are now ready to state the main result of our work, which is a frequentist (or worst-case) expected regret bound for Algorithm 1: + +Theorem 1. Assume that parameter $\eta \leq 0.4b^{-2}$ is set sufficiently small and that Assumption 2 holds. Then for any $\beta > 0$ , the expected regret after $T$ episodes of Algorithm 1 on any MDP $M$ is bounded as + +$$ +\mathbb {E} [ \operatorname {R e g} (T) ] \leq \frac {\lambda}{\eta} \mathrm {d c} \left(\mathcal {F}, M, T, \frac {\eta}{4 \lambda}\right) + \frac {2 T}{\lambda} \kappa (b / T ^ {\beta}) + \frac {6 H T ^ {2 - \beta}}{\lambda} + b T ^ {1 - \beta}, +$$ + +where the expectation is over the samples drawn from the MDP and the algorithm's internal randomness. Let $\mathrm{dc}(\mathcal{F},M,T)$ be any bound on $\sup_{\mu \leq 1}\mathrm{dc}(\mathcal{F},MT,\mu)$ and set $\eta = 1 / 4b^2$ and $\lambda = \sqrt{\frac{T\kappa(b / T^2)}{b^2\mathrm{dc}(\mathcal{F},M,T)}}$ . If $\lambda b^2 \geq 1$ , then our bound becomes + +$$ +\mathbb {E} [ \operatorname {R e g} (T) ] = O \left(b \sqrt {\mathrm {d c} (\mathcal {F} , M , T) \kappa (b / T ^ {2}) T} + \mathrm {d c} (\mathcal {F}, M, T) + \sqrt {H}\right). \tag {5} +$$ + +For the simpler form of our regret bound in Equation (5), we chose a specific $\lambda$ (the condition $\lambda b^{2} \geq 1$ is easy to satisfy for large $T$ ). However, we may also use that $\lambda^2 \mathrm{dc}(\mathcal{F}, M, T, \eta / (4\lambda))$ is an increasing function of $\lambda$ to set $\lambda$ differently and achieve a better tuned bound. To instantiate the general regret bound in Theorem 1 to specific settings, we first derive bounds on the decoupling coefficient in Section 4.1 and then state and discuss Theorem 1 for those settings in Section 4.2. + +# 4.1 Decoupling Coefficient and its Relation to Other Complexity Measures + +We present several previously studied settings for which the decoupling coefficient is provably small. + +Linear Markov decision processes. We first consider the linear MDP setting [Bradtke and Barto, 1996, Melo and Ribeiro, 2007] which was formally defined by Jin et al. [2020] as: + +Definition 3 (Linear MDP). An MDP with feature map $\phi : \mathcal{X} \times \mathcal{A} \to \mathbb{R}^d$ is linear, if for any $h \in [H]$ , there exist $d$ unknown (signed) measures $\mu_h = (\mu_h^{(1)}, \ldots, \mu_h^{(d)})$ over $\mathcal{X}$ and an unknown vector $\theta_h \in \mathbb{R}^d$ , such that for any $(x, a) \in \mathcal{X} \times \mathcal{A}$ , we have + +$$ +P ^ {h} (\cdot \mid x, a) = \left\langle \phi (x, a), \mu_ {h} (\cdot) \right\rangle , \quad r ^ {h} (x, a) = \left\langle \phi (x, a), \theta_ {h} \right\rangle . +$$ + +We assume further $\| \phi (x,a)\| \leq 1$ for all $(x,a)\in \mathcal{X}\times \mathcal{A}$ , and $\max \{\| \mu_h(\mathcal{X})\| ,\| \theta_h\|\} \leq \sqrt{d}$ for all $h\in [H]$ . + +Since the transition kernel and expected immediate rewards are linear in given features $\phi$ , it is well known that the Q-function of any policy is also a linear function in $\phi$ [Jin et al., 2020]. We further show in the following proposition that the decoupling coefficient is also bounded by $O(dH\ln T)$ : + +Proposition 1. In linear MDPs, the linear function class $\mathcal{F} = \bigotimes_{h=1}^{H}\{\langle\phi(\cdot,\cdot),f\rangle|f\in\mathbb{R}^d,\|f\|\leq (H+1-h)\sqrt{d}\}$ satisfies Assumptions 1-3, and the decoupling coefficient for $\mu\leq 1$ is bounded by + +$$ +\mathrm {d c} (\mathcal {F}, M, T, \mu) \leq 2 d H (1 + \ln (2 H T)). +$$ + +Notably, since tabular MDPs are linear MDPs with dimension at most $|\mathcal{X}||\mathcal{A}|$ , Proposition 1 implies that $\mathrm{dc}(\mathcal{F},M,T,\mu)\leq 2|\mathcal{X}||\mathcal{A}|H(1 + \ln (2HT))$ in tabular MDPs. As compared to other complexity measures such as Eluder dimension, the bound of the decoupling coefficient generally exhibits an additional factor of $H$ . This factor appears because the decoupling coefficient is defined for the sum of all time steps $[H]$ instead of the maximum. We chose the formulation with sums because it is advantageous when the complexity of the MDP of function class varies with $h$ . + +Generalized linear MDPs. Linear functions admit a straightforward generalization to include a rich class of non-linear functions which have previously been studied by Wang et al. [2019, 2020] in the RL setting. + +Definition 4 (Generalized linear models). For a given link function $\sigma : [-1,1] \to [-1,1]$ such that $|\sigma'(x)| \in [k, K]$ for Lipschitz constants $0 < k \leq K < \infty$ , and a known feature map $\phi : \mathcal{X} \times \mathcal{A} \to \mathbb{R}^d$ , the class of generalized linear models is + +$$ +\mathcal {G} := \left\{(x, a) \rightarrow \sigma (\langle \phi (x, a), \theta \rangle \mid \theta \in \Theta \subset \mathbb {R} ^ {d} \right\}. +$$ + +As the following result shows, we can readily bound the decoupling coefficient for generalized linear Q-functions. + +Proposition 2. If $(\mathcal{F}_h)_h = 1$ are generalized linear models with Lipschitz constants $k, K$ , and bounded norm $\| f \| \leq \sqrt{d} H$ for all $h$ and all $f \in \mathcal{F}_h$ , then the decoupling coefficient for any $\mu \leq 1$ is bounded by + +$$ +\mathrm {d c} (\mathcal {F}, M, T, \mu) \leq 2 d H \frac {K ^ {2}}{k ^ {2}} (1 + \ln (2 H T)). +$$ + +Bellman-Eluder Dimension. Finally in more generality, our decoupling coefficient is small for instances with low Bellman-Eluder dimension [Jin et al., 2021]. Problems with low Bellman-Eluder dimension include in decreasing order of generality: small Eluder dimension [Wang et al., 2020], generalized linear MDPs [Wang et al., 2019], linear MDPs [Bradtke and Barto, 1996, Melo and Ribeiro, 2007], and tabular MDPs. Before stating our reduction of Bellman Eluder dimension to decoupling coefficient formally, we first restate the definition of Bellman Eluder dimension in the following three definitions: + +Definition 5 ( $\varepsilon$ -independence between distributions). Let $\mathcal{G}$ be a function class defined on $\mathcal{X}$ , and $\nu, \mu_1, \ldots, \mu_n$ be probability measures over $\mathcal{X}$ . We say $\nu$ is $\varepsilon$ -independent of $\{\mu_1, \mu_2, \ldots, \mu_n\}$ with respect to $\mathcal{G}$ if there exists $g \in \mathcal{G}$ such that $\sqrt{\sum_{i=1}^{n} (\mathbb{E}_{\mu_i}[g])^2} \leq \varepsilon$ , but $|\mathbb{E}_{\nu}[g]| > \varepsilon$ . + +Definition 6 ((Distributional Eluder (DE) dimension). Let $\mathcal{G}$ be a function class defined on $\mathcal{X}$ , and $\Pi$ be a family of probability measures over $\mathcal{X}$ . The distributional Eluder dimension $\dim_{DE}(\mathcal{G},\Pi ,\varepsilon)$ is the length of the longest sequence $\{\rho_1,\ldots ,\rho_n\} \subset \Pi$ such that there exists $\varepsilon^{\prime} > \varepsilon$ where $\rho_{i}$ is $\varepsilon^\prime$ -independent of $\{\rho_1,\dots ,\rho_{i - 1}\}$ for all $i\in [n]$ . + +Definition 7 (Bellman Eluder (BE) dimension [Jin et al., 2021]). Let $\mathcal{E} \coloneqq \bigotimes_{h=1}^{H} \{\mathcal{E}_h(f; x, a) : f \in \mathcal{F}\}$ be the set of Bellman residuals induced by $\mathcal{F}$ at step $h$ , and $\Pi = \{\Pi_h\}_{h=1}^H$ be a collection of $H$ probability measure families over $\mathcal{X} \times \mathcal{A}$ . The $\varepsilon$ -Bellman Eluder dimension of $\mathcal{F}$ with respect to $\Pi$ is defined as + +$$ +\dim_ {B E} (\mathcal {F}, \Pi , \varepsilon) := \max _ {h \in [ H ]} \dim_ {D E} (\mathcal {E}, \Pi , \varepsilon). +$$ + +We show that the decoupling coefficient is small whenever the Bellman-Eluder dimension is small: + +Proposition 3. Let $\Pi = \mathcal{D}_{\mathcal{F}}$ be the set of probability measures over $\mathcal{X} \times \mathcal{A}$ at any step $h$ obtained by following the policy $\pi_f$ for $f \in \mathcal{F}$ . If for all $\varepsilon > 0$ + +$$ +\dim_ {B E} (\mathcal {F}, \Pi , \varepsilon) \leq E \ln \frac {1}{\varepsilon}, +$$ + +then the decoupling coefficient for any $\mu \leq 1$ is bounded by + +$$ +\mathrm {d c} (\mathcal {F}, M, T, \mu) \leq 4 (1 + \ln (T)) E H. +$$ + +Bellman-rank. Another general complexity measure sufficient for provably efficient algorithms is the low Bellman-rank [Jiang et al., 2017], which includes reactive POMDPs. As discussed in Jin et al. [2021], a certain type of Bellman rank ("Q-type") implies bounded Bellman Eluder dimension (as defined above) and is thus also bounded decoupling coefficient. However, it is an open question if a low Bellman-rank in the original definition [Jiang et al., 2017] implies a small decoupling coefficient. The main difference is that Bellman-rank considers measures induced by $x \sim \pi_f$ , $a \sim \pi_{f'}$ , whereas the decoupling coefficient always samples state and action from the same policy. + +# 4.2 Interpretation of Theorem 1 + +We can instantiate Theorem 1 with all bounds on the decoupling coefficients derived in the previous section. To illustrate the results, we will present two specific cases. The first one is for finite function classes that are often considered for simplicity [e.g. Jiang et al., 2017]. + +Corollary 1 (Regret bound for finite function classes with completeness). Assume a finite function class $\mathcal{F}$ that satisfies Assumptions 1, 2 and 3 with range $b = 2$ . Assume further that the stagewise prior is uniform $p_0^h(f) = 1 / |\mathcal{F}_h|$ , and $|\mathcal{F}| = \prod_{h=1}^{H} |\mathcal{F}_h|$ . Set parameters $\eta = 0.1$ and $\lambda = \sqrt{\frac{T \ln |\mathcal{F}|}{\mathrm{dc}(\mathcal{F}, M, T)}}$ . Then the expected regret of Algorithm 1 after $T$ episodes is bounded on any MDP $M$ as + +$$ +\mathbb {E} [ \operatorname {R e g} (T) ] = O \left(\sqrt {\mathrm {d c} (\mathcal {F} , M , T) T \ln | \mathcal {F} |}\right). +$$ + +Note that this result can be generalized readily to infinite function-classes when we replace $\ln |\mathcal{F}|$ by an appropriate covering number $\mathcal{N}_{\infty}(\mathcal{F},\epsilon)$ for $\epsilon$ small enough. + +In addition to finite function classes, we also illustrate Theorem 1 for linear Markov decision processes: + +Corollary 2. Assume Algorithm 1 is run on a $d$ -dimensional linear MDP with the function class from Proposition 1. Assume further a learning rate of $\eta = 0.4H^{-2}$ and $\lambda = \sqrt{\frac{T\kappa(H / T^2)}{dH^3(1 + \ln(2HT))}}$ . Then the expected regret after $T$ episodes is bounded as + +$$ +\mathbb {E} [ \operatorname {R e g} (T) ] \leq O \left(H ^ {3 / 2} \sqrt {d T \kappa \left(H / T ^ {2}\right) \ln (H T)}\right). +$$ + +If the stage-wise priors $p_0^h$ are chosen uniformly, then $\kappa (\epsilon) = HdO(\ln (Hd\epsilon))$ as in (4), and thus + +$$ +\mathbb {E} [ \operatorname {R e g} (T) ] \leq O \left(H ^ {2} d \sqrt {T} \ln (d H T)\right). +$$ + +Our regret bound improves the regret bound of $\tilde{O}(H^{2.5}d^2\sqrt{T} + H^5d^4)$ for the posterior-sampling method OPT-RLSVI [Zanette et al., 2020a] by a factor of $\sqrt{H}d$ . It also improves the $\tilde{O}(d^{3/2}H^2\sqrt{T})$ regret of UCB-LSVI [Jin et al., 2020] by a factor of $\sqrt{d}$ . However, we would like to remark that these algorithms are known to be computationally efficient in this setting, while the computational tractability of our method is an open problem. Our regret bound also matches the bound of Zanette et al. [2020b] without misspecification once we account for the different boundedness assumption ( $b = 2$ instead of $b = H + 1$ ) in this work. + +# 5 Proof Overview of Theorem 1 + +We provide a detailed proof of Theorem 1 in the appendix and highlight the main steps in this section. We start by presenting an alternate way to write the posterior in (3) that lends itself better to our analysis. To that end, we introduce some helpful notations. + +We denote by $\zeta_s = \{x_s^h, a_s^h, r_s^h\}_{h \in [H]}$ the trajectory collected in the $s$ -th episode. The notation $\mathbb{E}_{\pi_{f_s}}$ is equivalent to $\mathbb{E}_{\zeta_s \sim \pi_{f_s}}$ . Moreover, in the following, the symbol $S_t$ at episode $t$ contains all historic observations up to episode $t$ , which include both $\{\zeta_s\}_{s \in [t]}$ and $\{f_s\}_{s \in [t]}$ . These observations are generated in the order $f_1 \sim p_0(\cdot)$ , $\zeta_1 \sim \pi_{f_1}$ , $f_2 \sim p(\cdot | S_1)$ , $\zeta_2 \sim \pi_{f_2}, \ldots$ + +We further define the TD error difference at episode $s$ as + +$$ +\begin{array}{l} \Delta L ^ {h} \left(f ^ {h}, f ^ {h + 1}; \zeta_ {s}\right) = (f ^ {h} \left(x _ {s} ^ {h}, a _ {s} ^ {h}\right) - r _ {s} ^ {h} - f ^ {h + 1} \left(x _ {s} ^ {h + 1}\right)) ^ {2} \\ - \left(\mathcal {T} _ {h} ^ {\star} f ^ {h + 1} \left(x _ {s} ^ {h}, a _ {s} ^ {h}\right) - r _ {s} ^ {h} - f ^ {h + 1} \left(x _ {s} ^ {h + 1}\right)\right) ^ {2}. \\ \end{array} +$$ + +The term we subtract from the TD error is the sampling error of this transition for the Bellman error. With $\Delta f^1 (x^1) = f^1 (x^1) - Q_1^\star (x^1)$ defined as the error of $f^{1}$ and + +$$ +\begin{array}{l} \hat {\Phi} _ {t} ^ {h} (f) = - \ln p _ {0} ^ {h} (f ^ {h}) + \eta \sum_ {s = 1} ^ {t - 1} \Delta L ^ {h} (f ^ {h}, f ^ {h + 1}; \zeta_ {s}) \\ + \ln \mathbb {E} _ {\tilde {f} ^ {h} \sim p _ {0} ^ {h}} \exp \left(- \eta \sum_ {s = 1} ^ {t - 1} \Delta L ^ {h} (\tilde {f} ^ {h}, f ^ {h + 1}; \zeta_ {s})\right), \\ \end{array} +$$ + +we can equivalently rewrite the posterior distribution (3) in the following form: + +$$ +p (f | S _ {t - 1}) \propto \exp \left(- \sum_ {h = 1} ^ {H} \hat {\Phi} _ {t} ^ {h} (f) + \lambda \Delta f ^ {1} \left(x ^ {1}\right)\right). +$$ + +Note that in the definition of $\hat{\Phi}$ , we have replaced $L^h(\cdot)$ by $\Delta L^h(\cdot)$ . Although we do not need to know the Bellman operator $\mathcal{T}_h^\star$ in the actual algorithm, in our theoretical analysis, it is equivalent to knowing the operator via the use of $\Delta L^h(\cdot)$ . This equivalence is possible with the temporal difference error likelihood which we introduce in this paper, and this is the main technical reason why we choose this conditional posterior sampling distribution. It is the key observation that allows us to circumvent the double-sample issue discussed earlier. + +With the new expression of posterior distribution, we can start the proof of Theorem 1 by using the following decomposition, referred to the value-function error decomposition in Jiang et al. [2017], + +$$ +V _ {1} ^ {\star} \left(x ^ {1}\right) - V _ {1} ^ {\pi_ {f _ {t}}} \left(x ^ {1}\right) = \sum_ {h = 1} ^ {H} \mathbb {E} _ {\pi_ {f _ {t}}} \left[ \mathcal {E} _ {h} \left(f _ {t}, x _ {t} ^ {h}, a _ {t} ^ {h}\right) \right] - \Delta f _ {t} ^ {1} \left(x ^ {1}\right). +$$ + +We now write the expected instantaneous regret of episode $t$ (scaled by $\lambda$ ) using this decomposition as + +$$ +\begin{array}{l} \lambda \mathbb {E} _ {S _ {t - 1}} \mathbb {E} _ {f _ {t} \sim p (\cdot | S _ {t - 1})} \left[ V _ {1} ^ {\star} \left(x ^ {1}\right) - V _ {1} ^ {\pi f _ {t}} \left(x ^ {1}\right) \right] \\ = \underbrace {\mathbb {E} _ {S _ {t - 1}} \mathbb {E} _ {f _ {t} \sim p (\cdot | S _ {t - 1})} \sum_ {h = 1} ^ {H} \left[ \lambda \mathbb {E} _ {\pi_ {f _ {t}}} \mathcal {E} _ {h} (f _ {t} , x _ {t} ^ {h} , a _ {t} ^ {h}) - \frac {\eta}{4} \sum_ {s = 1} ^ {t - 1} \mathbb {E} _ {\pi_ {f _ {s}}} (\mathcal {E} _ {h} (f _ {t} ; x _ {s} ^ {h} , a _ {s} ^ {h})) ^ {2} \right]} _ {F _ {t} ^ {\mathrm {d c}}} \\ + \underbrace {\mathbb {E} _ {S _ {t - 1}} \mathbb {E} _ {f _ {t} \sim p (\cdot | S _ {t - 1})} \left[ \sum_ {h = 1} ^ {H} \frac {\eta}{4} \sum_ {s = 1} ^ {t - 1} \mathbb {E} _ {\pi_ {f _ {s}}} \left(\mathcal {E} _ {h} (f _ {t} ; x _ {s} ^ {h} , a _ {s} ^ {h})\right) ^ {2} - \lambda \Delta f _ {t} ^ {1} (x ^ {1}) \right]} _ {F _ {t} ^ {\kappa}}. \\ \end{array} +$$ + +By summing over $t = 1,\ldots ,T$ , we obtain the following expression of cumulative expected regret + +$$ +\lambda \mathbb {E} \operatorname {R e g} (T) = \lambda \sum_ {t = 1} ^ {T} \mathbb {E} _ {S _ {t - 1}} \mathbb {E} _ {f _ {t} \sim p (\cdot | S _ {t - 1})} \left[ V _ {1} ^ {\star} \left(x ^ {1}\right) - V _ {1} ^ {\pi_ {f _ {t}}} \left(x ^ {1}\right) \right] = \sum_ {t = 1} ^ {T} F _ {t} ^ {\mathrm {d c}} + \sum_ {t = 1} ^ {T} F _ {t} ^ {\kappa}. \tag {6} +$$ + +To bound the first term on the RHS, we can use the definition of decoupling coefficient which gives that + +$$ +\sum_ {t = 1} ^ {T} F _ {t} ^ {\mathrm {d c}} \leq \frac {\lambda^ {2}}{\eta} \mathrm {d c} \left(\mathcal {F}, M, T, \frac {\eta}{4 \lambda}\right). \tag {7} +$$ + +To complete the proof it remains to upper-bound the $F_t^\kappa$ terms in (6). To do so we start with the following bounds (Lemma 1 and Lemma 4 in the appendix) which requires the realizability assumption: + +$$ +\begin{array}{l} \mathbb {E} _ {f \sim p (\cdot | S _ {t - 1})} \left(\sum_ {h = 1} ^ {H} \hat {\Phi} _ {t} ^ {h} (f) - \lambda \Delta f ^ {1} (x ^ {1}) + \ln p (f | S _ {t - 1})\right) \\ = \inf _ {p} \mathbb {E} _ {f \sim p (\cdot)} \left(\sum_ {h = 1} ^ {H} \hat {\Phi} _ {t} ^ {h} (f) - \lambda \Delta f ^ {1} \left(x ^ {1}\right) + \ln p (f)\right) \\ \leq \lambda \epsilon + 4 \eta (t - 1) H \epsilon^ {2} + \kappa (\epsilon). \tag {8} \\ \end{array} +$$ + +The occurrence of the term $\kappa (\epsilon)$ here implicitly corresponds to the realizability assumption. It can also be shown (see Lemma 10) that + +$$ +\begin{array}{l} \sum_ {h = 1} ^ {H} \mathbb {E} _ {S _ {t - 1}} \mathbb {E} _ {f \sim p (\cdot | S _ {t - 1})} \left[ \ln \mathbb {E} _ {\tilde {f} ^ {h} \sim p _ {0} ^ {h}} \exp \left(- \eta \sum_ {s = 1} ^ {t - 1} \Delta L ^ {h} (\tilde {f} ^ {h}, f ^ {h + 1}, \zeta_ {s})\right) \right] \\ \geq - \eta \epsilon (2 b + \epsilon) (t - 1) H - \kappa (\epsilon), \\ \end{array} +$$ + +which means that the expected log-partition function in the definition of conditional posterior distribution is small, and its effect is under control. The proof requires the completeness assumption, and the occurrence of the term $\kappa (\epsilon)$ here implicitly corresponds to the completeness assumption. By combining this inequality with (8), and by using the definition of $\hat{\Phi}$ , we obtain the following inequality + +$$ +\begin{array}{l} \mathbb {E} _ {S _ {t - 1}} \mathbb {E} _ {f \sim p (\cdot | S _ {t - 1})} \left(\eta \sum_ {h = 1} ^ {H} \sum_ {s = 1} ^ {t - 1} \Delta L ^ {h} \left(f ^ {h}, f ^ {h + 1}, \zeta_ {s}\right) - \lambda \Delta f ^ {1} \left(x ^ {1}\right) + \ln \frac {p (f | S _ {t - 1})}{\prod_ {h = 1} ^ {H} p _ {0} ^ {h} \left(f ^ {h}\right)}\right) \\ \leq \lambda \epsilon + \eta (t - 1) H \epsilon (5 \epsilon + 2 b) + 2 \kappa (\epsilon). \tag {9} \\ \end{array} +$$ + +In this bound, we have removed the effect of log-partition function in the definition of the conditional posterior probability, and the inequality bounds the expected cumulative squared TD error. + +One can further establish a connection between squared TD error and Bellman residual, by showing (Lemma 5 and Lemma 8) that + +$$ +\begin{array}{l} \mathbb {E} _ {S _ {t - 1}} \mathbb {E} _ {f \sim p (\cdot | S _ {t - 1})} \left[ \eta \sum_ {h = 1} ^ {H} \sum_ {s = 1} ^ {t - 1} \Delta L ^ {h} \left(f ^ {h}, f ^ {h + 1}, \zeta_ {s}\right) + \ln \frac {p (f | S _ {t - 1})}{\prod_ {h = 1} ^ {H} p _ {0} ^ {h} (f ^ {h})} \right] \\ \geq \sum_ {h = 1} ^ {H} \mathbb {E} _ {S _ {t - 1}} \mathbb {E} _ {f \sim p (\cdot | S _ {t - 1})} \left[ \eta \sum_ {s = 1} ^ {t - 1} \Delta L ^ {h} \left(f ^ {h}, f ^ {h + 1}, \zeta_ {s}\right) + 0. 5 \ln \frac {p \left(f ^ {h} , f ^ {h + 1} \mid S _ {t - 1}\right)}{p _ {0} ^ {h} \left(f ^ {h}\right) p _ {0} ^ {h + 1} \left(f ^ {h + 1}\right)} \right] \\ \geq 0.25 \eta \sum_ {s = 1} ^ {t - 1} \sum_ {h = 1} ^ {H} \mathbb {E} _ {S _ {t - 1}} \mathbb {E} _ {f _ {t} \sim p (\cdot | S _ {t - 1})} \mathbb {E} _ {\pi_ {f _ {s}}} \left(\mathcal {E} _ {h} \left(f; x _ {s} ^ {h}, a _ {s} ^ {h}\right)\right) ^ {2}. \\ \end{array} +$$ + +By combining this bound with (9), we obtain + +$$ +\begin{array}{l} F _ {t} ^ {\kappa} = 0. 2 5 \eta \sum_ {s = 1} ^ {t - 1} \sum_ {h = 1} ^ {H} \mathbb {E} _ {S _ {t - 1}} \mathbb {E} _ {f _ {t} \sim p (\cdot | S _ {t - 1})} \mathbb {E} _ {\pi_ {f _ {s}}} \left(\mathcal {E} _ {h} \left(f _ {t}; x _ {s} ^ {h}, a _ {s} ^ {h}\right)\right) ^ {2} - \lambda \mathbb {E} _ {S _ {t - 1}} \mathbb {E} _ {f _ {t} \sim p (\cdot | S _ {t - 1})} \Delta f _ {t} ^ {1} \left(x ^ {1}\right) \\ \leq \lambda \epsilon + \eta (t - 1) H \epsilon (5 \epsilon + 2 b) + 2 \kappa (\epsilon). \\ \end{array} +$$ + +This implies the following bound for the sum of $F_{t}^{\kappa}$ term in (6): + +$$ +\sum_ {t = 1} ^ {T} F _ {t} ^ {\kappa} \leq \lambda \epsilon T + \eta (t - 1) H \epsilon (5 \epsilon + 2 b) T + 2 \kappa (\epsilon) T. +$$ + +By combining this estimate with (7) and (6), we obtain + +$$ +\lambda \mathbb {E} \operatorname {R e g} (T) \leq \frac {\lambda^ {2}}{\eta} \mathrm {d c} \left(\mathcal {F}, M, T, \frac {\eta}{4 \lambda}\right) + \lambda \epsilon T + \eta (t - 1) H \epsilon (5 \epsilon + 2 b) T + 2 \kappa (\epsilon) T. +$$ + +The choice of $\epsilon = b / T^{\beta}$ implies the first bound of Theorem 1. + +# 6 Conclusion + +This paper proposed a new posterior sampling algorithm for episodic reinforcement learning using conditional sampling with a temporal difference error likelihood. We show that posterior sampling methods can achieve the same frequentist regret guarantees as algorithms based on optimism in the face of uncertainty (OFU) in a wide range of settings with general value function approximation. Our results thus suggest that there is no statistical efficiency gap between OFU and posterior sampling algorithms. While our results are stated in expectation, it is possible to derive high probability bounds with a slightly more complicated analysis. + +One of the key open questions for provably efficient reinforcement learning under general assumptions such as low Bellman-Eluder dimension or Bellman rank is that of computational efficiency. No computationally tractable algorithm is known for such general settings. Although the computational complexity of sampling from the posterior in our algorithm is unknown, we hope that the addition of a sampling-based algorithm to the pool of sample-efficient algorithms in this setting may provide additional tools to design statistically and computationally tractable algorithms. + +# References + +Priyank Agrawal, Jinglin Chen, and Nan Jiang. Improved worst-case regret bounds for randomized least-squares value iteration. arXiv preprint arXiv:2010.12163, 2020. +Shipra Agrawal and Randy Jia. Optimistic posterior sampling for reinforcement learning: worst-case regret bounds. In Advances in Neural Information Processing Systems, volume 30, 2017. URL https://proceedings.neurips.cc/paper/2017/file/3621f1454cacf995530ea53652ddb8fb-Paper.pdf. +John Asmuth, Lihong Li, Michael L Littman, Ali Nouri, and David Wingate. A bayesian sampling approach to exploration in reinforcement learning. arXiv preprint arXiv:1205.2664, 2012. +Leemon Baird. *Residual algorithms: Reinforcement learning with function approximation*. In *Machine Learning Proceedings* 1995, pages 30-37. Elsevier, 1995. +Steven J Bradtke and Andrew G Barto. Linear least-squares algorithms for temporal difference learning. Machine learning, 22(1):33-57, 1996. +Christoph Dann, Gerhard Neumann, Jan Peters, et al. Policy evaluation with temporal differences: A survey and comparison. Journal of Machine Learning Research, 15:809-883, 2014. +Meire Fortunato, Mohammad Gheshlaghi Azar, Bilal Piot, Jacob Menick, Ian Osband, Alex Graves, Vlad Mnih, Remi Munos, Demis Hassabis, Olivier Pietquin, et al. Noisy networks for exploration. arXiv preprint arXiv:1706.10295, 2017. +Mehdi Jafarnia-Jahromi, Liyu Chen, Rahul Jain, and Haipeng Luo. Online learning for stochastic shortest path model via posterior sampling. arXiv preprint arXiv:2106.05335, 2021. +Nan Jiang, Akshay Krishnamurthy, Alekh Agarwal, John Langford, and Robert E Schapire. Contextual decision processes with low bellman rank are pac-learnable. In International Conference on Machine Learning, pages 1704-1713. PMLR, 2017. +Chi Jin, Zhuoran Yang, Zhaoran Wang, and Michael I Jordan. Provably efficient reinforcement learning with linear function approximation. In Conference on Learning Theory, pages 2137-2143. PMLR, 2020. +Chi Jin, Qinghua Liu, and Sobhan Miryoosefi. Bellman eluder dimension: New rich classes of rl problems, and sample-efficient algorithms. arXiv preprint arXiv:2102.00815, 2021. +Emilie Kaufmann, Nathaniel Korda, and Rémi Munos. Thompson sampling: An asymptotically optimal finite-time analysis. In International conference on algorithmic learning theory, pages 199-213. Springer, 2012. +Branislav Kveton, Manzil Zaheer, Csaba Szeptesvari, Lihong Li, Mohammad Ghavamzadeh, and Craig Boutilier. Randomized exploration in generalized linear bandits. In International Conference on Artificial Intelligence and Statistics, pages 2066-2076. PMLR, 2020. +Lihong Li, Wei Chu, John Langford, and Robert E Schapire. A contextual-bandit approach to personalized news article recommendation. In Proceedings of the 19th international conference on World wide web, pages 661-670, 2010. +Francisco S Melo and M Isabel Ribeiro. Q-learning with linear function approximation. In International Conference on Computational Learning Theory, pages 308-322. Springer, 2007. +Ian Osband and Benjamin Van Roy. Model-based reinforcement learning and the eluder dimension. arXiv preprint arXiv:1406.1853, 2014. +Ian Osband, Daniel Russo, and Benjamin Van Roy. (more) efficient reinforcement learning via posterior sampling. arXiv preprint arXiv:1306.0940, 2013. +Ian Osband, Charles Blundell, Alexander Pritzel, and Benjamin Van Roy. Deep exploration via bootstrapped dqn. arXiv preprint arXiv:1602.04621, 2016a. + +Ian Osband, Benjamin Van Roy, and Zheng Wen. Generalization and exploration via randomized value functions. In International Conference on Machine Learning, pages 2377-2386. PMLR, 2016b. +Ian Osband, John Aslanides, and Albin Cassirer. Randomized prior functions for deep reinforcement learning. arXiv preprint arXiv:1806.03335, 2018. +Aldo Pacchiano, Philip Ball, Jack Parker-Holder, Krzysztof Choromanski, and Stephen Roberts. On optimism in model-based reinforcement learning. arXiv preprint arXiv:2006.11911, 2020. +Daniel Russo. Worst-case regret bounds for exploration via randomized value functions. arXiv preprint arXiv:1906.02870, 2019. +Daniel Russo and Benjamin Van Roy. Learning to optimize via posterior sampling. Mathematics of Operations Research, 39(4):1221-1243, 2014. +Malcolm Strens. A bayesian framework for reinforcement learning. In ICML, volume 2000, pages 943-950, 2000. +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. +Ruosong Wang, Ruslan Salakhutdinov, and Lin F Yang. Provably efficient reinforcement learning with general value function approximation. arXiv preprint arXiv:2005.10804, 2020. +Yining Wang, Ruosong Wang, Simon S Du, and Akshay Krishnamurthy. Optimism in reinforcement learning with generalized linear function approximation. arXiv preprint arXiv:1912.04136, 2019. +Christopher JCH Watkins and Peter Dayan. Q-learning. Machine learning, 8(3-4):279-292, 1992. +Zhihan Xiong, Ruoqi Shen, and Simon S Du. Randomized exploration is near-optimal for tabular mdp. arXiv preprint arXiv:2102.09703, 2021. +Andrea Zanette, David Brandfonbrener, Emma Brunskill, Matteo Pirotta, and Alessandro Lazaric. Frequentist regret bounds for randomized least-squares value iteration. In International Conference on Artificial Intelligence and Statistics, pages 1954-1964. PMLR, 2020a. +Andrea Zanette, Alessandro Lazaric, Mykel Kochenderfer, and Emma Brunskill. Learning near optimal policies with low inherent bellman error. In International Conference on Machine Learning, pages 10978-10989. PMLR, 2020b. +Tong Zhang. Data dependent concentration bounds for sequential prediction algorithms. In International Conference on Computational Learning Theory, pages 173-187. Springer, 2005. +Tong Zhang. Feel-good thompson sampling for contextual bandits and reinforcement learning, 2021. +Weitong Zhang, Dongruo Zhou, Lihong Li, and Quanquan Gu. Neural thompson sampling. arXiv preprint arXiv:2010.00827, 2020. \ No newline at end of file diff --git a/aprovablyefficientmodelfreeposteriorsamplingmethodforepisodicreinforcementlearning/images.zip b/aprovablyefficientmodelfreeposteriorsamplingmethodforepisodicreinforcementlearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..8b5ab5ea58026ed9fccc2e437ffa2e642fb653c8 --- /dev/null +++ b/aprovablyefficientmodelfreeposteriorsamplingmethodforepisodicreinforcementlearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3779e0cdfe4bbf1aa689ed753467f6e9a782a42ed0ea95b542c31c6499c2686b +size 358857 diff --git a/aprovablyefficientmodelfreeposteriorsamplingmethodforepisodicreinforcementlearning/layout.json b/aprovablyefficientmodelfreeposteriorsamplingmethodforepisodicreinforcementlearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..3c678cbb64301aa01ed62a714381d99dabcedfb9 --- /dev/null +++ b/aprovablyefficientmodelfreeposteriorsamplingmethodforepisodicreinforcementlearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a3ca1cc65f4cafd4dd9ac1c3462f0ccee743a6930dd92c61613a1f33d9a15dec +size 542674 diff --git a/aprovablyefficientsamplecollectionstrategyforreinforcementlearning/a6b49135-bb56-41cf-b1ae-43ba6d10ce4b_content_list.json b/aprovablyefficientsamplecollectionstrategyforreinforcementlearning/a6b49135-bb56-41cf-b1ae-43ba6d10ce4b_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..0ea9245843e7f6cecadc38b6a6d76e0296dace6a --- /dev/null +++ b/aprovablyefficientsamplecollectionstrategyforreinforcementlearning/a6b49135-bb56-41cf-b1ae-43ba6d10ce4b_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:48c35ef0f34f0c34c25e9e8f3bd2852c2b619914193901a544a9740b42e388e3 +size 87402 diff --git a/aprovablyefficientsamplecollectionstrategyforreinforcementlearning/a6b49135-bb56-41cf-b1ae-43ba6d10ce4b_model.json b/aprovablyefficientsamplecollectionstrategyforreinforcementlearning/a6b49135-bb56-41cf-b1ae-43ba6d10ce4b_model.json new file mode 100644 index 0000000000000000000000000000000000000000..650545ba103232fa779d72bb1e7ad7258981e273 --- /dev/null +++ b/aprovablyefficientsamplecollectionstrategyforreinforcementlearning/a6b49135-bb56-41cf-b1ae-43ba6d10ce4b_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dbd9f82edbc95328f70e6a7b1b30d380fdbbe9fcb8e9a6a65e4caf501ba48b42 +size 111074 diff --git a/aprovablyefficientsamplecollectionstrategyforreinforcementlearning/a6b49135-bb56-41cf-b1ae-43ba6d10ce4b_origin.pdf b/aprovablyefficientsamplecollectionstrategyforreinforcementlearning/a6b49135-bb56-41cf-b1ae-43ba6d10ce4b_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4351d1facb95e14f3281a1ccccddd76ce1010af9 --- /dev/null +++ b/aprovablyefficientsamplecollectionstrategyforreinforcementlearning/a6b49135-bb56-41cf-b1ae-43ba6d10ce4b_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8017b52b4fff8d4a55f6e81507b050b232639085af0ac12cac9667bc93a5cb1e +size 1123297 diff --git a/aprovablyefficientsamplecollectionstrategyforreinforcementlearning/full.md b/aprovablyefficientsamplecollectionstrategyforreinforcementlearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..645960ca9d1d30915aabd447bde13142248be3e1 --- /dev/null +++ b/aprovablyefficientsamplecollectionstrategyforreinforcementlearning/full.md @@ -0,0 +1,339 @@ +# A Provably Efficient Sample Collection Strategy for Reinforcement Learning + +Jean Tarbouriech + +Facebook AI Research Paris & Inria Lille + +jean.tarbouriech@gmail.com + +Matteo Pirotta + +Facebook AI Research Paris + +pirotta@fb.com + +Michal Valko + +DeepMind Paris + +valkom@deepmind.com + +Alessandro Lazaric + +Facebook AI Research Paris + +lazaric@fb.com + +# Abstract + +One of the challenges in online reinforcement learning (RL) is that the agent needs to trade off the exploration of the environment and the exploitation of the samples to optimize its behavior. Whether we optimize for regret, sample complexity, state-space coverage or model estimation, we need to strike a different exploration-exploitation trade-off. In this paper, we propose to tackle the exploration-exploitation problem following a decoupled approach composed of: 1) An "objective-specific" algorithm that (adaptively) prescribes how many samples to collect at which states, as if it has access to a generative model (i.e., a simulator of the environment); 2) An "objective-agnostic" sample collection exploration strategy responsible for generating the prescribed samples as fast as possible. Building on recent methods for exploration in the stochastic shortest path problem, we first provide an algorithm that, given as input the number of samples $b(s,a)$ needed in each state-action pair, requires $\widetilde{O}\bigl (BD + D^{3 / 2}S^2 A\bigr)$ time steps to collect the $B = \sum_{s,a}b(s,a)$ desired samples, in any unknown communicating MDP with $S$ states, $A$ actions and diameter $D$ . Then we show how this general-purpose exploration algorithm can be paired with "objective-specific" strategies that prescribe the sample requirements to tackle a variety of settings — e.g., model estimation, sparse reward discovery, goal-free cost-free exploration in communicating MDPs — for which we obtain improved or novel sample complexity guarantees. + +# 1 Introduction + +One of the challenges in online reinforcement learning (RL) is that the agent needs to trade off the exploration of the environment and the exploitation of the samples to optimize its behavior. Whenever the agent needs to gather information about a specific region of the Markov decision process (MDP), it must plan for a policy to reach the desired states, despite not having exact knowledge of the environment dynamics. This makes solving the exploration-exploitation problem in RL highly non-trivial and it requires designing a specific strategy depending on the learning objective, such as PAC-MDP learning [e.g., 13, 47, 59], regret minimization [e.g., 28, 6, 29, 66] or pure exploration [e.g., 30, 31, 39, 63, 64]. + +A simpler scenario considered in the literature is to assume access to a generative model or sampling oracle $(\mathcal{SO})$ [33]. Given any state-action pair $(s,a)$ , the $\mathcal{SO}$ returns a next state $s^{\prime}$ drawn from the transition probability $p(\cdot | s, a)$ and a reward $r(s, a)$ . In this case, it is possible to focus exclusively on where and how many samples to collect, while disregarding the problem of finding a suitable policy + +to obtain them. For instance, an $SO$ can be used to obtain samples from the environment, which are combined with dynamic programming techniques to compute an $\varepsilon$ -optimal policy. $SO$ -based algorithms can be as simple as prescribing the same amount of samples from each state-action pair [e.g. 35, 33, 5, 16, 46, 1, 38] or they may adaptively change the sample requirements on different state-action pairs [e.g. 15, 58, 62]. An $SO$ is also used in Monte-Carlo planning [49, 25, 7] which focuses on computing the optimal action at the current state by optimizing over rollout trajectories sampled from the $SO$ . Finally, in multi-armed bandit [37], there are cases where each arm corresponds to a state (or state-action), and "pulling" an arm translates into a call to an $SO$ (see e.g., the pure exploration setting of [51]). Unfortunately, while an $SO$ may be available in domains such as simulated robotics and computer games, this is not the case in the more general online RL setting. + +In this paper we tackle the exploration-exploitation problem in online RL by drawing inspiration from the $SO$ assumption. Specifically, we define an approach that is decoupled in two parts: 1) an "objective-specific" algorithm that assumes access to an $SO$ that (adaptively) prescribes the samples needed to achieve the learning objective of interest, and 2) an "objective-agnostic" algorithm that takes on the exploration challenge of collecting the samples requested by the $SO$ -based algorithm as quickly as possible.1 Our main contributions can be summarized as follows: + +- We define the sample complexity of the objective-agnostic algorithm as the number of (online) steps needed to satisfy the prescribed sampling requirements. Leveraging recent techniques on exploration in the stochastic shortest path (SSP) problem [45, 50], we propose GOSPRL (Goal-based Optimistic Sampling Procedure for RL), a conceptually simple and flexible exploration algorithm that learns how to "generate" the samples requested by any $SO$ -based algorithm and we derive bounds on its sample complexity. +- Leveraging the generality of our approach, we combine GOSPRL with problem-specific $SO$ -based algorithms and readily obtain online RL algorithms in difficult exploration problems. While in general our decoupled approach may be suboptimal compared to exploration strategies designed to solve one specific problem, we obtain sample complexity guarantees that are on par or better than state-of-the-art algorithms in a range of problems. 1) GOSPRL solves the problem of sparse reward discovery in $\widetilde{O}\left(D^{3/2}S^2A\right)$ time steps, which improves the dependency on the diameter $D$ w.r.t. a reward-free variant of UCRL2B [28, 22], as well as on $S$ and $A$ w.r.t. a MAXENT-type approach [26, 17]. 2) GOSPRL improves over the method of [54] for model estimation, by removing their ergodicity assumption as well as achieving better sample complexity. 3) GOSPRL provably tackles the problem of goal-free cost-free exploration, for which no specific strategy is available. +- We report numerical simulations supporting our theoretical findings and showing that pairing GOSPRL with $SO$ -based algorithms outperforms both heuristic and theoretically grounded baselines in various problems. + +Related work. While to the best of our knowledge no other work directly addresses the problem of simulating an $\mathcal{SO}$ , a number of approaches are related to it. The problem solved by GOSPRL can be seen as a reward-free exploration problem, since it is not driven by any external reward but by the objective of covering the state space to quickly meet the sampling requirements. Standard exploration-exploitation algorithms, such as UCRL2 [28] in the undiscounted setting or RMAX [13] in the discounted one, implicitly encourage exploration to specific areas of the state-action space that are not estimated accurately enough. The objective of covering the state space is also studied in [26, 17] with a Frank-Wolfe approach that optimizes a smooth aggregate function of the state visitations. + +Recent works on reward-free exploration (RFE) in the finite-horizon setting [e.g., 30, 31, 39, 64] provide sufficient exploration so that an $\varepsilon$ -optimal policy for any reward function can be computed. Our proposed solution shares high-level algorithmic principles with RFE approaches which incentivize the agent to visit insufficiently visited states via intrinsic reward. Nonetheless, our contribution significantly differs from existing RFE literature in two dimensions: 1) While we study the performance of GOSPRL in one goal-conditioned RFE problem (Sect. 4.3), our framework is much broader and it allows us to tackle a wider and diverse set of problems (Sect. 4 and App. I); 2) Our setting is horizon-agnostic and reset-free, which prevents from directly using any method or technical analysis in RFE designed for problems with an imposed planning horizon (e.g., finite-horizon or discounted). + +Finally, GOSPRL draws inspiration from the SSP formalism and solutions of [50, 45], but our approach critically differs from these works in three main ways: 1) we are interested in sample + +complexity guarantees rather than a regret analysis; 2) we consider requirements (i.e., goals to sample) that vary throughout the learning process, instead of an SSP problem with fixed goal state and cost function; 3) we show how GOSPRL can serve as a sample collection component to tackle various learning problems other than regret minimization. + +# 2 Problem Definition + +We consider a finite and reset-free MDP [43] $M \coloneqq \langle S, \mathcal{A}, p, r, s_0 \rangle$ , with $S \coloneqq |\mathcal{S}|$ states, $A \coloneqq |\mathcal{A}|$ actions and an arbitrary starting state $s_0 \in S$ . Calling an $\mathcal{SO}$ in any state-action pair $(s, a)$ leads to two outcomes: a next state sampled from the transition probability distribution $p(\cdot | s, a) \in \Delta(S)$ , and a reward $r(s, a) \in \mathbb{R}$ . A stationary deterministic policy is a mapping $\pi : S \to \mathcal{A}$ from states to actions and we denote by $\Pi^{\mathrm{SD}}$ the set of all such policies. For any policy $\pi$ and pair of states $(s, s')$ , let $\tau_{\pi}(s \to s')$ be the (possibly infinite) hitting time from $s$ to $s'$ when executing $\pi$ , i.e., $\tau_{\pi}(s \to s') \coloneqq \inf \{t \geq 0 : s_{t+1} = s' | s_1 = s, \pi\}$ , where $s_t$ is the state visited at time step $t$ . We introduce + +$$ +D _ {s s ^ {\prime}} := \min _ {\pi \in \Pi^ {\mathrm {S D}}} \mathbb {E} [ \tau_ {\pi} (s \to s ^ {\prime}) ], \qquad D _ {s ^ {\prime}} := \max _ {s \in \mathcal {S} \setminus \{s ^ {\prime} \}} D _ {s s ^ {\prime}}, \qquad D := \max _ {s ^ {\prime} \in \mathcal {S}} D _ {s ^ {\prime}}, +$$ + +where $D_{ss'}$ is the shortest-path distance between $s$ and $s'$ , $D_{s'}$ is the SSP-diameter of $s'$ [50] and $D$ is the MDP diameter [28]. + +We now formalize the problem of simulating an $SO$ (i.e., to generate the samples prescribed by an $SO$ -based algorithm). At each time step $t \geq 1$ the agent receives a function $b_{t}: S \times \mathcal{A} \to \mathbb{N}$ , where $b_{t}(s, a)$ defines the total number of samples that need to be collected at $(s, a)$ by time step $t$ . We consider that $(b_{t})_{t \geq 1}$ is an arbitrary sequence with each $b_{t}$ measurable w.r.t. the filtration up to time $t$ (i.e., it may depend on the samples observed so far).2 We focus on the objective of designing an online algorithm that minimizes the time required to collect the prescribed samples. Since the environment is initially unknown, we need to trade off between exploring states and actions to improve estimates of the dynamics and exploiting current estimates to collect the required samples as quickly as possible. We formally define the performance metric as follows. + +Definition 1. For any state-action pair, we denote by $N_{t}(s,a) \coloneqq \sum_{i=1}^{t} \mathbb{1}_{\{(s_{i},a_{i})=(s,a)\}}$ the number of visits to state $s$ and action $a$ up to (and including) time step $t$ . Given a sampling requirement sequence $b \coloneqq (b_{t})_{t \geq 1}$ with $b_{t}: \mathcal{S} \times \mathcal{A} \to \mathbb{N}$ and a confidence level $\delta \in (0,1)$ , we define the sample complexity of a learning algorithm $\mathfrak{A}$ as + +$$ +\mathcal {C} \big (\mathfrak {A}, b, \delta \big) := \min \left\{t > 0: \mathbb {P} \big (\forall (s, a) \in \mathcal {S} \times \mathcal {A}, N _ {t} (s, a) \geq b _ {t} (s, a) \big) \geq 1 - \delta \right\}. +$$ + +With no additional condition, it is trivial to define problems such that $\mathcal{C}(\mathfrak{A}, b, \delta) = +\infty$ for any algorithm. To avoid this case, we introduce the following assumptions. + +Assumption 1. The MDP $M$ is communicating with a finite and unknown diameter $D < +\infty$ . + +Assumption 2. There exist an unknown and bounded function $\overline{b} : \mathcal{S} \times \mathcal{A} \to \mathbb{N}$ such that the sequence $(b_{t})_{t \geq 1}$ verifies: $\forall t \geq 1$ , $\forall (s, a) \in \mathcal{S} \times \mathcal{A}$ , $b_{t}(s, a) \leq \overline{b}(s, a)$ . + +Asm. 1 guarantees that whatever state needs to be sampled, there exists at least one policy that can reach it in finite time almost-surely (notice that it is considerably weaker than the ergodicity assumption (App. J) often used in online RL, see e.g., [60, 40, 24]). Asm. 2 ensures that the sequence of sampling requirements does not diverge and can thus be fulfilled in finite time. These assumptions guarantee that the problem in Def. 1 is well-posed and the sample complexity is bounded. + +A variety of problems can be cast under our decoupled approach, in the sense that they can be tackled by solving the problem of Def. 1 under a specific instantiation of the sampling requirement sequence $(b_{t})_{t\geq 1}$ . For instance, consider the problem of covering the state-action space (e.g., to discover a hidden sparse reward), then the requirement is immediately defined as $b_{t}(s,a) = 1$ . In Sect. 4 and App. I, we review problems where defining $b_{t}$ can be as simple as computing the sufficient number of samples needed to reach a certain level of accuracy in estimating a quantity of interest (e.g., model estimation) or can be directly extracted from existing literature (e.g., $\varepsilon$ -optimal policy learning). + +We now provide a simple worst-case lower bound on the sample complexity (details in App. D). + +Algorithm 1 GOSPRL Algorithm +Input: sampling requirement sequence $(b_{t})_{t\geq 1}$ with $b_{t}:\mathcal{S}\times \mathcal{A}\to \mathbb{N}$ revealed at time $t$ (or anytime before). Initialize: Set $\mathcal{G}_1\coloneqq \{s\in S:\exists a\in \mathcal{A},b_1(s,a) > 0\}$ , time step $t\coloneqq 1$ , counters $N_{1}(s,a)\coloneqq 0$ , attempt index $k\coloneqq 1$ and attempt counters $U_{1}(s,a)\coloneqq 0,\nu_{1}(s,a)\coloneqq 0.$ while $\mathcal{G}_k$ is not empty do Define the SSP problem $M_{k}$ with goal states $\mathcal{G}_k$ , and compute its optimistic shortest-path policy $\widetilde{\pi}_k$ Set flag $\equiv$ True and counter $\nu_{k}(s,a)\coloneqq 0$ while flag do Execute action $a_{t}\coloneqq \widetilde{\pi}_{k}(s_{t})$ and observe next state $s_{t + 1}\sim p(\cdot |s_t,a_t)$ Increment counters $\nu_{k}(s_{t},a_{t})$ and $N_{t}(s_{t},a_{t})$ if $s_{t + 1}\in \mathcal{G}_k$ or $\nu_{k}(s_{t},a_{t}) > \{U_{k}(s_{t},a_{t})\vee 1\}$ then Set flag $\equiv$ False. end if Set $t + = 1$ end while if $s_t\in \mathcal{G}_k$ then Execute an action a s.t. $N_{t}(s_{t},a) < b_{t}(s_{t},a)$ , observe next state $s_{t + 1}\sim p(\cdot |s_t,a)$ and set $t + = 1$ end if Set $U_{k + 1}(s,a)\coloneqq U_k(s,a) + \nu_k(s,a),k + = 1$ Update the set of goal states $\mathcal{G}_k\coloneqq \{s\in S:\exists a\in \mathcal{A},N_{t - 1}(s,a) < b_{t - 1}(s,a)\}$ end while + +Lemma 1. For any $S \geq 1$ , there exists an MDP with $S$ states satisfying Asm. 1 such that for any sampling requirement $b: S \to \mathbb{N}$ satisfying Asm. 2, + +$$ +\min _ {\mathfrak {A}} \mathcal {C} \big (\mathfrak {A}, b, \frac {1}{2} \big) = \Omega \Big (\sum_ {s \in \mathcal {S}} D _ {s} b (s) \Big). +$$ + +Lemma 1 shows that the (possibly non-stationary) policy minimizing the time to collect all samples requires $\Omega\left(\sum_{s}D_{s}b(s)\right)$ time steps in a worst-case MDP. We also notice that when the total sampling requirement $B$ is concentrated on the state $\overline{s}$ for which $D_{\overline{s}} = D$ (i.e., $b(s^{\prime}) = 0, \forall s^{\prime}\neq \overline{s}$ ), the previous bound reduces to $\Omega(BD)$ . + +# 3 Online Learning for $SO$ Simulation + +We now introduce our algorithm for the problem in Def. 1, bound its sample complexity and discuss several extensions. + +# 3.1 The GOSPRL Algorithm + +In Alg. 1 we outline GOSPRL (Goal-based Optimistic Sampling Procedure for Reinforcement Learning). At each time step $t$ , GOSPRL receives a sampling requirement $b_{t}: S \times \mathcal{A} \to \mathbb{N}$ . The algorithm relies on the principle of optimism in the face of uncertainty and proceeds through attempts to collect relevant samples. We index the attempts by $k = 1, 2, \ldots$ and denote by $t_{k}$ the time step at the start of attempt $k$ and by $U_{k} := N_{t_{k-1}}$ the number of samples available at the start of attempt $k$ . At each attempt, GOSPRL goes through the following steps: 1) Cast the under-sampled states as goal states and define an associated unit-cost multi-goal SSP instance (with unknown transitions); 2) Compute an optimistic shortest-path policy; 3) Execute the policy until either a goal state is reached or a stopping condition is satisfied; 4) If a sought-after goal state denoted by $g$ has been reached, execute an under-sampled action (i.e., an action $a$ such that $N_{t}(g, a) < b_{t}(g, a)$ ). The algorithm ends when the sampling requirements are met, i.e., at the first time $t \geq 1$ where $N_{t}(s, a) \geq b_{t}(s, a)$ for all $(s, a)$ . + +Step 1. At any attempt $k$ we begin by defining the set of all under-sampled states + +$$ +\mathcal {G} _ {k} := \left\{s \in \mathcal {S}: \exists a \in \mathcal {A}, N _ {t _ {k} - 1} (s, a) < b _ {t _ {k} - 1} (s, a) \right\}. +$$ + +We then cast the sample collection problem as a goal-reaching objective, by constructing a multi-goal SSP problem [9] denoted by $M_{k}\coloneqq \langle S_{k},\mathcal{A},p_{k},c_{k},\mathcal{G}_{k}\rangle$ , with: + +- $\mathcal{G}_k$ denotes the set of goal states, $S_k \coloneqq S \setminus \mathcal{G}_k$ the set of non-goal states and $\mathcal{A}$ the set of actions. +- The transition model $p_k$ is the same as the original $p$ except for the transitions exiting the goal states which are redirected as a self-loop, i.e., $p_k(s'|s, a) \coloneqq p(s'|s, a)$ and $p_k(g|g, a) \coloneqq 1$ for any $(s, s', a, g) \in S_k \times S \times \mathcal{A} \times \mathcal{G}_k$ . +- The cost function $c_k$ is defined as follows: for any $a \in \mathcal{A}$ , any goal state $g \in \mathcal{G}_k$ is zero-cost $(c_k(g, a) := 0)$ , while the non-goal costs are unitary $(c_k(s, a) := 1$ for $s \in S_k$ ). + +From [10], Asm. 1 and the positive non-goal costs $c_k$ entail that solving $M_k$ is a well-posed SSP problem and that there exists an optimal policy that is proper (i.e., that eventually reaches one of the goal states with probability 1 when starting from any $s \in S_k$ ). Crucially, the objective of collecting a sample from the under-sampled states $\mathcal{G}_k$ coincides with the SSP objective of minimizing the expected cumulative cost to reach a goal state in $M_k$ . + +Step 2. Since $p_k$ is unknown, we cannot directly compute the shortest-path policy for $M_k$ . Instead, leveraging the samples collected so far, we apply an extended value iteration scheme for SSP which implicitly skews the empirical transitions $\widehat{p}_k$ towards reaching the goal states. This procedure can be done efficiently as shown in [50] (see App. A), and it outputs an optimistic shortest-path policy $\widetilde{\pi}_k$ . + +Step 3. $\widetilde{\pi}_k$ is then executed with the aim of quickly reaching an under-sampled state. Along its trajectory, the counter $N_{t}$ is updated for each visited state-action. Because of the error in estimating the model, $\widetilde{\pi}_k$ may never reach one of the goal states (i.e., it may not be proper in $p_k$ ). Thus $\widetilde{\pi}_k$ is executed until either one of the goals in $\mathcal{G}_k$ is reached, or the number of visits is doubled in a state-action pair in $S_{k} \times \mathcal{A}$ , a standard termination condition first introduced in [28]. If a sought-after goal state is reached, the agent executes an under-sampled action according to the current sampling requirements at that state. At the end of each attempt, the statistics (e.g., model estimate) are updated. + +The algorithmic design of GOSPRL is conceptually simple and can flexibly incorporate various modifications driven by slightly different objectives or prior knowledge, without altering Thm. 1 (cf. App. B). + +# 3.2 Sample Complexity Guarantee of GOSPRL + +Thm. 1 establishes the sample complexity guarantee of GOSPRL (Alg. 1). + +Theorem 1. Under Asm. 1 and 2, for any sampling requirement sequence $b = (b_{t})_{t\geq 1}$ and any confidence level $\delta \in (0,1)$ , the sample complexity of GOSPRL is bounded as + +$$ +\mathcal {C} (\text {G O S P R L}, b, \delta) = \widetilde {O} (\bar {B} D + D ^ {3 / 2} S ^ {2} A), \tag {1} +$$ + +$$ +\mathcal {C} (\text {G O S P R L}, b, \delta) = \widetilde {O} \left(\sum_ {s \in \mathcal {S}} \left(D _ {s} \bar {b} (s) + D _ {s} ^ {3 / 2} S ^ {2} A\right)\right), \tag {2} +$$ + +where the $\widetilde{O}$ notation hides logarithmic dependencies on $S, A, D, 1 / \delta$ and $\overline{b}(s) \coloneqq \sum_{a \in \mathcal{A}} \overline{b}(s, a)$ and $\overline{B} \coloneqq \sum_{s \in \mathcal{S}} \overline{b}(s)$ . Recall that $D_s \leq D$ is the SSP-diameter of state $s$ and captures the difficulty of collecting a sample at state $s$ starting at any other state in the MDP. + +We notice that in practice GOSPRL stops at the first random step $\tau$ at which the sampling requirement $b_{\tau}(s,a)$ is achieved for all $(s,a)$ . Thm. 1 provides a worst-case upper bound on the stopping time of GOSPRL using the possibly loose bound $b_{\tau}(s,a) \leq \overline{b}(s,a)$ . On the other hand, in the special case of $b: S \to \mathbb{N}$ when the requirements are both time-independent (i.e., given as initial input to the algorithm) and action-independent, the actual sampling requirement $b(s)$ (resp. $B := \sum_{s \in S} b(s)$ ) replaces $\overline{b}(s)$ (resp. $\overline{B}$ ) in the bound. In the following, we consider this case for the ease of exposition. + +Proof idea. The key step (see App. C for the full derivation) is to link the sample complexity of GOSPRL to the regret accumulated over the sequence of multi-goal SSP problems $M_{k}$ generated across multiple attempts. Indeed we can define the regret at attempt $k$ as the gap between the performance of the SSP-optimal policy $\pi_k^\star$ solving $M_{k}$ (i.e., the minimum expected number of steps to reach any of the states in $\mathcal{G}_k$ starting from $s_{t_k}$ ) and the actual number of steps executed by GOSPRL before terminating the attempt. While the SSP regret minimization analysis of [45] assumes that the goal is fixed, we show that it is possible to bound the regret accumulated across different attempts for any arbitrary sequence of goals. The proof is concluded by bounding the cumulative performance of the SSP-optimal policies and it leads to the bound $\widetilde{O}\bigl (BD + D^{3 / 2}S^2 A\bigr)$ where $B\coloneqq \sum_{s\in S}b(s)$ . On the other hand, the refined bound in Eq. 2 requires a more careful analysis, where we no longer directly + +translate regret bounds into sample complexity and we rather focus on relating the performance to state-dependent quantities $D_{s}$ and $b(s)$ . Finally, we show that the extension to the general case of time-dependent action-dependent sampling requirements is straightforward and obtain Thm. 1. + +Interpretation of Thm. 1. We can decompose Eq. 1 as a linear term in $B$ and a constant term. In the regime of large sample requirements (i.e., large $B$ ), the sample complexity thus reduces to $\widetilde{O}(BD)$ , which adds at most an extra "cost" factor of $D$ w.r.t. an $SO$ . As this may be loose in many cases, the more refined analysis of Eq. 2 stipulates a cost of $D_s$ to collect a sample at state $s$ , which better captures the connectivity of the MDP. In fact the lower bound in Lem. 1 shows that this cost of $D_s$ is unavoidable in the worst case, and that GOSPRL is only constant and logarithmic terms off w.r.t. to the best sample complexity that can be achieved in the worst case. While an extra attempt of refinement would be to avoid being worst-case w.r.t. the starting state in the definition of $D_s$ , this seems particularly challenging as the randomness of the environment makes it hard to control and analyze the sequence of states traversed by the agent. Also note that existing bounds in SSP [50, 45] are only worst-case and it remains an open question to derive finer (e.g., problem-dependent) bounds in SSP and how they could be leveraged in our case. + +Optimal solution. GOSPRL targets a greedy-optimal strategy, which seeks to sequentially minimize each time to reach an under-sampled state. Alternatively, one may wonder if it is possible to design a learning algorithm that approaches the performance of the exact-optimal solution, i.e., a (nonstationary) policy explicitly minimizing the number of steps required to fulfill the sampling requirements. Such strategy can be characterized as the optimal policy of an SSP problem for an MDP with state space augmented by the current sampling requirements and goal state corresponding to the case when all desired samples are collected. Even under known dynamics, the computational complexity of computing the optimal policy in this MDP (e.g., via value iteration) is exponential (scaling in $B^S$ ). When the dynamics is unknown, it appears highly challenging to obtain any learning algorithm whose performance is comparable to the exact-optimal strategy for any finite sample requirement $B$ . + +Beyond Communicating MDPs. In App. E we design an extension of GOSPRL to poorly or weakly communicating environments. In this setting, it is expected to assess online the "feasibility" of certain sampling requirements and discard them whenever associated to states that are too difficult to reach or unreachable. Given as input a "reachability" threshold $L$ , we derive sample complexity guarantees for our variant of GOSPRL where the (possibly large or infinite) diameter $D$ is fittingly replaced by $L$ . + +# 4 Applications of GOSPRL + +An appealing feature of GOSPRL is that it can be integrated with techniques that compute the (fixed or adaptive) sampling requirements to readily obtain an online RL algorithm with theoretical guarantees. In this section we focus on three specific problems where in our decoupled approach the $\mathcal{SO}$ -based algorithm is either trivial or can be directly extracted from existing literature, and its combination with the sample collection strategy of GOSPRL yields improved or novel guarantees. Other applications (e.g., PAC-policy learning, diameter estimation, bridging bandits and MDPs) are illustrated in App. I. + +# 4.1 Sparse Reward Discovery (TREASURE) + +A number of recent methods focus on the state-space coverage problem, where each state in the MDP needs to be reached as quickly as possible. This problem is often motivated by environments where a one-hot reward signal, called the treasure, is hidden and can only be discovered by reaching a specific state and taking a specific action. Not only the environment but also the treasure state-action pair is unknown, and the agent does not receive any side information to guide its search (e.g., a measure of closeness to the treasure). Thus the agent must perform exhaustive exploration to find the treasure. + +Definition 2. Given a confidence $\delta \in (0,1)$ , the TREASURE sample complexity of a learning algorithm $\mathfrak{A}$ is defined as $\mathcal{C}_{\mathrm{TREASURE}}(\mathfrak{A},\delta) \coloneqq \min \left\{t > 0:\mathbb{P}\big(\forall (s,a)\in S\times \mathcal{A},N_t(s,a)\geq 1\big)\geq 1 - \delta \right\}$ . + +In this case, a $SO$ -based algorithm would immediately solve the problem by collecting one sample from each state-action pair. As a result, we can directly apply GOSPRL for TREASURE by simply setting $b(s,a) = 1$ for each $(s,a)$ and from Thm. 1 with $B = SA$ we obtain the following guarantee. + +Lemma 2. GOSPRL with $b(s, a) = 1$ verifies $\mathcal{C}_{\text{TREASURE}}(\text{GOSPRL}, \delta) = \widetilde{O}\big(D^{3/2}S^2A\big)$ . + +We now compare this result to alternative approaches to the problem, showing that GOSPRL has state-of-the-art guarantee for TREASURE (see App. G for details). + +- First, reward-free methods such as [30, 64, 31, 39] are designed for finite-horizon problems so their guarantees cannot be directly translated to sample complexity for the TREASURE problem. Nonetheless, we draw inspiration from their algorithmic principles and analyze a reward-free variant of UCRL2 [28, 22]. Specifically we consider 0/1-UCRL, which runs UCRL by setting a reward of 1 to under-sampled states and 0 otherwise. However, we obtain a TREASURE sample complexity for 0/1-UCRL of $\widetilde{O}\left(\sum_{s\in S}D_s^3 S^2 A\right)$ , which is always worse than the bound in Lem. 2. +- Second, we can adapt the MAXENT approach [26] to state-action coverage so that it targets a policy whose stationary state-action distribution $\lambda$ maximizes $H(\lambda) := -\sum_{s,a} \lambda(s,a) \log \lambda(s,a)$ . While optimizing this entropy does not provably solve TREASURE, it encourages us to take a "worst-case" approach w.r.t. the state-action visitations, and rather maximize $F(\lambda) := \min_{(s,a) \in S \times A} \lambda(s,a)$ . We show that the learning algorithm of [17] instantiated to maximize $F$ yields a TREASURE sample complexity of at least $\Omega \left( \min \left\{ D^2 S^2 A / (\omega^\star)^2, D^3 / (\omega^\star)^3 \right\} \right)$ with $\omega^\star := \min_\lambda F(\lambda) \leq (SA)^{-1}$ , which is significantly poorer than Lem. 2. In fact, in contrast to MAXENT-inspired methods that optimize for a single stationary policy, GOSPRL realizes a non-stationary strategy that gradually collects the required samples by tackling successive learning problems. + +# 4.2 Model Estimation (MODEST) + +We now study the problem of accurately estimating the unknown transition dynamics in a reward-free communicating environment. The objective was recently introduced in [54] and we refer to it as the model-estimation problem, or MODEST for short. + +Definition 3. Given an accuracy level $\eta >0$ and a confidence level $\delta \in (0,1)$ , the MODEST sample complexity of an online learning algorithm $\mathfrak{A}$ is defined as + +$$ +\mathcal {C} _ {\text {M O D E S T}} (\mathfrak {A}, \eta , \delta) := \min \left\{t > 0: \mathbb {P} \big (\forall (s, a) \in \mathcal {S} \times \mathcal {A}, \| \widehat {p} _ {\mathfrak {A}, t} (\cdot | s, a) - p (\cdot | s, a) \| _ {1} \leq \eta \big) \geq 1 - \delta \right\}, +$$ + +where $\widehat{p}_{\mathfrak{A},t}$ is the estimate (i.e., empirical average) of the transition dynamics $p$ after $t$ time steps. + +Unlike in TREASURE, here the sampling requirements are not immediately prescribed by the problem. To define the $SO$ -based algorithm we first upper-bound the estimation error using an empirical Bernstein inequality and then invert it to derive the amount of samples $b_{t}(s,a)$ needed to achieve the desired level of accuracy $\eta$ (see App. F). Specifically, letting $\widehat{\sigma}_t^2(s'|s,a) \coloneqq \widehat{p}_t(s'|s,a)(1 - \widehat{p}_t(s'|s,a))$ be the estimated variance of the transition from $(s,a)$ to $s'$ after $t$ steps, we set + +$$ +b _ {t} (s, a) := \left\lceil \frac {5 7 (\sum_ {s ^ {\prime}} \widehat {\sigma} _ {t} (s ^ {\prime} | s , a)) ^ {2}}{\eta^ {2}} \log^ {2} \left(\frac {8 e (\sum_ {s ^ {\prime}} \widehat {\sigma} _ {t} (s ^ {\prime} | s , a)) ^ {2} \sqrt {2 S A}}{\sqrt {\delta} \eta}\right) + \frac {2 4 S}{\eta} \log \left(\frac {2 4 S ^ {2} A}{\delta \eta}\right)\right\rceil . \quad (3) +$$ + +Since the estimated variance changes depending on the samples observed so far, the sampling requirements are adapted over time. Given that $\widehat{\sigma}_t^2 (s'|s,a)\leq 1 / 4$ , $b_{t}(s,a)$ is always bounded so Thm. 1 provides the following guarantee. + +Lemma 3. Let $\Gamma \coloneqq \max_{s,a}\| p(\cdot |s,a)\| _0\leq S$ be the maximal support of $p(\cdot |s,a)$ over the state-action pairs $(s,a)$ . Running GOSPRL with the sampling requirements in Eq. 3 yields + +$$ +\mathcal {C} _ {\mathrm {M O D E S T}} (\mathrm {G O S P R L}, \eta , \delta) = \widetilde {O} \Big (\frac {D \Gamma S A}{\eta^ {2}} + \frac {D S ^ {2} A}{\eta} + D ^ {3 / 2} S ^ {2} A \Big). +$$ + +Lem. 3 improves over the result of [54] in two important aspects. First, the latter suffers from an inverse dependency on the stationary state-action distribution that optimizes a proxy objective function used in the derivation of their algorithm. Second, while [54] requires an ergodicity assumption, Lem. 3 is the first sample complexity result for MODEst in the more general communicating setting. + +# 4.3 Goal-Free & Cost-Free Exploration in Communicating MDPs + +We finally delve into the paradigm of reward-free exploration introduced by [30]: the objective of the agent is to collect enough information during the reward-free exploration phase, so that it can readily compute a near-optimal policy once any reward function is provided. The problem has been analyzed in the finite-horizon setting [e.g., 30, 39, 64]. Here we study the more general and challenging setting of goal-conditioned RL. We define the goal-free cost-free objective as follows: after the exploration phase, the agent is expected to compute a near-optimal goal-conditioned policy for any goal state and any cost function (w.l.o.g. we consider a maximum possible cost $c_{\mathrm{max}} = 1$ ). Recall that given a goal state $g$ and costs $c$ , the (possibly unbounded) value function of a policy $\pi$ is + +$$ +V ^ {\pi} (s \to g) := \mathbb {E} \bigg [ \sum_ {t = 1} ^ {\tau_ {\pi} (s \to g)} c (s _ {t}, \pi (s _ {t})) \mid s _ {1} = s \bigg ]. +$$ + +Given a slack parameter $\theta \in [1, +\infty]$ , we say that a policy $\widehat{\pi}$ is $(\varepsilon, \theta)$ -optimal if + +$$ +V ^ {\widehat {\pi}} (s \rightarrow g) \leq \min _ {\pi : \mathbb {E} [ \tau_ {\pi} (s \rightarrow g) ] \leq \theta D _ {s, g}} V ^ {\pi} (s \rightarrow g) + \varepsilon . +$$ + +In this setting, constructing an efficient $SO$ -based algorithm is considerably more complex than TREASURE and MODEST. Relying on a sample complexity analysis for the fixed-goal SSP problem with a generative model [53], we define the (adaptive) number of samples needed in each state-action pair for our online objective. Although the number depends on the unknown diameter, we estimate $D$ using GOSPRL. The resulting sequence of sampling requirements is then fed online to GOSPRL. Combining the result of [53] and the properties of GOSPRL yields the following bound (see App. H). + +Lemma 4. Consider any MDP satisfying Asm. 1 and the goal-free cost-free exploration problem with accuracy level $0 < \varepsilon \leq 1$ , confidence level $\delta \in (0,1)$ , minimum cost $c_{\mathrm{min}} \in [0,1]$ , slack parameter $\theta \in [1, +\infty]$ . We can instantiate GOSPRL so that its exploration phase (i.e., number of time steps) is bounded with probability at least $1 - \delta$ by + +$$ +\widetilde {O} \bigg (\frac {D ^ {4} \Gamma S A}{\omega \varepsilon^ {2}} + \frac {D ^ {3} S ^ {2} A}{\omega \varepsilon} + \frac {D ^ {3} \Gamma S A}{\omega^ {2}} \bigg), +$$ + +where $\omega := \max \left\{c_{\min}, \varepsilon / (\theta D)\right\} > 0$ (thus, either $c_{\min} = 0$ or $\theta = +\infty$ , but not both simultaneously). Following the exploration phase, the algorithm can compute in the planning phase, for any goal state $g \in S$ and any cost function $c$ in $[c_{\min}, 1]$ , a policy $\widehat{\pi}_{g,c}$ that is $(\varepsilon, \theta)$ -optimal. + +Lem. 4 establishes the first sample complexity guarantee for general goal-free, cost-free exploration. While the objective is demanding and the upper bound on the length of the exploration phase can be large, the main purpose of this result is to showcase how GOSPRL can be readily instantiated to tackle a challenging exploration problem for which no existing solution can be easily leveraged. Comparing our analysis to the finite-horizon objective of [30] reveals two interesting properties: + +- The goal-free aspect: moving from finite-horizon to goal-conditioned renders unavoidable both the communicating requirement (Asm. 1) and the bound's dependency on the unknown diameter $D$ (which partly captures the role of the known horizon $H$ in the bound of [30]). +- The cost-free aspect: in contrast to finite-horizon, the value of $c_{\mathrm{min}}$ has an important impact on the type of performance guarantees we can obtain; in particular our analysis distinguishes between positive and non-negative costs (as also done in existing SSP analysis [11, 50, 45]). + +# 5 Experiments + +In this section we report a preliminary numerical validation of our theoretical findings. While GOSPRL can be integrated in many different contexts, here we focus on the problems where our theory suggests that GOSPRL performs better than state-of-the-art online learning methods. + +![](images/3a29b412b95e7866550c923cf77d462c257736a8c60e803183de5e4beb262997.jpg) +Figure 1: TREASURE-10 problem (i.e., with $b(s, a) = 10$ ): Proportion $\mathcal{P}_t$ of states meeting the requirements at time $t$ , averaged over 30 runs. By definition of the sample complexity, the metric of interest is not the rate of increase of $\mathcal{P}_t$ over time but only the time needed to reach the line of success $\mathcal{P}_t = 1$ . Left: 6-state RiverSwim, Center: 24-state corridor gridworld, Right: 43-state 4-room gridworld (see App. K for details on the domains). + +![](images/f606e6edeb8d8e29c0adc791097f6634be753fa4a9d3fcdbce5f3a5f6b787b69.jpg) + +![](images/21edc4caefe0df55c486dbadace1a22b004ecddbb3bd9bcbcd74b371e233c813.jpg) + +![](images/5cc7b45d988cec624cbfa271cd76222e115f06ddb86c16d2b0b344ab6c8d2cf7.jpg) +Figure 2: Sample complexity boxplots of GOSPRL (in red) and $0/1$ -UCRL (in blue). Each column represents 30 runs on a randomly generated Garnet $\mathcal{G}(S, A = 5, \beta = 5)$ with randomly generated state-action sampling requirements $b: S \times \mathcal{A} \to \mathcal{U}(0, 100)$ . Left: $S = 10$ , Right: $S = 50$ . + +![](images/4209dccc77e4765c1a0836702b7f2c58a472032144bf027bacf02a79f59028b4.jpg) + +![](images/e57e628c2dbf0707f7bc9787fd9be6f633a22eb44993920712253271d2e2e684.jpg) +Figure 3: MODEST problem: $\ell_1$ -error $\mathcal{E}_t \coloneqq (SA)^{-1} \cdot \sum_{s,a} \| \widehat{p}_t(\cdot | s, a) - p(\cdot | s, a) \|_1$ , averaged over 30 runs. Left: NoisyRiverSwim(36), Center: Wheel(30), Right: Randomly generated Garnet $\mathcal{G}(50, 5, 25)$ . + +![](images/9f06f56f20fdb7294c485b8cf87dab15b2389964062530a0252291856d2848dd.jpg) + +![](images/5bb831dd280e91080b9469a482a7110b5a80f60eb720b895ff0cb7d4df47afe4.jpg) +Figure 4: Simple three-state reward-free domain [23] and TREASURE-10 sample complexity of GOSPRL (averaged over 30 runs) as a function of the diameter $D \approx 1 / \nu$ . + +![](images/1415ebbb5c1d96639446ed48697112c8e79c2940f775ea95beecaebd61c2e0d6.jpg) + +![](images/a2f61f2870fb104aba19eda9ac9335f69d44b4fa45c435a1f873c88eb6e205c6.jpg) + +TREASURE-type problem. We consider a TREASURE-type problem (Sect. 4.1), where for all $(s, a)$ we set $b(s, a) = 10$ instead of 1 (we call it the TREASURE-10 problem).8 We begin by showing in Fig. 4 that it is easy to construct a worst-case problem where the sample complexity scales linearly with the diameter, which is consistent with the theoretical discussion in Sect. 2 and 3. + +We compare to two heuristics based on UCRL2B [28, 22]: 0-UCRL, where the reward used in computing the optimistic policy is set proportional to $\left([N(s,a) - b(s,a)]^{+}\right)^{-1 / 2}$ , and 0/1-UCRL with reward 1 for undersampled state-action pairs and 0 otherwise. We also compare with the MAXENT algorithm [17] that maximizes entropy over the state-action space, and with a uniformly random baseline policy. We test on the RiverSwim domain [48] and various gridworlds (see App. K for details and more results). Fig. 1 reports the proportion $\mathcal{P}_t$ of states that satisfy the sampling requirements at time $t$ . Our metric of interest is the time needed to collect all required samples, and we see that GOSPRL reaches the $\mathcal{P}_t = 1$ line of success consistently, and faster than 0/1-UCRL, while the other heuristics struggle. The steady increase of $\mathcal{P}_t$ illustrates GOSPRL's design to progressively meet the sampling requirements, and not exhaust them state after state. + +Random MDPs and sampling requirements. To study the generality of GOSPRL to collect arbitrary sought-after samples, we further compare GOSPRL with 0/1-UCRL which is the best heuristic from the previous experiment. We test on a variety of randomly generated configurations, that we define as follows: each configuration corresponds to i) a randomly generated Garnet environment $\mathcal{G}(S,A,\beta)$ (with $S$ states, $A$ actions and branching factor $\beta$ , see [12]), and ii) randomly generated requirements $b(s,a)\in \mathcal{U}(0,\overline{U})$ , where the maximum budget is set to $\overline{U} = 100$ to have a wide range of possible requirements across each environment. The boxplots in Fig. 2 provide aggregated statistics on the sample complexity for different configurations. We observe that GOSPRL consistently meets the sampling requirements faster than 0/1-UCRL, as well as suffers from lower variance across runs. + +Modest problem. Finally, we empirically evaluate GOSPRL for the MODEST problem (Sect. 4.2). We compare to the fully online WEIGHTEDMAXENT heuristic, which weighs the state-action entropy components with an optimistic estimate of the next-state transition variance and was shown in [54] to perform empirically better than algorithms with theoretical guarantees. We test on the two environments (NoisyRiverSwim and Wheel) proposed in [54] for their high level of stochasticity, as well as on a randomly generated Garnet. To facilitate the comparison, we consider a GOSPRL-for-MODEST algorithm where the sampling requirements are computed using a decreasing error $\eta$ (see App. K for details). We observe in Fig. 3 that GOSPRL outperforms the WEIGHTEDMAXENT heuristic. + +# 6 Conclusion + +In this paper, we introduced the online learning problem of simulating a sampling oracle (Sect. 2) and derived the algorithm GOSPRL with its sample complexity guarantee (Sect. 3). We then illustrated how it can be used to tackle in a unifying fashion a variety of applications without having to design a specific online algorithm for each, while at the same time obtaining improved or novel sample complexity guarantees (Sect. 4). Going forward, we believe that GOSPRL can be used as a competitive off-the-shelf baseline when a new application is introduced. + +An exciting direction of future investigation is to extend the general sample collection problem and its various applications beyond the tabular setting. Handling a continuous state space or linear function approximation requires redefining the notion of reaching a specific state (e.g., via adequate discretization or by considering requirements based on the covariance matrix). Studying the SSP problem beyond tabular may provide insights, as recently initiated in [56] in linear function approximation under the assumption that all policies are proper. On the more algorithmic side, GOSPRL hinges on knowing the sampling requirement function $b_{t}$ and deriving a shortest-path policy $\widetilde{\pi}$ . Interestingly, we can identify algorithmic counterparts to both modules in deep RL. The computation of $\widetilde{\pi}$ can be entrusted to a goal-conditioned network (using e.g., [2]), while the specification of $b_{t}$ can be related to goal-sampling selection mechanisms that elect hard-to-reach [21] or rare [42] states as goals. + +# References + +[1] A. Agarwal, S. Kakade, and L. F. Yang. Model-based reinforcement learning with a generative model is minimax optimal. In Proceedings of Thirty Third Conference on Learning Theory, volume 125 of Proceedings of Machine Learning Research. PMLR, 2020. +[2] M. Andrychowicz, F. Wolski, A. Ray, J. Schneider, R. Fong, P. Welinder, B. McGrew, J. Tobin, P. Abbeel, and W. Zaremba. Hindsight experience replay. In Proceedings of the 31st International Conference on Neural Information Processing Systems, pages 5055-5065, 2017. +[3] J.-Y. Audibert and S. Bubeck. Best arm identification in multi-armed bandits. In COLT - 23th Conference on Learning Theory, 2010. +[4] J.-Y. Audibert, R. Munos, and C. Szepesvári. Exploration-exploitation tradeoff using variance estimates in multi-armed bandits. Theoretical Computer Science, 410(19):1876-1902, 2009. +[5] M. G. Azar, R. Munos, and H. J. Kappen. Minimax pac bounds on the sample complexity of reinforcement learning with a generative model. Machine learning, 91(3):325-349, 2013. + +[6] M. G. Azar, I. Osband, and R. Munos. Minimax regret bounds for reinforcement learning. In Proceedings of the 34th International Conference on Machine Learning-Volume 70, pages 263-272. JMLR, 2017. +[7] P. Bartlett, V. Gabillon, J. Healey, and M. Valko. Scale-free adaptive planning for deterministic dynamics & discounted rewards. In International Conference on Machine Learning, pages 495-504. PMLR, 2019. +[8] P. L. Bartlett and A. Tewari. Regal: a regularization based algorithm for reinforcement learning in weakly communicating mdps. In Proceedings of the Twenty-Fifth Conference on Uncertainty in Artificial Intelligence, 2009. +[9] D. P. Bertsekas. Dynamic programming and optimal control, volume 1. Athena scientific Belmont, MA, 1995. +[10] D. P. Bertsekas and J. N. Tsitsiklis. An analysis of stochastic shortest path problems. Mathematics of Operations Research, 16(3):580-595, 1991. +[11] D. P. Bertsekas and H. Yu. Stochastic shortest path problems under weak conditions. Lab. for Information and Decision Systems Report LIDS-P-2909, MIT, 2013. +[12] S. Bhatnagar, R. S. Sutton, M. Ghavamzadeh, and M. Lee. Natural actor-critic algorithms. Automatica, 45(11):2471-2482, 2009. +[13] R. I. Brafman and M. Tennenholtz. R-max-a general polynomial time algorithm for near-optimal reinforcement learning. Journal of Machine Learning Research, 3(Oct):213-231, 2002. +[14] A. Carpentier, A. Lazaric, M. Ghavamzadeh, R. Munos, and P. Auer. Upper-confidence-bound algorithms for active learning in multi-armed bandits. In International Conference on Algorithmic Learning Theory, 2011. +[15] Y. Chen, L. Li, and M. Wang. Scalable bilinear $\pi$ learning using state and action features. arXiv preprint arXiv:1804.10328, 2018. +[16] Y. Chen and M. Wang. Stochastic primal-dual methods and sample complexity of reinforcement learning. arXiv preprint arXiv:1612.02516, 2016. +[17] W. C. Cheung. Exploration-exploitation trade-off in reinforcement learning on online markov decision processes with global concave rewards. arXiv preprint arXiv:1905.06466, 2019. +[18] W. C. Cheung. Regret minimization for reinforcement learning with vectorial feedback and complex objectives. In Advances in Neural Information Processing Systems, pages 724-734, 2019. +[19] O. Dekel, J. Ding, T. Koren, and Y. Peres. Bandits with switching costs: $T^{2/3}$ regret. In Proceedings of the forty-sixth annual ACM symposium on Theory of computing, pages 459-467, 2014. +[20] F. d'Epenoux. A probabilistic production and inventory problem. Management Science, 10(1):98-108, 1963. +[21] C. Florensa, D. Held, X. Geng, and P. Abbeel. Automatic goal generation for reinforcement learning agents. In International conference on machine learning, pages 1515-1528. PMLR, 2018. +[22] R. Fruit, M. Pirotta, and A. Lazaric. Improved analysis of ucr12 with empirical bernstein inequality. arXiv preprint arXiv:2007.05456, 2020. +[23] R. Fruit, M. Pirotta, A. Lazaric, and R. Ortner. Efficient bias-span-constrained exploration-exploitation in reinforcement learning. In ICML 2018-The 35th International Conference on Machine Learning, volume 80, pages 1578-1586, 2018. +[24] E. Garcelon, M. Ghavamzadeh, A. Lazaric, and M. Pirotta. Conservative exploration in reinforcement learning. In International Conference on Artificial Intelligence and Statistics, pages 1431-1441. PMLR, 2020. + +[25] J.-B. Grill, M. Valko, and R. Munos. Blazing the trails before beating the path: Sample-efficient monte-carlo planning. In Advances in Neural Information Processing Systems, pages 4680-4688, 2016. +[26] E. Hazan, S. Kakade, K. Singh, and A. Van Soest. Provably efficient maximum entropy exploration. In International Conference on Machine Learning, pages 2681-2691, 2019. +[27] D. J. Hsu, A. Kontorovich, and C. Szepesvári. Mixing time estimation in reversible markov chains from a single sample path. In Advances in neural information processing systems, pages 1459-1467, 2015. +[28] T. Jaksch, R. Ortner, and P. Auer. Near-optimal regret bounds for reinforcement learning. Journal of Machine Learning Research, 11(Apr):1563-1600, 2010. +[29] C. Jin, Z. Allen-Zhu, S. Bubeck, and M. I. Jordan. Is q-learning provably efficient? In Advances in Neural Information Processing Systems, pages 4863-4873, 2018. +[30] C. Jin, A. Krishnamurthy, M. Simchowitz, and T. Yu. Reward-free exploration for reinforcement learning. In International Conference on Machine Learning, pages 4870-4879. PMLR, 2020. +[31] E. Kaufmann, P. Menard, O. D. Domingues, A. Jonsson, E. Leurent, and M. Valko. Adaptive reward-free exploration. In Algorithmic Learning Theory, pages 865–891. PMLR, 2021. +[32] A. Kazerouni, M. Ghavamzadeh, Y. Abbasi, and B. Van Roy. Conservative contextual linear bandits. In Advances in Neural Information Processing Systems, pages 3910-3919, 2017. +[33] M. Kearns, Y. Mansour, and A. Y. Ng. A sparse sampling algorithm for near-optimal planning in large markov decision processes. Machine learning, 49(2-3):193-208, 2002. +[34] M. Kearns and S. Singh. Near-optimal reinforcement learning in polynomial time. Machine learning, 49(2-3):209-232, 2002. +[35] M. J. Kearns, Y. Mansour, and A. Y. Ng. Approximate planning in large pomdpds via reusable trajectories. In Advances in Neural Information Processing Systems, pages 1001-1007, 2000. +[36] T. Koren, R. Livni, and Y. Mansour. Bandits with movement costs and adaptive pricing. In Conference on Learning Theory, pages 1242-1268. PMLR, 2017. +[37] T. Lattimore and C. Szepesvári. Bandit algorithms. Cambridge University Press, 2020. +[38] G. Li, Y. Wei, Y. Chi, Y. Gu, and Y. Chen. Breaking the sample size barrier in model-based reinforcement learning with a generative model. Advances in Neural Information Processing Systems, 2020. +[39] P. Ménard, O. D. Domingues, A. Jonsson, E. Kaufmann, E. Leurent, and M. Valko. Fast active learning for pure exploration in reinforcement learning. In International Conference on Machine Learning, pages 7599-7608. PMLR, 2021. +[40] R. Ortner. Regret bounds for reinforcement learning via markov chain concentration. Journal of Artificial Intelligence Research, 67:115-128, 2020. +[41] D. Paulin. Concentration inequalities for markov chains by marton couplings and spectral methods. Electronic Journal of Probability, 20, 2015. +[42] V. Pong, M. Dalal, S. Lin, A. Nair, S. Bahl, and S. Levine. Skew-fit: State-covering self-supervised reinforcement learning. In International Conference on Machine Learning, pages 7783-7792. PMLR, 2020. +[43] M. L. Puterman. Markov Decision Processes.: Discrete Stochastic Dynamic Programming. John Wiley & Sons, 2014. +[44] J. Qian, R. Fruit, M. Pirotta, and A. Lazaric. Exploration bonus for regret minimization in discrete and continuous average reward mdps. In Advances in Neural Information Processing Systems, pages 4891-4900, 2019. + +[45] A. Rosenberg, A. Cohen, Y. Mansour, and H. Kaplan. Near-optimal regret bounds for stochastic shortest path. In International Conference on Machine Learning, pages 8210-8219. PMLR, 2020. +[46] A. Sidford, M. Wang, X. Wu, L. Yang, and Y. Ye. Near-optimal time and sample complexities for solving markov decision processes with a generative model. In Advances in Neural Information Processing Systems, pages 5186-5196, 2018. +[47] A. L. Strehl, L. Li, and M. L. Littman. Reinforcement learning in finite mdps: Pac analysis. Journal of Machine Learning Research, 10(Nov):2413-2444, 2009. +[48] A. L. Strehl and M. L. Littman. An analysis of model-based interval estimation for markov decision processes. Journal of Computer and System Sciences, 74(8):1309-1331, 2008. +[49] B. Szörenyi, G. Kedenburg, and R. Munos. Optimistic planning in markov decision processes using a generative model. Advances in Neural Information Processing Systems, 27:1035-1043, 2014. +[50] J. Tarbouriech, E. Garcelon, M. Valko, M. Pirotta, and A. Lazaric. No-regret exploration in goal-oriented reinforcement learning. In International Conference on Machine Learning, pages 9428-9437. PMLR, 2020. +[51] J. Tarbouriech and A. Lazaric. Active exploration in markov decision processes. In The 22nd International Conference on Artificial Intelligence and Statistics, pages 974–982, 2019. +[52] J. Tarbouriech, M. Pirotta, M. Valko, and A. Lazaric. Improved sample complexity for incremental autonomous exploration in mdps. In Advances in Neural Information Processing Systems, volume 33, pages 11273-11284, 2020. +[53] J. Tarbouriech, M. Pirotta, M. Valko, and A. Lazaric. Sample complexity bounds for stochastic shortest path with a generative model. In Algorithmic Learning Theory, pages 1157-1178. PMLR, 2021. +[54] J. Tarbouriech, S. Shekhar, M. Pirotta, M. Ghavamzadeh, and A. Lazaric. Active model estimation in markov decision processes. In Conference on Uncertainty in Artificial Intelligence, pages 1019-1028. PMLR, 2020. +[55] F. Trevizan, S. Thiebaux, P. Santana, and B. Williams. Heuristic search in dual space for constrained stochastic shortest path problems. In Twenty-Sixth International Conference on Automated Planning and Scheduling, 2016. +[56] D. Vial, A. Parulekar, S. Shakkottai, and R. Srikant. Regret bounds for stochastic shortest path problems with linear function approximation. arXiv preprint arXiv:2105.01593, 2021. +[57] M. Wainwright. Course on mathematical statistics, chapter 2: Basic tail and concentration bounds. University of California at Berkeley, Department of Statistics, 2015. +[58] M. Wang. Primal-dual $\pi$ learning: Sample complexity and sublinear run time for ergodic markov decision problems. arXiv preprint arXiv:1710.06100, 2017. +[59] Y. Wang, K. Dong, X. Chen, and L. Wang. Q-learning with ub exploration is sample efficient for infinite-horizon mdp. In International Conference on Learning Representations, 2019. +[60] C.-Y. Wei, M. J. Jahromi, H. Luo, H. Sharma, and R. Jain. Model-free reinforcement learning in infinite-horizon average-reward markov decision processes. In International Conference on Machine Learning, pages 10170-10180. PMLR, 2020. +[61] A. Zanette and E. Brunskill. Tighter problem-dependent regret bounds in reinforcement learning without domain knowledge using value function bounds. In International Conference on Machine Learning, pages 7304-7312, 2019. +[62] A. Zanette, M. J. Kochenderfer, and E. Brunskill. Almost horizon-free structure-aware best policy identification with a generative model. In Advances in Neural Information Processing Systems, pages 5626-5635, 2019. + +[63] X. Zhang, Y. Ma, and A. Singla. Task-agnostic exploration in reinforcement learning. In 34th Conference on Neural Information Processing Systems, pages 11734–11743, 2020. +[64] Z. Zhang, S. S. Du, and X. Ji. Nearly minimax optimal reward-free reinforcement learning. arXiv preprint arXiv:2010.05901, 2020. +[65] Z. Zhang and X. Ji. Regret minimization for reinforcement learning by evaluating the optimal bias function. In Advances in Neural Information Processing Systems, pages 2823-2832, 2019. +[66] Z. Zhang, Y. Zhou, and X. Ji. Almost optimal model-free reinforcement learning via reference-advantage decomposition. Advances in Neural Information Processing Systems, 33, 2020. \ No newline at end of file diff --git a/aprovablyefficientsamplecollectionstrategyforreinforcementlearning/images.zip b/aprovablyefficientsamplecollectionstrategyforreinforcementlearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..bab6a118c5534251f68f89208fde041882afaae9 --- /dev/null +++ b/aprovablyefficientsamplecollectionstrategyforreinforcementlearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:98c1c0c6b08be34dfc8142d7b7969f35136eb26fb69ff30e351d7e546685d664 +size 196751 diff --git a/aprovablyefficientsamplecollectionstrategyforreinforcementlearning/layout.json b/aprovablyefficientsamplecollectionstrategyforreinforcementlearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..b7e76581bc7fc0d8393246800d35afa282ecfffe --- /dev/null +++ b/aprovablyefficientsamplecollectionstrategyforreinforcementlearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4266269ee2e8850a44c8c9222da8d107ce08e79b4cc8ea0ad3164d2a7a13df71 +size 632258 diff --git a/aregressionapproachtolearningaugmentedonlinealgorithms/c795d077-3f98-4ca1-bd80-df18ca80517f_content_list.json b/aregressionapproachtolearningaugmentedonlinealgorithms/c795d077-3f98-4ca1-bd80-df18ca80517f_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..48a8876fcee4d829b851d4552c57a785f1dce6e7 --- /dev/null +++ b/aregressionapproachtolearningaugmentedonlinealgorithms/c795d077-3f98-4ca1-bd80-df18ca80517f_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9028f25e2dec2d1705b971afab9c3edd9d7158053f6a74fade72b630eec1668c +size 86028 diff --git a/aregressionapproachtolearningaugmentedonlinealgorithms/c795d077-3f98-4ca1-bd80-df18ca80517f_model.json b/aregressionapproachtolearningaugmentedonlinealgorithms/c795d077-3f98-4ca1-bd80-df18ca80517f_model.json new file mode 100644 index 0000000000000000000000000000000000000000..07e1a16d4647c845ad0ff55c3c66a7a4a67e1d83 --- /dev/null +++ b/aregressionapproachtolearningaugmentedonlinealgorithms/c795d077-3f98-4ca1-bd80-df18ca80517f_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ab7880843055f34fc4237e2fcd51f763571bbcafee72169f83d3d5ccae10c974 +size 104804 diff --git a/aregressionapproachtolearningaugmentedonlinealgorithms/c795d077-3f98-4ca1-bd80-df18ca80517f_origin.pdf b/aregressionapproachtolearningaugmentedonlinealgorithms/c795d077-3f98-4ca1-bd80-df18ca80517f_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..99df8991b34f265dffd0da46955a081a1b2fddb6 --- /dev/null +++ b/aregressionapproachtolearningaugmentedonlinealgorithms/c795d077-3f98-4ca1-bd80-df18ca80517f_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4c2ba1188efe84d81f61ec0504b594603d6f4049c7f4c651ad63791dfcf152c8 +size 340049 diff --git a/aregressionapproachtolearningaugmentedonlinealgorithms/full.md b/aregressionapproachtolearningaugmentedonlinealgorithms/full.md new file mode 100644 index 0000000000000000000000000000000000000000..3acaca80254d58c9801a21538f7205b7c3edf4ed --- /dev/null +++ b/aregressionapproachtolearningaugmentedonlinealgorithms/full.md @@ -0,0 +1,374 @@ +# A Regression Approach to Learning-Augmented Online Algorithms + +# Keerti Anand + +Department of Computer Science + +Duke University + +Durham, NC 27705 + +kanand@cs.duke.edu + +# Rong Ge + +Department of Computer Science + +Duke University + +Durham, NC 27705 + +rongge@cs.duke.edu + +# Amit Kumar + +Department of Computer Science + +Indian Institute of Technology + +Hauz Khas, New Delhi - 110016 + +amitk@cse.iitd.ernet.in + +# Debmalya Panigrahi + +Department of Computer Science + +Duke University + +Durham, NC 27705 + +debmalya@cs.duke.edu + +# Abstract + +The emerging field of learning-augmented online algorithms uses ML techniques to predict future input parameters and thereby improve the performance of online algorithms. Since these parameters are, in general, real-valued functions, a natural approach is to use regression techniques to make these predictions. We introduce this approach in this paper, and explore it in the context of a general online search framework that captures classic problems like (generalized) ski rental, bin packing, minimum makespan scheduling, etc. We show nearly tight bounds on the sample complexity of this regression problem, and extend our results to the agnostic setting. From a technical standpoint, we show that the key is to incorporate online optimization benchmarks in the design of the loss function for the regression problem, thereby diverging from the use of off-the-shelf regression tools with standard bounds on statistical error. + +# 1 Introduction + +A recent trend in online algorithms has seen the use of future predictions generated by ML techniques to bypass pessimistic worst-case lower bounds. A growing body of work has started to emerge in this area in the last few years addressing a broad variety of problems in online algorithms such as rent or buy, caching, metrical task systems, matching, scheduling, experts learning, stopping problems, and others (see related work for references). The vast majority of this literature is focused on using ML predictions in online algorithms, but does not address the question of how these predictions are generated. This raises the question: what can we learn from data that will improve the performance of online algorithms? Abstractly, this question comes in two inter-dependent parts: the first part is a learning problem where we seek to learn a function that maps the feature domain to predicted parameters, and the second part is to re-design the online algorithm to use these predictions. In this paper, we focus on the first part of this design pipeline, namely we develop a regression approach to generating ML predictions for online algorithms. + +Before delving into this question further, we note that there has been some recent research that focuses on the learnability of predicted parameters in online algorithms. Recently, Lavastida et al. [33], building on the work of Lattanzi et al. [32], took a data-driven algorithms approach to design online algorithms for scheduling and matching problems via learned weights. In this line of work, the goal is to observe sample inputs in order to learn a set of weights that facilitate better algorithms for instances from a fixed distribution. In contrast, Anand et al. [4] relied on a classification learning approach for the Ski Rental problem, where they aimed to learn a function that maps the feature set to a binary label characterizing the optimal solution. But, in general, the value of the optimal solution is a real-valued function, which motivates a regression approach to learning-augmented online algorithms that we develop in this paper. + +To formalize the notion of an unknown optimal solution that we seek to learn via regression, we use the online search (ONLINESEARCH) framework. In this framework, there is as an input sequence $\Sigma = \sigma_1, \sigma_2, \ldots$ available offline, and the actual online input is a prefix of this sequence $\Sigma_T = \sigma_1, \sigma_2, \ldots, \sigma_T$ , where the length of the prefix $T$ is revealed online. Namely, in each online step $t > 0$ , there are two possibilities: either the sequence ends, i.e., $T = t$ , or the sequence continues, i.e., $T > t$ . The algorithm must maintain, at all times $t$ , a solution that is feasible for the current sequence, i.e., for the prefix $\Sigma_t = \sigma_1, \ldots, \sigma_t$ . The goal is to obtain a solution that is of minimum cost among all the feasible solutions for the actual input sequence $\Sigma_T$ . + +We will discuss applicability of the ONLINESEARCH framework in more detail in Section 1.2, but for a quick illustration now, consider the ski rental problem in this framework. In this problem, if the sequence continues on day $t$ , then the algorithm must rent skis if it has not already bought them. In generalizations of the ski rental problem to multiple rental options, the requirement is that one of the rental options availed by the algorithm must cover day $t$ . We will show in Section 1.2 that we can similarly model several other classic online problems in the ONLINESEARCH framework. + +We use the standard notion of competitive ratio, defined as the worst case ratio between the algorithm's cost and the optimal cost, to quantify the performance of an online algorithm. For online algorithms with predictions, we follow the terminology in [41] that is now standard: we say that the consistency and robustness of an algorithm are its competitive ratios for correct predictions and for arbitrarily incorrect predictions respectively. Typically, we fix consistency at $1 + \epsilon$ for a hyper-parameter $\epsilon$ and aim to minimize robustness as a function of $\epsilon$ . + +We make some mild assumptions on the problem. First, we assume that solutions are composable, i.e., that adding feasible solutions for subsequences ensures feasibility over the entire sequence; second, that cost is monotone, i.e., the optimal cost for a subsequence is at most that for the entire sequence; and third, that the offline problem is (approximately or exactly) solvable. These assumptions hold for essentially all online problems we care for. + +# 1.1 Our Contributions + +As a warm up, we first give an algorithm called DOUBLE for the ONLINESEARCH problem without predictions in Section 2. The DOUBLE algorithm has a competitive ratio of 4. We build on the DOUBLE algorithm in Section 3, where we give an algorithm called PREDICT-AND-DOUBLE for the ONLINESEARCH problem with predictions. We show that the PREDICT-AND-DOUBLE algorithm has a consistency of $1 + \epsilon$ and robustness of $O(1 / \epsilon)$ , for any hyper-parameter $\epsilon >0$ . We also show that this tradeoff between consistency and robustness is asymptotically tight. + +Our main contributions are in Section 4. In this section, we model the question of obtaining a learning-augmented algorithm for the ONLINESEARCH problem in a regression framework. Specifically, we assume that the input comprises a feature vector $x$ that is mapped by an unknown real-valued function $f$ to an input for the ONLINESEARCH problem $z$ . In the training phase, we are given a set of labeled samples of the form $(x,z)$ from some (unknown to the algorithm) data distribution $\mathbb{D}$ . The goal of the learning algorithm is to produce a mapping from the feature space to algorithmic strategies for the ONLINESEARCH problem, such that when it gets an unlabeled (test) sample $x$ from the same distribution $\mathbb{D}$ , the algorithmic strategy corresponding to $x$ obtains a competitive solution for the actual input $z$ in the test sample (that is unknown to the algorithm). + +The learning algorithm employs a regression approach in the following manner. It assumes that the function $f$ is from a hypothesis class $\mathcal{F}$ , and obtains an empirical minimizer in $\mathcal{F}$ for a carefully crafted loss function on the training samples. The design of this loss function is crucial since a bound + +on this loss function is then shown to translate to a bound on the competitive ratio of the algorithmic strategy. (Indeed, we will show later that because of this reason, standard loss functions used in regression are inadequate for our purpose.) Finally, we use statistical learning theory for real-valued functions to bound the sample complexity of the learner that we designed. + +Using the above framework, we show a sample complexity bound of $O\left(\frac{H \cdot d}{\epsilon}\right)$ for obtaining a competitive ratio of $1 + \epsilon$ , where $H$ and $d$ respectively represent the log-range of the optimal cost and a measure of the expressiveness of the function class $\mathcal{F}$ called its pseudo-dimension. We also extend this result to the so-called agnostic setting, where the function class $\mathcal{F}$ is no longer guaranteed to contain an exact function $f$ that maps $x$ to $z$ , rather the competitive ratio is now in terms of the best function in this class that approximates $f$ . We also prove nearly matching lower bounds for our sample complexity bounds in the two models. + +Our framework can also be extended to the setting where the offline optimal solution is hard to compute, but there exists an algorithm with competitive ratio $c$ given the cost of optimal solution. In that case our algorithms give a competitive ratio $c(1 + \epsilon)$ , which can still be better than the competitive ratio without predictions (see examples in next subsection). + +# 1.2 Applicability of the ONLINESEARCH framework + +The ONLINESEARCH framework is applicable whenever an online algorithm benefits from knowing the optimal value of the solution. Many online problems benefit from this knowledge, which is sometimes called advice in the online algorithms literature. For concreteness, we give three examples of classic problems - ski rental with multiple options, online scheduling, and online bin packing - to illustrate the applicability of our framework. Our algorithm PREDICT-AND-DOUBLE (explained in more detail in section 3) successively predicts the optimal value of the solution and appends the corresponding solution to its output. + +Ski Rental with Multiple Options. Generalizations of the ski rental problem with multiple options have been widely studied (e.g., [1, 34, 37, 19]), recently with ML predictions [44]. Suppose there are $V$ options (say coupons) at our disposal, where coupon $i$ costs us $C_i$ and is valid for $d_i$ number of days. Given such a setup, we need to come up with a schedule: $\{(t_k, i_k), k = 1, 2 \ldots\}$ that instructs us to buy coupon $i_k$ at time $t_k$ . (The classic ski rental problem corresponds to having only two coupons $C_1 = 1, d_1 = 1$ and $C_2 = B, d_2 \to \infty$ .) Our ONLINESEARCH framework is applicable here: a solution that allows us to buy coupons valid time $t$ is also a valid solution for all times $s \leq t$ . Further, PREDICT-AND-DOUBLE can be implemented efficiently as we can compute $\mathrm{OPT}(t)$ , for any time $t$ using a dynamic program. + +Online Scheduling. Next, we consider the classic online scheduling problem where the goal is to assign jobs arriving online to a set of identical machines so as to minimize the maximum load on any machine (called the makespan). For this algorithm, the classic list scheduling algorithm [26] has a competitive ratio of 2. A series of works [23, 14, 29, 2] improved the competitive ratio to 1.924, and currently the best known result has competitive ratio of (approx) 1.92 [20]; in fact, there are nearly matching lower bounds [25]. However, if the optimal make-span (OPT) is known, then these lower bounds can be overcome, and a significantly better competitive ratio of 1.5 can be obtained in this setting [17] (see also [10, 31, 21, 22]). The ONLINESEARCH framework is applicable here with a slight modification: whenever PREDICT-AND-DOUBLE tries to buy a solution corresponding to a predicted value of OPT, we execute the 1.5-approximation algorithm based on this value. The problem still satisfies the property that a solution for $t$ jobs is valid for any prefix. We get a competitive ratio of $1.5 + O(\epsilon)$ that significantly outperforms the competitive ratio of 1.92 without predictions. + +Online Bin Packing. As a third example, we consider the online bin packing problem. In this problem, items arrive online and must be packed into fixed-sized bins, the goal being to minimize the number of bins. (We can assume w.l.o.g., by scaling, that the bins are of unit size.) Here, it is known that the critical parameter that one needs to know/predict is not OPT but the number of items of moderate size, namely those sized between $1/2$ and $2/3$ . If this is known, then there is a simple 1.5-competitive algorithm [5], which is not achievable without this additional knowledge. Again, our ONLINESEARCH framework can be used to take advantage of this result. In this case, the application is not as direct, because predicting OPT does not yield the better algorithm. Nevertheless, + +an inspection of the algorithm in [5] reveals the following strategy: The items are partitioned into three groups. The items of size $\geq 2/3$ are assigned individual bins, items of size between $1/3$ and $1/2$ are assigned separate bins where at least two of them are assigned to each bin, and the remaining items are assigned a set of common bins. Clearly, the first two categories can be handled online without any additional information; this means that we can define a surrogate OPT (call it OPT') that only captures the optimal number of bins for the common category. Note that the use of prediction of OPT' serves as a substitute for knowing the numbers of items of moderate size. Now, if OPT' is known, then we can recover the competitive ratio of $3/2$ by using a simple greedy strategy. This now allows us to use the ONLINESEARCH framework where we predict OPT'. As earlier, the ONLINESEARCH framework can be applied with slight modification: whenever PREDICT-AND-DOUBLE tries to buy a solution corresponding to a predicted value of OPT', we execute the 1.5-competitive algorithm based on this value. The problem still satisfies the property that a solution for $t$ items is valid for any prefix. + +# 1.3 Motivation for a cognizant loss function + +In this work, we explore the idea of a carefully crafted loss function that can help in making better predictions for the online decision task. To illustrate this, consider the problem of balancing the load between machines/clusters in a data center where remote users are submitting jobs. The goal is to minimize the maximum load on any machine, also called the makespan of the assignment. The optimal makespan, which we would like to predict, depends on the workload submitted by individual users who are currently active in the system. Therefore, we would like to use the user features to predict their behavior in terms of the workload submitted to the server. A typical feature vector would then be a binary vector encoding of the set of users currently active in the system, and based on this information, a learning model trained on historical behavior of the users can predict (say) a histogram of loads that these users are expected to submit, and therefore, the value of the optimal makespan. The feature space can be richer, e.g., including contextual information like the time of the day, day of the week, etc. that are useful to more accurately predict user behavior. Irrespective of the precise learning model, the main idea in this paper is that the learner should try to optimize for competitive loss instead of standard loss functions. This is because the goal of the learner is not to accurately predict the workload of each user, but to eventually obtain the best possible makespan. For instance, a user who submits few jobs that are inconsequential to the eventual makespan need not be accurately predicted. Our technique automatically makes this adjustment in the loss function, thereby obtaining better performance on the competitive ratio. + +# 1.4 Related Work + +There has been considerable recent work in incorporating ML predictions in online algorithms. Some of the problems include: auction pricing [36], ski rental [41, 24, 4, 13, 44, 6], caching [35, 42, 28, 45], scheduling [41, 32, 39], frequency estimation [27], Bloom filters [38], online linear optimization [16], speed scaling [11], set cover [12], bipartite and secretary problems [9], etc. While most of these papers focus on designing online algorithms for ML predictions but not on the generation of these predictions, there has also been some work on the design of predictors using a binary classification approach [4]), and on the formal learnability of the predicted parameters [32, 33]. In contrast, we use a regression approach to the problem in this paper. + +The PAC learning framework was first introduced by [43] in the context of learning binary classification functions, and related the sample complexity to the VC dimension of the hypothesis class. This was later extended to real-valued functions by [40], who introduced the concept of pseudo-dimension, and [30] (see also [15]), who introduced the fat shattering dimension, as generalizations of VC dimension to real-valued functions. For a comprehensive discussion of the extension of VC theory to learning real-valued functions, the reader is referred to the excellent text by [8]. A different approach was proposed by [3] (see also [7]) who analysed a model of learning in which the error of a hypothesis is taken to be the expected squared loss, and gave uniform convergence results for this setting. In this paper, we use pseudo-dimension and corresponding sampling complexity bounds in quantifying the complexity of the regression learning problem of predicting input length. + +# 2 ONLINESEARCH without Predictions + +As a warm up, we first describe a simple algorithm called DOUBLE (Algorithm 1) for the ONLINESEARCH problem without predictions. This algorithm places milestones on the input sequence corresponding to inputs at which the cost of the optimal solution doubles. When the input sequence crosses such a milestone, the algorithm buys the corresponding optimal solution and adds it to the existing online solution. This simple algorithm will form a building block for the algorithms that we will develop later in the paper; hence, we describe it and prove its properties below. + +First, we introduce some notation. + +Definition 1. We use $\mathrm{OPT}(t)$ to denote an optimal (offline) solution for the input prefix of length $t$ ; we overload notation to denote the cost of this solution by $\mathrm{OPT}(t)$ as well. + +Definition 2. Given an input length $\tau$ and any $\alpha >0$ , we use MIN-LENGTH $(\alpha ,\tau)$ to denote the smallest length $t$ such that $\mathrm{OPT}(t)\geq \alpha \cdot \mathrm{OPT}(\tau)$ . The monotonicity property of OPT ensures that MIN-LENGTH $(\alpha ,\tau) > \tau$ if $\alpha >1$ , and MIN-LENGTH $(\alpha ,\tau)\leq \tau$ otherwise. + +# Algorithm 1 DOUBLE + +Input: The input sequence $\mathcal{I}$ + +Output: The online solution SOL. + +Set $i\coloneqq 0$ $\tau_0\coloneqq 1$ ,SOL $\coloneqq \emptyset$ + +for $t = 1,2,\ldots ,T$ + +if $t = \tau_{i}$ + +Set $\tau_{i + 1} = \mathrm{MIN - Length}(2,\tau_i)$ + +Add $\mathrm{OPT}(\tau_{i + 1} - 1)$ to SOL. + +Increment $i$ + +Theorem 1. The DOUBLE algorithm is 4-competitive for the ONLINESEARCH problem. + +# 3 ONLINESEARCH with Predictions + +In the previous section, we described a simple online algorithm for the ONLINESEARCH problem. Now, we build on this algorithm to take advantage of ML predictions. For now, we do not concern ourselves with how these predictions are generated; we will address this question in the next section. + +Suppose we have a prediction $\hat{T}$ for the input length $T$ of an ONLINESEARCH problem instance. Naively, we might trust this prediction completely and buy the solution $\mathrm{OPT}(\hat{T})$ . While this algorithm is perfect if the prediction is accurate, it can fail in two ways if the prediction is inaccurate: (a) if $T \ll \hat{T}$ and therefore $\mathrm{OPT}(T) \ll \mathrm{OPT}(\hat{T})$ , then the algorithm has a large competitive ratio, and (b) if $T > \hat{T}$ , then $\mathrm{OPT}(\hat{T})$ may not even be feasible for $T$ . A natural idea is to then progressively add $\mathrm{OPT}(t)$ solutions for small values of $t$ (similar to DOUBLE) until a certain threshold is reached, before buying the predicted optimal solution $\mathrm{OPT}(\hat{T})$ . Next, if $T > \hat{T}$ , the algorithm can resume buying solution $\mathrm{OPT}(t)$ for $t > \hat{T}$ , again using DOUBLE, until the actual input $T$ is reached. + +One problem with this strategy, however, is that the algorithm does not degrade gracefully around the prediction, a property that we will need later in the paper. In particular, if $T$ is only slightly larger than $\hat{T}$ , then the algorithm adds a solution that has cost $2 \cdot \mathrm{OPT}(\hat{T})$ , thereby realizing the worst case scenario in Theorem 1 that was achieved without any prediction. Our work-around for this issue is to buy $\mathrm{OPT}(t)$ for a $t$ slightly larger than $\hat{T}$ , instead of $\mathrm{OPT}(\hat{T})$ itself, which secures us against the possibility of the actual input being slightly longer than the prediction. We call this algorithm PREDICT-AND-DOUBLE (Algorithm 2). Here, we use a hyper-parameter $\epsilon$ that offers a tradeoff between the consistency and robustness of the algorithm. We also use the following definition: + +Definition 3. Given an input length $\tau$ and any $\alpha >0$ , we use MAX-LENGTH $(\alpha ,\tau)$ to denote the largest length $t$ such that $\mathrm{OPT}(t)\leq \alpha \cdot \mathrm{OPT}(\tau)$ . + +As described in the introduction, the desiderata for an online algorithm with predictions are its consistency and robustness; we establish the tradeoff between these parameters for the PREDICT-AND-DOUBLE algorithm below. + +Algorithm 2 PREDICT-AND-DOUBLE +Input: The input sequence $\mathcal{L}$ and prediction $\hat{T}$ +Output: The online solution SOL. +Set SOL $\coloneqq \emptyset$ $t_1\coloneqq$ MIN-LENGTH( $\epsilon /5,\hat{T})$ ,and $t_2\coloneqq$ MAX-LENGTH(1 + $\epsilon /5,\hat{T})$ Phase 1: Execute DOUBLE while $t < t_1$ Phase 2: At $t = t_{1}$ , add OPT $(t_{2})$ to SOL. Phase 3: If $t > t_2$ , resume DOUBLE as follows: +Set $i\coloneqq 0$ $\tau_0\coloneqq t_2 + 1$ . +for $t = t_2 + 1,t_2 + 2,\ldots ,T$ if $t = \tau_{i}$ Set $\tau_{i + 1} =$ MIN-LENGTH(2, $\tau_{i}$ ). Add OPT $(\tau_{i + 1} - 1)$ to SOL. Increment i. + +Theorem 2. The PREDICT-AND-DOUBLE algorithm has a consistency of $1 + \epsilon$ and robustness of $5\left(1 + \frac{1}{\epsilon}\right)$ . + +We also show that this tradeoff between $(1 + \epsilon)$ -consistency and $O(1 / \epsilon)$ -robustness bounds is essentially tight. + +Theorem 3. Any algorithm for the ONLINESEARCH problem with predictions that has a consistency bound of $1 + \epsilon$ must have a robustness bound of $\Omega\left(\frac{1}{\epsilon}\right)$ . + +Having shown the consistency and robustness of the PREDICT-AND-DOUBLE algorithm, we now analyze how its competitive ratio varies with error in the prediction $\hat{T}$ . In particular, the next lemma shows that the competitive ratio gracefully degrades with prediction error for small error, and is capped at 4 for large error. + +Lemma 4. Given a prediction $\hat{T}$ for the input length, the competitive ratio of PREDICT-AND-DOUBLE is given by: + +$$ +\operatorname {C R} \leq \left\{ \begin{array}{l} 4, T \leq t _ {1} \\ (1 + \epsilon) \cdot \frac {\operatorname {O P T} (\hat {T})}{\operatorname {O P T} (T)}, t _ {1} \leq T \leq t _ {2} \\ 4, T > t _ {2} \end{array} \right. +$$ + +where $t_1$ represents the minimum value of $t$ that satisfies $\mathrm{OPT}(t) \geq \frac{\epsilon}{5} \cdot \mathrm{OPT}(\hat{T})$ and $t_2$ represents the maximum value of $t$ that satisfies $\mathrm{OPT}(t) \leq (1 + \frac{\epsilon}{5}) \cdot \mathrm{OPT}(\hat{T})$ . + +# 4 LEARN TO SEARCH: A Regression Approach + +In the previous section, we designed an algorithm for the ONLINESEARCH problem that utilizes ML predictions. Now, we delve deeper into how we can generate these predictions. More generally, we develop a regression-based approach to learn to solve an ONLINESEARCH problem. For this purpose, we first introduce some standard terminology for our learning framework, which we call the LEARNTOSEARCH problem. + +# 4.1 Preliminaries + +An instance $(x,z)$ of the LEARNTOSEARCH problem is given by a feature $x\in \mathbb{X}$ , and the (unknown) cost of the optimal offline solution $z\in [1,M]$ . The two quantities $x$ and $z$ are assumed to be drawn from a joint distribution on $\mathbb{X}\times [1,M]$ . A prediction strategy works with a hypothesis class $\mathcal{F}$ that is a subset of functions $\mathbb{X}\mapsto [1,M]$ and tries to obtain the best function $f\in \mathcal{F}$ that predicts the target variable $z$ accurately. For notational convenience, we set our target $y = \ln z$ , i.e., we try to predict the log-cost of the optimal solution. Note that predicting the log-cost of $\mathrm{OPT}(T)$ is equivalent to predicting the input length $T$ . Furthermore, let $\mathbb{D}$ denote the input distribution on $\mathbb{X}\times \mathbb{Y}$ , where $\mathbb{Y} = [0,H]$ and $H = \ln M$ ; i.e., we assume that $(x,y)\sim \mathbb{D}$ . + +We define a LEARNTOSEARCH algorithm $\mathcal{A}$ as a strategy that receives a set of $m$ samples $S\sim \mathbb{D}^m$ for training, and later, when given the feature set $x$ of a test instance $(x,y)\sim \mathbb{D}$ (where $y$ is not revealed to the algorithm), it defines an online algorithm for the ONLINESEARCH problem with input $y$ . Recall that an online algorithm constitutes a sequence of solutions that the algorithm buys at different times of the input sequence (see Algorithm 3 for a generic description of an LEARNTOSEARCH algorithm). + +Algorithm 3 A general LEARNTOSEARCH algorithm +Training: Given a Sample Set $S$ , the training phase outputs a mapping $M$ from every feature vector $x\in \mathbb{X}$ to an increasing sequence of positive integers +Testing: Given unknown sample $x\in \mathbb{X}$ , define thresholds $M(x) = (\tau_0,\tau_1\dots)$ +Set $i\coloneqq 0$ , SOL $\coloneqq$ OPT( $\tau_0 - 1$ ). +while (Input has not ended) if (SOL is infeasible) SOL $\coloneqq$ OPT $(\tau_{i + 1} - 1)$ . Increment i. + +We will use the notation $\mathrm{CR}_{\mathcal{A}}(x,y)$ to denote the competitive ratio obtained by an algorithm $\mathcal{A}$ on the instance $(x,y)$ . For a given set of thresholds $(\tau_0,\tau_1\dots)$ , define $i_{T} = \min_{\tau_{i} > T}i$ . Then, $\mathcal{A}$ pays a total cost of $\sum_{i = 0}^{i_T}\mathrm{OPT}(\tau_i)$ , and thus the competitive ratio is + +$$ +\operatorname {C R} _ {\mathcal {A}} (x, y) = \frac {\sum_ {i = 0} ^ {i _ {T}} \operatorname {O P T} \left(\tau_ {i}\right)}{e ^ {y}}. +$$ + +We define the "efficiency" of a LEARNTOSEARCH algorithm by comparing its performance with the best achievable competitive ratio. The optimal competitive ratio for a given distribution may be strictly greater than 1. For example, consider the distribution where $x$ is fixed (say $x_0$ ) and $z$ is uniformly distributed over the set $\{2,4\}$ . One can verify that the best strategy for the above distribution is to buy the solution costing 2, and then if the input has not ended, then buy the solution costing 4. The competitive ratio for this strategy (in expectation) is 1.25. + +Definition 4. A LEARNTOSEARCH algorithm $\mathcal{A}$ is said to be $\epsilon$ -efficient if + +$$ +\mathbb {E} _ {(x, y) \sim \mathbb {D}} \mathrm {C R} _ {\mathcal {A}} (x, y) \leq \rho^ {*} + \epsilon , +$$ + +where $\rho^{*} = \mathbb{E}_{(x,y)\sim \mathbb{D}}\mathrm{CR}_{A^{*}}(x,y)$ and $A^{*}$ is an optimal solution that has full knowledge of $\mathbb{D}$ and no computational limitations. + +The "expressiveness" of a function family is captured by the following standard definition: + +Definition 5. A set $S = \{x_{1}, x_{2}, \ldots, x_{m}\}$ is said to be "shattered" by a class $\mathcal{F}$ of real-valued functions $S \mapsto [0, H]$ if there exists "witnesses" $R = \{r_{1}, r_{2}, \ldots, r_{m}\} \in [0, H]^{m}$ such that the following condition holds: For all subsets $T \subseteq S$ , there exists an $f \in \mathcal{F}$ such that $f(x_{i}) > r_{i}$ if and only if $x_{i} \in T$ . The "pseudo-dimension" of $\mathcal{F}$ (denoted as $Pdim(\mathcal{F})$ ) is the cardinality of the largest subset $S \subseteq X$ that is shattered by $\mathcal{F}$ . + +# 4.2 The Sample Complexity of LEARNTOSEARCH + +Our overall strategy is to learn a suitable predictor function $f \in \mathcal{F}$ and use $f(x)$ as a prediction in the PREDICT-AND-DOUBLE algorithm. Note that prediction errors on the two sides (over- and under-estimation) affect the competitive ratio of PREDICT-AND-DOUBLE (given by Lemma 4) in different ways. If we underestimate $\mathrm{OPT}(T)$ by a factor less than $1 + \frac{\epsilon}{5}$ , the competitive ratio remains $1 + O(\epsilon)$ , but a larger underestimate causes the competitive ratio to climb up to 4. On the other hand, if we overestimate $\mathrm{OPT}(T)$ , then the competitive ratio grows steadily by the ratio of over-estimation, until it reaches $5 \cdot \left(1 + \frac{1}{\epsilon}\right)$ . This asymmetric dependence is illustrated in Figure 1. + +At a high level, our goal is to use regression to obtain the best function $f \in \mathcal{F}$ . But, the asymmetric behavior of the competitive ratio suggests that we should not use a standard loss function in the regression analysis. Let $\epsilon$ be the accuracy parameter for the PREDICT-AND-DOUBLE algorithm, and let $\hat{y} = \ln \mathrm{OPT}(\hat{T})$ and $y = \ln \mathrm{OPT}(T)$ be the predicted and actual log-cost of the optimal solution respectively. Then we define the following loss function that follows the asymmetric behaviour of the competitive ratio for PREDICT-AND-DOUBLE: + +![](images/138536333f62e6ed677f4f828946d3a9639e60e0db1f58dc496b986508943d81.jpg) +Figure 1: Competitive ratio of the PREDICT-AND-DOUBLE algorithm for a fixed prediction $\hat{T}$ as a function of the input $T$ , where the prediction is $\hat{T}$ + +Definition 6. The $\epsilon$ -parameterized competitive error is defined as: + +$$ +\ell_ {\epsilon} (y, \hat {y}) = \left\{ \begin{array}{l} \frac {5}{\epsilon} - 1 w h e n y \leq \hat {y} - \ln \frac {5}{\epsilon} \\ e ^ {y - \hat {y}} - 1 w h e n \hat {y} - \ln \frac {5}{\epsilon} < y \leq \hat {y} \\ \frac {1}{\epsilon} \cdot (y - \hat {y}) w h e n \hat {y} < y \leq \hat {y} + \ln \left(1 + \frac {\epsilon}{5}\right) \\ 1 w h e n y > \hat {y} + \ln \left(1 + \frac {\epsilon}{5}\right). \end{array} \right. +$$ + +We give more justification for using this loss function in the supplementary material, and show that standard loss functions do not suffice for our purposes. Using this loss function, we can measure the error of a function for an input distribution or for a fixed input set: + +Definition 7. Given a distribution $\mathbb{D}$ on the set $\mathbb{X} \times \mathbb{Y}$ and function $f: \mathbb{X} \mapsto \mathbb{Y}$ , we define + +$$ +\mathbf {E R} _ {\mathbb {D}, \epsilon} (f) = \mathbb {E} _ {(x, y) \sim \mathbb {D}} [ \ell_ {\epsilon} (y, f (x)) ]. +$$ + +Alternatively, for a set of samples, $S\sim \mathbb{D}^m$ , we define, + +$$ +\mathbf {E R} _ {S, \epsilon} (f) = \frac {1}{m} \cdot \sum_ {i = 1} ^ {m} \ell_ {\epsilon} \left(y _ {i}, f \left(x _ {i}\right)\right). +$$ + +Our high-level goal is to use samples to optimize for the loss function called $\epsilon$ -parameterized competitive error that we defined above over the function class $\mathcal{F}$ , and then use an algorithm that translates the empirical error bound to a competitive ratio bound. This requires, in the training phase, that we optimize the empirical loss on the training samples. We define such a minimizer below: + +Definition 8. For a given set of samples $S \sim \mathbb{D}$ and a function family $\mathcal{F}$ , we denote an optimization scheme $\mathcal{O}: S \mapsto \mathcal{F}$ as $\epsilon$ -Sample Error Minimizing (SEM) if it returns a function $\hat{f} \in \mathcal{F}$ satisfying: + +$$ +\mathbf {E R} _ {S, \epsilon} (\hat {f}) \leq \inf _ {f \in \mathcal {F}} [ \mathbf {E R} _ {S, \epsilon} (f) ] + \epsilon . +$$ + +For the rest of this paper, we will assume that we are given an $\epsilon-$ SEM routine for arbitrary $\epsilon > 0$ . + +We are now ready to present our LEARNTOSEARCH algorithm (Algorithm 4), which basically uses the predictor with minimum expected loss to make predictions for PREDICT-AND-DOUBLE. + +Algorithm 4 A LEARNTOSEARCH algorithm with accuracy parameter $\epsilon$ + +Training: + +Input: Sample Set $S$ , Function Family $\mathcal{F}$ + +Output: $\hat{f}$ output by an $\epsilon$ -SEM algorithm $\mathcal{O}$ , i.e., $\mathbf{E R}_{S,\epsilon}(\hat{f}) \leq \inf_{\tilde{f} \in \mathcal{F}} \mathbf{E R}_{S,\epsilon}(\tilde{f}) + \epsilon$ . + +Testing: + +Given new sample $x$ , set $\hat{y} = \hat{f}(x)$ . + +Predicted prefix length: $\hat{T} = \max_{\mathrm{OPT}(t)\leq e^{\hat{y}}}t$ + +Call PREDICT-AND-DOUBLE with $\hat{T}$ and $\epsilon$ . + +We relate the competitive ratio of Algorithm 4 to the error of function $\hat{f}$ obtained during training: + +Lemma 5. Algorithm 4 has a competitive ratio upper bounded by $\left(1 + \epsilon +3\cdot \mathbf{E}\mathbf{R}_{\mathbb{D},\epsilon}(\hat{f})\right)$ + +Standard and Agnostic Models. We consider two different settings. First, we assume that the function class $\mathcal{F}$ contains the function $f^{*}$ that maps the feature set $x$ to $y$ -we call this the standard model. We relax this assumption in the more general agnostic model, where the function class $\mathcal{F}$ is arbitrary. In terms of the error function, in the standard model, we have $\inf_{f\in \mathcal{F}}\mathbf{E}\mathbf{R}_{\mathbb{D},\epsilon}(f) = \inf_{f\in \mathcal{F}}\mathbf{E}\mathbf{R}_{S,\epsilon}(f) = 0$ , while no such guarantee holds in the agnostic model. + +# 4.3 Analysis in the Standard Model + +Next, we analyze the competitive ratio of Algorithm 4 in the standard model, i.e., when $\inf_{f\in \mathcal{F}}\mathbf{E}\mathbf{R}_{\mathbb{D},\epsilon}(f) = \inf_{f\in \mathcal{F}}\mathbf{E}\mathbf{R}_{S,\epsilon}(f) = 0$ + +Theorem 6. In the standard model, Algorithm 4 obtains a competitive ratio of $1 + O(\epsilon)$ with probability at least $1 - \delta$ , when using $O\left(\frac{H \cdot d \log \frac{1}{\epsilon} \log \frac{1}{\delta}}{\epsilon}\right)$ samples, where $d = Pdim(\mathcal{F})$ . + +When the cost of the optimal solution $\mathrm{OPT}(\tau)$ is hard to compute, we can replace the offline optimal with an online algorithm that achieves competitive ratio $c$ given the value of $\tau$ to get the following: + +Corollary 7. In the standard model, if there exists a c-competitive algorithm for $\mathrm{OPT}(\tau)$ given the value of prefix-length $\tau$ , Algorithm 4 obtains a competitive ratio of $c(1 + O(\epsilon))$ with probability at least $1 - \delta$ , when using $O\left(\frac{H \cdot d \log \frac{1}{\epsilon} \log \frac{1}{\delta}}{\epsilon}\right)$ samples, where $d = Pdim(\mathcal{F})$ . + +We also show that the result in Theorem 6 is tight up to a factor of $H \log 1 / \epsilon$ : + +Theorem 8. Let $\mathcal{F}$ be a family of real valued functions such that there exists a function $f^{*}:\mathbb{X}\mapsto \mathbb{Y}$ that $f^{*}(x) = y$ and let $d = Pdim(\mathcal{F})$ . There exists an instance of the LEARNTOSEARCH problem that enforces any algorithm to query $\Omega \left(\frac{d\log\frac{1}{\delta}}{\epsilon}\right)$ samples in order to have an expected competitive ratio of $1 + \epsilon$ with probability $\geq 1 - \delta$ . + +# 4.4 Extension to the Agnostic Model + +In the agnostic model, we no longer assume a function $f \in \mathcal{F}$ that predicts the log-cost $y$ perfectly. It is possible that the true predictor is outside $\mathcal{F}$ , or in more difficult scenarios for any feature $x$ , the behaviour of the log-cost $y$ may be entirely arbitrary. + +We first show that the loss function $\epsilon$ -parameterized competitive error defined earlier is still a reasonable proxy for the competitive ratio. Specifically, we show that any algorithm that hopes to achieve a competitive ratio of $1 + O(\epsilon)$ must use a prediction $\hat{f} \in \mathcal{F}$ whose error $\mathbf{E}\mathbf{R}_{\mathbb{D},\epsilon}(f)$ is bounded by $O(\epsilon)$ . We formally state this below: + +Lemma 9. Let $\mathcal{A}$ be an algorithm for LEARNTOSEARCH that has access to a predictor $\hat{f}:\mathbb{X}\mapsto [0,H]$ for the log-cost $y$ . Then, there exists a distribution $\mathbb{D}$ and a function $\hat{f}_{\mathcal{A}}$ with the property $\mathbf{ER}_{\mathbb{D},\epsilon}(\hat{f}_{\mathcal{A}}) = \epsilon$ such that $\mathbb{E}_{(x,y)\sim \mathbb{D}}[\mathrm{CR}_{\mathcal{A}}(x,y)]\geq 1 + \frac{\epsilon}{2}$ . + +Unlike in the standard model, we no longer have that for any $\epsilon > 0$ , $\min_{f \in \mathcal{F}} \mathbf{E} \mathbf{R}_{\mathbb{D}, \epsilon}(f) = 0$ . Therefore, we need to first quantify the performance of an ideal algorithm that uses predictors from $\mathcal{F}$ . + +Definition 9. Let $\chi (\epsilon) = \min_{f\in \mathcal{F}}\mathbf{E}\mathbf{R}_{\mathbb{D},\epsilon}(f)$ . Then, $\Delta_{\mathcal{F}}$ is the solution to the equation: $\epsilon = \chi (\epsilon)$ . + +$\Delta_{\mathcal{F}}$ measures the best competitive ratio that we can hope to get when we use a predictor from $\mathcal{F}$ . Note that $\epsilon$ appears in two places in this definition, since the loss function in Definition 6 depends on $\epsilon$ . We first show that this is a reasonable definition in that the solution to the equation is unique: + +Lemma 10. For a given function family $\mathcal{F}$ and distribution $\mathbb{D}$ , the value of $\Delta_{\mathcal{F}}$ is unique. + +We also give an algorithm that can approximate $\Delta_{\mathcal{F}}$ (Algorithm 5). + +Lemma 11. If $|S| \geq C \cdot \left( \frac{H \cdot d \log \frac{1}{\epsilon} \log \frac{1}{\delta}}{\epsilon} \right)$ for suitable constants $C > 0, \delta \leq \frac{1}{2}$ , and $\epsilon \leq \Delta_{\mathcal{F}}$ , then with probability at least $1 - \delta$ , we have $\varepsilon / 6 \leq \Delta_F \leq 5\varepsilon / 3$ , where $\varepsilon$ is as returned by Algorithm 5. + +We are now ready to define our LEARNTOSEARCH algorithm for the agnostic model. This algorithm is simply Algorithm 4 where the accuracy parameter $\epsilon$ is set to the value of $\varepsilon$ returned by Algorithm 5. + +Algorithm 5 Procedure to estimate $\Delta_{\mathcal{F}}$ +Input: Sample Set $S$ , and function family $\mathcal{F}$ +Let $\epsilon$ be an accuracy parameter given by the size of the sample set $S$ +Choose $\varepsilon \coloneqq \epsilon$ +Compute: $\hat{f}$ such that $\mathbf{E}\mathbf{R}_{S,\varepsilon}(\hat{f})\leq \min_{f\in \mathcal{F}}\mathbf{E}\mathbf{R}_{S,\varepsilon}(f) + \frac{\varepsilon}{3}.$ +while $\varepsilon \leq \mathbf{E}\mathbf{R}_{S,\varepsilon}(\hat{f})$ $\varepsilon \gets 2\varepsilon$ . Recompute $\hat{f}$ s.t. $\mathbf{E}\mathbf{R}_{S,\varepsilon}(\hat{f})\leq \min_{f\in \mathcal{F}}\mathbf{E}\mathbf{R}_{S,\varepsilon}(f) + \frac{\varepsilon}{3}.$ +Return $\varepsilon$ + +Theorem 12. In the agnostic model for a function family $\mathcal{F}$ , Algorithm 4 with accuracy parameter $\varepsilon$ from Algorithm 5 obtains a competitive ratio of $1 + O\left(\Delta_{\mathcal{F}}\right)$ with probability at least $1 - \delta$ , when using $O\left(\frac{H \cdot d \log\left(\frac{1}{\Delta_{\mathcal{F}}}\right) \cdot \log \frac{1}{\delta}}{\Delta_{\mathcal{F}}}\right)$ samples, where $d = Pdim(\mathcal{F})$ . + +We also lower bound the sample complexity of a LEARNTOSEARCH algorithm: + +Theorem 13. Any LEARNTOSEARCH algorithm that is $\epsilon$ -efficient with probability at least $1 - \delta$ must query $\Omega\left(\frac{\log\frac{1}{\delta}}{\epsilon^2}\right)$ samples. + +# 4.5 Robustness of Algorithm 4 + +So far, we have established the competitive ratio of Algorithm 4 in the PAC model. Now, we show the robustness of this algorithm, i.e., bound its competitive ratio for any input. Even for adversarial inputs, we show that this algorithm has a competitive ratio of $O(1 / \epsilon)$ , which matches the robustness guarantees in Theorem 2 for the PREDICT-AND-DOUBLE algorithm. + +Theorem 14. Algorithm 4 is $5(1 + \frac{1}{\epsilon}) = O\left(\frac{1}{\epsilon}\right)$ -robust. + +# 5 Conclusion, Limitations, and Future Work + +In this paper, we studied the role of regression in making predictions for learning-augmented online algorithms. In particular, we used the ONLINESEARCH framework that includes a variety of online problems such as ski rental and its generalizations, online scheduling, online bin packing, etc. and showed that by using a carefully crafted loss function, we can obtain predictions that yield near-optimal algorithms for this problem. One assumption that holds for the above problems, but not for other problems such as online matching, is the composability of solutions, i.e., that the union of two feasible solutions is also a feasible solution. Extending our work to such "packing" problems is an interesting direction for future research. Another interesting direction would be to give a general recipe for converting competitive ratios to loss functions, minimizing which over a collection of training samples generates better ML predictions for online problems. + +# 6 Acknowledgements + +This research was partially funded by the Indo-US Virtual Networked Joint Center project No. IUSSTF/JC-017/2017. Keerti Anand and Debmalya Panigrahi were supported in part by NSF Awards CCF-1955703, CCF-1750140 (CAREER), and ARO Award W911NF2110230. Rong Ge was also supported in part by NSF Awards DMS-2031849, CCF-1704656, CCF-1845171 (CAREER), CCF-1934964 (TRIPODS), a Sloan Research Fellowship, and a Google Faculty Research Award. + +# References + +[1] Lingqing Ai, Xian Wu, Lingxiao Huang, Longbo Huang, Pingzhong Tang, and Jian Li. The multi-shop ski rental problem. In Sujay Sanghavi, Sanjay Shakkottai, Marc Lelarge, and Bianca Schroeder, editors, ACM SIGMETRICS / International Conference on Measurement and Modeling of Computer Systems, SIGMETRICS '14, Austin, TX, USA - June 16 - 20, 2014, pages 463-475. ACM, 2014. +[2] Susanne Albers. Better bounds for online scheduling. SIAM Journal on Computing, 29(2): 459-473, 1999. +[3] Noga Alon, Shai Ben-David, Nicolo Cesa-Bianchi, and David Haussler. Scale-sensitive dimensions, uniform convergence, and learnability. Journal of the ACM (JACM), 44(4):615-631, 1997. +[4] Keerti Anand, Rong Ge, and Debmalya Panigrahi. Customizing ML predictions for online algorithms. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pages 303-313. PMLR, 2020. +[5] Spyros Angelopoulos, Christoph Durr, Shahin Kamali, Marc P. Renault, and Adi Rosén. Online bin packing with advice of small size. In Frank Dehne, Jörg-Rüdiger Sack, and Ulrike Stege, editors, Algorithms and Data Structures - 14th International Symposium, WADS 2015, Victoria, BC, Canada, August 5-7, 2015. Proceedings, volume 9214 of Lecture Notes in Computer Science, pages 40-53. Springer, 2015. +[6] Spyros Angelopoulos, Christoph Durr, Shendan Jin, Shahin Kamali, and Marc P. Renault. Online computation with untrusted advice. In Thomas Vidick, editor, 11th Innovations in Theoretical Computer Science Conference, ITCS 2020, January 12-14, 2020, Seattle, Washington, USA, volume 151 of LIPics, pages 52:1-52:15. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2020. +[7] Martin Anthony and Peter L. Bartlett. Function learning from interpolation. Comb. Probab. Comput., 9(3):213-225, 2000. +[8] Martin M Anthony and Peter Bartlett. Learning in neural networks: theoretical foundations. Cambridge University Press, 1999. +[9] Antonios Antoniadis, Themis Gouleakis, Pieter Kleer, and Pavel Kolev. Secretary and online matching problems with machine learned advice. In Hugo Larochelle, Marc'Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. +[10] Yossi Azar and Oded Regev. On-line bin-stretching. In Michael Luby, José D. P. Rolim, and Maria J. Serna, editors, Randomization and Approximation Techniques in Computer Science, Second International Workshop, RANDOM'98, Barcelona, Spain, October 8-10, 1998, Proceedings, volume 1518 of Lecture Notes in Computer Science, pages 71-81. Springer, 1998. +[11] Étienne Bamas, Andreas Maggiori, Lars Rohwedder, and Ola Svensson. Learning augmented energy minimization via speed scaling. In Hugo Larochelle, Marc'Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. +[12] Étienne Bamas, Andreas Maggiori, and Ola Svensson. The primal-dual method for learning augmented algorithms. In Hugo Larochelle, Marc'Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. + +[13] Soumya Banerjee. Improving online rent-or-buy algorithms with sequential decision making and ML predictions. In Hugo Larochelle, Marc'Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. +[14] Yair Bartal, Amos Fiat, Howard J. Karloff, and Rakesh Vohra. New algorithms for an ancient scheduling problem. In S. Rao Kosaraju, Mike Fellows, Avi Wigderson, and John A. Ellis, editors, Proceedings of the 24th Annual ACM Symposium on Theory of Computing, May 4-6, 1992, Victoria, British Columbia, Canada, pages 51-58. ACM, 1992. +[15] Peter L. Bartlett, Philip M. Long, and Robert C. Williamson. Fat-shattering and the learnability of real-valued functions. J. Comput. Syst. Sci., 52(3):434-452, 1996. +[16] Aditya Bhaskara, Ashok Cutkosky, Ravi Kumar, and Manish Purohit. Online learning with imperfect hints. In Proceedings of the 37th International Conference on Machine Learning, ICML 2020, 13-18 July 2020, Virtual Event, volume 119 of Proceedings of Machine Learning Research, pages 822-831. PMLR, 2020. +[17] Martin Böhm, Jiri Sgall, Rob van Steele, and Pavel Vesely. A two-phase algorithm for bin stretching with stretching factor 1.5. J. Comb. Optim., 34(3):810-828, 2017. +[18] Cecil C Craig. On the tchebychef inequality of bernstein. The Annals of Mathematical Statistics, 4(2):94-102, 1933. +[19] Rudolf Fleischer. On the bahncard problem. Theor. Comput. Sci., 268(1):161-174, 2001. +[20] Rudolf Fleischer and Michaela Wahl. Online scheduling revisited. In Mike Paterson, editor, Algorithms - ESA 2000, 8th Annual European Symposium, Saarbrücken, Germany, September 5-8, 2000, Proceedings, volume 1879 of Lecture Notes in Computer Science, pages 202-210. Springer, 2000. +[21] Michael Gabay, Vladimir Kotov, and Nadia Brauner. Online bin stretching with bunch techniques. Theor. Comput. Sci., 602:103-113, 2015. +[22] Michael Gabay, Nadia Brauner, and Vladimir Kotov. Improved lower bounds for the online bin stretching problem. 4OR, 15(2):183-199, 2017. +[23] Gabor Galambos and Gerhard J Woeginger. An on-line scheduling heuristic with better worst-case ratio than graham's list scheduling. SIAM Journal on Computing, 22(2):349-355, 1993. +[24] Sreenivas Gollapudi and Debmalya Panigrahi. Online algorithms for rent-or-buy with expert advice. In Proceedings of the 36th International Conference on Machine Learning, ICML 2019, 9-15 June 2019, Long Beach, California, USA, pages 2319-2327, 2019. +[25] Todd Gormley, Nicholas Reingold, Eric Torng, and Jeffery Westbrook. Generating adversaries for request-answer games. In Proceedings of the eleventh annual ACM-SIAM symposium on Discrete algorithms, pages 564-565, 2000. +[26] Ronald L. Graham. Bounds on multiprocessing timing anomalies. SIAM Journal of Applied Mathematics, 17(2):416-429, 1969. +[27] Chen-Yu Hsu, Piotr Indyk, Dina Katabi, and Ali Vakilian. Learning-based frequency estimation algorithms. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019. +[28] Zhihao Jiang, Debmalya Panigrahi, and Kevin Sun. Online algorithms for weighted caching with predictions. In 47th International Colloquium on Automata, Languages, and Programming, ICALP 2020, 2020. +[29] David R Karger, Steven J Phillips, and Eric Torng. A better algorithm for an ancient scheduling problem. Journal of Algorithms, 20(2):400-430, 1996. +[30] Michael J. Kearns and Robert E. Schapire. Efficient distribution-free learning of probabilistic concepts. J. Comput. Syst. Sci., 48(3):464-497, 1994. + +[31] Hans Kellerer and Vladimir Kotov. An efficient algorithm for bin stretching. Oper. Res. Lett., 41(4):343-346, 2013. +[32] Silvio Lattanzi, Thomas Lavastida, Benjamin Moseley, and Sergei Vassilvitskii. Online scheduling via learned weights. In Shuchi Chawla, editor, Proceedings of the 2020 ACM-SIAM Symposium on Discrete Algorithms, SODA 2020, Salt Lake City, UT, USA, January 5-8, 2020, pages 1859-1877. SIAM, 2020. +[33] Thomas Lavastida, Benjamin Moseley, R Ravi, and Chenyang Xu. Learnable and instance-robust predictions for online matching, flows and load balancing. arXiv preprint arXiv:2011.11743, 2020. +[34] Zvi Lotker, Boaz Patt-Shamir, and Dror Rawitz. Rent, lease, or buy: Randomized algorithms for multislope ski rental. SIAM J. Discret. Math., 26(2):718-736, 2012. +[35] Thodoris Lykouris and Sergei Vassilvitskii. Competitive caching with machine learned advice. In Jennifer G. Dy and Andreas Krause, editors, Proceedings of the 35th International Conference on Machine Learning, ICML 2018, Stockholm, Sweden, July 10-15, 2018, volume 80 of Proceedings of Machine Learning Research, pages 3302-3311. PMLR, 2018. +[36] Andres Muñoz Medina and Sergei Vassilvitskii. Revenue optimization with approximate bid predictions. In Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, 4-9 December 2017, Long Beach, CA, USA, pages 1858-1866, 2017. +[37] Adam Meyerson. The parking permit problem. In 46th Annual IEEE Symposium on Foundations of Computer Science (FOCS 2005), 23-25 October 2005, Pittsburgh, PA, USA, Proceedings, pages 274-284. IEEE Computer Society, 2005. +[38] Michael Mitzenmacher. A model for learned bloom filters and optimizing by sandwiching. In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicolò Cesa-Bianchi, and Roman Garnett, editors, Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada, pages 462-471, 2018. +[39] Michael Mitzenmacher. Scheduling with predictions and the price of misprediction. In Thomas Vidick, editor, 11th Innovations in Theoretical Computer Science Conference, ITCS 2020, January 12-14, 2020, Seattle, Washington, USA, volume 151 of LIPIcs, pages 14:1-14:18. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2020. +[40] David Pollard. Empirical processes: theory and applications. In NSF-CBMS regional conference series in probability and statistics, pages 1-86. JSTOR, 1990. +[41] Manish Purohit, Zoya Svitkina, and Ravi Kumar. Improving online algorithms via ML predictions. In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicolò Cesa-Bianchi, and Roman Garnett, editors, Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada, pages 9684-9693, 2018. +[42] Dhruv Rohatgi. Near-optimal bounds for online caching with machine learned advice. In Shuchi Chawla, editor, Proceedings of the 2020 ACM-SIAM Symposium on Discrete Algorithms, SODA 2020, Salt Lake City, UT, USA, January 5-8, 2020, pages 1834-1845. SIAM, 2020. +[43] Leslie G. Valiant. A theory of the learnable. Commun. ACM, 27(11):1134-1142, 1984. +[44] Shufan Wang, Jian Li, and Shiqiang Wang. Online algorithms for multi-shop ski rental with machine learned advice. In Hugo Larochelle, Marc'Aurelio Ranzato, Raia Hadsell, Maria-Florina Balcan, and Hsuan-Tien Lin, editors, Advances in Neural Information Processing Systems 33: Annual Conference on Neural Information Processing Systems 2020, NeurIPS 2020, December 6-12, 2020, virtual, 2020. + +[45] Alexander Wei. Better and simpler learning-augmented online caching. In Jaroslaw Byrka and Raghu Meka, editors, Approximation, Randomization, and Combinatorial Optimization. Algorithms and Techniques, APPROX/RANDOM 2020, August 17-19, 2020, Virtual Conference, volume 176 of LIPIcs, pages 60:1-60:17. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2020. \ No newline at end of file diff --git a/aregressionapproachtolearningaugmentedonlinealgorithms/images.zip b/aregressionapproachtolearningaugmentedonlinealgorithms/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..0036d5fad2303a751b1d8d50903157be11a0d17d --- /dev/null +++ b/aregressionapproachtolearningaugmentedonlinealgorithms/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d915dd72c20fdcbeb2e0155dfbe881933971667392b51c6b6719acde8356e16c +size 52984 diff --git a/aregressionapproachtolearningaugmentedonlinealgorithms/layout.json b/aregressionapproachtolearningaugmentedonlinealgorithms/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..e5959d8845819959f28ecf4c44cc7b3506e0e199 --- /dev/null +++ b/aregressionapproachtolearningaugmentedonlinealgorithms/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3ae9df55ba631c92201ad0df8d3eae785b1a980a1516e0b4b7c348eeeda46ca5 +size 611380 diff --git a/asamplingbasedcircuitforoptimaldecisionmaking/96428645-978e-40c8-bff3-08ad68aca339_content_list.json b/asamplingbasedcircuitforoptimaldecisionmaking/96428645-978e-40c8-bff3-08ad68aca339_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..daaea907c2676f3c6da75c00ce0059f7b3f23973 --- /dev/null +++ b/asamplingbasedcircuitforoptimaldecisionmaking/96428645-978e-40c8-bff3-08ad68aca339_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:edc633c6e7f7ba2277a790720131cabf87cab6421eef180d8c4ad270764b4c51 +size 77169 diff --git a/asamplingbasedcircuitforoptimaldecisionmaking/96428645-978e-40c8-bff3-08ad68aca339_model.json b/asamplingbasedcircuitforoptimaldecisionmaking/96428645-978e-40c8-bff3-08ad68aca339_model.json new file mode 100644 index 0000000000000000000000000000000000000000..455435b28f7d312e683127be7b803155adca2f4b --- /dev/null +++ b/asamplingbasedcircuitforoptimaldecisionmaking/96428645-978e-40c8-bff3-08ad68aca339_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:41bea0f6a5116a0d9bde84b0e5dc8c63daba9585c9857564651fb62cee935e1b +size 92671 diff --git a/asamplingbasedcircuitforoptimaldecisionmaking/96428645-978e-40c8-bff3-08ad68aca339_origin.pdf b/asamplingbasedcircuitforoptimaldecisionmaking/96428645-978e-40c8-bff3-08ad68aca339_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ba4dea8eaa884194893f3a0b1bc0e5b8646f5afa --- /dev/null +++ b/asamplingbasedcircuitforoptimaldecisionmaking/96428645-978e-40c8-bff3-08ad68aca339_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8abbfe02ed77bbb012d40a21f228a983a2efae35004f9da9fdd94c61aae0c634 +size 6180912 diff --git a/asamplingbasedcircuitforoptimaldecisionmaking/full.md b/asamplingbasedcircuitforoptimaldecisionmaking/full.md new file mode 100644 index 0000000000000000000000000000000000000000..83aa2f572998ac325edd4283fc140bbdf578f763 --- /dev/null +++ b/asamplingbasedcircuitforoptimaldecisionmaking/full.md @@ -0,0 +1,261 @@ +# A sampling-based circuit for optimal decision making + +Camille E. Rullán Buxó + +Center for Neural Science + +New York University + +New York, NY 10003 + +ch2880@nyu.edu + +Cristina Savin + +Center for Neural Science + +Center for Data Science + +New York University + +New York, NY 10003 + +csavin@nyu.edu + +# Abstract + +Many features of human and animal behavior can be understood in the framework of Bayesian inference and optimal decision making, but the biological substrate of such processes is not fully understood. Neural sampling provides a flexible code for probabilistic inference in high dimensions and explains key features of sensory responses under experimental manipulations of uncertainty. However, since it encodes uncertainty implicitly, across time and neurons, it remains unclear how such representations can be used for decision making. Here we propose a spiking network model that maps neural samples of a task-specific marginal distribution into an instantaneous representation of uncertainty via a procedure inspired by online kernel density estimation, so that its output can be readily used for decision making. Our model is consistent with experimental results at the level of single neurons and populations, and makes predictions for how neural responses and decisions could be modulated by uncertainty and prior biases. More generally, our work brings together conflicting perspectives on probabilistic brain computation. + +One of the central questions of perception is how organisms reliably estimate hidden or abstract quantities of interest using noisy and ambiguous sensory information. Almost equally important is representing the reliability of these estimates, especially in complex environments and situations of risk, where the uncertainty associated with a choice may radically change the optimal course of action. From basic functions, such as cue combination or motor control, to higher level cognitive tasks, such as decision making and planning, there is substantial evidence that both humans and animals represent and use uncertainty information to guide their actions [1]. Neural correlates have been identified in a number of regions, including the orbitofrontal cortex [2], the cingulate cortex [3], and the lateral intraparietal area (LIP) [4, 5], but the principles behind how uncertainty is represented in neural circuits to support circuit computations remain hotly debated. + +Since behavior has been shown to be Bayes-optimal in many situations [6], the problem of perception can be modelled in the framework of Bayesian inference, whereby an observer combines prior information with current observations according to an internal model to arrive at a posterior estimate of a quantity of interest (the 'latent variable'). Moreover, natural statistics are strongly non-Gaussian and there is evidence that human subjects use varied, non-Gaussian prior representations to support behavior [7, 8], so observers must be able to perform inference flexibly, efficiently and adaptively. This raises two questions: which neural organizations allow for these kinds of computations, and how are the associated neural representations mapped into behaviorally relevant action plans? + +Currently there are several theories for how neural activity may represent probability distributions. One large class of models assume that neural responses encode parameters of underlying posterior distributions; this includes probabilistic population codes [9, 10], their predecessors, kernel density estimators and distributional population codes [11, 12], and most recently, distributed distributional codes (DDC) [13]. A second class of models relies on stochasticity in recurrent circuits to approxi + +![](images/69ac04484109c30c696ccd1e903f5aeda8986c4c6666ae54a734afbf9e9b8139.jpg) +Figure 1: Schematic of sampling-based optimal decision making in spiking networks. Approximate inference is performed in a first spiking recurrent network by distributed sampling [22] (example trajectory from joint posterior shown in white). Samples from the task-relevant marginal posterior are read out linearly from this circuit and serve as input to a second network, which integrates them and converts them into a parametric representation. The associated parameters (bank of kernels in gray) are read out linearly from this second circuit and combined with a cost function, reflecting the potentially asymmetric cost of different errors, to generate the final optimal decision. + +mately encode probability distributions via sampling [14, 15]. This idea was originally motivated by the practical success of Markov Chain Monte Carlo (MCMC) sampling when performing inference in complex graphical models [14], and had the appeal of being able to flexibly represent complex probability distributions, something that parametric models could not achieve at the time. Sampling has been invoked to explain aspects of perceptual decision making [16], response variability in V1 neurons [17, 18] and structured spontaneous activity in the cortex [19]. Moreover, recent theoretical work has focused on improving the computational efficiency of neural sampling, by increasing sampling speed [20, 21] and improving the robustness of the representation [22]. Nonetheless, sampling-based codes represent uncertainty only implicitly, distributed across time and neurons [22]. How the brain maps neural sampling dynamics into uncertainty-calibrated decisions remains a key open question. + +Here, we propose the first spiking circuit for mapping neural samples into appropriate actions. At the core of our idea is the observation that although inference may involve complex high-dimensional posteriors, individual decisions are usually based on low-dimensional marginals of these distributions, which can be represented explicitly using a traditional parametric code. The proposed recurrent network model takes as inputs samples from the task-relevant posterior marginal and integrates them over time in a procedure inspired by online kernel density estimation [23]. We demonstrate the ability of this circuit to perform decision making in several toy examples. We also analyze the spiking activity of the network to look for signatures of uncertainty and probabilistic computation at the level of single neurons and population activity and find that our model recapitulates a variety of empirical observations in neural data. The model also makes predictions for how uncertainty and prior biases affect neural activity and population latent dynamics in this decision circuit. + +# 1 Spiking neural network for sampling-based marginalization + +In a Bayesian framework, perceptual decision making involves several key computations. First, given a sensory stimulus, $\mathbf{s}$ , one needs to compute the posterior over the latent variables, $\mathbf{x}$ , that may have given rise to it, $\mathrm{P}(\mathbf{x}|\mathbf{s})$ . Second, uncertainty about nuisance variables is averaged out, to obtain a marginal distribution over the task-relevant latent $x_{i}$ , $\mathrm{P}(x_i|\mathbf{s})$ . Finally, this marginal is combined with a task-specific cost function to yield the final decision. The first two steps are straightforward under a sampling framework [22], but parametric representations are needed for the final step to convert the information represented by samples into a spatially and temporally localized code [9]. + +Our approach uses spike-based distributed sampling for approximate inference and marginalization, then converts the resulting samples into an instantaneous parametric representation that can be used + +for decision making (Fig.1). For the inference portion of the model, we use the distributed sampling scheme developed by Savin and Deneve [22], implemented using the Poisson version of the encoding model, proposed by Rullán Buxó and Pillow [24]. Briefly, the recurrent circuit embeds Langevin sampling dynamics into a population of spiking neurons so that samples can be read out from the instantaneous neural rates (computed by low-pass filtering the spikes with an exponential kernel), $\mathbf{r}_t^\prime$ via a fixed linear decoder, $\mathbf{D}^{\prime}$ : $\mathbf{x}_t = \mathbf{D}^{\prime}\mathbf{r}^{\prime}_t$ (see Suppl. Info. and Refs. [22, 24] for details) $^{2}$ . Given these dynamics, samples from the $i$ -th marginal are obtained by projecting activity along the axis defined by row $i$ of the decoding matrix, $\mathbf{D}_i^\prime$ . + +The core of our contribution is the second circuit, which receives inputs $x_{i,t} = \mathbf{D}_i' \mathbf{r}_t'$ from the inference circuit, and constructs a parametric approximation of the associated distribution as a mixture of Gaussian kernels, $\phi_k(\cdot)$ , parametrized by kernel weights, $\mathbf{c}$ : $\mathrm{P}(x_i) = \sum_k c_k \phi_k(x_i)$ . For simplicity, here we assume a collection of $K$ Gaussian basis functions, although alternative choices of kernels are also possible. The parameters $\mathbf{c}$ adapt dynamically with each input sample, following dynamics of the form: + +$$ +\dot {\mathbf {c}} _ {t} = \frac {1}{\alpha} \left(\phi \left(x _ {i t}\right) - f \left(\mathbf {c} _ {t - 1}\right)\right) \tag {1} +$$ + +where vector $\phi (x_{it})$ concatenates all basis functions evaluated at the current input; function $f(\cdot)$ ensures that the fixed point solution yields a properly normalized distribution. Throughout this paper, we define $f(\vec{\mathbf{c}}_t) = K\langle \phi \rangle \vec{\mathbf{c}}_t = \beta \vec{\mathbf{c}}_t$ , such that at the fixed point, the norm is 1, $\sum_{k}\frac{\phi_k(x_t)}{\beta} = \sum_{k}c_{k,t} = 1$ (see Suppl. Info. for details). The $\alpha$ term in Eq. 1 can be thought of as a leak, or the discount rate of internal evidence. This term becomes important for studying the dynamics of neural activity and decision making when the marginal posterior is changing, but otherwise does not qualitatively affect our results. + +The dynamics implementing the parametric approximation of the marginal are embedded into a spiking neuron population, using the same encoding model used for the first module [24, 25, 27], so that the parameters can themselves be read out from neural activity via another arbitrary, fixed linear decoder, $D$ , of size $K \times N$ . The communication between circuits involves a linear map along the relevant axis of the inference circuit decoder, followed by point nonlinearities, with a form determined by the kernel $\phi_k(\cdot)$ ; this map could be implemented by local dendritic non-linearities. + +As a simple proof of concept, we first consider inference in a linear Gaussian graphical model (Fig. 2A; see Suppl. Info. for details and simulation parameters), which results in Gaussian posterior marginals. Before stimulus onset, the inference circuit samples from a broad Gaussian prior centered at zero. Once the stimulus is on $(t = 0.15\mathrm{s})$ , the dynamics switch to sampling from a sharper and correlated posterior (Fig. 2B). We take the first dimension $x_{1}$ as the decision-relevant latent dimension, with corresponding samples forming the stream of inputs to the decision circuit of size $N = 160$ where they are converted into a parametric representation of the marginal (Fig. 2C). The spiking activity of the neurons in the second circuit reflects these probabilistic computations, both before (spontaneous activity) and after stimulus presentation (Fig. 2D) so that parameters $\mathbf{c}_t$ can be read out from the neural responses (Fig. 2E). They also closely match the ground truth $\sim 150 - 200\mathrm{ms}$ after stimulus onset, once the dynamics have stabilized (Fig. 2F). + +To explore how this representation could be used for optimal decision making, we consider a slightly more involved scenario, in which the task-relevant marginal is a bimodal distribution (formally, a two-component Gaussian mixture with unequal variance, Fig. 3A), a classic example where different choices of cost functions can have very different optimal decisions. $^{3}$ For instance the task of estimating $x_{1}$ has the posterior mean as the optimum, while reporting the most likely value would use a maximum a posteriori (MAP) estimate. Here, we consider a binary categorization task, which requires reporting the sign of $x_{1}$ as an abstract analogue to binary discrimination (for instance, deciding whether or not an oriented grating is tilted leftwards or rightwards relative to the vertical). The optimal decision in this case is to report the side of the decision boundary that has more mass (integrating out the posterior $\int_0^\infty \mathrm{P}(x_i|\mathbf{s})dx_i$ ). For our concrete example, there is slightly more mass + +![](images/1c1e5d3909add9a18eb3b3b7e1d1028c31d62c31578cff4527505e9bfa80eb7a.jpg) + +![](images/34419f3687cb94e96b72f48239b39c9240b9b824f383e7f062f891f0649f0a2b.jpg) + +![](images/4ef0b5450ce2291c9a87b147d151a65e02ce16a372cd29304143a6d077fda312.jpg) + +![](images/b023a5bbf13bf0b360713208f837157f7c8b49268bdecb5bf36c49cafc21f8c2.jpg) +Figure 2: Decision circuit and proof of concept decision making. A. Graphical model for our toy example: inference in a linear Gaussian model. B. An example prior and posterior with two latent variables. C. The time evolution of the parametric approximation of the marginal for $x_{1}$ of the prior (before stimulus onset), and the posterior (afterward)s. D. Spiking activity encoding this information. E. Decoded parameters, c; ground truth in in black, network estimates in color. F. Comparison between estimate and ground truth posterior marginal at the end the trial. + +![](images/6293fff1e5adb098073db7cbb280de9800f238df7e3ebba02da7b5a71ad7483f.jpg) + +![](images/54a1d0ebcd7b3834f82c79abc10c2be0bee75cb6857888f30e358902b47d52d8.jpg) + +on the negative side, such that with equal costs the optimal decision would be to report 'L'.4 We also define an asymmetric cost scenario where the cost of mistakenly reporting a negative value is higher than the alternative so the optimal decision changes to 'R'. + +The dynamics of the decision circuit are shown in Fig. 3B. In this example, the inference circuit happens to start its trajectory in the rightward mixture component; since Langevin dynamics are slow at crossing regions of low probability [20, 21], initially the decision circuit only 'sees' samples from one component, but eventually both components are explored and the parametric marginal converges to the ground truth. In parallel, a cost-weighted linear projection of the corresponding neural responses tracks the evolution of the estimated cost associated to the two options (Fig. 3C). Indeed, for equal costs option 'L' starts with a high value, as it looks improbable under the initial approximate posterior, with the estimate converging to the correct low value with more samples; comparing the two options yields the optimal decision, 'L'. Similarly, when high costs bias the decision away from this option, the network labels 'R' as the preferred option. Any other choice of cost function can be accommodated by changing the linear readout from the decision circuit. The same is true for estimation tasks based on the posterior mean, which we simulated to reproduce a reduction in the slope of a psychometric function with increasing uncertainty (Fig. 3D) and a shift in due to prior biases (Fig. 3E). + +# 2 Neural signatures of sampling-based decision making + +The inference and decision circuits share a lot of their underlying structure. Both encode information using the same spiking code; both their responses are driven by samples from the same posterior, directly in the inference circuit, and indirectly via a linear projection in the decision circuit. Are the two computations distinguishable at the level of the neural activity? + +To investigate the neural implications of our model, we reproduced the experiment used to probe neural correlates of distributed sampling from [22]. Briefly, we assumed that the first circuit performs inference in response to 9 distinct test stimuli, under the assumption of a linear Gaussian graphical model. At the level of the decision circuit, this setup yields corresponding Gaussian marginals with equal variance and means that are evenly spaced on an interval from $-1$ to $1$ . We probe the responses + +![](images/231dd79c4cd5c8e3f9d85bd17dec6e80d53be95c42d561d206a0b3a929a05e2e.jpg) + +![](images/4d3a16e237df1b15c2decb0d7f6e5e81ecea0f0ac8c9d574d5353a4b075bd76c.jpg) + +![](images/4e67e28e1a1c122a58ee508e8f59d08747bc97efb1eb19bd4f86634a36e0c0ab.jpg) + +![](images/bdc895624f9df615a226314d0e5dee273b2b8cface7b3a841534c652bd3ead61.jpg) +Figure 3: Toy examples of decision making. A. A binary decision when the relevant marginal is a two-component Gaussian mixture, so the mean (green) and the mode (red) of the distribution differ. The goal is to optimally report the sign of $x_{1}$ , taking into account any asymmetry in the cost structure. B. Evolution of the network's marginal estimate; inference circuit dynamics start in the right posterior mode. C. Weighting output by the cost function generates dynamic estimates of the expected cost of the two decisions (L/R) in the case of equal costs (light purple = R, dark purple = L) or asymmetric cost (light pink = R, dark pink = L). D. Posterior mean estimation under uncertainty. Stimuli were selected from one of nine equally spaced measurement distributions with varying uncertainty (left). Psychometric curves showing the proportion of rightward judgements as a function of stimulus location and uncertainty (right). E. Same as D but for inference with prior-induced biases. + +![](images/fe76c77ce59a8a19a108d0574d23ff5beda2f2fccc7daf66fcb1e1c48a88b2ec.jpg) + +of the decision circuit to these stimuli and analyze the resulting spiking activity of the circuit the same way an experimentalist would analyze cortical data. We furthermore quantify how these responses change with uncertainty and prior biases. All figures shown are for the decision circuit; equivalent results for the inference circuit can be found in [22]. + +# Signatures of uncertainty in single neurons + +We quantified a range of response statistics that are commonly used to characterize spiking activity in the cortex using simulated data from the model. For each stimulus condition, we further varied posterior uncertainty between three levels, from low to high uncertainty (analogous to changing from high to low contrast in V1 experiments) (Fig. 4A). + +Measuring the tuning function of individual neurons revealed that they decrease their peak firing and increase their width as uncertainty increases (Fig.4B). This modulation differs from the behavior of the inference module [22] or from data in early visual cortex [30]. The difference can be easily understood in the context of our unified coding scheme. In both modules, individual neurons are responsible for particular directions in signal space (here signal refers to either $\mathbf{x}_t$ or $\mathbf{c}_t$ ), defined by the corresponding columns of the decoding matrix. They will increase their firing whenever the underlying signal is in their preferred region of stimulus space. In the inference module, this means that the average firing rate of the neuron will reflect the posterior mean. In the decision module, neurons inherit their stimulus selectivity from their preferred c axis. As uncertainty increases, their preferred $\mathbf{c}_k$ will reduce its amplitude, triggering a corresponding reduction in the neuron's firing for a preferred stimulus. Likewise, $\mathbf{c}_k$ s far away from the stimulus, which were originally inactive, will start to participate in the signal; their corresponding neurons will also increase their firing rates, which leads to a widening of their tuning function. Putting together the different effects, as a function of similarity of the neuron's preferred stimulus with the presented stimulus, we find reductions in firing rates for the preferred stimulus and an increase in firing away from the preferred stimulus, with the magnitude of the effects scaled by uncertainty (Fig. 4C). + +In contrast, the effects of uncertainty on variability were consistent across circuits (see corresponding figure in Ref.[22]), with mean Fano factors close to 1 in the low uncertainty conditions and systematic + +![](images/0ad874d33343c7b12506b73c4059dc6e26573e2e64dd7082e578436769d1cb0a.jpg) + +![](images/21431bad85d8c6fd1c50cb32ab9e9755366ff91bfdef5780049feb6662793608.jpg) + +![](images/4c2408d8429f54b57ddb6d365685755f0446802b864313cbefa27f5a87b25fdf.jpg) + +![](images/4fa4fbc44eb3ec5e67327c29e9cc7dd82c555ed5efc024759092a76d6628a914.jpg) + +![](images/47e0b9b5e62d0d0e43332aea9f95a5e8d9690b908529bfebe489bc720badb7d1.jpg) +Figure 4: Modulation of single neuron responses by uncertainty. A. Simulated experiment with a range of stimuli that induce marginals with different means and the same variance; the uncertainty manipulations change their width. B. Tuning curves for a representative example neuron as uncertainty changes (with spline smoothing). C. Fractional changes in firing rate relative to the high certainty condition as a function of the distance between the stimulus and the neuron's preferred stimulus. D. Fano factor cumulative distributions. E. Average Fano factors and F. Voltage variance as a function of the stimulus similarity to the neuron's preferred stimulus. Black dashed line in E. shows average across all conditions. G. Lifetime sparsity cumulative distributions. H. Noise correlations between neuron pairs; neurons sorted by stimulus preference . I. Noise correlations as a function of tuning similarity; linear regression fit in black. J. Slope of regression line as a function of marginal uncertainty. All summary statistics were measured using 20 trials per stimulus condition. + +![](images/9b1560f6bd7f95965962c5784349ac608a927ec0928e74ab7bf419d462a0f767.jpg) + +![](images/74b1d02868cb9876ca4255aeb061005e3293e27ee7c0b7dd3a0b4c12ed10b954.jpg) + +![](images/597fe08ea35798f49775c9401d54259db7c66ca0a97eb01192f9786d3200df59.jpg) + +![](images/2ae25c441044f3cad36e2955aacf1e9802839d8436118404cef5ff26394248e8.jpg) + +![](images/88d1ce77488c591eefecfb7dbf699c4e4db335c254f9c47047f07c200c56a4d7.jpg) + +rightward shifts of the Fano factor distribution with increasing uncertainty (Fig. 4D). This property can again be understood in the context of the encoding scheme: the variability of individual neurons can be decomposed into Poisson variability due to the encoding scheme [24] and signal variability. The first is largely unchanged across manipulations, but the increase in uncertainty leads to proportional increases in the signal — directly in the case of the inference circuit and indirectly in the decision module, since the variance of an average estimate also changes with the variance of the random variable being averages. Similar Fano factor increases are also a robust feature of experimental data [31, 17, 32]. + +Recent work also showed that average Fano factors over a range of uncertainties were roughly constant across stimulus orientations, both in a sampling-based model of V1 activity [17] and in data from awake macaque V1 [32]. While our model recapitulates this behavior on average (Fig. 4E, black dashed line), Fano factors start to increase at the preferred orientation for high uncertainty stimuli, a novel prediction for future data analyses. We found a similar pattern in the voltage variance (see detailed model description in Suppl.Info.), which increases with uncertainty and peaks at the preferred orientation (Fig. 4F), in agreement with previous experimental results [17, 33] as well as previous distributed sampling theory [34]. We also found that the sparsity of neural responses decreases with uncertainty, similar to that in the inference module (Fig. 4G). + +Lastly, we analyzed the properties of pairwise correlations between neurons in the same setup. When visualizing the matrix of noise correlations between neurons (measured by Pearson correlations between their instantaneous firing rates over the course of a trial), with neurons indexed by their preferred stimulus, we found its structure to be modulated by uncertainty, with correlations expanding across wider stimulus ranges in high uncertainty conditions (Fig. 4H). While this observation is less intuitively explainable at the mechanistic level, it is likely to reflect the expansion of the active $c_{k}$ range, possibly paired with the competitive process that ensures the normalization of the approximate marginal distribution. When organizing the noise correlations by the tuning preference of the two neurons, we found that similarly tuned neurons have higher correlations than neurons with different + +![](images/18f7f78ffbb799cfa067893db21f810ebe664a55362f22b551b712392a30bdb0.jpg) +Figure 5: Signatures of internal evidence integration. Distributions in color represent posterior marginal. A. Left: a neuron's perspective on probabilistic decision making comparing a scenario when the posterior mean is close to its preferred stimulus (top) vs. the posterior attributing high probability to non-preferred stimuli (bottom). Right: Evolution of average firing rates over time for the two scenarios. B. Prior manipulations (left) and the change in average neuron activity relative to no bias, for the two conditions (right). + +![](images/86ce65dad6cfe925fa9759e3eeea32a68b3a64debea058d52339353b41c8bf13.jpg) + +tuning preferences (Fig. 4I), as seen experimentally [35]. Moreover, this dependence increases in strength with uncertainty (Fig. 4J), as previously reported for the inference circuit [22], leading to a robust prediction for this kind of sampling based computation, which can be tested experimentally. + +Signatures of internal evidence integration So far, we have investigated the neural responses of the second module through the lens of statistics commonly used to characterize sensory neuron activity. Here, we analyze the same responses as one would for a decision circuit, such as LIP. + +In particular, we focused on the unfolding of single neuron responses over time after stimulus onset (Fig. 5A), segregating the neurons into subsets whose tuning aligns with the presented stimulus (light pink) or not (dark pink). We found that neurons tuned to the stimulus ramp up their responses over time, as a reflection of the approximate posterior accumulating more posterior samples and thus increasing the corresponding $c_k$ values. In contrast, neurons tuned to other stimuli decrease their responses, as the posterior density associated to that stimulus region decreases. The amplitude of these ramps depends on the overall uncertainty level, such that firing rates saturate at higher levels for higher certainty stimuli when the stimulus is in the preferred direction, similar to LIP responses found by Roitman and Shadlen [36] during sensory evidence integration. The key distinction is that here we are integrating internal evidence (a stream of samples) rather than external evidence (a stream of noisy stimuli). Or, put another way, the model we're proposing computes a distribution over the decision variable and not a point estimate of the decision variable itself, as is the case in traditional evidence integration. What has been taken to be a key signature of evidence integration (firing rates increasing as more evidence is shown over time) is also consistent with our probabilistic coding scheme, despite the different computational goals. + +The second manipulation we consider is one of the prior, inspired by an experiment by Rao and collaborators [37], in which the prior mean shifts rightwards or leftwards relative to a 'no bias' condition in which the prior is uninformative (Fig. 5B). After isolating the subset of neurons activated in the no bias condition, we compared their responses to the 'right bias' condition (light green) in which the prior aligns with the likelihood slightly sharpening the posterior without significantly changing its mean, and 'left bias' (dark green), which shifts the posterior away from the monitored neural population. Before the stimulus is presented, the neurons increase their activity when encoding the right bias, when the $c_k$ 's that these neurons are tuned to have high values, and similarly decrease their firing for the left bias. However, after the stimulus is turned on, this discrepancy slowly decreases: as the likelihood is strongly informative, the differences between posteriors are much less prominent than the differences between the two priors, so as more samples are integrated, the difference in responses are reduced so as to reflect the relatively minor difference between the likelihood and both posteriors. Again, LIP is known to show similar responses, where the effect of prior biases diminishes as the circuit accumulates more sensory evidence [37]. + +# Signatures of probabilistic computation at the population level + +The encoding of information in our model is naturally distributed across entire spiking neural networks and allows us to find robust signatures of the underlying probabilistic computation in the form of neural trajectories in low-dimensional manifolds [22]. If the map from neural responses to the + +![](images/889b78781f90d33ec3fbfc84e65b28b12a331b452dc69ad0a3eeb48259631f3d.jpg) +Figure 6: Latent population dynamics. A. Variance explained by increasing size of latent manifold for low (dark blue) and high (light blue) uncertainty; estimates use trial-average PCA for responses to 9 probe stimuli. B. Latent dynamics of the decision circuit in response to sequentially presenting the test stimuli (inset), for different uncertainty levels (colors). C. Latent dynamics of three presentations of the same stimulus, for different uncertainty conditions. D. Latent dynamics for three presentations of the same stimulus with an uninformative prior (blue) or left/right prior biases (green); initial conditions differ by prior, the likelihood is the same across conditions. + +![](images/25704eeb808cc59c21dc8b59fadb83b44533037effd4b797810293046c0ef900.jpg) + +![](images/dcea694dfcd863dd31a01ed1a6b55f3821b5720269f29b3a8a566876a3f8b5ad.jpg) + +![](images/0fdc8362d44a5b164af016533ff69432d6057ff7769a5703dda997883746c829.jpg) + +embedding manifold is easy to understand for the sampling circuit (the manifold maps one-to-one to the latent axes of the encoded posterior and the circuit dynamics to MCMC samples from it), this is not necessarily the case for the decision circuit. In particular the effective dimensionality of this circuit may change depending on uncertainty level. The intuition for this is simple: if the test stimuli are relatively sparse and the posteriors sharp, then a fraction of the parameters $c_{k}$ s will not be recruited by any of the test trials. These 'collapsed' axes reduce the effective dimensionality of the dynamics; increasing uncertainty recruits more of these parameters, increasing effective dimensionality. Paired with the fact that $c_{k}$ s are strongly correlated, dynamics appear almost invariably one dimensional in our toy examples (Fig. 6A), as seen in LIP data [38]. + +We can look at the low dimensional embedding of these dynamics for signatures of both uncertainty and prior biases. For instance, we simulated a scenario where the model is presented with the full sequence of test stimuli (from left to right) at different uncertainty levels, and traced the corresponding decision circuit trajectories in the space of their first two principal components (Fig. 6B), similar to [39]. This revealed structured trajectories whose geometry directly reflects posterior uncertainty. We further probed the effect of uncertainty on single stimuli (Fig. 6C). Here, the trajectories start at the same point (a location defined by the prior distribution) and gradually separate out to reflect different posteriors (Fig. 6C). The stimulus with the highest uncertainty (light blue) is closer to the prior, which nicely mirrors the observation that with limited evidence a Bayesian observer depends more on prior knowledge. The same pattern was seen in monkeys performing a time interval reproduction task [40]. The variance around the specific fixed point also depends on uncertainty, with more variability for higher uncertainty, analogous to (and inherited from) the inference circuit. + +Finally we also considered a scenario where the likelihood is fixed, but the prior varies from leftward biased (dark green) to uninformative (blue) and rightward biased (light green). In this scenario, all three trajectories start in different regions of phase space (reflecting their respective priors) but quickly converge to roughly the same region of phase space (since the likelihood is narrow and dominates posterior estimates), with slight offsets that reflect the bias. Overall, we found that the decision circuit dynamics are low-dimensional and finely structured to reflect aspects of probabilistic computation, in a very different way from the sampling trajectory that drives them. + +# Inference under changing conditions + +The online nature of the marginalization procedure implemented by the decision circuit allows it to integrate samples from any posterior, static or dynamic, within a time window specified by parameter $\alpha$ . This will lead to dependencies over time in the outputs of this circuit within the time horizon of integration, with possibly measurable behavioral signatures. Although the current implementation of the distributed sampling network only considers inference with static stimuli, we can get a sense for how the coding scheme is affected by stimulus dynamics by simulating a slightly more complex setup, with a succession of two static stimuli. + +Figure 7A shows a simple simulation of a changing distribution, where the sensory input switches halfway through the simulation such that the mean of the marginal posterior changes. The decoded + +![](images/5bfcab72b7ad33fa4cd4ab9bb9b9f0931cfed635f79ac8b109a0750b5b5fdfd0.jpg) +Figure 7: Switching between two static stimuli. A. Dynamics of decoded parameters c when the stimulus switches $400\mathrm{ms}$ (dashed line) into the simulated trial. B. The evolution of the decoded marginal over time. C. The decoded marginal distribution (black) $400\mathrm{ms}$ after the stimulus switch. D. Decoded posterior mean estimate over time, for different values of integration time constant $\alpha$ . Dashed lines show ground truth for the two stimuli. + +![](images/9b5de4d4214d9ed1e343d2bf408991e5a9feb170e1fdcd0f44998418d18380ba.jpg) + +![](images/96e911f40808335a0cddf329b57828a7592a2321ae9ed98bebfb77a5bba1a6f1.jpg) + +![](images/9f924cd4ab55ebe0a2ff954d7fb6576f88b873e351717eb429ce16ad48d93ddd.jpg) + +marginal distribution shows lingering traces of the previous stimulus, with the approximate marginal exhibiting bimodality (Fig.7B) that still persists 400ms after the switch (Fig.7C). Our model predicts that the strength of this bias should be related to the uncertainty of the preceding stimuli, and the similarity between the stimuli (formally, the distance between their corresponding posterior means). The temporal extent of this bias is controlled by the leak, or evidence discount rate, of the marginal posterior (Fig.7D). This is reminiscent of the history dependence of choice biases seen in sequential decision making [41, 42]. It may even be beneficial for dynamic inference, since exponential discounting of past evidence can be used to approximate Bayes-optimal inference in non-stationary environments [43]. It leads however to an interesting conundrum: on the one side, a precise representation of the marginal requires a large $\alpha$ so as to integrate as many samples as possible; on the other side, $\alpha$ should be small if we are to minimize sequential biases. The optimal trade-off between the two is dictated by the time scale of changes in the sensory stimuli. Indeed, discount rates are known to reflect the expected rate of change of the statistics of the environment in a similar manner [44]. We expect that the integration time constant $\alpha$ is fixed within a given experimental context, but may adapt over time to reflect the time constants of environmental stability. The $\alpha$ parameter can in principle be estimated independently at the level of behavior and in neural data, which could be used to generate experimental predictions of the theory. + +# 3 Discussion + +Although behavioral evidence supports the idea that humans and animals use uncertainty to guide nearly optimal behavior (but see [45-47] for counter-arguments), the neural underpinnings of probabilistic computation remain controversial [15, 6, 48]. Contrary to the tradition of viewing parametric and sampling-based codes as mutually exclusive, here we use them both as useful data structures, needed at different computational stages for approximately optimal decision making. First, sensory circuits use sampling to represent the joint statistics over many features and to marginalize out nuisance variables, which is hard with parametric representations [49]. Second, in decision areas, parametric codes provide a compact, quasi-instantaneous representation of the marginals which can be easily combined with costs to yield approximately optimal decisions. Thus, our model provides a computationally well-justified reconciliation between competing probabilistic neural codes, which is complementary to recent attempts at unifying parametric and sampling-based models through the lens of Bayesian encoding and decoding [50]. + +Our decision circuit could in principle be adapted to represent a two-dimensional marginal posterior using two-dimensional kernel functions. The corresponding circuit size would need to grow linearly in the number of parameters, $\vec{c}$ , and in principle exponentially with the number of marginal posterior dimensions. However, higher dimensional marginals may not be necessary: one should be able to include the decision variable explicitly as part of sampling-based hierarchical inference, making the relevant marginals always 1-D. These marginals could, in principle, change to adapt to different tasks using any of the biologically plausible proposals for dynamic information routing between neural circuits [51-53]. + +Our model involves two stages of computation and relies on the same spike-based framework [24] to encode the corresponding probabilistic quantities. This shared encoding means that many classic measures of responses in single cell and neuron pairs are preserved across processing stages and + +largely consistent with those reported for early sensory cortical responses. Furthermore, the points of difference match experimental points of contention between parametric and sampling-based codes (e.g. the modulation of tuning functions by uncertainty) [9, 22]. Finally, although the idea that neural computation relies on coordinated activity between neurons is central to the construction of both circuits, they significantly diverge in the properties of their latent trajectories. Specifically, the two circuits have different slow dynamics that reflect the different underlying computations, leading to diverging experimental predictions. Uncertainty manifests mainly in the entropy of latent trajectories for sampling [22], whereas in the decision circuit it affects amplitude of mostly deterministic trajectories. These different signatures point to approaches based on latent dynamical systems models [54, 55] as a way to potentially disambiguate between different stages of probabilistic computation. + +Our decision circuit can be thought of as a probabilistic form of evidence integration akin to that proposed by Boerlin and Deneve [25], with the 'evidence' given by samples from the network's internal model rather than noisy external inputs. This close analogy prompts the idea that from the perspective of a brain trying to act in the world—or our decision circuit—there may be little point in making a distinction between internal and external noise [56]. This significantly complicates the experimental validation of neural sampling in a way that can only be addressed by further theoretical work. To explore such complex scenarios, a natural next step is to expand the first module from inference with static stimuli to inference based on continuous stimulus streams with nontrivial temporal correlations. This could in principle be achieved by using particle filtering as underlying sampling dynamics [57], with particles embedded in the same spiking recurrent circuit (as previously demonstrated for multiple parallel chains sampling from the same static posterior [22]). Exploring the interaction between such inference dynamics and our probabilistic decision circuit could reveal new neural and behavioral signatures of sampling-based probabilistic computation in the brain. + +# Acknowledgments and Disclosure of Funding + +We thank Edoardo Balzani, Pedro Herrero-Vidal and Colin Bredenberg for helpful discussions and feedback on earlier versions of this manuscript. CRB is supported by the National Science Foundation Graduate Research Fellowship under Grant No. DGE1839302. CS is supported by National Institute of Mental Health Award 1R01MH125571-01, by the National Science Foundation under NSF Award No.1922658 and a Google faculty award. + +# References + +[1] Wei Ji Ma and Mehrdad Jazayeri. Neural coding of uncertainty and probability. Annual Review of Neuroscience, 37(1), 2014. +[2] Adam Kepecs, Naoshige Uchida, Hatim A. Zariwala, and Zachary F. Mainen. Neural correlates, computation and behavioural impact of decision confidence. Nature, 455(7210):227-231, September 2008. +[3] E. R. Stern, R. Gonzalez, R. C. Welsh, and S. F. Taylor. Updating beliefs for a decision: Neural correlates of uncertainty and underconfidence. Journal of Neuroscience, 30(23):8032-8041, June 2010. +[4] R. Kiani and M. N. Shadlen. Representation of confidence associated with a decision by neurons in the parietal cortex. Science, 324(5928):759-764, May 2009. +[5] Tianming Yang and Michael N. Shadlen. Probabilistic reasoning by neurons. Nature, 447(7148):1075-1080, June 2007. +[6] Alexandre Pouget, Jeffrey M Beck, Wei Ji Ma, and Peter E Latham. Probabilistic brains: knowns and unknowns. Nature Neuroscience, 16(9):1170-1178, September 2013. +[7] Neil M.T. Houlsby, Ferenc Huszár, Mohammad M. Ghassemi, Gergő Orbán, Daniel M. Wolpert, and Mate Lengyel. Cognitive tomography reveals complex, task-independent mental representations. Current Biology, 23(21):2169-2175, November 2013. + +[8] Thomas L. Griffiths and Joshua B. Tenenbaum. Optimal predictions in everyday cognition. Psychological Science, 17(9):767-773, September 2006. +[9] Jeffrey M. Beck, Wei Ji Ma, Roozbeh Kiani, Tim Hanks, Anne K. Churchland, Jamie Roitman, Michael N. Shadlen, Peter E. Latham, and Alexandre Pouget. Probabilistic Population Codes for Bayesian Decision Making. Neuron, 60(6):1142-1152, December 2008. +[10] Wei Ji Ma, Jeffrey M Beck, Peter E Latham, and Alexandre Pouget. Bayesian inference with probabilistic population codes. Nature Neuroscience, 9(11):1432-1438, November 2006. +[11] Richard S. Zemel, Peter Dayan, and Alexandre Pouget. Probabilistic interpretation of population codes. Neural Computation, 10(2):403-430, 1998. +[12] Richard S. Zemel and Peter Dayan. Distributional population codes and multiple motion models. In Proceedings of the 11th International Conference on Neural Information Processing Systems, NIPS'98, page 174-180, Cambridge, MA, USA, 1998. MIT Press. +[13] Eszter Vértes and Maneesh Sahani. Flexible and accurate inference and learning for deep generative models. In Advances in Neural Information Processing Systems, volume 31, 2018. +[14] Patrik Hoyer and Aapo Hyvarinen. Interpreting neural response variability as monte carlo sampling of the posterior. In S. Becker, S. Thrun, and K. Obermayer, editors, Advances in Neural Information Processing Systems, volume 15. MIT Press, 2003. +[15] József Fiser, Pietro Berkes, Gergő Orbán, and Mate Lengyel. Statistically optimal perception and learning: from behavior to neural representations. Trends in Cognitive Sciences, 14(3):119-130, March 2010. +[16] Ralf M. Haefner, Pietro Berkes, and József Fiser. Perceptual Decision-Making as Probabilistic Inference by Neural Sampling. Neuron, 90(3):649-660, May 2016. +[17] Gergő Orbán, Pietro Berkes, József Fiser, and Máté Lengyel. Neural variability and sampling-based probabilistic representations in the visual cortex. Neuron, 92(2):530-543, October 2016. +[18] Rodrigo Echeveste, Laurence Aitchison, Guillaume Hennequin, and Máté Lengyel. Cortical-like dynamics in recurrent circuits optimized for sampling-based probabilistic inference. Nature neuroscience, 23(9):1138-1149, 2020. +[19] P. Berkes, G. Orban, M. Lengyel, and J. Fiser. Spontaneous cortical activity reveals hallmarks of an optimal internal model of the environment. Science, 331(6013):83-87, January 2011. +[20] Guillaume Hennequin, Laurence Aitchison, and Mate Lengyel. Fast sampling-based inference in balanced neuronal networks. In Advances in Neural Information Processing Systems 27, pages 2240-2248. 2014. +[21] Laurence Aitchison and Máté Lengyel. The Hamiltonian brain: Efficient probabilistic inference with excitatory-inhibitory neural circuit dynamics. PLOS Computational Biology, 12(12):1-24, 12 2016. +[22] Cristina Savin and Sophie Denéve. Spatio-temporal representations of uncertainty in spiking neural networks. In Advances in Neural Information Processing Systems 27, pages 2024-2032. 2014. +[23] Matej Kristan, Aleš Leonardis, and Danijel Skočaj. Multivariate online kernel density estimation with gaussian kernels. Pattern Recognition, 44(10):2630-2642, 2011. +[24] Camille E. Rullán Buxó and Jonathan W. Pillow. Poisson balanced spiking networks. PLOS Computational Biology, 16(11):e1008261, November 2020. +[25] Martin Boerlin, Christian K. Machens, and Sophie Denève. Predictive coding of dynamical variables in balanced spiking networks. PLoS Computational Biology, 9(11):e1003258, November 2013. + +[26] Wieland Brendel, Ralph Bourdoukan, Pietro Vertechi, Christian K. Machens, and Sophie Denève. Learning to represent signals spike by spike. PLOS Computational Biology, 16(3):e1007692, March 2020. +[27] Sophie Denève and Christian K Machens. Efficient codes and balanced networks. Nature Neuroscience, 19(3):375-382, February 2016. +[28] David Reichert, Peggy Series, and Amos J Storkey. Neuronal adaptation for sampling-based probabilistic inference in perceptual bistability. In Advances in Neural Information Processing Systems, volume 24, 2011. +[29] Cristina Savin, Peter Dayan, and Máté Lengyel. Optimal recall from bounded metaplastic synapses: Predicting functional adaptations in hippocampal area CA3. PLOS Computational Biology, 10(2):1-22, 02 2014. +[30] Todd W. Troyer, Anton E. Krukowski, Nicholas J. Priebe, and Kenneth D. Miller. Contrast-invariant orientation tuning in cat visual cortex: Thalamocortical input tuning and correlation-based intracortical connectivity. Journal of Neuroscience, 18(15):5908-5927, 1998. +[31] Mark M Churchland, Byron M Yu, John P Cunningham, Leo P Sugrue, Marlene R Cohen, Greg S Corrado, William T Newsome, Andrew M Clark, Paymon Hosseini, Benjamin B Scott, David C Bradley, Matthew A Smith, Adam Kohn, J Anthony Movshon, Katherine M Armstrong, Tirin Moore, Steve W Chang, Lawrence H Snyder, Stephen G Lisberger, Nicholas J Priebe, Ian M Finn, David Ferster, Stephen I Ryu, Gopal Santhanam, Maneesh Sahani, and Krishna V Shenoy. Stimulus onset quenches neural variability: a widespread cortical phenomenon. Nature Neuroscience, 13(3):369-378, February 2010. +[32] Alexander S. Ecker, Philipp Berens, Georgios A. Keliris, Matthias Bethge, Nikos K. Logothetis, and Andreas S. Tolias. Decorated neuronal firing in cortical microcircuits. Science, 327(5965):584-587, 2010. +[33] Ian M. Finn, Nicholas J. Priebe, and David Ferster. The emergence of contrast-invariant orientation tuning in simple cells of cat visual cortex. Neuron, 54(1):137-152, April 2007. +[34] Edoardo Balzani and Cristina Savin. Population-level signatures of probabilistic computation. In COSYNE 2019, 2019. +[35] Matthew A. Smith and Adam Kohn. Spatial and temporal scales of neuronal correlation in primary visual cortex. Journal of Neuroscience, 28(48):12591-12603, 2008. +[36] Jamie D. Roitman and Michael N. Shadlen. Response of neurons in the lateral intraparietal area during a combined visual discrimination reaction time task. The Journal of Neuroscience, 22(21):9475-9489, November 2002. +[37] V. Rao, G. C. DeAngelis, and L. H. Snyder. Neural correlates of prior expectations of motion in the lateral intraparietal and middle temporal areas. Journal of Neuroscience, 32(29):10063-10074, July 2012. +[38] Surya Ganguli, James W. Bisley, Jamie D. Roitman, Michael N. Shadlen, Michael E. Goldberg, and Kenneth D. Miller. One-dimensional dynamics of attention and decision making in LIP. Neuron, 58(1):15-25, April 2008. +[39] Gouki Okazawa, Long Sha, and Roozbeh Kiani. Linear integration of sensory evidence over space and time underlies face categorization. Cell (in press), November 2020. +[40] Hansem Sohn, Devika Narain, Nicolas Meirhaeghe, and Mehrdad Jazayeri. Bayesian computation through cortical latent dynamics. Neuron, 103(5):934-947.e5, September 2019. +[41] Daniel E. Acuna and Paul Schrater. Structure learning in human sequential decision-making. PLOS Computational Biology, 6(12):1-12, 12 2010. +[42] Anne E Urai, Jan Willem De Gee, Konstantinos Tsetsos, and Tobias H Donner. Choice history biases subsequent evidence accumulation. *Elife*, 8:e46331, 2019. + +[43] Angela J Yu and Jonathan D Cohen. Sequential effects: Superstition or rational behavior? In Advances in Neural Information Processing Systems 21, pages 1873-1880. 2009. +[44] Christopher M Glaze, Joseph W Kable, and Joshua I Gold. Normative evidence accumulation in unpredictable environments. eLife, 4, August 2015. +[45] Jeffrey S Bowers and Colin J Davis. Bayesian just-so stories in psychology and neuroscience. Psychological bulletin, 138(3):389, 2012. +[46] Dobromir Rahnev and Rachel N Denison. Suboptimality in perceptual decision making. Behavioral and Brain Sciences, 41, 2018. +[47] A Emin Orhan and Wei Ji Ma. Efficient probabilistic inference in generic neural networks trained with non-probabilistic feedback. Nature communications, 8(1):1-14, 2017. +[48] Jeff Beck, Ralf Haefner, Xaq Pitkow, Cristina Savin, and Eszter Vertes. Competing theories of probabilistic computations in the brain. https://openreview.net/forum?id=uZMMO2ob150. Accessed: 2021-05-28. +[49] J. M. Beck, P. E. Latham, and A. Pouget. Marginalization in neural circuits with divisive normalization. Journal of Neuroscience, 31(43):15310-15319, October 2011. +[50] Richard D. Lange, Sabyasachi Shivkumar, Ankani Chattoraj, and Ralf M. Haefner. Bayesian encoding and decoding as distinct perspectives on neural coding. bioarxiv, October 2020. +[51] David C Van Essen, Charles H Anderson, and Bruno A Olshausen. Dynamic routing strategies in sensory, motor, and cognitive processing. Large-scale neuronal theories of the brain, pages 271-299, 1994. +[52] Christopher H Donahue and Daeyeol Lee. Dynamic routing of task-relevant signals for decision making in dorsolateral prefrontal cortex. Nature neuroscience, 18(2):295-301, 2015. +[53] Guangyu Robert Yang, John D Murray, and Xiao-Jing Wang. A dendritic disinhibitory circuit mechanism for pathway-specific gating. Nature communications, 7(1):1-14, 2016. +[54] John P Cunningham and Byron M Yu. Dimensionality reduction for large-scale neural recordings. Nature Neuroscience, 17(11):1500-1509, August 2014. +[55] Jakob H Macke, Lars Busing, John P. Cunningham, Byron M. Yu, Krishna V. Shenoy, and Maneesh Sahani. Empirical models of spiking in neural populations. Advances in Neural Information Processing Systems 24, 2011. +[56] Jeffrey M. Beck, Wei Ji Ma, Xaq Pitkow, Peter E. Latham, and Alexandre Pouget. Not Noisy, Just Wrong: The Role of Suboptimal Inference in Behavioral Variability. Neuron, 74(1):30-39, April 2012. +[57] Anna Kutschireiter, Simone Carlo Surace, Henning Sprekeler, and Jean-Pascal Pfister. Nonlinear Bayesian filtering and learning: a neuronal dynamics for perception. Scientific Reports, 7(1):8722, December 2017. \ No newline at end of file diff --git a/asamplingbasedcircuitforoptimaldecisionmaking/images.zip b/asamplingbasedcircuitforoptimaldecisionmaking/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..2d00e392d001885bd77c7900f941424cffda14a6 --- /dev/null +++ b/asamplingbasedcircuitforoptimaldecisionmaking/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3a782da8ecb155fd235712d0f4f513c31a27220306eda5497216f2eddbfb4a85 +size 395652 diff --git a/asamplingbasedcircuitforoptimaldecisionmaking/layout.json b/asamplingbasedcircuitforoptimaldecisionmaking/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ae75dfe2dfa43be9f27781513e65156121e21217 --- /dev/null +++ b/asamplingbasedcircuitforoptimaldecisionmaking/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f720c530fb15a1c02ad023dbcd03423fa7792d8d64ee149a6a83c8d308bbfe74 +size 344570 diff --git a/aselfconsistenttheoryofgaussianprocessescapturesfeaturelearningeffectsinfinitecnns/b1ba7970-64f8-4dbc-8fcc-c0a73b486535_content_list.json b/aselfconsistenttheoryofgaussianprocessescapturesfeaturelearningeffectsinfinitecnns/b1ba7970-64f8-4dbc-8fcc-c0a73b486535_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..99bdaca71efab04cff555b6aa0f93c708cae1642 --- /dev/null +++ b/aselfconsistenttheoryofgaussianprocessescapturesfeaturelearningeffectsinfinitecnns/b1ba7970-64f8-4dbc-8fcc-c0a73b486535_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f931e328931d63c47520f392ff90df073a433089e8729ffadf342a1274f8912e +size 83954 diff --git a/aselfconsistenttheoryofgaussianprocessescapturesfeaturelearningeffectsinfinitecnns/b1ba7970-64f8-4dbc-8fcc-c0a73b486535_model.json b/aselfconsistenttheoryofgaussianprocessescapturesfeaturelearningeffectsinfinitecnns/b1ba7970-64f8-4dbc-8fcc-c0a73b486535_model.json new file mode 100644 index 0000000000000000000000000000000000000000..de3f3a4212037debc39d0d7a76cfdba16df21a7d --- /dev/null +++ b/aselfconsistenttheoryofgaussianprocessescapturesfeaturelearningeffectsinfinitecnns/b1ba7970-64f8-4dbc-8fcc-c0a73b486535_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:11a2df7d63fa46766a1e903ad55ae7a90bb87c85c049c6014350c4649c549272 +size 101475 diff --git a/aselfconsistenttheoryofgaussianprocessescapturesfeaturelearningeffectsinfinitecnns/b1ba7970-64f8-4dbc-8fcc-c0a73b486535_origin.pdf b/aselfconsistenttheoryofgaussianprocessescapturesfeaturelearningeffectsinfinitecnns/b1ba7970-64f8-4dbc-8fcc-c0a73b486535_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fb2542ff940367c49fa99a462235e06758c92037 --- /dev/null +++ b/aselfconsistenttheoryofgaussianprocessescapturesfeaturelearningeffectsinfinitecnns/b1ba7970-64f8-4dbc-8fcc-c0a73b486535_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:03682f12d79c12d71105974f953e837e02d2df44525e60e7d56251d47abad174 +size 1707171 diff --git a/aselfconsistenttheoryofgaussianprocessescapturesfeaturelearningeffectsinfinitecnns/full.md b/aselfconsistenttheoryofgaussianprocessescapturesfeaturelearningeffectsinfinitecnns/full.md new file mode 100644 index 0000000000000000000000000000000000000000..26c99e48a60018413a243d4bf96f236188f9f144 --- /dev/null +++ b/aselfconsistenttheoryofgaussianprocessescapturesfeaturelearningeffectsinfinitecnns/full.md @@ -0,0 +1,337 @@ +# A self-consistent theory of Gaussian Processes captures feature learning effects in finite CNNs + +Gadi Naveh + +Racah Institute of Physics + +Hebrew University + +Jerusalem, Israel 91904 + +gad.mintz@mail.huji.ac.il + +Zohar Ringel + +Racah Institute of Physics + +Hebrew University + +Jerusalem, Israel 91904 + +zohar.ringel@mail.huji.ac.il + +# Abstract + +Deep neural networks (DNNs) in the infinite width/channel limit have received much attention recently, as they provide a clear analytical window to deep learning via mappings to Gaussian Processes (GPs). Despite its theoretical appeal, this viewpoint lacks a crucial ingredient of deep learning in finite DNNs, laying at the heart of their success — feature learning. Here we consider DNNs trained with noisy gradient descent on a large training set and derive a self-consistent Gaussian Process theory accounting for strong finite-DNN and feature learning effects. Applying this to a toy model of a two-layer linear convolutional neural network (CNN) shows good agreement with experiments. We further identify, both analytically and numerically, a sharp transition between a feature learning regime and a lazy learning regime in this model. Strong finite-DNN effects are also derived for a non-linear two-layer fully connected network. We have numerical evidence demonstrating that the assumptions required for our theory hold true in more realistic settings (Myrtle5 CNN trained on CIFAR-10). Our self-consistent theory provides a rich and versatile analytical framework for studying strong finite-DNN effects, most notably - feature learning. + +# 1 Introduction + +The correspondence between Gaussian Processes (GPs) and deep neural networks (DNNs) has been instrumental in advancing our understanding of these complex algorithms. Early results related randomly initialized strongly over-parameterized DNNs with GP priors [33, 24, 30]. More recent results considered training using gradient flow (or noisy gradients), where DNNs, potentially following some ensembling, map to Bayesian inference on GPs governed by the neural tangent kernel [21, 25, 18] (or the NNGP kernel [32]). These correspondences carry over to a wide variety of architectures, going beyond fully connected networks (FCNs) to convolutional neural networks (CNNs) [4, 36], recurrent neural networks (RNNs) [2] and even attention networks [20]. They provide us with closed analytical expressions for the outputs of strongly over-parameterized trained DNNs, which have been used to make accurate predictions for DNN learning curves [11, 9, 8]. + +Despite their theoretical appeal, GPs are unable to capture feature learning [47, 46], which is a well-observed key property of trained DNNs. Indeed, it was noticed [21] that as the width tends to infinity, the neural tangent kernel (NTK) tends to a constant kernel that does not evolve during training and the weights in hidden layers change infinitesimally from their initialization values. This regime of training was thus dubbed lazy training [10]. Other studies showed that for CNNs trained on image classification tasks, the feature learning regime generally tends to outperform the lazy regime [15, 14, 23]. Clearly, working in the feature learning regime is also crucial for performing transfer learning [45, 46]. + +It is therefore desirable to have a theoretical approach to deep learning which enjoys the generality and analytical power of GPs while capturing feature learning effects in finite DNNs. Here we make several contributions towards this goal: + +1. We show that the mean predictor of a finite DNN trained on a large data set with noisy gradients, weight decay and MSE loss, can be obtained from GP regression on a shifted target (§3). Central to our approach is a non-linear self-consistent equation involving the higher cumulants of the finite DNN (at initialization) which predicts this target shift. +2. Using this machinery on a toy model of a two-layer linear CNN in a teacher-student setting, we derive explicit analytical predictions which are in very good agreement with experiments even well away from the GP/lazy-learning regime (large number of channels, $C$ ) thus accounting for strong finite-DNN corrections (§4.1). The match to empirical values of our theory in this toy model is shown to be clearly superior to two alternative theoretical predictions, one of them being a purely perturbative theory. Similarly strong corrections to GPs, yielding qualitative improvements in performance, are demonstrated for the quadratic two-layer fully connected model of Ref. [28]. +3. We show how our framework can be used to study statistical properties of weights in hidden layers. In particular, in the CNN toy model, we identify, both analytically and numerically, a sharp transition between a feature learning phase and a lazy learning phase (§4.1.4). We define the feature learning phase as the regime where the features of the teacher network leave a clear signature in the spectrum of the student's hidden weights posterior covariance matrix. In essence, this phase transition is analogous to the transition associated with the recovery of a low-rank signal matrix from a noisy matrix taken from the Wishart ensemble, when varying the strength of the low-rank component [6]. + +# 1.1 Additional related work + +Several previous papers derived leading order finite-DNN corrections to the GP results [32, 44, 13, 39]. While these results are in principle extendable to any order in perturbation theory, such high order expansions have not been studied much, perhaps due to their complexity. These previous perturbative approaches are expected to be satisfactory only when the GP limit already gives a reasonable approximation to the DNN behavior. In contrast, we develop an analytically tractable non-perturbative approach which we find crucial for obtaining non-negligible feature learning and associated performance enhancement effects. + +Previous works [15, 14, 43] studied how the behavior of infinite DNNs depends on the scaling of the top layer weights with its width. In [45] it is shown that the standard and NTK parameterizations of a neural network do not admit an infinite-width limit that can learn features, and instead suggest an alternative parameterization which can learn features in this limit. While unifying various viewpoints on infinite DNNs, this approach does not immediately lend itself to analytical analysis of the kind proposed here. Also, in our work, feature learning as a purely finite-width effect. + +Several works [38, 27, 16, 3] show that finite width models can generalize either better or worse than their infinite width counterparts, and provide examples where the relative performance depends on the optimization details, the DNN architecture and the statistics of the data. Another study [1] considered cases where the enhanced flexibility of a finite DNN relative to its infinite width counterpart provides the former with superior performance. Here we demonstrate analytically that finite DNNs outperform their GP counterparts when the latter have a prior that lacks some constraint found in the data (e.g. positive-definiteness [28] or translation invariance / equivariance [36]). + +Deep linear networks (FCNs and CNNs) similar to our CNN toy example have been studied in the literature [5, 40, 22, 17]. These studies use different approaches and assumptions and do not discuss the target shift mechanism which applies also for non-linear CNNs. In addition, their analytical results hinge strongly on linearity whereas our approach could be useful whenever several leading cumulants of the DNN output are known or can be approximated, and we give an example of this in a non-linear setting in §4.2. While there are some similarities between the phase transition we discuss in §4.1.4 and the one appearing in Ref. [22], there are several important differences, to mention one of them: that study considers the statistics of a noisy teacher, whereas we consider the statistics of the first layer of the trained student network. + +Two concurrent works [48, 34] derived exact expressions for the output priors of finite FCNs induced by Gaussian priors over their weights. However, these results only apply to the limited case of a prior over a single training point and only for a FCN. In contrast, our approach applies to the setting of a large training set, it is not restricted to FCNs and yields results for the posterior predictions, not the prior. Focusing on deep linear fully connected DNNs, recent work [26] derived analytical finite-width renormalization results for the GP kernel, by sequentially integrating out the weights of the DNN, starting from the output layer and working backwards towards the input. Our analytical approach, its scope, and the models studied here differ substantially from that work. + +# 2 Preliminaries + +We consider a fixed set of $n$ training inputs $\{\mathbf{x}_{\mu}\}_{\mu = 1}^{n}\subset \mathbb{R}^{d}$ and a single test point $\mathbf{x}_*$ over which we wish to model the distribution of the outputs of a DNN. We consider a generic DNN architecture where for simplicity we assume a scalar output $f(\mathbf{x})\in \mathbb{R}$ . The learnable parameters of the DNN that determine its output, are collected into a single vector $\theta$ . We pack the outputs evaluated on the training set and on the test point into a vector $\vec{f}\equiv (f(\mathbf{x}_1),\dots,f(\mathbf{x}_n),f(\mathbf{x}_{n + 1}))\in \mathbb{R}^{n + 1}$ , where we denoted the test point as $\mathbf{x}_{*} = \mathbf{x}_{n + 1}$ . We train the DNNs using full-batch gradient decent with weight decay and external white Gaussian noise. The discrete dynamics of the parameters are thus + +$$ +\theta_ {t + 1} - \theta_ {t} = - (\gamma \theta_ {t} + \nabla_ {\theta} \mathcal {L} (f _ {\theta})) \eta + 2 \sigma \sqrt {\eta} \xi_ {t} \tag {1} +$$ + +where $\theta_{t}$ is the vector of all network parameters at time step $t$ , $\gamma$ is the strength of the weight decay, $\mathcal{L}(f_{\theta})$ is the loss as a function of the DNN output $f_{\theta}$ (where we have emphasized the dependence on the parameters $\theta$ ), $\sigma$ is the magnitude of noise, $\eta$ is the learning rate and $\xi_{t} \sim \mathcal{N}(0,I)$ . As $\eta \rightarrow 0$ this discrete-time dynamics converge to the continuous-time Langevin equation given by $\dot{\theta}(t) = -\nabla_{\theta}\left(\frac{\gamma}{2}\|\theta(t)\|^{2} + \mathcal{L}(f_{\theta})\right) + 2\sigma\xi(t)$ with $\langle\xi_{i}(t)\xi_{j}(t^{\prime})\rangle = \delta_{ij}\delta(t - t^{\prime})$ , so that as $t \to \infty$ the DNN parameters $\theta$ will be sampled from the equilibrium Gibbs distribution $P(\theta)$ . + +As shown in [32], the parameter distribution $P(\theta)$ induces a posterior distribution over the trained DNN outputs $P(\vec{f})$ with the following partition function: + +$$ +Z (\vec {J}) = \int d \vec {f} P _ {0} (\vec {f}) \exp \left(- \frac {1}{2 \sigma^ {2}} \mathcal {L} \left(\left\{f _ {\mu} \right\} _ {\mu = 1} ^ {n}, \left\{g _ {\mu} \right\} _ {\mu = 1} ^ {n}\right) + \sum_ {\mu = 1} ^ {n + 1} J _ {\mu} f _ {\mu}\right) \tag {2} +$$ + +Here $P_0(\vec{f})$ is the prior generated by the finite-DNN with $\theta$ drawn from $\mathcal{N}(0,2\sigma^2 /\gamma)$ where the weight decay $\gamma$ may be layer-dependent, $\{g_{\mu}\}_{\mu = 1}^{n}$ are the training targets and $\vec{J}$ are source terms used to calculate the statistics of $f$ . We keep the loss function $\mathcal{L}$ arbitrary at this point, committing to a specific choice in the next section. As standard [19], to calculate the posterior mean at any of the training points or the test point $\mathbf{x}_{n + 1}$ from this partition function one uses + +$$ +\forall \mu \in \{1, \dots , n + 1 \}: \quad \left\langle f _ {\mu} \right\rangle = \partial_ {J _ {\mu}} \log Z (\vec {J}) \Bigg | _ {\vec {J} = \vec {0}} \tag {3} +$$ + +# 3 A self-consistent theory for the posterior mean and covariance + +In this section we show that for a large training set, the posterior mean predictor (Eq. 3) amounts to GP regression on a shifted target $(g_{\mu}\rightarrow g_{\mu} - \Delta g_{\mu})$ . This shift to the target $(\Delta g_{\mu})$ is determined by solving certain self-consistent equations involving the cumulants of the prior $P_0(\vec{f})$ . For concreteness, we focus here on the MSE loss $\mathcal{L} = \sum_{\mu = 1}^{n}\left(f_{\mu} - g_{\mu}\right)^{2}$ and comment on extensions to other losses, e.g. the cross entropy, in App. C. To this end, consider first the prior of the output of a finite DNN. Using standard manipulations (see App. A), it can be expressed as follows + +$$ +P _ {0} (\vec {f}) \propto \int_ {\mathbb {R} ^ {n + 1}} d \vec {t} \exp \left(- \sum_ {\mu = 1} ^ {n + 1} i t _ {\mu} f _ {\mu} + \sum_ {r = 2} ^ {\infty} \frac {1}{r !} \sum_ {\mu_ {1}, \dots , \mu_ {r} = 1} ^ {n + 1} \kappa_ {\mu_ {1}, \dots , \mu_ {r}} i t _ {\mu_ {1}} \dots i t _ {\mu_ {r}}\right) \tag {4} +$$ + +where $\kappa_{\mu_1,\dots,\mu_r}$ is the $r$ 'th multivariate cumulant of $P_0(\vec{f})$ [31]. The second term in the exponent is the cumulant generating function (CGF), denoted by $\mathcal{C}(\vec{t})$ , corresponding to $P_0$ . As discussed in + +App. B and Ref. [32], for standard initialization protocols the $r$ 'th cumulant will scale as $1 / C^{(r / 2 - 1)}$ , where $C$ controls the over-parameterization, e.g. number of neurons / channels in each layer for FCNs / CNNs, respectively. The second $(r = 2)$ cumulant which is $C$ -independent, describes the NNGP kernel of the finite DNN and is denoted by $K(\mathbf{x}_{\mu_1},\mathbf{x}_{\mu_2}) = \kappa_{\mu_1,\mu_2}$ . + +Consider first the case of $C \to \infty$ [24, 30, 33] where all $r > 2$ cumulants vanish. Here one can explicitly perform the integration in Eq. 4 to obtain the standard GP prior $P_0(\vec{f}) \propto \exp\left(-\frac{1}{2} \sum_{\mu_1, \mu_2 = 1}^{n + 1} \kappa_{\mu_1, \mu_2} f_{\mu_1} f_{\mu_2}\right)$ . Plugging this prior into Eq. 2 with MSE loss, one recovers standard GP regression formulas [37]. In particular, the predictive mean at $\mathbf{x}_*$ is: $\langle f(\mathbf{x}_*) \rangle = \sum_{\mu, \nu = 1}^{n} K_\mu^* \tilde{K}_{\mu\nu}^{-1} g_\nu$ where $K_\mu^* = K(\mathbf{x}_*, \mathbf{x}_*)$ and $\tilde{K}_{\mu\nu} = K(\mathbf{x}_\mu, \mathbf{x}_\nu) + \sigma^2 \delta_{\mu\nu}$ . Another set of quantities we shall find useful are the discrepancies in GP prediction, which for the training set read + +$$ +\left. \forall \mu \in \{1, \dots , n \}: \quad \langle \hat {\delta} g _ {\mu} \rangle \equiv g _ {\mu} - \langle f (\mathbf {x} _ {\mu}) \rangle = g _ {\mu} - \sum_ {\nu , \nu^ {\prime} = 1} ^ {n} K _ {\mu \nu^ {\prime}} \tilde {K} _ {\nu^ {\prime}, \nu} ^ {- 1} g _ {\nu} \right. \tag {5} +$$ + +Saddle-point approximation for the mean predictor. For a DNN with finite $C$ , the prior $P_0(\vec{f})$ will no longer be Gaussian and cumulants with $r > 2$ would contribute. This renders the partition function in Eq. 2 intractable and so some approximation is needed to make progress. To this end we note that $f$ can be integrated out (see App. A.1) to yield a partition function of the form + +$$ +Z (\vec {J}) \propto \int_ {\mathbb {R} ^ {n}} d t _ {1} \dots d t _ {n} e ^ {- S (\vec {t}, \vec {J})} \tag {6} +$$ + +where $S(\vec{t},\vec{J})$ is the action whose exact form is given in Eq. A.14. Interestingly, the $it_{\mu}$ variables appearing above are closely related to the discrepancies $\hat{\delta} g_{\mu}$ , in particular $\langle it_{\mu}\rangle = \langle \hat{\delta} g_{\mu}\rangle /\sigma^{2}$ . + +To proceed analytically we adopt the saddle-point (SP) approximation [12] which often relies on having a partition function of the form $Z = \int dte^{-nS(t)}$ where $n$ is a large number and $S$ is $O(1)$ . In our settings we cannot simply extract such a large factor from the action and make it $O(1)$ . Nonetheless, we argue in App. A.4 that the saddle-point is still a good approximation for large $n$ (training set size). This relies on the fact that the non-linear terms in the action comprise of a sum of many $it_{\mu}$ 's. Given that this sum is dominated by collective effects coming from all data points (as opposed to only a selected few), expanding $S(\vec{t},\vec{J})$ around the saddle-point yields terms with increasingly negative powers of $n$ . + +For the training points $\mu \in \{1,\dots ,n\}$ , taking the saddle-point approximation amounts to setting $\partial_{it_\mu}S(\vec{t},\vec{J})\bigg|_{\vec{J} = \vec{0}} = 0$ . This yields a set of equations that has precisely the form of Eq. 5, but where the target is shifted as $g_{\nu}\rightarrow g_{\nu} - \Delta g_{\nu}$ and the target shift is determined self-consistently by + +$$ +\Delta g _ {\nu} = \sum_ {r = 3} ^ {\infty} \frac {1}{(r - 1) !} \sum_ {\mu_ {1}, \dots , \mu_ {r - 1} = 1} ^ {n} \kappa_ {\nu , \mu_ {1}, \dots , \mu_ {r - 1}} \left\langle \sigma^ {- 2} \hat {\delta} g _ {\mu_ {1}} \right\rangle \dots \left\langle \sigma^ {- 2} \hat {\delta} g _ {\mu_ {r - 1}} \right\rangle \tag {7} +$$ + +Equation 7 is thus an implicit equation for $\Delta g_{\nu}$ involving all training points, and it holds for the training set and the test point $\nu \in \{1,\dots ,n + 1\}$ . Once solved, either analytically or numerically, one calculates the predictions on the test point via + +$$ +\langle f _ {*} \rangle = \Delta g _ {*} + \sum_ {\mu , \nu = 1} ^ {n} K _ {\mu} ^ {*} \tilde {K} _ {\mu \nu} ^ {- 1} \left(g _ {\nu} - \Delta g _ {\nu}\right) \tag {8} +$$ + +Equation 5 with $g_{\nu}\rightarrow g_{\nu} - \Delta g_{\nu}$ along with Eqs. 7 and 8 are the first main result of this paper. Viewed as an algorithm, the procedure to predict the finite DNN's output on a test point $\mathbf{x}_{*}$ is as follows: we shift the target in Eq. 5 as $g\to g - \Delta g$ with $\Delta g$ as in Eq. 7, arriving at a closed equation for the average discrepancies $\langle \hat{\delta} g_{\mu}\rangle$ on the training set. For some models, the cumulants $\kappa_{\nu ,\mu_2,\dots ,\mu_r}$ can be computed for any order $r$ and it can be possible to sum the entire series, while for other models several leading cumulants might already give a reasonable approximation due to their $1 / C^{r / 2 - 1}$ + +scaling. The resulting coupled non-linear equations can then be solved numerically, to obtain $\Delta g_{\mu}$ from which predictions on the test point are calculated using Eq. 8. + +Notwithstanding, solving such equations analytically is challenging and one of our main goals here is to provide concrete analytical insights. Thus, in §4.1.2 we propose an additional approximation wherein to leading order we replace all summations over data-points with integrals over the measure from which the data-set is drawn. This approximation, taken in some cases beyond leading order as in Ref. [11], will yield analytically tractable equations which we solve for two simple toy models, one of a linear CNN and the other of a non-linear FCN. + +Saddle-point plus Gaussian fluctuations for the posterior covariance. The SP approximation can be extended to compute the predictor variance by expanding the action $S$ to quadratic order in the deviation from the SP value $\delta t_{\mu} \equiv t_{\mu} - t_{\mu}^{\mathrm{SP}}$ (see App. A.3). Due to the saddle-point being an extremum this leads to $S \approx S_{\mathrm{SP}} + \frac{1}{2}\sum_{\mu,\nu}\delta t_{\mu}A_{\mu\nu}^{-1}\delta t_{\nu}$ . This leaves the previous SP approximation for the posterior mean on the training set unaffected (since the mean and maximizer of a Gaussian coincide), but is necessary to get sensible results for the posterior covariance. Using the standard Gaussian integration formula, one finds that $A_{\mu\nu}$ is the covariance matrix of $it_{\mu}$ . Performing such an expansion one finds + +$$ +A _ {\mu \nu} ^ {- 1} = - \left(\sigma^ {2} \delta_ {\mu \nu} + K _ {\mu \nu} + \Delta K _ {\mu \nu}\right) \tag {9} +$$ + +$$ +\Delta K _ {\mu \nu} = \partial_ {i t _ {\mu}} \partial_ {i t _ {\nu}} \tilde {C} (i t _ {1}, \dots , i t _ {n}) +$$ + +where the $it$ 's on the r.h.s. are those of the saddle-point and $\tilde{\mathcal{C}}$ is the CGF $\mathcal{C}$ without the second cumulant (see App. A.1). This gives an expression for the posterior covariance matrix on the training set: + +$$ +\Sigma_ {\mu \nu} \equiv \left\langle f _ {\mu} f _ {\nu} \right\rangle - \left\langle f _ {\mu} \right\rangle \left\langle f _ {\nu} \right\rangle = - \sigma^ {4} \left[ \sigma^ {2} I + K + \Delta K \right] _ {\mu \nu} ^ {- 1} + \sigma^ {2} \delta_ {\mu \nu} \tag {10} +$$ + +where the r.h.s. coincides with the posterior covariance of a GP with a kernel equal to $K + \Delta K$ [37]. The variance on the test point is given by (repeating indices are summed over the training set) + +$$ +\Sigma_ {* *} = K _ {* *} - K _ {\mu} ^ {*} A _ {\mu \nu} ^ {- 1} K _ {\nu} ^ {*} + \left\langle \partial_ {i t _ {*}} ^ {2} \tilde {\mathcal {C}} | _ {i t _ {*} = 0} \right\rangle + 2 \left(\left\langle \Delta g _ {*} K _ {\mu} ^ {*} i t _ {\mu} \right\rangle - \left\langle \Delta g _ {*} \right\rangle \left\langle K _ {\mu} ^ {*} i t _ {\mu} \right\rangle\right) + \operatorname {V a r} (\Delta g _ {*}) \tag {11} +$$ + +where here $\Delta g_{*}$ is as in Eq. 7 but where the $\left\langle \sigma^{-2}\hat{\delta} g_{\mu}\right\rangle$ ’s are replaced the $it_{\mu}$ 's that have Gaussian fluctuations. The first two terms in Eq. 11 yield the standard result for the GP posterior covariance matrix on a test point [37], for the case of $\Delta K = 0$ (see Eq. 9). The rest of the terms can be evaluated by the SP plus Gaussian fluctuations approximation, where the details would depend on the model at hand. + +# 4 Experiments + +# 4.1 The two layer linear CNN + +# 4.1.1 Setting of the model and its properties + +Here we define a teacher-student toy model showing several qualitative real-world aspects of feature learning and analyze it via our self-consistent shifted target approach. Concretely, we consider the simplest student CNN $f(\mathbf{x})$ , having one hidden layer with linear activation, and a corresponding teacher CNN, $g(\mathbf{x})$ + +$$ +f (\mathbf {x}) = \sum_ {i = 1} ^ {N} \sum_ {c = 1} ^ {C} a _ {i, c} \mathbf {w} _ {c} \cdot \tilde {\mathbf {x}} _ {i} \quad g (\mathbf {x}) = \sum_ {i = 1} ^ {N} \sum_ {c = 1} ^ {C ^ {*}} a _ {i, c} ^ {*} \mathbf {w} _ {c} ^ {*} \cdot \tilde {\mathbf {x}} _ {i} \tag {12} +$$ + +This describes a CNN that performs 1-dimensional convolution where the convolutional weights for each channel are $\mathbf{w}_c\in \mathbb{R}^S$ . These are dotted with a convolutional window of the input $\tilde{\mathbf{x}}_i = (x_{S(i - 1) + 1},\ldots ,x_{S\cdot i})^\top \in \mathbb{R}^S$ and there are no overlaps between them so that $\mathbf{x} = (x_{1},\dots,x_{N\cdot S})^{\top} = (\tilde{\mathbf{x}}_1,\dots,\tilde{\mathbf{x}}_N)^{\top}\in \mathbb{R}^{N\cdot S}$ . Namely, the input dimension is $d = NS$ , where $N$ is + +the number of (non-overlapping) convolutional windows, $S$ is the stride of the conv-kernel and it is also the length of the conv-kernel, hence there is no overlap between the strides. The inputs $\mathbf{x}$ are sampled from $\mathcal{N}(0, I_d)$ . + +Despite its simplicity, this model distils several key differences between feature learning models and lazy learning or GP models. Due to the lack of pooling layers, the GP associated with the student fails to take advantage of the weight sharing property of the underlying CNN [36]. In fact, here it coincides with a GP of a fully-connected DNN (see Eq. 13) which is quite inappropriate for the task. We thus expect that the finite network will have good performance already for $n = C^{*}(N + S)$ whereas the GP will need $n$ of order of the dimension ( $NS$ ) to learn well [11]. Thus, for $N + S \ll NS$ there should be a broad regime in the value of $n$ where the finite network substantially outperforms the corresponding GP. We later show (§4.1.4) that this performance boost over GP is due to feature learning, as one may expect. + +Conveniently, the cumulants of the student DNN of any order can be worked out exactly. Assuming $\gamma$ and $\sigma^2$ of the noisy GD training are chosen such that $a_{i,c} \sim \mathcal{N}\left(0, \sigma_a^2 / CN\right)$ , $\mathbf{w}_c \sim \mathcal{N}\left(\mathbf{0}, \frac{\sigma_w^2}{S} I_S\right)$ (and similarly for the teacher DNN) the covariance function for the associated GP reads + +$$ +K \left(\mathbf {x}, \mathbf {x} ^ {\prime}\right) = \frac {\sigma_ {a} ^ {2} \sigma_ {w} ^ {2}}{N S} \sum_ {i = 1} ^ {N} \tilde {\mathbf {x}} _ {i} ^ {\top} \tilde {\mathbf {x}} _ {i} ^ {\prime} = \frac {\sigma_ {a} ^ {2} \sigma_ {w} ^ {2}}{N S} \mathbf {x} ^ {\top} \mathbf {x} ^ {\prime} \tag {13} +$$ + +Denoting $\lambda := \frac{\sigma_a^2}{N} \frac{\sigma_w^2}{S}$ , the even cumulant of arbitrary order $2m$ is (see App. F): + +$$ +\kappa_ {2 m} \left(\mathbf {x} _ {1}, \dots , \mathbf {x} _ {2 m}\right) = \frac {\lambda^ {m}}{C ^ {m - 1}} \sum_ {i _ {1}, \dots , i _ {m} = 1} ^ {N} \left(\boldsymbol {\bullet} _ {i _ {1}}, \boldsymbol {\bullet} _ {i _ {2}}\right) \dots \left(\boldsymbol {\bullet} _ {i _ {m - 2}}, \boldsymbol {\bullet} _ {i _ {m - 1}}\right) \left(\boldsymbol {\bullet} _ {i _ {m - 1}}, \boldsymbol {\bullet} _ {i _ {m}}\right) \dots [ (2 m - 1)! ] \tag {14} +$$ + +while all odd cumulants vanish due to the sign flip symmetry of the last layer. In this notation, we mean that the $\bullet$ 's stand for integers in $\{1, \ldots, 2m\}$ and e.g. $(1_{i_1}, 2_{i_2}) \equiv (\tilde{\mathbf{x}}_{i_1}^1 \cdot \tilde{\mathbf{x}}_{i_2}^2)$ and the bracket notation $[(2m - 1)!]$ stands for the number of ways to pair the integers $\{1, \ldots, 2m\}$ into the above form. This result can then be plugged in 7 to obtain the self-consistent (saddle-point) equations on the training set. See App. A.4 for a convergence criterion for the saddle-point, supporting its application here. + +# 4.1.2 Self-consistent equation in the limit of a large training set + +In §3 our description of the self-consistent equations was for a finite and fixed training set. Further analytical insight can be gained if we consider the limit of a large training set, known in the GP literature as the Equivalent Kernel (EK) limit [37, 42]. For a short review of this topic, see App. D. In essence, in the EK limit we replace the discrete sums over a specific draw of training set, as in Eqs. 5, 7, 8, with integrals over the entire input distribution $\mu(\mathbf{x})$ . Given a kernel that admits a spectral decomposition in terms of its eigenvalues and eigenfunctions: $K(\mathbf{x}, \mathbf{x}') = \sum_{s} \lambda_s \psi_s(\mathbf{x}) \psi_s(\mathbf{x}')$ , the standard result for the GP posterior mean at a test point is approximated by [37] + +$$ +\langle f (\mathbf {x} _ {*}) \rangle = \int d \mu (\mathbf {x}) h (\mathbf {x} _ {*}, \mathbf {x}) g (\mathbf {x}); \quad h (\mathbf {x} _ {*}, \mathbf {x}) = \sum_ {s} \frac {\lambda_ {s}}{\lambda_ {s} + \sigma^ {2} / n} \psi_ {s} (\mathbf {x} _ {*}) \psi_ {s} (\mathbf {x}) \tag {15} +$$ + +This has several advantages, already at the level of GP analysis. From a theoretical point of view, the integral expressions retain the symmetries of the kernel $K(\mathbf{x},\mathbf{x}^{\prime})$ unlike the discrete sums that ruin these symmetries. Also, Eq. 15 does not involve computing the inverse matrix $\tilde{K}^{-1}$ which is costly for large matrices. + +In the context of our theory, the EK limit allows for a derivation of a simple analytical form for the self-consistent equations. As shown in App. E.1, in our toy CNN we can write both $\Delta g$ and $\hat{\delta}g$ in terms of the target $g$ using corresponding proportionality factors. Thus the self-consistent equations can be reduced to a single equation governing the proportionality factor $\alpha$ between $\hat{\delta}g$ and $g$ ( $\hat{\delta}g = \alpha g$ ). Notice that $\alpha$ itself is governed by an equation that is non-linear in $g$ , which means that $\Delta g$ and $\hat{\delta}g$ do not scale linearly with $g$ , only that we can trade the function-valued self-consistent + +equation for a scalar-valued one. Thus, starting from the general self-consistent equations, 5, 7, 8, taking their EK limit, and plugging in the general cumulant for our toy model (14) we arrive at the following equation for $\alpha$ + +$$ +\alpha = \frac {\sigma^ {2} / n}{\lambda + \sigma^ {2} / n} + \frac {(1 - q) \lambda}{\lambda + \sigma^ {2} / n} + \left(q \frac {\lambda}{\lambda + \sigma^ {2} / n} - 1\right) \frac {\lambda^ {2}}{C} \left(\frac {\alpha}{\sigma^ {2} / n}\right) ^ {3} \left[ 1 - \frac {\lambda}{C} \left(\frac {\alpha}{\sigma^ {2} / n}\right) ^ {2} \right] ^ {- 1} \tag {16} +$$ + +Setting for simplicity $\sigma_{a}^{2} = 1 = \sigma_{w}^{2}$ we have $\lambda = 1 / (NS)$ and we also introduced the constant $q\equiv \lambda^{-1}(1 - \hat{\alpha}_{\mathrm{GP}})(\lambda +\sigma^2 /n)$ where $\hat{\alpha}_{\mathrm{GP}}$ is computed using the empirical GP predictions on either the training set or test set: $\hat{\alpha}_{\mathrm{GP}}\equiv 1 - \left(\sum_{\mu}f_{\mu}^{\mathrm{GP}}g_{\mu}\right) / \left(\sum_{\mu}g_{\mu}^{2}\right)$ , or analytically in the perturbation theory approach developed in [11]. The quantity $q$ has an interpretation as a $1 / n$ correction to the EK approximation [11] but here can be considered as a fitting parameter. It is non-negative and is typically $O(1)$ ; for more details and analytical estimates of $q$ see App. E.2. + +Equation 16 is the second main analytical result of this work. It simplifies the highly non-linear inference problem to a single equation that embodies strong non-linear finite-DNN effect and feature learning (see also §4.1.4). In practice, to compute $\alpha_{\mathrm{test}}$ we numerically solve 16 using $q_{\mathrm{train}}$ for the training set to get $\alpha_{\mathrm{train}}$ , and then set $\alpha = \alpha_{\mathrm{train}}$ in the r.h.s. of 16 but use $q = q_{\mathrm{test}}$ . Equation 16 can also be used to bound $\alpha$ analytically on both the training set and test point, given the reasonable assumption that $\alpha$ changes continuously with $C$ . Indeed, at large $C$ the pole in this equation lays at $\alpha_{\mathrm{pole}} = (\sigma^2 / n)(C / \lambda)^{1/2} \gg 1$ whereas $\alpha \approx \alpha_{\mathrm{GP}} < \alpha_{\mathrm{pole}}$ . As $C$ diminishes, continuity implies that $\alpha$ must remain smaller than $\alpha_{\mathrm{pole}}$ . The latter decays as $\sigma^2 \sqrt{CNS} / n$ implying that the amount of data required for good performance scales as $\sqrt{CNS}$ rather than as $NS$ in the GP case. + +# 4.1.3 Numerical verification + +In this section we numerically verify the predictions of the self-consistent theory of Sec. §4.1.2, by training linear shallow student CNNs on a teacher with $C^* = 1$ as in Eq. 12, using noisy gradients as in Eq. 1, and averaging their outputs across noise realizations and across dynamics after reaching equilibrium. + +For simplicity we used $N = S$ and $n \in \{62, 200, 650\}$ , $S \in \{15, 30, 60\}$ so that $n \propto S^{1.7}$ . The latter scaling places us in the poorly performing regime of the associated GP while allowing good performance of the CNN. Indeed, as aforementioned, the GP here requires $n$ on the scale of $\lambda^{-1} = NS = O(S^2)$ for good performance [11], while the CNN requires $n$ on the scale of the number of parameters $(C(N + S) = O(S))$ . + +![](images/06c9cf37e1ad2dc6965d94c07fec7b240e759cba81a27169f7618b2513256a19.jpg) +(A) + +![](images/793bdd3669f4272d74e5bc6825cf3d8d1dadac17bcc2d40b5bf64d1c67c72f2f.jpg) +Figure 1: (A) The CNNs' cosine distance $\alpha$ , defined by $\langle f \rangle = (1 - \alpha)g$ between the ensemble-averaged prediction $\langle f \rangle$ and ground truth $g$ plotted vs. number of channels $C$ for the test set (for the train set, see App. H.1). As $n$ increases, the solution of the self-consistent equation 16 (solid line) yields an increasingly accurate prediction of these empirical values (dots). (B) Same data as in (A), presented as empirical $\alpha$ vs. predicted $\alpha$ . As $n$ grows, the two converge to the identity line (dashed black line). Solid lines connecting the dots here are merely for visualization purposes. (C) The theoretical predictions of the self-consistent theory but using only the fourth cumulant rather than all cumulants (dotted lines), and the predictions of perturbation theory to order $1 / C$ (dashed lines, truncated to avoid large negative values in the figure). + +![](images/b80a18ffd51f9784ade86fd305da4ff0572ca5b641e25c9fe0ffe734c48e043c.jpg) + +The results are shown in Fig. 1 where we compare the theoretical predictions given by the solution of the self-consistent equation (16) to the empirical values of $\alpha$ obtained by training actual CNNs and averaging their outputs across the ensemble. We can see that as $n$ increases, the predictions of our theory match the empirical data more closely (panels A and B), as can be expected from our SP approximation which is valid for large $n$ . + +In panel C, we compare the empirical values to two alternative theoretical predictions: (i) our self-consistent theory but using only the fourth cumulant, equivalent to equation Eq. 16 while ignoring the $[\cdot \cdot \cdot ]^{-1}$ term, rather than summing the geometric series of cumulants of all orders which gives rise to this term (dotted lines); (ii) A purely perturbative theory (see e.g. [32, 44, 39]) keeping only a leading $O(1 / C)$ term on top of the GP predictions (dashed lines, truncated to avoid large negative values in the figure). We see that the predictions of our full self-consistent theory (panels A and B) are clearly better than those of either (i) or (ii) above, at least for sufficiently small $C$ or sufficiently large $n$ : e.g. the predictions of (ii) for $n\in \{62,200\}$ match the empirical data nicely for $C\geq 2^4$ but diverge rapidly for smaller values of $C$ , as one would expect. The predictions of (i) don't diverge so rapidly from the empirical data and always gives $0\leq \alpha \leq 1$ , but are also quite poor for $C\lesssim 2^{5}$ . This shows that in these settings knowing all the cumulants provides a much more accurate theory. For sufficiently large $C$ , all predictions, including our own theory, coincide as they all converge to the GP limit. + +# 4.1.4 Feature learning phase transition in the CNN model + +At this point there is evidence that our self-consistent shifted target approach works well within the feature learning regime of the toy model. Indeed, GP is sub-optimal here, since it does not represent the CNN's weight sharing present in the teacher network. Weight sharing is intimately tied with feature learning in the first layer, since it aggregates the information coming from all convolutional windows to refine a single set of repeating convolution-filters. Empirically, we observed a large performance gap of finite- $C$ CNNs over the infinite- $C$ (GP) limit, which was also observed previously in more realistic settings [23, 15, 36]. Taken together with the existence of a clear feature in the teacher, a natural explanation for this performance gap is that feature learning, which is completely absent in GPs, plays a major role in the behavior of finite $C$ CNNs. + +To analyze this we wish to track how the feature of the teacher $\mathbf{w}^*$ is reflected in the student network's first layer weights $\mathbf{w}_c$ across training time (after reaching equilibrium) and across training realizations. However, as our formalism deals with ensembles of DNNs, computing averages of $\mathbf{w}_c$ with respect to these ensembles would simply give zero. Indeed, the chance of a DNN with specific parameters $\theta = \{a_{i,c},\mathbf{w}_c\}$ appearing is the same as that of $-\theta$ . Consequently, to detect feature learning the first reasonable object to examine is the empirical covariance matrix $\Sigma_W\equiv \frac{S}{C} WW^\top$ , where the matrix $W\in \mathbb{R}^{S\times C}$ has $\mathbf{w}_c$ as its $c$ 'th column. This $\Sigma_W$ is invariant under such a change of signs and provides important information on the statistics of $\mathbf{w}_c$ . + +As shown in App. G, using our field-theory or function-space formulation, we find that to leading order in $1 / C$ the ensemble average of the empirical covariance matrix, for a teacher with a single feature $\mathbf{w}^*$ , is + +$$ +\left\langle \left[ \Sigma_ {W} \right] _ {s s ^ {\prime}} \right\rangle = \left(1 + \left(\frac {1}{\lambda} + \frac {n}{\sigma^ {2}}\right) ^ {- 1}\right) \delta_ {s s ^ {\prime}} + \frac {2}{C} \frac {\lambda}{(\lambda + \sigma^ {2} / n) ^ {2}} w _ {s} ^ {*} w _ {s ^ {\prime}} ^ {*} + O \left(1 / C ^ {2}\right) \tag {17} +$$ + +A first conclusion that could be drawn here, is that given access to an ensemble of such trained CNNs, feature learning happens for any finite $C$ as a statistical property. We turn to discuss the more common setting where one wishes to use the features learned by a specific randomly chosen CNN from this ensemble. + +To this end, we follow Ref. [29] and model $\Sigma_W$ as a Wishart matrix with a rank-one perturbation. The variance of the matrix and details of the rank one perturbation are then determined by the above equation. Consequently the eigenvalue distribution is expected to follow a spiked Marchenko-Pastur (MP) model, which was studied extensively in [7]. To test this modeling assumption, for each snapshot of training time (after reaching equilibrium) and noise realization we compute $\Sigma_W$ 's eigenvalues and aggregate these across the ensemble. In Fig. 2 we plot the resulting empirical spectral distribution for varying values of $C$ while keeping $S$ fixed. Note that, differently from the usual spiked-MP model, varying $C$ here changes both the distribution of the MP bulk (which is determined by the ratio $S / C$ ) as well as the strength of the low-rank perturbation. + +Our main finding is a phase transition (analogous to [7]) between two regimes which becomes sharp as one takes $n, S \to \infty$ . In the regime of large $C$ the eigenvalue distribution of $\Sigma_W$ is indistinguishable from the MP distribution, whereas in the regime of small $C$ an outlier eigenvalue $\lambda_m$ departs from the support of the bulk MP distribution and the associated top eigenvector has a non-zero overlap + +with $\mathbf{w}^*$ , see Fig. 2. We refer to the latter as the feature-learning regime, since the feature $\mathbf{w}^*$ is manifested in the spectrum of the students' weights, whereas the former is the non-feature learning regime. We use the quantity $\mathcal{Q}\equiv \mathbf{w}^{*^{\mathrm{T}}}\Sigma_{W}\mathbf{w}^{*}$ as a surrogate for $\lambda_{m}$ , as it is valid on both sides of the transition. Having established the correspondence to the MP plus low rank model, we can use the results of [7] to find the exact location of the phase transition, which occurs at the critical value $C_{\mathrm{crit}}$ given by + +$$ +C _ {\text {c r i t}} = \frac {4}{S \left(S ^ {- 1} + \left(\sigma^ {2} / n\right) S\right) ^ {4}} \left(1 + \left(S ^ {2} + \frac {n}{\sigma^ {2}}\right) ^ {- 1}\right) + O \left(1 + \left(\frac {1}{\lambda} + \frac {n}{\sigma^ {2}}\right) ^ {- 1}\right) \tag {18} +$$ + +where we assumed for simplicity $N = S$ so that $\lambda = S^{-2}$ + +![](images/5d46bbfa4c7ccee04f9860db13755bce9a8005cbb1b6808cdf27d2972b14dae6.jpg) +Figure 2: (A) Aggregated histograms of $\Sigma_W$ eigenvalues where $\Sigma_W = \frac{S}{C}WW^{\top}$ is the normalized empirical covariance matrix of the hidden layer weights during training. Different colors indicate varying number of channels, $C$ . Solid smooth lines indicate the corresponding Marchenko-Pastur (MP) distributions with support on $[\lambda_{-},\lambda_{+}]$ where: $\lambda_{\pm} = \left(1\pm \sqrt{S / C}\right)^{2}$ . The quantity $\mathcal{Q}\equiv \mathbf{w}^{*\top}\Sigma_{W}\mathbf{w}^{*}$ , which correlates with the strength of rank-1 component of the feature $\mathbf{w}^*$ , is represented by thick short bars. For large $C$ , $\mathcal{Q}$ remains within the MP bulk whereas for small $C$ it pops out. (B) The theoretical $\lambda_{+}$ curve and interpolated curve of $\mathcal{Q}$ intersect very close to the theoretically predicted value given in Eq. 18, here given by $C_{\mathrm{crit}} = 473$ (dashed vertical line). + +![](images/804a9735e5e1fdc9455d84fd339c523485e2a6fd095dd222790a577656e90b92.jpg) + +# 4.2 Two-layer FCN with average pooling and quadratic activations + +Another setting where GPs are expected to under-perform finite-DNNs is the case of quadratic fully connected teacher and student DNNs where the teacher is rank-1, also known as the phase retrieval problem [28]. Here we consider some positive target of the form $g(\mathbf{x}) = (\mathbf{w}_* \cdot \mathbf{x})^2 - \sigma_w^2 \| \mathbf{x} \|^2$ where $\mathbf{w}_*, \mathbf{x} \in \mathbb{R}^d$ and a student DNN given by $f(\mathbf{x}) = \sum_{m=1}^{M} (\mathbf{w}_m \cdot \mathbf{x})^2 - \sigma_w^2 \| \mathbf{x} \|^2$ . We consider training this DNN on $n$ train points $\{\mathbf{x}_\mu\}_{\mu=1}^n$ using noisy GD training with weight decay $\gamma = 2M\sigma^2/\sigma_w^2$ . + +Similarly to the previous toy model, here too the GP associated with the student at large $M$ (and finite $\sigma^2$ ) overlooks a qualitative feature of the finite DNN — the fact that the first term in $f(\mathbf{x})$ is non-negative. Interestingly, this feature provides a strong performance boost [28] in the $\sigma^2 \to 0$ limit compared to the associated GP. Namely the DNN, even at large $M$ , performs well for $n > 2d$ [28] whereas the associated GP is expected to work well only for $n = O(d^2)$ [11]. + +We wish to solve for the predictions of this model with our self-consistent GP based approach. As shown in App. I, the cumulants of this model can be obtained from the following cumulant generating function + +$$ +\mathcal {C} \left(t _ {1}, \dots , t _ {n + 1}\right) = - \frac {M}{2} \operatorname {T r} \left(\log \left[ I - 2 M ^ {- 1} \sigma_ {w} ^ {2} \sum_ {\mu} i t _ {\mu} \mathbf {x} _ {\mu} \mathbf {x} _ {\mu} ^ {\mathrm {T}} \right]\right) - \sum_ {\mu = 1} ^ {n + 1} i t _ {\mu} \sigma_ {w} ^ {2} \| \mathbf {x} _ {\mu} \| ^ {2} \tag {19} +$$ + +The associated GP kernel is given by $K(\mathbf{x}_{\mu}, \mathbf{x}_{\nu}) = 2M^{-1}\sigma_w^4 (\mathbf{x}_\mu \cdot \mathbf{x}_\nu)^2$ . Following this, the target shift equation, at the saddle-point level, appears as + +$$ +\Delta g _ {\nu} = - \sum_ {\mu} K (\mathbf {x} _ {\nu}, \mathbf {x} _ {\mu}) \frac {\hat {\delta} g _ {\mu}}{\sigma^ {2}} + \sigma_ {w} ^ {2} \mathbf {x} _ {\nu} ^ {\mathsf {T}} \left[ I - 2 M ^ {- 1} \sigma_ {w} ^ {2} \sum_ {\mu} \frac {\hat {\delta} g _ {\mu}}{\sigma^ {2}} \mathbf {x} _ {\mu} \mathbf {x} _ {\mu} ^ {\mathsf {T}} \right] ^ {- 1} \mathbf {x} _ {\nu} - \sigma_ {w} ^ {2} \| \mathbf {x} _ {\nu} \| ^ {2} \tag {20} +$$ + +In App. I, we solve these equations numerically for $\sigma^2 = 10^{-5}$ and show that our approach captures the correct $n = 2d$ threshold value. An analytic solution of these equations at low $\sigma^2$ using EK or other continuum approximations is left for future work (see Refs. [11, 8, 9] for potential approaches). As a first step towards this goal, in App. I we consider the simpler case of $\sigma^2 = 1$ and derive the asymptotics of the learning curves which deviate strongly from those of GP for $M \ll d$ . + +# 4.3 Validity of the saddle-point approximation in realistic settings + +In this subsection we complement the above results on controlled toy models by some preliminary results in more realistic settings. The approximation underlying our analysis was that the fluctuations of the integrand in the partition function of Eq. 6 are near-Gaussian. A strong indication of how adequate this approximation is in real-world settings can be given by performing normality tests on an ensemble of the outputs of trained DNNs on the training set. Indeed, this is the ensemble described by our partition function. In App. H.3 we report some preliminary results we obtained by training the Myrtle-5 deep CNN [41] using our protocol on tiny subsets $(n\in \{16,32,64\})$ of CIFAR-10, and inspecting the normality of output fluctuations, as measured by the 4th cumulant of the outputs. In the experiments with small enough $C$ , although the CNN predictions already deviated strongly from those at infinite width, we haven't found a measurable signal of non-normality, thus our Gaussian fluctuation assumption is consistent with these findings. + +# 5 Discussion + +In this work we presented a correspondence between ensembles of finite DNNs trained with noisy gradients and GPs trained on a shifted target. The shift in the target can be found by solving a set of self-consistent equations for which we give a general form. We found explicit expressions for these equations for the case of a 2-layer linear CNN and a non-linear FCN, and solved them analytically and numerically. For the former model, we performed numerical experiments on CNNs that agree well with our theory both in the GP regime and well away from it, i.e. for small number of channels $C$ , thus accounting for strong finite $C$ effects. For the latter model, the numerical solution of these equations captures a remarkable and subtle effect in these DNNs which the GP approach completely overlooks — the $n = 2d$ threshold value. + +Considering feature learning in the CNN model, we found that averaging over ensembles of such networks always leads to a form of feature learning. Namely, the teacher always leaves a signature on the statistics of the student's weights. However, feature learning is usually considered at the level of a single DNN instance rather than an ensemble of DNNs. Focusing on this case, we show numerically that the eigenvalues of $\Sigma_W$ , the student hidden weights covariance matrix, follow a Marchenko-Pastur distribution plus a rank-1 perturbation. We then use our approach to derive the critical number of channels $C_{\mathrm{crit}}$ below which the student is in a feature learning regime. + +There are many directions for future research. Our toy models were chosen to be as simple as possible in order to demonstrate the essence of our theory on problems where lazy learning grossly under-performs finite-DNNs. Even within this setting, various extensions are interesting to consider such as adding more features to the teacher CNN (e.g. biases or a subset of linear functions which are more favorable), studying linear CNNs with overlapping convolutional windows, or deeper linear CNNs. As for non-linear CNNs, we believe it is possible to find the exact cumulants of any order for a variety of toy CNNs involving, for example, quadratic activation functions. For other cases it may be useful to develop methods for characterizing and approximating the cumulants. + +More generally, we advocated here a physics-style methodology using approximations, self-consistency checks, and experimental tests. As DNNs are very complex experimental systems, we believe this mode of research is both appropriate and necessary. Nonetheless we hope the insights gained by our approach would help generate a richer and more relevant set of toy models on which mathematical proofs could be made. + +# Acknowledgements + +We would like to thank Haim Sompolinsky for useful discussions and Jonathan Kadmon, Oded Ben-David, Dar Gilboa and Inbar Seroussi for comments on the manuscript. GN was partially + +supported by the Gatsby Charitable Foundation, the Swartz Foundation, the National Institutes of Health (Grant No. 1U19NS104653) and the MAFAT Center for Deep Learning. + +# References + +[1] L. Aitchison. Why bigger is not always better: on finite and infinite neural networks. arXiv preprint arXiv:1910.08013, 2019. +[2] S. Alemohammad, Z. Wang, R. Balestriero, and R. Baraniuk. The recurrent neural tangent kernel. arXiv preprint arXiv:2006.10246, 2020. +[3] A. Andreassen and E. Dyer. Asymptotics of wide convolutional neural networks. arXiv preprint arXiv:2008.08675, 2020. +[4] S. Arora, S. S. Du, W. Hu, Z. Li, R. Salakhutdinov, and R. Wang. On Exact Computation with an Infinitely Wide Neural Net. arXiv e-prints, page arXiv:1904.11955, Apr 2019. +[5] P. Baldi and K. Hornik. Neural networks and principal component analysis: Learning from examples without local minima. Neural networks, 2(1):53-58, 1989. +[6] F. Benaych-Georges and R. R. Nadakuditi. The eigenvalues and eigenvectors of finite, low rank perturbations of large random matrices. Advances in Mathematics, 227(1):494-521, 2011. +[7] F. Benaych-Georges and R. R. Nadakuditi. The singular values and vectors of low rank perturbations of large rectangular random matrices. Journal of Multivariate Analysis, 111:120-135, 2012. +[8] B. Bordelon, A. Canatar, and C. Pehlevan. Spectrum dependent learning curves in kernel regression and wide neural networks, 2020. +[9] A. Canatar, B. Bordelon, and C. Pehlevan. Spectral bias and task-model alignment explain generalization in kernel regression and infinitely wide neural networks. Nature Communications, 12(1), May 2021. +[10] L. Chizat, E. Oyallon, and F. Bach. On lazy training in differentiable programming. In Advances in Neural Information Processing Systems, pages 2937-2947, 2019. +[11] O. Cohen, O. Malka, and Z. Ringel. Learning Curves for Deep Neural Networks: A Gaussian Field Theory Perspective. arXiv e-prints, page arXiv:1906.05301, Jun 2019. +[12] H. E. Daniels. Saddlepoint Approximations in Statistics. The Annals of Mathematical Statistics, 25(4):631-650, 1954. +[13] E. Dyer and G. Gur-Ari. Asymptotics of wide networks from feynman diagrams. In International Conference on Learning Representations, 2020. +[14] M. Geiger, L. Petrini, and M. Wyart. Landscape and training regimes in deep learning. *Physics Reports*, 2021. +[15] M. Geiger, S. Spigler, A. Jacot, and M. Wyart. Disentangling feature and lazy training in deep neural networks. Journal of Statistical Mechanics: Theory and Experiment, 2020(11):113301, 2020. +[16] B. Ghorbani, S. Mei, T. Misiakiewicz, and A. Montanari. When do neural networks outperform kernel methods? arXiv preprint arXiv:2006.13409, 2020. +[17] S. Gunasekar, J. Lee, D. Soudry, and N. Srebro. Implicit bias of gradient descent on linear convolutional networks. arXiv preprint arXiv:1806.00468, 2018. +[18] B. He, B. Lakshminarayanan, and Y. W. Teh. Bayesian deep ensembles via the neural tangent kernel. arXiv preprint arXiv:2007.05864, 2020. +[19] M. Helias and D. Dahmen. Statistical field theory for neural networks. arXiv preprint arXiv:1901.10416, 2019. + +[20] J. Hron, Y. Bahri, J. Sohl-Dickstein, and R. Novak. Infinite attention: Nngp and ntk for deep attention networks. In International Conference on Machine Learning, pages 4376-4386. PMLR, 2020. +[21] A. Jacot, F. Gabriel, and C. Hongler. Neural Tangent Kernel: Convergence and Generalization in Neural Networks. arXiv e-prints, page arXiv:1806.07572, Jun 2018. +[22] A. K. Lampinen and S. Ganguli. An analytic theory of generalization dynamics and transfer learning in deep linear networks. arXiv preprint arXiv:1809.10374, 2018. +[23] J. Lee, S. S. Schoenholz, J. Pennington, B. Adlam, L. Xiao, R. Novak, and J. Sohl-Dickstein. Finite versus infinite neural networks: an empirical study. arXiv preprint arXiv:2007.15801, 2020. +[24] J. Lee, J. Sohl-dickstein, J. Pennington, R. Novak, S. Schoenholz, and Y. Bahri. Deep neural networks as gaussian processes. In International Conference on Learning Representations, 2018. +[25] J. Lee, L. Xiao, S. S. Schoenholz, Y. Bahri, R. Novak, J. Sohl-Dickstein, and J. Pennington. Wide neural networks of any depth evolve as linear models under gradient descent. arXiv preprint arXiv:1902.06720, 2019. +[26] Q. Li and H. Sompolinsky. Statistical mechanics of deep linear neural networks: The backpropagating renormalization group. arXiv preprint arXiv:2012.04030, 2020. +[27] E. Malach, P. Kamath, E. Abbe, and N. Srebro. Quantifying the benefit of using differentiable learning over tangent kernels. arXiv preprint arXiv:2103.01210, 2021. +[28] S. S. Mannelli, E. Vanden-Eijnden, and L. Zdeborova. Optimization and generalization of shallow neural networks with quadratic activation functions. arXiv preprint arXiv:2006.15459, 2020. +[29] C. H. Martin and M. W. Mahoney. Implicit Self-Regularization in Deep Neural Networks: Evidence from Random Matrix Theory and Implications for Learning. arXiv e-prints, page arXiv:1810.01075, Oct. 2018. +[30] A. G. d. G. Matthews, M. Rowland, J. Hron, R. E. Turner, and Z. Ghahramani. Gaussian process behaviour in wide deep neural networks. arXiv preprint arXiv:1804.11271, 2018. +[31] P. McCullagh. Tensor Methods in Statistics. Dover Books on Mathematics, 2017. +[32] G. Naveh, O. Ben-David, H. Sompolinsky, and Z. Ringel. Predicting the outputs of finite networks trained with noisy gradients. arXiv preprint arXiv:2004.01190, 2020. +[33] R. M. Neal. Priors for infinite networks. In *Bayesian Learning for Neural Networks*, pages 29-53. Springer, 1996. +[34] L. Noci, G. Bachmann, K. Roth, S. Nowozin, and T. Hofmann. Precise characterization of the prior predictive distribution of deep relu networks. arXiv preprint arXiv:2106.06615, 2021. +[35] R. Novak, L. Xiao, J. Hron, J. Lee, A. A. Alemi, J. Sohl-Dickstein, and S. S. Schoenholz. Neural tangents: Fast and easy infinite neural networks in python. arXiv preprint arXiv:1912.02803, 2019. +[36] R. Novak, L. Xiao, J. Lee, Y. Bahri, G. Yang, D. A. Abolafia, J. Pennington, and J. Sohl-Dickstein. Bayesian Deep Convolutional Networks with Many Channels are Gaussian Processes. arXiv e-prints, page arXiv:1810.05148, Oct. 2018. +[37] C. E. Rasmussen and C. K. I. Williams. Gaussian Processes for Machine Learning (Adaptive Computation and Machine Learning). The MIT Press, 2005. +[38] M. Refinetti, S. Goldt, F. Krzakala, and L. Zdeborova. Classifying high-dimensional gaussian mixtures: Where kernel methods fail and neural networks succeed. arXiv preprint arXiv:2102.11742, 2021. + +[39] D. A. Roberts, S. Yaida, and B. Hanin. The principles of deep learning theory. arXiv preprint arXiv:2106.10165, 2021. +[40] A. M. Saxe, J. L. McClelland, and S. Ganguli. Exact solutions to the nonlinear dynamics of learning in deep linear neural networks. arXiv preprint arXiv:1312.6120, 2013. +[41] V. Shankar, A. Fang, W. Guo, S. Fridovich-Keil, J. Ragan-Kelley, L. Schmidt, and B. Recht. Neural kernels without tangents. In International Conference on Machine Learning, pages 8614–8623. PMLR, 2020. +[42] P. Sollich and C. K. Williams. Understanding gaussian process regression using the equivalent kernel. In International Workshop on Deterministic and Statistical Methods in Machine Learning, pages 211-228. Springer, 2004. +[43] B. Woodworth, S. Gunasekar, J. D. Lee, E. Moroshko, P. Savarese, I. Golan, D. Soudry, and N. Srebro. Kernel and rich regimes in overparametrized models. In Conference on Learning Theory, pages 3635-3673. PMLR, 2020. +[44] S. Yaida. Non-gaussian processes and neural networks at finite widths. In Mathematical and Scientific Machine Learning, pages 165-192. PMLR, 2020. +[45] G. Yang and E. J. Hu. Feature learning in infinite-width neural networks. arXiv preprint arXiv:2011.14522, 2020. +[46] J. Yosinski, J. Clune, Y. Bengio, and H. Lipson. How transferable are features in deep neural networks? In Z. Ghahramani, M. Welling, C. Cortes, N. Lawrence, and K. Q. Weinberger, editors, Advances in Neural Information Processing Systems, volume 27. Curran Associates, Inc., 2014. +[47] D. Yu, M. Seltzer, J. Li, J.-T. Huang, and F. Seide. Feature learning in deep neural networks - studies on speech recognition. In International Conference on Learning Representations, May 2013. +[48] J. A. Zavatone-Veth and C. Pehlevan. Exact priors of finite neural networks. arXiv preprint arXiv:2104.11734, 2021. \ No newline at end of file diff --git a/aselfconsistenttheoryofgaussianprocessescapturesfeaturelearningeffectsinfinitecnns/images.zip b/aselfconsistenttheoryofgaussianprocessescapturesfeaturelearningeffectsinfinitecnns/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..1208887010b87a23d55ce2570bb54ea6d3e10908 --- /dev/null +++ b/aselfconsistenttheoryofgaussianprocessescapturesfeaturelearningeffectsinfinitecnns/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb4da57684fffaab0a8809efd5e223749b3697aef2772da5bf3f3a93444b4130 +size 258965 diff --git a/aselfconsistenttheoryofgaussianprocessescapturesfeaturelearningeffectsinfinitecnns/layout.json b/aselfconsistenttheoryofgaussianprocessescapturesfeaturelearningeffectsinfinitecnns/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..5f8ea4706525b6b3b8b134e53bdaad05da754ae0 --- /dev/null +++ b/aselfconsistenttheoryofgaussianprocessescapturesfeaturelearningeffectsinfinitecnns/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:32b0bb07531c81a05c84a5158ae6ceacc49825d00d4328b97eae1a51e68cf7e0 +size 538002 diff --git a/aseparationresultbetweendataobliviousanddataawarepoisoningattacks/4c27df68-9d63-4889-b369-0fb86464d038_content_list.json b/aseparationresultbetweendataobliviousanddataawarepoisoningattacks/4c27df68-9d63-4889-b369-0fb86464d038_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..b2a3b19da8fca0042b3560e33eb0f64f1427c26e --- /dev/null +++ b/aseparationresultbetweendataobliviousanddataawarepoisoningattacks/4c27df68-9d63-4889-b369-0fb86464d038_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f72a9ca9dd82c28b9f419e4842e153dce85a6a6db4355104dbf98af240a2211 +size 85733 diff --git a/aseparationresultbetweendataobliviousanddataawarepoisoningattacks/4c27df68-9d63-4889-b369-0fb86464d038_model.json b/aseparationresultbetweendataobliviousanddataawarepoisoningattacks/4c27df68-9d63-4889-b369-0fb86464d038_model.json new file mode 100644 index 0000000000000000000000000000000000000000..fac2dc7e5291975af9d6bdbcbcbe7a42c36b7535 --- /dev/null +++ b/aseparationresultbetweendataobliviousanddataawarepoisoningattacks/4c27df68-9d63-4889-b369-0fb86464d038_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1b29e0a23db248dd71403530ca2a7c0a21aa962318494dbb31c89e5b31355a72 +size 110699 diff --git a/aseparationresultbetweendataobliviousanddataawarepoisoningattacks/4c27df68-9d63-4889-b369-0fb86464d038_origin.pdf b/aseparationresultbetweendataobliviousanddataawarepoisoningattacks/4c27df68-9d63-4889-b369-0fb86464d038_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c8bb03bc14b4407780e6c1d6009d4b9150358e55 --- /dev/null +++ b/aseparationresultbetweendataobliviousanddataawarepoisoningattacks/4c27df68-9d63-4889-b369-0fb86464d038_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eec00bb5843a617c9b0dd6c0172275562da3d6a344cfd2c108459343d8be0745 +size 401787 diff --git a/aseparationresultbetweendataobliviousanddataawarepoisoningattacks/full.md b/aseparationresultbetweendataobliviousanddataawarepoisoningattacks/full.md new file mode 100644 index 0000000000000000000000000000000000000000..5bd7da8ecbb4839b70a150067bc1a741d607341e --- /dev/null +++ b/aseparationresultbetweendataobliviousanddataawarepoisoningattacks/full.md @@ -0,0 +1,345 @@ +# A Separation Result Between Data-oblivious and Data-aware Poisoning Attacks + +Samuel Deng + +Columbia University + +samdeng@cs.columbia.edu + +Sanjam Garg + +UC Berkeley and NTT Research + +sanjamg@berkeley.edu + +Somesh Jha + +University of Wisconsin + +jha@cs.wisc.edu + +Saeed Mahloujifar + +Princeton + +sfar@princeton.edu + +Mohammad Mahmoody + +University of Virginia +mohammad@virginia.edu + +Abhradeep Thakurta + +Google Research - Brain Team athakurta@gmail.com + +# Abstract + +Poisoning attacks have emerged as a significant security threat to machine learning algorithms. It has been demonstrated that adversaries who make small changes to the training set, such as adding specially crafted data points, can hurt the performance of the output model. Some of the stronger poisoning attacks require the full knowledge of the training data. This leaves open the possibility of achieving the same attack results using poisoning attacks that do not have the full knowledge of the clean training set. In this work, we initiate a theoretical study of the problem above. Specifically, for the case of feature selection with LASSO, we show that full information adversaries (that craft poisoning examples based on the rest of the training data) are provably stronger than the optimal attacker that is oblivious to the training set yet has access to the distribution of the data. Our separation result shows that the two setting of data-aware and data-oblivious are fundamentally different and we cannot hope to always achieve the same attack or defense results in these scenarios. + +# 1 Introduction + +Traditional approaches to supervised machine learning focus on a benign setting where honestly sampled training data is given to a learner. However, the broad use of these learning algorithms in safety-critical applications makes them targets for sophisticated attackers. Consequently, machine learning has gone through a revolution of studying the same problem, but this time under so-called adversarial settings. Researchers have investigated several types of attacks, including test-time (a.k.a., evasion attacks to find adversarial examples) [62, 6, 32, 55], training-time attacks (a.k.a., poisoning or causative attacks) [3, 8, 51], backdoor attacks [67, 33], membership inference attacks [57], etc. In response, other works have put forth several defenses [52, 43, 9] followed by adaptive attacks [15, 2, 65] that circumvent some of the proposed defenses. Thus, developing approaches that are based on solid theoretical foundations (that prevent further adaptive attacks) has stood out as an important area of investigation. + +Poisoning Attacks. In a poisoning attack, an adversary changes a training set $S$ of examples into a "close" training set $S'$ (The difference is usually measured by Hamming distance; i.e., the number of examples injected and/or removed.). Through these changes, the goal of the adversary, generally speaking, is to degrade the "quality" of the learned model, where quality here could be interpreted in different ways. In a recent industrial survey [39], poisoning attacks were identified as the most important threat model against applications of machine learning. The main reason behind the importance of poisoning attacks are the feasibility of performing the attack for adversary. As the + +data is usually gathered from multiple sources, the adversary can perform the poisoning attacks by corrupting one of the sources. Hence, it is extremely important to fundamentally understand this threat model. In particular, we need to investigate the role of design choices that are made in both poisoning attacks and defenses. + +Does the attacker know the training data? The role of knowledge of the clean training set is one of the less investigated aspects of poisoning attacks. Many previous work on theoretical analysis of poisoning attacks implicitly, or explicitly, assume that the adversary has full knowledge of the training data $S$ before choosing what examples to add or delete from $S$ [38, 58, 44, 61]. In several natural scenarios, an adversary might not have access to the training data before deciding on how to tamper with it. This has led researchers to study poisoning attacks that do not use the knowledge of the training set to craft the poison points. In this work, we explore the following question: + +What is the role of the knowledge of training set in the success of poisoning adversaries? Can the knowledge of training set help the attacks? Or alternatively, can hiding the training set from adversaries help the defenses? + +In this work, as a first step to understand this question, we show a separation result between data-oblivious and data-aware poisoning adversaries. In particular, we show that there exist a learning setting (Feature selection with LASSO on Gaussian data) where poisoning adversaries that know the distribution of data but are oblivious to specific training samples that are used to train the model are provably weaker than the adversaries with the knowledge of both training set and the distribution. To the best of our knowledge, this is the first separation result for poisoning attacks. + +Implications of our separation result: Here, we mention some implications of our separation result. + +- Separation of threat models: The first implication of our result is the separation of data-oblivious and data-aware poisoning threat models. Our result shows that data-oblivious attacks are strictly weaker than data-aware attacks. In other words, it shows that we cannot expect the defenses to have the same effectiveness in both scenarios. This makes the knowledge of data a very important design choice that should be clearly stated when designing defenses or attacks. +- Possibility of designing new defenses: Although data-oblivious poisoning is a weaker attack model, it might still be the right threat model for many applications. For instance, if data providers use cryptographically secure multi-party protocols to train the model [68], then each participant can only observe their own data. Note that each party might still have access to some data pool from the true distribution of training set and that still fits in our data-oblivious threat model. In these scenarios, it is natural to use defenses that are only secure against data-oblivious attacks. Our results show the possibility of designing defense mechanisms that leverage the secrecy of training data and can provide much stronger security guarantees in this threat mode. In particular, our result shows the provable robustness of LASSO algorithm in defending against data-oblivious attacks. + +Note that this approach is distinct from the demoted notion of "security through obscurity" as the attacker knows every detail of the algorithm as well as the data distribution. The only unknown to the adversary is the randomness involved in the process of sampling training examples from the training distribution. This is exactly similar to how secret randomness helps security in cryptography. + +- A new motive for privacy: privacy is often viewed as a utility for data owners in the machine learning pipeline. Due to the trade-offs between privacy and the efficiency/utility, data-users often ignore the privacy of data owners while doing their analysis, especially when there is no incentive to enforce the privacy of the learning protocol. The possibility of improving the security against poisoning attacks by enforcing the (partial) data-obliviousness of the adversary could create a new incentive for keeping training datasets secret. Specifically, the users of data would now have more motivation to try to keep training dataset private, with the goal of securing their models against poisoning and increasing their utility in scenarios where part of data is coming from potentially malicious sources. + +# 1.1 Our Contributions + +In this work, we provide theoretical evidence that obliviousness of attackers to the training data can indeed help robustness against poisoning attacks. In particular, we provide a provable difference between: (i) an adversary that is aware of the training data as well as the distribution of training data, before launching the attack (data-aware adversary) and (ii) an adversary that only knows the distribution of training data and does not know the specific clean examples in the training set (data-oblivious adversary). + +We start by formalizing what it means mathematically for the poisoning adversary to be data-oblivious or data-aware. + +Separations for feature selection with Lasso. We then prove a separation theorem between the data-aware and data-oblivious poisoning threat models in the context of feature selection. We study data-aware and data-oblivious attackers against the Lasso estimator and show that if certain natural properties hold for the distribution of dataset, the power of optimal data-aware and data-oblivious poisoning adversaries differ significantly. + +We emphasize that in our data-oblivious setting, the adversary fully knows the data distribution, and hence it implicitly has access to a lot of auxiliary information about the data set, yet the very fact that it does not know the actual sampled dataset makes it harder for adversary to achieve its goal. + +Experiments. To further investigate the power of data-oblivious and data-aware attacks in the context of feature selection, we experiment on synthetic datasets sampled from Gaussian distributions, as suggested in our theoretical results. Our experiments confirm our theoretical findings by showing that the power of data-oblivious and poisoning attacks differ significantly. Furthermore, we experimentally evaluate the power of partially-aware attackers who only know part of the data. These experiments show the gradual improvement of the attack as the knowledge of data grows. + +In our experimental studies we go beyond Gaussian setting and show that the power of data-oblivious attacks could be significantly lower on real world distributions as well. In our experiments, sometimes (depending on the noise nature of the dataset), even an attacker that knows $20\%$ of the dataset cannot have much of improvement over an oblivious attacker. + +Separation for classification. In addition to our main results in the context of feature selection, in this work, we also take initial steps to study the role of adversary's knowledge (about the data set) when the goal of the attacker is to increase the risk of the produced model in the context of classification. These results are presented supplemental material (Section A). + +# 1.2 Related Work + +Here, we provide a short version of related prior work. A more comprehensive description of previous work has been provided in Appendix B where we also categorize the existing attacks into data-aware and data-oblivious categories. + +Beatson et al. [4] study "Blind" attackers against machine learning models that do not even know the distribution of the data. They show that poisoning attacks could be successful in such a restricted setting by studying the minimax risk of learners. They also introduced "informed" attacks that see the data distribution, but not the actual training samples and leave the study of these attacks to future work. Interestingly, the "informed" setting of [4] is equivalent to the "oblivious" setting in our work. + +Xiao et al. [71] empirically examine the robustness of feature selection in the context of poisoning attacks, but their measure of stability is across sets of features. We are distinct in that our paper studies the effect of data-oblivious attacks on individual features and with provable guarantees. + +We distinguish our work with another line of work that studies the computational complexity of the attacker [46, 29]. Here, we study the "information complexity" of the attack; namely, what information the attacker needs to succeed in a poisoning attack, while those works study the computational resources that a poisoning attacker needs to successfully degrade the quality of the learned model. Another recent exciting line of work that studies the computational aspect of robust learning in poisoning contexts, focuses on the computational complexity of the learning process itself [18, 40, 16, 20, 21, 19, 53, 22], and other works have studied the same question about the complexity of the learning process for evasion attacks [11, 10, 17]. Furthermore, our work deals with + +information complexity and is distinct from works that study the impact of the training set (e.g., using clean labels) on the success of poisoning [55, 73, 59, 67]. + +Our work's motivation for data secrecy might seem similar to other works that leverage privacy-preserving learning (and in particular differential privacy [23, 26, 25]) to limit the power of poisoning attacks by making the learning process less sensitive to poison data [42]. However, despite seeming similarity, what we pursue here is fundamentally different. In this work, we try to understand the effect of keeping the data secret from adversaries. Whereas the robustness guarantees that come from differential privacy has nothing to do with secrecy and hold even if the adversary gets to see the full training set (or even select the whole training set in an adversarial way.). + +We also point out some separation results in the context of adversarial examples. The work of Bubeck et al. [12] studies the separation in the power of computationally bounded v.s. computationally unbounded learning algorithms in learning robust model. Tsipras et al. [66] studies the separation between benign accuracy and robust accuracy of classifiers showing that they can be even at odds with each other. Schmidt et al. [54] show the separation between sample complexity of learning algorithms in training an adversarially robust model versus a model with high benign accuracy. Garg et al. [29] separate the notions of computationally bounded v.s. computationally unbounded attacks in successfully generating adversarial examples. Although all these results are only proven for few (perhaps unrealistic) settings, they still significantly helped the understanding of adversarial examples. + +As opposed to the data poisoning setting, the question of adversary's (adaptive) knowledge was indeed previously studied in the line of work on adversarial examples [41, 49, 62]. In a test time evasion attack the adversary's goal is to find an adversarial example, the adversary knows the input $x$ entirely before trying to find a close input $x'$ that is misclassified. So, this adaptivity aspect already differentiates adversarial examples from random noise. + +# 2 Defining Threat Models: Data-oblivious and Data-aware Poisoning + +In this section, we formally define the security games of learning systems under data-oblivious poisoning attacks. It is common in cryptography to define security model based on a game between an adversary and a challenger [36]. Here, we use the same approach and introduce game based definitions for data-oblivious and data-aware adversaries. + +Feature selection. The focus of this work is mostly on the feature selection which is a significant task in machine learning. In a feature selection problem, the learning algorithm wants to discover the relevant features that determine the ground truth function. For example, imagine a dataset of patients with many features, who suffer from a specific disease with different levels of severity. One can try to find the most important features contributing to the severity of the disease in the context of feature selection. Specifically, the learners' goal is to recover a vector $\theta^{*} \in \mathbb{R}^{d}$ whose non-zero coordinates determine the relevant features contributing to the disease. In this scenario, the goal of the adversary is to deceive the learning process and make it output a model $\hat{\theta}' \in \mathbb{R}^{d}$ with a different set of non-zero coordinates. As motivation for studying feature selection under adversarial perturbations, note that the non-zero coordinates of the learned model could be related to a sensitive subject. For example, in the patient data example described in the introduction, the adversary might be a pharmaceutical institute who tries to imply that a non-relevant feature is contributing to the disease, in order to advertise for a specific medicine. + +We start by separating the goal of a poisoning attack from how the adversary achieves the goal. The setting of an data-oblivious attack deals with the latter, namely it is about how the attack is done, and this aspect is orthogonal to the goal of the attack. In a nutshell, many previous works on data poisoning deal with increasing the population risk of the produced model (see Definition A.1 below and Section C for more details and variants of such attacks). In a different line of work, when the goal of the learning process is to recover a set of features (a.k.a., model recovery) the goal of an attacker would be defined to counter the goal of the feature selection, namely to add or remove features from the correct model. + +In what follows, we describe the security games for a feature selection task. We give this definition for a basic reference setting in which the data-oblivious attacker injects data into the data set, and its goal is to change the selected features. (See Section C for more variants of the attack.) Later, in + +Section 3 we will see how to construct problem instances (by defining their data distributions) that provably separate the power of data-oblivious attacks from data-aware ones. + +Notation. We first define some useful notation. For an arbitrary vector $\theta \in \mathbb{R}^d$ we use $\operatorname{Supp}(\theta) = \{i\colon \theta_i\neq 0\}$ , we denote the set of (indices of) its non-zero coordinates. We use capital letters (e.g. $X$ ) to denote sets and calligraphic letters (e.g. $\mathcal{X}$ ) to denote distributions. $(\mathcal{X},\mathcal{Y})$ denotes the joint distribution of $\mathcal{X}$ and $\mathcal{Y}$ and $\mathcal{X}_1\equiv \mathcal{X}_2$ denotes the equivalence of two distributions $\mathcal{X}_1$ and $\mathcal{X}_2$ . We use $\| \theta \| _2$ and $\| \theta \|$ to denote the $\ell_2$ and $\ell_1$ norms of $\theta$ respectively. For two matrices $X\in R^{n\times d}$ and $Y\in R^{n\times 1}$ , we use $[X\mid Y]\in R^{n\times (d + 1)}$ to denote a set of $n$ regression observations on feature vectors $X_{i\in [n]}$ such that $Y_{i}$ is the real-valued observation for $X_{i}$ . For two matrices $X_{1}\in \mathbb{R}^{n_{1}\times d}$ and $X_{2}\in \mathbb{R}^{n_{2}\times d}$ , we use $\begin{bmatrix} X_1\\ X_2 \end{bmatrix} \in \mathbb{R}^{(n_1 + n_2)\times d}$ to denote the concatenation of $X_{1}$ and $X_{2}$ . Similarly, for two sets of observations $[X_1\mid Y_1]\in \mathbb{R}^{n_1\times (d + 1)}$ and $[X_2\mid Y_2]\in \mathbb{R}^{n_2\times (d + 1)}$ , we use $\begin{bmatrix} X_1 & Y_1\\ X_2 & Y_2 \end{bmatrix} \in$ $\mathbb{R}^{(n_1 + n_2)\times (d + 1)}$ to denote the concatenation of $[X_1\mid Y_1]$ and $[X_2\mid Y_2]$ . For a security game $G$ and an adversary $A$ we use $\mathrm{Adv}(A,G)$ (advantage of adversary $A$ in game $G$ ) to denote probability of adversary $A$ winning the security game $G$ , where the probability is taken over the randomness of the game and adversary. + +Since the security games for data-aware and data-oblivious games are close, we use Definition 2.1 below for both, while we specify their exact differences. + +Definition 2.1 (Data-oblivious and data-aware data injection poisoning for feature selection). We first describe the data-oblivious security game between a challenger $C$ and an adversary $A$ . The game is parameterized by the adversary's budget $k$ and the training data $S = [X|Y]$ which is a matrix $X$ and a set of labels $Y$ , and the feature selection algorithm FtrSelector. + +ObfPtrSel $(k,\mathcal{D},\mathrm{FtrSelector},n)$ + +1. Knowing the algorithm FtrSelector and distribution $\mathcal{D}$ supported on $\mathbb{R}^{d + 1}$ , and given $k$ as input, the adversary $A$ generates a poisoning dataset $[X' | Y'] \in [-1, 1]^{k \times (d + 1)}$ of size $k$ such that each row has $\ell_1$ norm at most 1 and sends it to $C$ . +2. $C$ samples a dataset $[X\mid Y]\gets \mathcal{D}^n$ +3. C recovers models $\hat{\theta} =$ FtrSelector([X|Y]) using the clean data and $\hat{\theta}' =$ FtrSelector $\left(\begin{bmatrix} X & Y \\ X' & Y' \end{bmatrix}\right)$ using the poisoned data. +4. Adversary wins if $\operatorname{Supp}(\hat{\theta}) \neq \operatorname{Supp}(\hat{\theta}')$ , and we use the following notation to denote the winning: + +$$ +\text {O b l F t r S e l} (A, k, \mathcal {D}, \text {F t r S e l e c t o r}, n) = 1. +$$ + +In the security game for data-aware attackers, all the steps are the same as above, except that the order of steps 1 and 2 are different. Namely, challenger first samples and sends the dataset to adversary. + +$\mathbf{A}\mathbf{w}\mathbf{r}\mathbf{F}\mathbf{t}\mathbf{r}\mathbf{S}\mathbf{e}1(k,\mathcal{D},\mathbf{F}\mathbf{t}\mathbf{r}\mathbf{s}\mathbf{e}\mathbf{t}\mathbf{o}\mathbf{r}\mathbf{o}\mathbf{r},n)$ + +1. $C$ samples $[X\mid Y]\gets \mathcal{D}^n$ and sends it A. +2. Knowing the algorithm FtrSelector and distribution $\mathcal{D}$ supported on $\mathbb{R}^{d + 1}$ , the dataset $[X\mid Y]$ , and given $k$ as input, the adversary $A$ generates a poisoning dataset $[X^{\prime}\mid Y^{\prime}]\in [-1,1]^{k\times (d + 1)}$ of size $k$ such that each row $[X^{\prime}\mid Y^{\prime}]$ has $\ell_1$ norm at most 1 and sends it to $C$ . +3. C recovers models $\hat{\theta} =$ FtrSelector([X|Y]) using the clean data and $\hat{\theta}' =$ FtrSelector $\left(\begin{bmatrix} X & Y \\ X' & Y' \end{bmatrix}\right)$ using the poisoned data. +4. Adversary wins if $\operatorname{Supp}(\hat{\theta}) \neq \operatorname{Supp}(\hat{\theta}')$ , and we use the following notation to denote the winning: + +$$ +\mathbf {A w r F t r S e l} (A, k, \mathcal {D}, \mathbf {F t r S e l e c t o r}, n) = 1. +$$ + +Variations of security games for Definition 2.1. Definition 2.1 is written only for the case of feature-flipping attacks by only injecting poison data. One can, however, envision variants by changing the adversary's goal and how it is doing the poisoning attack. In particular, one can define more + +specific goals for the attacker to violate the feature selection, by aiming to add or remove non-zero coordinates to the recovered model compared to the ground truth. In addition, it is also possible to change the method of the adversary to employ data elimination or substitution attacks. + +One can also imagine partial-information attackers who are exposed to a fraction of the data set $S$ (e.g., by being offered the knowledge of a randomly selected $p$ fraction of the rows of $[X|Y]$ ). Our experiments deal with this very setting. + +Why bounding the norm of the poison points? When bounding the number of poison points, it is important to bound the norm of the poisoning points according to some threshold (e.g. through a clipping operation) otherwise a single poison point can have infinitely large effect on the trained model. By bounding the $\ell_1$ norm of the poison data, we make sure that a single poison point has a bounded effect on the objective function and cannot play the role of a large dataset. We could remove this constraint from the security game and enforce it in the algorithm through a clipping operation but we keep it as a part of definition to emphasize on this aspect of the security game. Note that in this work we always assume that the data is centered around zero. That is why we only use a constraint on the norm of the poison data points. However, the security game could be generalized by replacing the $\ell_2$ norm constraint with an arbitrary filter $F$ for different scenarios. + +Why using $\hat{\theta}$ instead of $\theta$ . Note that in security games of Definition 2.1 we do not use the real model $\theta$ (or more accurately its set of features $\mathrm{Supp}(\theta)$ ), but rather we work with $\mathrm{Supp}(\hat{\theta})$ . That is because, we will work with promised data sets for which FtrSelector provably recovers the true set of features $\mathrm{Supp}(\hat{\theta}) = \mathrm{Supp}(\theta)$ . This could be guaranteed, e.g., by putting conditions on the data. + +Why injecting the poison data to the end? Note that in security games of Definition 2.1, we are simply injecting the poison examples to the end of the training sequence defined by $X, Y$ , instead of asking the adversary to pick their locations. That is only for simplicity, and the definition is implicitly assuming that the feature selection algorithm is symmetric with respect to the order of the elements int the data set (e.g., this is so for Lasso estimator). However, one can generalize the definition directly to allow the adversary to pick the specific location of the added elements. + +# 3 Separating Data-oblivious and Data-aware Poisoning for Feature Selection + +In this section, we provably demonstrate that the power of data-oblivious and data-aware adversaries could significantly differ. Specifically, we study the power of poisoning attacks on feature selection. + +Feature selection by the Lasso estimator. We work in the feature selection setting, and the exact format of our problem is as follows. There is a target parameter vector $\theta^{*} \in (0,1)^{d}$ . We have a $n \times d$ matrix $X$ ( $n$ vectors, each of $d$ features) and we have $Y = X \times \theta^{*} + W$ where $W$ itself is a small noise, and $Y$ is the vector of noisy observations about $\theta^{*}$ , where the number of non-zero elements (denoting the actual relevant features) in $\theta^{*}$ is bounded by $s$ namely, $|\operatorname{Supp}(\theta^{*})| \leq s$ . The goal of the feature selection is to find a model $\hat{\theta}$ , given $[X | Y]$ , such that $\operatorname{Supp}(\hat{\theta}) = \operatorname{Supp}(\theta^{*})$ . + +The Lasso Estimator tries to learn $\theta^{*}$ by optimizing the regularized loss with regularization parameter $\lambda$ and obtain the solution $\hat{\theta}_{\lambda}$ as + +$$ +\hat {\theta} _ {\lambda} = \operatorname * {a r g m i n} _ {\theta \in (0, 1) ^ {d}} \frac {1}{n} \cdot \| Y - X \times \theta \| _ {2} ^ {2} + \frac {2 \lambda}{n} \cdot \| \theta \| _ {1}. +$$ + +We use Lasso([X | Y], $\lambda$ ) to denote $\hat{\theta}_{\lambda}$ , as learned by the Lasso optimization described above. When we $\lambda$ is clear from the context, we use Lasso([X | Y]) and $\hat{\theta}$ . + +We also use $\operatorname{Risk}(\hat{\theta}, [X \mid Y], \lambda)$ (and $\operatorname{Risk}(\hat{\theta}, [X \mid Y], \lambda)$ ) when $\lambda$ is clear from the context) to denote the "scaled up" value of the Lasso's objective function + +$$ +\operatorname {R i s k} (\hat {\theta}, [ X \mid Y ]) = \left\| Y - X \times \hat {\theta} \right\| _ {2} ^ {2} + 2 \cdot \lambda \cdot \left\| \hat {\theta} \right\| _ {1}. +$$ + +It is known by a work of Wainwright [69] that under proper conditions Lasso estimator can recover the correct feature vector (See Theorems D.2 and D.4 in Appendix D for more details.) The robust + +version of this result, where part of the training data is chosen by an adversary, is also studied in Thakurta et al. [63]. (See Theorems D.5 and D.3 in Appendix D for more details.) However, the robust version considers robustness against data-aware adversaries that can see the dataset and select the poisoning points based on the rest of training data. In the following theorem, we show that the robustness against data-oblivious adversaries could be much higher than robustness against data-aware adversaries. + +Separation for feature selection. We prove the existence of a feature selection problem such that, with high probability, it stays secure in the data-oblivious attack model of Definition 2.1, while the same problem's setting is highly vulnerable to poisoning adversaries as defined in the data-aware threat model of Definition 2.1. We use Lasso estimator for proving our separation result. + +Theorem 3.1. For any $k \in \mathbb{N}$ and $\varepsilon_1 < \varepsilon_2 \in (0,1)$ , there exist an $n, d \in \mathbb{N}$ , $\sigma \in \mathbb{R}$ and $\theta^* \in \mathbb{R}^d$ such that the distribution $\mathcal{D} \equiv (\mathcal{X},\mathcal{Y})$ for $\mathcal{X} \equiv \mathcal{N}(0,\sigma^2)^{n\times d}$ and $\mathcal{Y} \equiv X \times \theta^* + \mathcal{N}(0,1/4)$ is recoverable using Lasso estimator, meaning that with high probability over the randomness of sampling a dataset $[X|Y] \gets \mathcal{D}^n$ we have + +$$ +\operatorname {S u p p} (\operatorname {L a s s o} ([ X \mid Y ]) = \operatorname {S u p p} (\theta^ {*}), +$$ + +while the advantage of any data-oblivious adversary in changing the support set is at most $\varepsilon_{1}$ . Namely for any data-oblivious adversary $A$ we have + +$$ +\underset {S \leftarrow D} {\mathbb {E}} \left[ \operatorname {O b l F t r S e l} (A, k, \mathcal {D}, \text {L a s s o}, n) \right] \leq \varepsilon_ {1} +$$ + +On the other hand, there is an adversary that can win the data-aware security game with probability at least $\varepsilon_{2}$ . Namely, there is an data-aware adversary $A$ such that + +$$ +\underset {\mathcal {S} \leftarrow D} {\mathbb {E}} \left[ \mathbf {A w r F t r S e l} (A, k, \mathcal {D}, \text {L a s s o}, n) \right] \geq \varepsilon_ {2}. +$$ + +The main idea behind the proof. To prove the separation, we use the fact that data-oblivious adversaries cannot discriminate between the coordinates that are not in the support set of $\theta^{*}$ . Imagine the distribution of data has a property that with high probability there exists a unique feature that is not in the support set, but it is possible to add that feature to the support set with a few number of poisoning examples. We call such a feature an "unstable" feature. Suppose the distribution also has an additional property that each coordinate has the same probability of being the unstable feature. Then, the only way that adversary can find the unstable feature is by looking into the dataset. Otherwise, if the adversary is data-oblivious, it does not have any information about the unstable feature and should attack blindly and pick one of the coordinates at random. On the other hand, the data-aware adversary can investigate the dataset and find the unstable feature. In the rest of this section we formalize this idea by constructing a distribution $D$ that has the properties mentioned above. + +Below we first define the notion of stable and unstable features and then formally define two properties for a distribution $\mathcal{D}$ that if satisfied, we derive Theorem 3.1 for it. + +Definition 3.2 (Stable and unstable coordinates). Consider a dataset $[X|Y] \in \mathbb{R}^{n \times (d + 1)}$ with a unique solution $\hat{\theta}_{\lambda}$ for the Lasso minimization. $[X|Y]$ is $k$ -unstable on coordinate $i \in [d]$ + +if the $i^{\mathrm{th}}$ coordinate of the feature vector obtained by running Lasso on $[X|Y]$ is 0, namely Lasso $([X|Y])_i = 0$ , and there exist a data set $[X'|Y']$ with size $k$ and $\ell_{\infty}$ norm at most 1 on each row such that $i \in \operatorname{Supp}(\text{Lasso}(\left[ \begin{array}{c} X \\ X' \end{array} \right] | Y'))$ . On the other hand, $[X|Y]$ is $k$ -stable on a coordinate $i$ , if for all datasets $[X'|Y']$ with $k$ rows and $\ell_{\infty}$ norm at most 1 on each row we have + +$$ +\operatorname {S i g n} (\mathsf {L a s s o} \left([ X \big | Y ]\right) _ {i}) = \operatorname {S i g n} \left(\mathsf {L a s s o} \left(\left[ \begin{array}{c c} X & Y \\ X ^ {\prime} & Y ^ {\prime} \end{array} \right]\right) _ {i}\right). +$$ + +The following definitions capture two properties of a distribution $D$ . The first property states that with high probability over the randomness of $D$ , a dataset sampled from $D$ has at least one unstable feature. + +Definition 3.3 $((k,\delta)$ -unstable distributions). A distribution $D$ is $(k,\varepsilon_2)$ -unstable if it is $k$ -unstable on at least one coordinate with probability at least $(\varepsilon_2)$ . Namely + +$$ +\operatorname * {P r} _ {S \leftarrow D} \left[ \exists i \in [ d ]: T h e i ^ {\text {t h}} f e a t u r e i s k - u n s t a b l e o n S \right] \geq \varepsilon_ {2}. +$$ + +The following notion defines the resilience of a distribution against a single poison dataset. In a nutshell, a distribution is resilient if there does not exist a universal poisoning set that can be effective against all the datasets coming from that distribution. + +Definition 3.4. $[ (k, \varepsilon) \text{-resilience} ]$ A distribution $D$ over $\mathbb{R}^{n \times (d + 1)}$ is $(k, \varepsilon)$ -resilient if for any poisoning dataset $S'$ of size $k$ and $\ell_{\infty}$ norm bounded by 1 we have + +$$ +\operatorname * {P r} _ {\mathcal {S} \leftarrow D} [ \operatorname {S u p p} \left(\operatorname {L a s s o} \left(\left[ \begin{array}{c} \mathcal {S} \\ \mathcal {S} ^ {\prime} \end{array} \right]\right)\right) \neq \operatorname {S u p p} (\operatorname {L a s s o} (S)) ] \leq \varepsilon . +$$ + +Remark 3.5. Note that Definitions 3.3 and 3.4 have an implicit dependence on $n$ , the size of the dataset sampled from the distribution that we omit from the notation for simplicity. + +Before constructing a distribution $D$ we first prove the following Proposition about $(k,\delta)$ -unstable and $(k,\varepsilon)$ -resilient distributions. The proof can be found in Appendix E + +Proposition 3.6 (Separation for unstable yet resilient distributions). If a data distribution is $(k, \varepsilon_1)$ -resilient and $(k, \varepsilon_2)$ -unstable, then there is an adversary that wins the data-aware game of definition 2.1 with probability $\varepsilon_2$ , while no adversary can win the data-oblivious game with probability more than $\varepsilon_1$ . + +# 3.1 (In)Stability and Resilience of Gaussian + +The only thing that remains to prove Theorem 3.1 is to show that Gaussian distributions with proper parameters are $(k,\varepsilon_2)$ -unstable and $(k,\varepsilon_1)$ -resilient at the same time. Here we sketch the two steps we take to prove this. + +Gaussian is Unstable. We first show that each feature in the Gaussian sampling process has a probability of being $k$ -unstable that is proportional to $e^{\lambda - k}$ . Note that the unstability of $i$ -th feature is independent from all other features and also note that the probability is independent of $d$ . This shows that, if $d$ is chosen large enough, with high probability, there will be at least one coordinate that is $k$ -unstable. However, note that the probability of a particular feature being unstable is still low and we are only leveraging the large dimensionality to increase the chance of having an unstable feature. Roughly, if we select $d = \omega(\varepsilon_2 / \varepsilon_1)$ , we can make sure that the ratio of the success rate between data-aware and data-oblivious adversary is what we need. The only thing that remains is to select $n, \lambda$ and $\sigma$ in a way that the data oblivious adversary has success rate of at most $\varepsilon_1$ and at least $\Omega(\varepsilon_1)$ . + +This result actually shows the tightness of the robustness theorem in [63] (See Theorem D.3 for the full description of this result). The authors in [63] show that running Lasso on Gaussian distribution can recover the correct support set, and is even robust to a certain number of adversarial entries. Our result complements theirs and shows that their theorem is indeed tight. Note that the robustness result of [63] is against dataset-aware attacks. In the next step, we show a stronger robustness guarantee for data-oblivious attacks in order to prove our separation result. See Appendix E for a formalization of this argument. + +Gaussian is Resilient. We show the LASSO is resilient when applied on Gaussian of any dimension. In particular, we show that if the adversary aims at adding a feature to the support set of the model, it should "invest" in that feature meaning that the $l_{2}$ weight on that feature should be high across all the poison entries. The bound on the $l_{2}$ norm of each entry will prevent the adversary to invest on all features and therefore, the adversary has to predict which features will be unstable and invest in them. On the other hand, since Gaussian is symmetric, each feature has the same probability of being unstable and the adversary will have a small chance of succeeding. In a nutshell, by selecting $\lambda = \Omega (k + \sigma \sqrt{(n + k)\ln(1 / \varepsilon_1)})$ we can make sure that the success probability of the oblivious adversary is bounded by $\varepsilon_{1}$ . This argument is formalized in Appendix E. + +# 3.2 Experiments + +In this section, we highlight our experimental findings on both synthetic and real data to compare the power of data-oblivious and data-aware poisoning attacks in the context of feature selection. Our experiments empirically support our separation result in Theorem 3.1. + +Our partial-knowledge attack: The attack first explores through the part of data that it has access to and identifies which feature is the most unstable feature. The key here is that the data-aware adversary can search for the most vulnerable feature in the available data. Then, the attack will use that feature to craft poison points that create maximum correlation between that feature and the response variable. See Appendix E.2 for more details. + +Experiments with Gaussian distribution. For the synthetic experiment, we demonstrate the separation result occurs for a large dataset sampled from a Gaussian distribution. For $n = 300$ rows and $d = 5 \times 10^5$ features, we demonstrate that unstable features occur for a dataset drawn from $\mathcal{N}(0,1)^{n \times d}$ . For the LASSO algorithm, we use the hyperparameter of $\lambda = 2\sigma \sqrt{n \log p}$ . We vary the "knowledge" the adversary has of the dataset from $p = 0, 5, 10, \ldots, 95, 100\%$ by only showing the adversary a random sample of $p\%$ (for $p = 0$ , the adversary is completely oblivious and so must choose a feature uniformly at random). The adversary then chooses the most unstable feature out of their $p\%$ of the data and performs the attack on that feature to add it to the $\mathrm{Supp}(\hat{\theta})$ . We observe a clear separation between data-oblivious, data-aware, and partially-aware adversaries in Figure 1. + +![](images/8a525a807c3e43eadb5ea0e13abff77309c7cd6f527903f9b708f8bc568a062c.jpg) +Figure 1: Synthetic experiment. The y-axis is the average (over 30 random $p\%$ splits of the dataset given to the adversary) number of poison points needed to add the feature to $\hat{\theta}$ . The leftmost point shows the power of an oblivious adversary while the rightmost point shows the power of a full-information adversary. The oblivious adversary needs significantly more poison points, on average, to add their uniformly chosen feature to $\operatorname{Supp}(\hat{\theta})$ . + +Experiments with real data. We also consider MNIST and four other datasets used widely in the feature selection literature to explore this separation in real world data: Boston, TOX, Prostate_GE, and SMK. $^3$ + +We first preprocess the data by standardizing to zero mean and unit variance. Then, we chose $\lambda$ such that the resulting parameter vector $\hat{\theta}$ has a reasonable support size (at least 10 features in the support); this was done by searching over the space of $\lambda / n \in [0, 1.0]$ , and resulted in $\lambda = 50.1$ for Boston, $\lambda = 9.35$ for SMK, $\lambda = 17$ for TOX, $\lambda = 5.1$ for Prostate, and $\lambda = 1000$ for MNIST. Just as in the synthetic experiments, we allow the adversary to have the knowledge of $p = 0, 5, 10, \ldots, 95, 100\%$ fraction of the data. Denote the features not in $\operatorname{Supp}(\hat{\theta})$ as $\mathcal{G}$ . We attack each feature $i \in \mathcal{G}$ with the same attack as our synthetic experiment, where $X' \in \mathbb{R}^{k \times d}$ and $Y' \in \mathbb{R}^{k \times 1}$ . We plot the average best value of $k$ needed by the adversary to add a feature to $\operatorname{Supp}(\hat{\theta})$ against how much knowledge ( $p\%$ ) of the dataset they have. We show the results for SMK and TOX in Figure 2 and the result for MNIST in Figure 3. + +![](images/fd703dfad9c55f013f9af1687b9628628749ff1b783a87d215f5f73c11d5c7ec.jpg) + +![](images/418efa161927cd7d1e156418db2093047b866c50a58f731b7bce278c03ca7bdb.jpg) + +![](images/b4d0d1d3e3a454bfe3b51fdb92103e39e0634cc1044c78a0b9bd90f8c11780a8.jpg) +Figure 2: SMK and TOX Experiments. The behavior of attack on these two datasets is very similar to synthetic experiments. We believe this is because of the noisy nature of these feature selection datasets which causes them to be similar to the Gaussian distribution. Since the noise is large, even given the half of the dataset, the attacker cannot identify the most unstable feature. +Figure 3: MNIST experiments. Compared to other experiments, the number of poison points drops faster as the percentage of data-awareness grows. This can be explained by separability (less noisy nature) of MNIST dataset. + +# 4 Conclusion + +In this paper we initiated a formal study of the power of data-oblivious adversaries who do not have the knowledge of the training set in comparison with data-aware adversaries who know the training data completely before adding poison points to it. Our main result proved a separation between the two threat models by constructing a sparse linear regression problem. We show that in this natural problem, Lasso estimator is robust against data-oblivious adversaries that aim to add a non-relevant features to the model with a certain poisoning budget. On the other hand, for the same problem, we prove that data-aware adversaries, with the same budget, can find specific poisoning examples based on the rest of the training data in such a way that they can successfully add non-relevant features to the model. We also experimentally explored the partial-information adversaries who only observe a fraction of the training set and showed that even in this setting, the adversary could be much weaker than full-information adversary. As a result, our work sheds light on an important and yet subtle aspect of modeling the threat posed by poisoning adversaries. We, leave open the question of separating different aspects of poisoning threat model including computational power of adversaries, computational power of learners, clean-label nature of adversaries and etc. + +Acknowledgments. Mohammad Mahmody was supported by NSF grants CCF-1910681 and CNS-1936799. Sanjam Garg is supported in part by DARPA under Agreement No. HR00112020026, AFOSR Award FA9550-19-1-0200, NSF CNS Award 1936826, and research grants by the Sloan Foundation, and Visa Inc. The work is partially supported by Air Force Grant FA9550-18-1-0166, the National Science Foundation (NSF) Grants CCF-FMitF-1836978, IIS-2008559, SaTC-Frontiers-1804648 and CCF-1652140, and ARO grant number W911NF17-1-0405. Somesh Jha is partially supported by the DARPA GARD problem under agreement number 885000. Any opinions, findings and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the United States Government or DARPA. + +# References + +[1] Hojjat Aghakhani, Dongyu Meng, Yu-Xiang Wang, Christopher Kruegel, and Giovanni Vigna. Bullseye polytope: A scalable clean-label poisoning attack with improved transferability. arXiv preprint arXiv:2005.00191, 2020. +[2] Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. In International Conference on Machine Learning, 2018. +[3] Marco Barreno, Blaine Nelson, Russell Sears, Anthony D Joseph, and J Doug Tygar. Can machine learning be secure? In Proceedings of the 2006 ACM Symposium on Information, computer and communications security, pages 16-25. ACM, 2006. +[4] Alex Beatson, Zhaoran Wang, and Han Liu. Blind attacks on machine learners. In Advances In Neural Information Processing Systems, pages 2397-2405, 2016. +[5] Arjun Nitin Bhagoji, Supriyo Chakraborty, Prateek Mittal, and Seraphin Calo. Analyzing federated learning through an adversarial lens. In International Conference on Machine Learning, pages 634-643, 2019. +[6] Battista Biggio, Igino Corona, Davide Maiorca, Blaine Nelson, Nedim Srndic, Pavel Laskov, Giorgio Giacinto, and Fabio Roli. Evasion Attacks against Machine Learning at Test Time. In ECML/PKDD, pages 387-402, 2013. +[7] Battista Biggio, Blaine Nelson, and Pavel Laskov. Support vector machines under adversarial label noise. In Asian conference on machine learning, pages 97-112, 2011. +[8] Battista Biggio, Blaine Nelson, and Pavel Laskov. Poisoning attacks against support vector machines. In Proceedings of the 29th International Coference on International Conference on Machine Learning, pages 1467-1474. Omnipress, 2012. +[9] Battista Biggio and Fabio Roli. Wild patterns: Ten years after the rise of adversarial machine learning. Pattern Recognition, 84:317-331, 2018. +[10] Sébastien Bubeck, Yin Tat Lee, Eric Price, and Ilya Razenshteyn. Adversarial examples from cryptographic pseudo-random generators. arXiv preprint arXiv:1811.06418, 2018. +[11] Sébastien Bubeck, Eric Price, and Ilya Razenshteyn. Adversarial examples from computational constraints. arXiv preprint arXiv:1805.10204, 2018. +[12] Sébastien Bubeck, Eric Price, and Ilya Razenshteyn. Adversarial examples from computational constraints. arXiv preprint arXiv:1805.10204, 2018. +[13] Cody Burkard and Brent Lagesse. Analysis of causative attacks against svms learning from data streams. In Proceedings of the 3rd ACM on International Workshop on Security And Privacy Analytics, pages 31-36, 2017. +[14] Di Cao, Shan Chang, Zhijian Lin, Guohua Liu, and Donghong Sun. Understanding distributed poisoning attack in federated learning. In 2019 IEEE 25th International Conference on Parallel and Distributed Systems (ICPADS), pages 233-239. IEEE, 2019. +[15] Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In IEEE Symposium on Security and Privacy, pages 39-57. IEEE, 2017. +[16] Moses Charikar, Jacob Steinhardt, and Gregory Valiant. Learning from untrusted data. In Proceedings of the 49th Annual ACM SIGACT Symposium on Theory of Computing, pages 47-60. ACM, 2017. +[17] Akshay Degwekar and Vinod Vaikuntanathan. Computational limitations in robust classification and win-win results. arXiv preprint arXiv:1902.01086, 2019. +[18] Ilias Diakonikolas, Gautam Kamath, Daniel M Kane, Jerry Li, Ankur Moitra, and Alistair Stewart. Robust estimators in high dimensions without the computational intractability. In Foundations of Computer Science (FOCS), 2016 IEEE 57th Annual Symposium on, pages 655-664. IEEE, 2016. + +[19] Ilias Diakonikolas, Gautam Kamath, Daniel M Kane, Jerry Li, Jacob Steinhardt, and Alistair Stewart. Sever: A robust meta-algorithm for stochastic optimization. arXiv preprint arXiv:1803.02815, 2018. +[20] Ilias Diakonikolas, Daniel M Kane, and Alistair Stewart. Statistical query lower bounds for robust estimation of high-dimensional Gaussians and Gaussian mixtures. In Foundations of Computer Science (FOCS), 2017 IEEE 58th Annual Symposium on, pages 73-84. IEEE, 2017. +[21] Ilias Diakonikolas, Daniel M Kane, and Alistair Stewart. List-decodable robust mean estimation and learning mixtures of spherical Gaussians. In Proceedings of the 50th Annual ACM SIGACT Symposium on Theory of Computing, pages 1047-1060. ACM, 2018. +[22] Ilias Diakonikolas, Weihao Kong, and Alistair Stewart. Efficient algorithms and lower bounds for robust linear regression. arXiv preprint arXiv:1806.00040, 2018. +[23] Irit Dinur and Kobbi Nissim. Revealing information while preserving privacy. In Proceedings of the twenty-second ACM SIGMOD-SIGACT-SIGART symposium on Principles of database systems, pages 202-210, 2003. +[24] Dimitrios I Diochnos, Saeed Mahloujifar, and Mohammad Mahmoody. Lower bounds for adversarially robust pac learning. arXiv preprint arXiv:1906.05815, 2019. +[25] Cynthia Dwork. Differential privacy: A survey of results. In International conference on theory and applications of models of computation, pages 1-19. Springer, 2008. +[26] Cynthia Dwork, Frank McSherry, Kobbi Nissim, and Adam Smith. Calibrating noise to sensitivity in private data analysis. In Theory of cryptography conference, pages 265-284. Springer, 2006. +[27] Minghong Fang, Neil Zhenqiang Gong, and Jia Liu. Influence function based data poisoning attacks to top-n recommender systems. In Proceedings of The Web Conference 2020, pages 3019-3025, 2020. +[28] Clement Fung, Chris JM Yoon, and Ivan Beschastnikh. Mitigating sybils in federated learning poisoning. arXiv preprint arXiv:1808.04866, 2018. +[29] Sanjam Garg, Somesh Jha, Saeed Mahloujifar, and Mohammad Mahmoody. Adversarily robust learning could leverage computational hardness. arXiv preprint arXiv:1905.11564, 2019. +[30] Jonas Geiping, Liam Fowl, W Ronny Huang, Wojciech Czaja, Gavin Taylor, Michael Moeller, and Tom Goldstein. Witches' brew: Industrial scale data poisoning via gradient matching. arXiv preprint arXiv:2009.02276, 2020. +[31] Micah Goldblum, Dimitris Tsipras, Chulin Xie, Xinyun Chen, Avi Schwarzschild, Dawn Song, Aleksander Madry, Bo Li, and Tom Goldstein. Data security for machine learning: Data poisoning, backdoor attacks, and defenses. arXiv preprint arXiv:2012.10544, 2020. +[32] Ian Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and Harnessing Adversarial Examples. In ICLR, 2015. +[33] Tianyu Gu, Brendan Dolan-Gavitt, and Siddharth Garg. Badnets: Identifying vulnerabilities in the machine learning model supply chain. arXiv preprint arXiv:1708.06733, 2017. +[34] Junfeng Guo and Cong Liu. Practical poisoning attacks on neural networks. Proceedings of the European Conference on Computer Vision, 2020. +[35] Rui Hu, Yuanxiong Guo, Miao Pan, and Yanmin Gong. Targeted poisoning attacks on social recommender systems. In 2019 IEEE Global Communications Conference (GLOBECOM), pages 1-6. IEEE, 2019. +[36] Jonathan Katz and Yehuda Lindell. Introduction to Modern Cryptography. Chapman & Hall/CRC, 2007. +[37] Pang Wei Koh and Percy Liang. Understanding black-box predictions via influence functions. In International Conference on Machine Learning, pages 1885-1894, 2017. + +[38] Pang Wei Koh, Jacob Steinhardt, and Percy Liang. Stronger data poisoning attacks break data sanitization defenses. arXiv preprint arXiv:1811.00741, 2018. +[39] Ram Shankar Siva Kumar, Magnus Nyström, John Lambert, Andrew Marshall, Mario Goertzel, Andi Comissoneru, Matt Swann, and Sharon Xia. Adversarial machine learning-industry perspectives. In 2020 IEEE Security and Privacy Workshops (SPW), pages 69-75. IEEE, 2020. +[40] Kevin A Lai, Anup B Rao, and Santosh Vempala. Agnostic estimation of mean and covariance. In Foundations of Computer Science (FOCS), 2016 IEEE 57th Annual Symposium on, pages 665-674. IEEE, 2016. +[41] Daniel Lowd and Christopher Meek. Adversarial learning. In KDD, pages 641-647, 2005. +[42] Yuzhe Ma, Xiaojin Zhu, and Justin Hsu. Data poisoning against differentially-private learners: attacks and defenses. In Proceedings of the 28th International Joint Conference on Artificial Intelligence, pages 4732-4738. AAAI Press, 2019. +[43] Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards Deep Learning Models Resistant to Adversarial Attacks. In ICLR, 2018. +[44] Saeed Mahloujifar, Dimitrios I Diochnos, and Mohammad Mahmooyd. The curse of concentration in robust learning: Evasion and poisoning attacks from concentration of measure. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 4536-4543, 2019. +[45] Saeed Mahloujifar and Mohammad Mahmoody. Blockwise p-Tampering Attacks on Cryptographic Primitives, Extractors, and Learners. In Theory of Cryptography Conference, pages 245-279. Springer, 2017. +[46] Saeed Mahloujifar and Mohammad Mahmoody. Can adversarially robust learning leverage computational hardness? arXiv preprint arXiv:1810.01407, 2018. +[47] Saeed Mahloujifar and Mohammad Mahmooyd. Can adversarially robust learning leverage computational hardness? In Algorithmic Learning Theory, pages 581-609, 2019. +[48] Saeed Mahloujifar, Mohammad Mahmoody, and Ameer Mohammed. Universal multi-party poisoning attacks. In International Conference on Machine Learning, pages 4274-4283, 2019. +[49] Blaine Nelson, Benjamin I. P. Rubinstein, Ling Huang, Anthony D. Joseph, and J. D. Tygar. Classifier Evasion: Models and Open Problems. In *PSDM*, pages 92–98, 2010. +[50] Nicolas Papernot, Patrick McDaniel, Ian Goodfellow, Somesh Jha, Z Berkay Celik, and Ananthram Swami. Practical black-box attacks against machine learning. In Proceedings of the 2017 ACM on Asia Conference on Computer and Communications Security, pages 506-519. ACM, 2017. +[51] Nicolas Papernot, Patrick McDaniel, Arunesh Sinha, and Michael Wellman. Towards the science of security and privacy in machine learning. arXiv preprint arXiv:1611.03814, 2016. +[52] Nicolas Papernot, Patrick McDaniel, Xi Wu, Somesh Jha, and Ananthram Swami. Distillation as a defense to adversarial perturbations against deep neural networks. In 2016 IEEE Symposium on Security and Privacy (SP), pages 582-597. IEEE, 2016. +[53] Adarsh Prasad, Arun Sai Suggala, Sivaraman Balakrishnan, and Pradeep Ravikumar. Robust estimation via robust gradient estimation. arXiv preprint arXiv:1802.06485, 2018. +[54] Ludwig Schmidt, Shibani Santurkar, Dimitris Tsipras, Kunal Talwar, and Aleksander Madry. Adversarily Robust Generalization Requires More Data. arXiv preprint arXiv:1804.11285, 2018. +[55] Ali Shafahi, W Ronny Huang, Mahyar Najibi, Octavian Suciu, Christoph Studer, Tudor Dumitras, and Tom Goldstein. Poison frogs! targeted clean-label poisoning attacks on neural networks. In Advances in Neural Information Processing Systems, pages 6103-6113, 2018. + +[56] Shiqi Shen, Shruti Tople, and Prateek Saxena. A uror: defending against poisoning attacks in collaborative deep learning systems. In Proceedings of the 32nd Annual Conference on Computer Security Applications, pages 508-519. ACM, 2016. +[57] Reza Shokri, Marco Stronati, Congzheng Song, and Vitaly Shmatikov. Membership inference attacks against machine learning models. In 2017 IEEE Symposium on Security and Privacy (SP), pages 3-18. IEEE, 2017. +[58] Jacob Steinhardt, Pang Wei W Koh, and Percy S Liang. Certified defenses for data poisoning attacks. In Advances in neural information processing systems, pages 3517-3529, 2017. +[59] Octavian Suciu, Radu Marginean, Yigitcan Kaya, Hal Daume III, and Tudor Dumitras. When does machine learning {FAIL}? generalized transferability for evasion and poisoning attacks. In 27th {USENIX} Security Symposium ( {USENIX} Security 18), pages 1299-1316, 2018. +[60] Lichao Sun. Natural backdoor attack on text data. arXiv preprint arXiv:2006.16176, 2020. +[61] Fnu Suya, Saeed Mahloujifar, David Evans, and Yuan Tian. Model-targeted poisoning attacks: Provable convergence and certified bounds. arXiv preprint arXiv:2006.16469, 2020. +[62] Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In ICLR, 2014. +[63] Abhradeep Guha Thakurta and Adam Smith. Differentially private feature selection via stability arguments, and the robustness of the lasso. In Conference on Learning Theory, pages 819-850, 2013. +[64] Vale Tolpegin, Stacey Truex, Mehmet Emre Gursoy, and Ling Liu. Data poisoning attacks against federated learning systems. In European Symposium on Research in Computer Security, pages 480-501. Springer, 2020. +[65] Florian Tramer, Nicholas Carlini, Wieland Brendel, and Aleksander Madry. On adaptive attacks to adversarial example defenses. arXiv preprint arXiv:2002.08347, 2020. +[66] Dimitris Tsipras, Shibani Santurkar, Logan Engstrom, Alexander Turner, and Aleksander Madry. Robustness may be at odds with accuracy. arXiv preprint arXiv:1805.12152, 2018. +[67] Alexander Turner, Dimitris Tsipras, and Aleksander Madry. Label-consistent backdoor attacks. arXiv preprint arXiv:1912.02771, 2019. +[68] Sameer Wagh, Divya Gupta, and Nishanth Chandran. Securenn: 3-party secure computation for neural network training. Proceedings on Privacy Enhancing Technologies, 2019(3):26-49, 2019. +[69] Martin J Wainwright. Sharp thresholds for high-dimensional and noisy sparsity recovery using $\ell_1$ -constrained quadratic programming (lasso). IEEE transactions on information theory, 55(5):2183-2202, 2009. +[70] Yizhen Wang and Kamalika Chaudhuri. Data poisoning attacks against online learning. arXiv preprint arXiv:1808.08994, 2018. +[71] Huang Xiao, Battista Biggio, Gavin Brown, Giorgio Fumera, Claudia Eckert, and Fabio Roli. Is feature selection secure against training data poisoning? In ICML, pages 1689-1698, 2015. +[72] Mengchen Zhao, Bo An, Wei Gao, and Teng Zhang. Efficient label contamination attacks against black-box learning models. In IJCAI, pages 3945-3951, 2017. +[73] Chen Zhu, W Ronny Huang, Ali Shafahi, Hengduo Li, Gavin Taylor, Christoph Studer, and Tom Goldstein. Transferable clean-label poisoning attacks on deep neural nets. arXiv preprint arXiv:1905.05897, 2019. \ No newline at end of file diff --git a/aseparationresultbetweendataobliviousanddataawarepoisoningattacks/images.zip b/aseparationresultbetweendataobliviousanddataawarepoisoningattacks/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..7aabfc2c387a89ebd1acb0cf8ea266d3c792cd28 --- /dev/null +++ b/aseparationresultbetweendataobliviousanddataawarepoisoningattacks/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d8d3f97b802893baebec7f6fda7e8792f8580d27fffd208700ac1a17d2da70a +size 109558 diff --git a/aseparationresultbetweendataobliviousanddataawarepoisoningattacks/layout.json b/aseparationresultbetweendataobliviousanddataawarepoisoningattacks/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..3ba8b3cfc98a834a16102d49769736a97d504ffb --- /dev/null +++ b/aseparationresultbetweendataobliviousanddataawarepoisoningattacks/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5c604e692a22908aaa2c02a76ea05c8caf5bedda08336f8a9dd22545d4551d8b +size 542599 diff --git a/ashadingguidedgenerativeimplicitmodelforshapeaccurate3dawareimagesynthesis/3b1110f1-f38d-4d16-b79a-e9be95d1719c_content_list.json b/ashadingguidedgenerativeimplicitmodelforshapeaccurate3dawareimagesynthesis/3b1110f1-f38d-4d16-b79a-e9be95d1719c_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..30e4d51693e00a942a901698526c7a9ce51b3a73 --- /dev/null +++ b/ashadingguidedgenerativeimplicitmodelforshapeaccurate3dawareimagesynthesis/3b1110f1-f38d-4d16-b79a-e9be95d1719c_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c79957cd77eb22a9561ae174a1197bf9cfc4708582dd8b6e4a49c8819f693d74 +size 72630 diff --git a/ashadingguidedgenerativeimplicitmodelforshapeaccurate3dawareimagesynthesis/3b1110f1-f38d-4d16-b79a-e9be95d1719c_model.json b/ashadingguidedgenerativeimplicitmodelforshapeaccurate3dawareimagesynthesis/3b1110f1-f38d-4d16-b79a-e9be95d1719c_model.json new file mode 100644 index 0000000000000000000000000000000000000000..64201c83b40b0d385c3988d8ffa234367b18658a --- /dev/null +++ b/ashadingguidedgenerativeimplicitmodelforshapeaccurate3dawareimagesynthesis/3b1110f1-f38d-4d16-b79a-e9be95d1719c_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5d0c8b97a3a215ed5250821e41dc608b37842af2f65efa86942b2c9fa73e91b +size 92466 diff --git a/ashadingguidedgenerativeimplicitmodelforshapeaccurate3dawareimagesynthesis/3b1110f1-f38d-4d16-b79a-e9be95d1719c_origin.pdf b/ashadingguidedgenerativeimplicitmodelforshapeaccurate3dawareimagesynthesis/3b1110f1-f38d-4d16-b79a-e9be95d1719c_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..da8e5b9de15391ada0bfaff2278ccb6e2eb347a4 --- /dev/null +++ b/ashadingguidedgenerativeimplicitmodelforshapeaccurate3dawareimagesynthesis/3b1110f1-f38d-4d16-b79a-e9be95d1719c_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c6c4db29a276c20af9f28c0ba0c846b1a3bf3b51701403b8a9b9f9c4452cc2db +size 1559049 diff --git a/ashadingguidedgenerativeimplicitmodelforshapeaccurate3dawareimagesynthesis/full.md b/ashadingguidedgenerativeimplicitmodelforshapeaccurate3dawareimagesynthesis/full.md new file mode 100644 index 0000000000000000000000000000000000000000..f893e84965a35c900aace0a93026f66df698e78c --- /dev/null +++ b/ashadingguidedgenerativeimplicitmodelforshapeaccurate3dawareimagesynthesis/full.md @@ -0,0 +1,285 @@ +# A Shading-Guided Generative Implicit Model for Shape-Accurate 3D-Aware Image Synthesis + +Xingang Pan1 Xudong Xu2 Chen Change Loy3 Christian Theobalt1 Bo Dai3 + +$^{1}$ Max Planck Institute for Informatics $^{2}$ The Chinese University of Hong Kong {xpan, theobalt}@mpi-inf.mpg.de xx018@ie.cuhk.edu.hk + +$^{3}$ S-Lab, Nanyang Technological University + +{ccloy,bo.dai}@ntu.edu.sg + +# Abstract + +The advancement of generative radiance fields has pushed the boundary of 3D-aware image synthesis. Motivated by the observation that a 3D object should look realistic from multiple viewpoints, these methods introduce a multi-view constraint as regularization to learn valid 3D radiance fields from 2D images. Despite the progress, they often fall short of capturing accurate 3D shapes due to the shape-color ambiguity, limiting their applicability in downstream tasks. In this work, we address this ambiguity by proposing a novel shading-guided generative implicit model that is able to learn a starkly improved shape representation. Our key insight is that an accurate 3D shape should also yield a realistic rendering under different lighting conditions. This multi-lighting constraint is realized by modeling illumination explicitly and performing shading with various lighting conditions. Gradients are derived by feeding the synthesized images to a discriminator. To compensate for the additional computational burden of calculating surface normals, we further devise an efficient volume rendering strategy via surface tracking, reducing the training and inference time by $24\%$ and $48\%$ , respectively. Our experiments on multiple datasets show that the proposed approach achieves photorealistic 3D-aware image synthesis while capturing accurate underlying 3D shapes. We demonstrate improved performance of our approach on 3D shape reconstruction against existing methods, and show its applicability on image relighting. Our code will be released at https://github.com/XingangPan/ShadeGAN. + +# 1 Introduction + +Advanced deep generative models, e.g., StyleGAN [1, 2] and BigGAN [3], have achieved great successes in natural image synthesis. While producing impressive results, these 2D representation-based models cannot synthesize novel views of an instance in a 3D-consistent manner. They also fall short of representing an explicit 3D object shape. To overcome such limitations, researchers have proposed new deep generative models that represent 3D scenes as neural radiance fields [4, 5]. Such 3D-aware generative models allow explicit control of viewpoint while preserving 3D consistency during image synthesis. Perhaps a more fascinating merit is that they have shown the great potential of learning 3D shapes in an unsupervised manner from just a collection of unconstrained 2D images. If we could train a 3D-aware generative model that learns accurate 3D object shapes, it would broaden various downstream applications such as 3D shape reconstruction and image relighting. + +Existing attempts for 3D-aware image synthesis [4, 5] tend to learn coarse 3D shapes that are inaccurate and noisy, as shown in Fig.1 (a). We found that such inaccuracy arises from an inevitable ambiguity inherent in the training strategy adopted by these methods. In particular, a form of + +![](images/a780001e5d90c695476a7a0ab2b74d597658b87a3f535ad709f2708215a20afd.jpg) +Figure 1: Motivation. (a) Previous methods like pi-GAN [4] resort to the "multi-view constraint", where the 3D representation is projected to different viewpoints as fake images to the discriminator. The extracted 3D meshes are often inaccurate due to the shape-color ambiguity. (b) The proposed approach ShadeGAN further adopts a "multi-lighting constraint", which motivates the 3D representation to look realistic under different lighting conditions. This constraint effectively addresses the ambiguity, giving rise to more natural and precise 3D shapes. + +regularization, which we refer to as "multi-view constraint", is used to enforce the 3D representation to look realistic from different viewpoints. The constraint is commonly implemented by first projecting the generator's outputs (e.g., radiance fields [6]) to randomly sampled viewpoints, and then feeding them to a discriminator as fake images for training. While such a constraint enables these models to synthesize images in a 3D-aware manner, it suffers from the shape-color ambiguity, i.e., small variations of shape could lead to similar RGB images that look equally plausible to the discriminator, as the color of many objects is locally smooth. Consequently, inaccurate shapes are concealed under this constraint. + +In this work, we propose a novel shading-guided generative implicit model (ShadeGAN) to address the aforementioned ambiguity. In particular, ShadeGAN learns more accurate 3D shapes by explicitly modeling shading, i.e., the interaction of illumination and shape. We believe that an accurate 3D shape should look realistic not only from different viewpoints, but also under different lighting conditions, i.e., satisfying the "multi-lighting constraint". This idea shares similar intuition with photometric stereo [7], which shows that accurate surface normal could be recovered from images taken under different lighting conditions. Note that the multi-lighting constraint is feasible as real-world images used for training are often taken under various lighting conditions. To fulfill this constraint, ShadeGAN takes a relightable color field as the intermediate representation, which approximates the albedo but does not necessarily satisfy viewpoint independence. The color field is shaded under a randomly sampled lighting condition during rendering. Since image appearance via such a shading process is strongly dependent on surface normals, inaccurate 3D shape representations will be much more clearly revealed than in earlier shading-agnostic generative models. Hence, by satisfying the multi-lighting constraint, ShadeGAN is encouraged to infer more accurate 3D shapes as shown in Fig.1 (b). + +The above shading process requires the calculation of the normal direction via back-propagation through the generator, and such calculation needs to be repeated dozens of times for a pixel in volume rendering [4, 5], introducing additional computational overhead. Existing efficient volume rendering techniques [8, 9, 10, 11, 12] mainly target static scenes, and could not be directly applied to generative models due to their dynamic nature. Therefore, to improve the rendering speed of ShadeGAN, we formulate an efficient surface tracking network to estimate the rendered object surface conditioned on the latent code. This enables us to save rendering computations by just querying points near the predicted surface, leading to $24\%$ and $48\%$ reduction of training and inference time without affecting the quality of rendered images. + +Comprehensive experiments are conducted across multiple datasets to verify the effectiveness of ShadeGAN. The results show that our approach is capable of synthesizing photorealistic images while capturing more accurate underlying 3D shapes than previous generative methods. The learned + +distribution of 3D shapes enables various downstream tasks like 3D shape reconstruction, where our approach significantly outperforms other baselines on the BFM dataset [13]. Besides, modeling the shading process enables explicit control over lighting conditions, achieving image relighting effect. Our contributions can be summarized as follows: 1) We address the shape-color ambiguity in existing 3D-aware image synthesis methods with a shading-guided generative model that satisfies the proposed multi-lighting constraint. In this way, ShadeGAN is able to learn more accurate 3D shapes for better image synthesis. 2) We devise an efficient rendering technique via surface tracking, which significantly saves training and inference time for volume rendering-based generative models. 3) We show that ShadeGAN learns to disentangle shading and color that well approximates the albedo, achieving natural relighting effects in image synthesis. + +# 2 Related Work + +Neural volume rendering. Starting from the seminal work of neural radiance fields (NeRF) [6], neural volume rendering has gained much popularity in representing 3D scenes and synthesizing novel views. By integrating coordinate-based neural networks with volume rendering, NeRF performs high-fidelity view synthesis in a 3D consistent manner. Several attempts have been proposed to extend or improve NeRF. For instance, [14, 15, 16] further model illumination, and learn to disentangle reflectance with shading given well-aligned multi-view and multi-lighting images. Besides, many studies accelerate the rendering of static scenes from the perspective of spatial sparsity [8, 9], architectural design [10, 11], or efficient rendering [17, 12]. However, it is not trivial to apply these illumination and acceleration techniques to volume rendering-based generative models [5, 4], as they typically learn from unposed and unpaired images, and represent dynamic scenes that change with respect to the input latent codes. + +In this work, we take the first attempt to model illumination in volume rendering-based generative models, which serves as a regularization for accurate 3D shape learning. We further devise an efficient rendering technique for our approach, which shares similar insight with [12], but does not rely on ground truth depth for training and it is not limited to a small viewpoint range. + +Generative 3D-aware image synthesis. Generative adversarial networks (GANs) [18] are capable of generating photorealistic images of high-resolution, but lack explicit control over camera viewpoint. In order to enable them to synthesis images in a 3D-aware manner, many recent approaches investigate how 3D representations could be incorporated into GANs [19, 20, 21, 22, 23, 24, 25, 26, 27, 5, 4, 28, 29, 30]. While some works directly learn from 3D data [19, 20, 21, 22, 30], in this work we focus on approaches that only have access to unconstrained 2D images, which is a more practical setting. Several attempts [23, 24, 25] adopt 3D voxel features with learned neural rendering. These methods produce realistic 3D-aware synthesis, but the 3D voxels are not interpretable, i.e., they cannot be transferred to 3D shapes. By leveraging differentiable renderer, [26] and [27] learn interpretable 3D voxels and meshes respectively, but [26] suffers from limited visual quality due to low voxel resolution while the learned 3D shapes of [27] exhibit noticeable distortions. The success of NeRF has motivated researchers to use radiance fields as the intermediate 3D representation in GANs [5, 4, 28]. While achieving impressive 3D-aware image synthesis with multi-view consistency, the extracted 3D shapes of these approaches are often imprecise and noisy. Our main goal in this work is to address the inaccurate shape by explicitly modeling illumination in the rendering process. This innovation helps achieve better 3D-aware image synthesis with broader applications. + +Unsupervised 3D shape learning from 2D images. Our work is also related to unsupervised approaches that learn 3D object shapes from unconstrained, monocular view 2D images. While several approaches use external 3D shape templates or 2D key-points as weak supervisions to facilitate learning [31, 32, 33, 34, 35, 36, 37], in this work we consider the harder setting where only 2D images are available. To tackle this problem, most approaches adopt an "analysis-by-synthesis" paradigm [38, 39, 40]. Specifically, they design photo-geometric autoencoders to infer the 3D shape and viewpoint of each image with a reconstruction loss. While succeed in learning the 3D shapes for some object categories, these approaches typically rely on certain regularization to prevent trivial solutions, like the commonly used symmetry assumption on object shapes [39, 40, 31, 32]. Such assumption tends to produce symmetric results that may overlook the asymmetric aspects of objects. Recently, GAN2Shape [41] shows that it is possible to recover 3D shapes for images generated by 2D GANs. This method, however, requires inefficient instance-specific training, and recovers depth maps instead of full 3D representations. + +![](images/5f72cb7eced194141f80716868bf28b428a802e85d190093d6083d9b949d35ef.jpg) +Figure 2: Method overview. Our generator $g_{\theta}$ models a reconfigurable color field conditioned on a latent code $z \sim p_z$ . To synthesis an image, it performs volume rendering under a random camera pose $\xi \sim p_{\xi}$ . The rendering process also performs shading with a randomly sampled lighting condition $\mu \sim p_{\mu}$ . The discriminator learns to distinguish the synthesized images with real images from the training dataset, and the whole model is trained with a GAN loss. Although our model is trained from unconstrained 2D images, it allows explicit control over camera pose and lighting condition during inference. + +The proposed 3D-aware generative model also serves as a powerful approach for unsupervised 3D shape learning. Compared with aforementioned autoencoder-based methods, our GAN-based approach avoids the need to infer the viewpoint of each image, and does not rely on strong regularizations. In experiments, we demonstrate superior performance over recent state-of-the-art approaches Unsup3d [39] and GAN2Shape [41]. + +# 3 Methodology + +We consider the problem of 3D-aware image synthesis by learning from a collection of unconstrained and unlabeled 2D images. We argue that modeling shading, i.e., the interaction of illumination and shape, in a generative implicit model enables unsupervised learning of more accurate 3D object shapes. In the following, we first provide some preliminaries on neural radiance fields (NeRF) [6], and then introduce our shading-guided generative implicit model. + +# 3.1 Preliminaries on Neural Radiance Fields + +As a deep implicit model, NeRF [6] uses an MLP network to represent a 3D scene as a radiance field. The MLP $f_{\theta}:(\boldsymbol{x},\boldsymbol{d}) \to (\sigma ,\boldsymbol{c})$ takes a 3D coordinate $\boldsymbol{x} \in \mathbb{R}^3$ and a viewing direction $\boldsymbol{d} \in \mathbb{S}^2$ as inputs, and outputs a volume density $\sigma \in \mathbb{R}^{+}$ and a color $\boldsymbol{c} \in \mathbb{R}^3$ . To render an image under a given camera pose, each pixel color $C$ of the image is obtained via volume rendering along its corresponding camera ray $r(t) = o + td$ with near and far bounds $t_n$ and $t_f$ as below: + +$$ +\boldsymbol {C} (\boldsymbol {r}) = \int_ {t _ {n}} ^ {t _ {f}} T (t) \sigma (\boldsymbol {r} (t)) \boldsymbol {c} (\boldsymbol {r} (t), \boldsymbol {d}) d t, \text {w h e r e} T (t) = \exp \left(- \int_ {t _ {n}} ^ {t} \sigma (\boldsymbol {r} (s)) d s\right). \tag {1} +$$ + +In practice, this volume rendering is implemented with a discretized form using stratified and hierarchical sampling. As this rendering process is differentiable, NeRF could be directly optimized via posed images of a static scene. After training, NeRF allows the rendering of images under new camera poses, achieving high-quality novel view synthesis. + +# 3.2 Shading-Guided Generative Implicit Model + +In this work, we are interested in developing a generative implicit model that explicitly models the shading process for 3D-aware image synthesis. To achieve this, we make two extensions to the MLP network in NeRF. First, similar to most deep generative models, it is further conditioned on a latent code $z$ sampled from a prior distribution $\mathcal{N}(0, I)^d$ . Second, instead of directly outputting the color $c$ , it outputs a relightable pre-cosine color term $\pmb{a} \in \mathbb{R}^3$ , which is conceptually similar to albedo in the way that it could be shaded under a given lighting condition. While albedo is viewpoint-independent, in this work we do not strictly enforce such independence for $\pmb{a}$ in order to account for dataset bias. Thus, our generator $g_{\theta}: (x, d, z) \to (\sigma, a)$ takes a coordinate $x$ , a viewing direction $d$ , and a latent + +code $z$ as inputs, and outputs a volume density $\sigma$ and a pre-cosine color $\pmb{a}$ . Note that here $\sigma$ is independent of $\pmb{d}$ , while the dependence of $\pmb{a}$ on $\pmb{d}$ is optional. To obtain the color $\pmb{C}$ of a camera ray $\pmb{r}(t) = \pmb{o} + t\pmb{d}$ with near and far bounds $t_n$ and $t_f$ , we calculate the final pre-cosine color $\pmb{A}$ via: + +$$ +\boldsymbol {A} (\boldsymbol {r}, \boldsymbol {z}) = \int_ {t _ {n}} ^ {t _ {f}} T (t, \boldsymbol {z}) \sigma (\boldsymbol {r} (t), \boldsymbol {z}) \boldsymbol {a} (\boldsymbol {r} (t), \boldsymbol {d}, \boldsymbol {z}) d t, \text {w h e r e} T (t, \boldsymbol {z}) = \exp \left(- \int_ {t _ {n}} ^ {t} \sigma (\boldsymbol {r} (s), \boldsymbol {z}) d s\right). \tag {2} +$$ + +We also calculate the normal direction $\pmb{n}$ with: + +$$ +\boldsymbol {n} (\boldsymbol {r}, \boldsymbol {z}) = \hat {\boldsymbol {n}} (\boldsymbol {r}, \boldsymbol {z}) / \| \hat {\boldsymbol {n}} (\boldsymbol {r}, \boldsymbol {z}) \| _ {2}, \text {w h e r e} \hat {\boldsymbol {n}} (\boldsymbol {r}, \boldsymbol {z}) = - \int_ {t _ {n}} ^ {t _ {f}} T (t, \boldsymbol {z}) \sigma (\boldsymbol {r} (t), \boldsymbol {z}) \nabla_ {\boldsymbol {r} (t)} \sigma (\boldsymbol {r} (t), \boldsymbol {z}) d t, \tag {3} +$$ + +where $\nabla_{\boldsymbol{r}(t)}\sigma(\boldsymbol{r}(t), \boldsymbol{z})$ is the derivative of volume density $\sigma$ with respect to its input coordinate, which naturally captures the local normal direction, and could be calculated via back-propagation. Then the final color $\boldsymbol{C}$ is obtained via Lambertian shading as: + +$$ +\boldsymbol {C} (\boldsymbol {r}, \boldsymbol {z}) = \boldsymbol {A} (\boldsymbol {r}, \boldsymbol {z}) \left(k _ {a} + k _ {d} \max (0, \boldsymbol {l} \cdot \boldsymbol {n} (\boldsymbol {r}, \boldsymbol {z}))\right), \tag {4} +$$ + +where $l \in \mathbb{S}^2$ is the lighting direction, $k_{a}$ and $k_{d}$ are the ambient and diffuse coefficients. We provide more discussions on this shading formulation at the end of this subsection. + +Camera and Lighting Sampling. Eq.(2 - 4) describe the process of rendering a pixel color given a camera ray $\boldsymbol{r}(t)$ and a lighting condition $\boldsymbol{\mu} = (l, k_a, k_d)$ . Generating a full image $\boldsymbol{I}_g \in \mathbb{R}^{3 \times H \times W}$ requires one to sample a camera pose $\boldsymbol{\xi}$ and a lighting condition $\boldsymbol{\mu}$ in addition to the latent code $z$ , i.e., $\boldsymbol{I}_g = G_\theta(\boldsymbol{z}, \boldsymbol{\xi}, \boldsymbol{\mu})$ . In our setting, the camera pose $\boldsymbol{\xi}$ could be described by pitch and yaw angles, and is sampled from a prior Gaussian or uniform distribution $p_\xi$ , as also done in previous works [4, 5]. Sampling the camera pose randomly during training would motivate the learned 3D scene to look realistic from different viewpoints. While this multi-view constraint is beneficial for learning a valid 3D representation, it is often insufficient to infer the accurate 3D object shape. Thus, in our approach, we further introduce a multi-lighting constraint by also randomly sampling a lighting condition $\boldsymbol{\mu}$ from a prior distribution $p_\mu$ . In practice, $p_\mu$ could be estimated from the dataset using existing approaches like [39]. We also show in our experiments that a simple and manually tuned prior distribution could also produce reasonable results. As the shading process is sensitive to the normal direction due to the diffuse term $k_d \max(0, l \cdot n(\boldsymbol{r}, \boldsymbol{z}))$ in Eq.(4), this multi-lighting constraint would regularize the model to learn more accurate 3D shapes that produce natural shading, as shown in Fig.1 (b). + +Training. Our generative model follows the paradigm of GANs [18], where the generator is trained together with a discriminator $D$ with parameters $\phi$ in an adversarial manner. During training, the generator generates fake images $I_g = G_\theta(z, \xi, \mu)$ by sampling the latent code $z$ , camera pose $\xi$ and lighting condition $\mu$ from their corresponding prior distributions $p_z, p_\xi$ , and $p_\mu$ . Let $I$ denotes real images sampled from the data distribution $p_I$ . We train our model with a non-saturating GAN loss with $R_1$ regularization [42]: + +$$ +\mathcal {L} (\theta , \phi) = \mathbf {E} _ {\boldsymbol {z} \sim p _ {z}, \boldsymbol {\xi} \sim p _ {\xi}, \boldsymbol {\mu} \sim p _ {\mu}} \left[ f \left(D _ {\phi} \left(G _ {\theta} \left(\boldsymbol {z}, \boldsymbol {\xi}, \boldsymbol {\mu}\right)\right)\right) \right] + \mathbf {E} _ {\boldsymbol {I} \sim p _ {\mathcal {D}}} \left[ f \left(- D _ {\phi} (\boldsymbol {I})\right) + \lambda \| \nabla D _ {\phi} (\boldsymbol {I}) \| ^ {2} \right], \tag {5} +$$ + +where $f(u) = -\log (1 + \exp (-u))$ , and $\lambda$ controls the strength of regularization. More implementation details are provided in the supplementary material. + +Discussion. Note that in Eq.(2 - 4), we perform shading after $\mathbf{A}$ and $\mathbf{n}$ are obtained via volume rendering. An alternative way is to perform shading at each local spatial point as $c(\boldsymbol{r}(t), \boldsymbol{d}, z) = a(\boldsymbol{r}(t), \boldsymbol{d}, z)(k_a + k_d \max(0, l \cdot \boldsymbol{n}(\boldsymbol{r}(t), z)))$ , where $\boldsymbol{n}(\boldsymbol{r}(t), z) = -\nabla_{\boldsymbol{r}(t)} \sigma(\boldsymbol{r}(t), z) / \| \nabla_{\boldsymbol{r}(t)} \sigma(\boldsymbol{r}(t), z) \|_2$ is the local normal. Then we could perform volume rendering using $c(\boldsymbol{r}(t), z)$ to get the final pixel color. In practice, we observe that this formulation obtains suboptimal results. An intuitive reason is that in this formulation, the normal direction is normalized at each local point, neglecting the magnitude of $\nabla_{\boldsymbol{r}(t)} \sigma(\boldsymbol{r}(t), z)$ , which tends to be larger near the object surfaces. We provide more analysis in experiments and the supplementary material. + +The Lambertian shading we used is an approximation to the real illumination scenario. While serving as a good regularization for improving the learned 3D shape, it could possibly introduce an additional gap between the distribution of generated images and that of real images. To compensate + +![](images/61a793ed2a9b181faddccbcf1bc488a260b52514841e865784d51dd5334466ba.jpg) +(a) Conventional volume rendering + +![](images/fc0ecdb286400934288cf999dae3dba4768a4a19a76ed8ba319ddc43a60f16b9.jpg) +(b) Proposed efficient volume rendering +Figure 3: (a) Conventional volume rendering samples dozens of points within a predefined near and far bounds $t_n$ and $t_f$ . (b) We propose an efficient volume rendering technique via surface tracking. Before rendering, our surface tracking network $S_{\psi}$ predicts an initial guess of the surface position $s$ conditioned on the latent code $z$ and camera pose $\xi$ . Then we sample points near $s$ , which requires fewer samples. Finally, we use the volume rendered depth $d$ as the ground truth to train $S_{\psi}$ . During training, $S_{\psi}$ is able to predict depth $s$ that well approximates the real surface depth $d$ . + +for such risk, we could optionally let the predicted $\pmb{a}$ be conditioned on the lighting condition, i.e., $\pmb{a} = \pmb{a}(\pmb{r}(t), \pmb{d}, \pmb{\mu}, \pmb{z})$ . Thus, in cases where the lighting condition deviates from the real data distribution, the generator could learn to adjust the value of $\pmb{a}$ and reduce the aforementioned gap. We show the benefit of this design in the experiments. + +# 3.3 Efficient Volume Rendering via Surface Tracking + +Similar to NeRF, we implement volume rendering with a discretized integral, which typically requires to sample dozens of points along a camera ray, as shown in Fig. 3 (a). In our approach, we also need to perform back-propagation across the generator in Eq.(3) to get the normal direction for each point, which introduces additional computational cost. To achieve more efficient volume rendering, a natural idea is to exploit spatial sparsity. Usually, the weight $T(t,z)\sigma (\boldsymbol {r}(t),z)$ in volume rendering would concentrate on the object surface position during training. Thus, if we know the rough surface position before rendering, we could sample points near the surface to save computation. While for a static scene it is possible to store such spatial sparsity in a sparse voxel grid [8, 9], this technique cannot be directly applied to our generative model, as the 3D scene keeps changing with respect to the input latent code. + +To achieve more efficient volume rendering in our generative implicit model, we further propose a surface tracking network $S$ that learns to mimic the surface position conditioned on the latent code. In particular, the volume rendering naturally allows the depth estimation of the object surface via: + +$$ +t _ {s} (\boldsymbol {r}, \boldsymbol {z}) = \int_ {t _ {n}} ^ {t _ {f}} T (t, \boldsymbol {z}) \sigma (\boldsymbol {r} (t), \boldsymbol {z}) t d t, \tag {6} +$$ + +where $T(t, \boldsymbol{z})$ is defined the same way as in Eq.(2). Thus, given a camera pose $\boldsymbol{\xi}$ and a latent code $\boldsymbol{z}$ , we could render the full depth map $\boldsymbol{t}_s(\boldsymbol{z}, \boldsymbol{\xi})$ . As shown in Fig. 3 (b), we mimic $\boldsymbol{t}_s(\boldsymbol{z}, \boldsymbol{\xi})$ with the surface tracking network $S_{\psi}$ , which is a light-weighted convolutional neural network that takes $\boldsymbol{z}$ , $\boldsymbol{\xi}$ as inputs and outputs a depth map. The depth mimic loss is: + +$$ +\mathcal {L} (\psi) = \mathbf {E} _ {\boldsymbol {z} \sim p _ {z}, \boldsymbol {\xi} \sim p _ {\xi}} \left[ \| S _ {\psi} (\boldsymbol {z}, \boldsymbol {\xi}) - \boldsymbol {t} _ {s} (\boldsymbol {z}, \boldsymbol {\xi}) \| _ {1} + \operatorname {P r e c} (S _ {\psi} (\boldsymbol {z}, \boldsymbol {\xi}), \boldsymbol {t} _ {s} (\boldsymbol {d} (\boldsymbol {z}, \boldsymbol {\xi})) ] \right], \tag {7} +$$ + +where Prec is the perceptual loss that motivates $S_{\psi}$ to better capture edges of the surface. + +During training, $S_{\psi}$ is optimized jointly with the generator and the discriminator. Thus, each time after we sample a latent code $z$ and a camera pose $\xi$ , we can get an initial guess of the depth map as $S_{\psi}(z,\xi)$ . Then for a pixel with predicted depth $s$ , we could perform volume rendering in Eq.(2,3,6) with near bound $t_n = s - \Delta_i / 2$ and far bound $t_f = s + \Delta_i / 2$ , where $\Delta_i$ is the interval for volume rendering that decreases as the training iteration $i$ grows. Specifically, we start with a large interval $\Delta_{max}$ and decrease to $\Delta_{min}$ with an exponential schedule. As $\Delta_i$ decreases, the number of points used for rendering $m$ also decreases accordingly. Note that the computational cost of our efficient surface tracking network is marginal compared to the generator, as the former only needs a single forward pass to render an image while the latter will be queried for $H\times W\times m$ times. Thus, the reduction of $m$ would significantly accelerate the training and inference speed for ShadeGAN. + +![](images/40d709118f2a81f3c0010f8b9a24bb18c2004c07952119cd5c2d55f7ef9a16d3.jpg) +Figure 4: Qualitative comparison on BFM (top), CelebA (middle), and Cats (bottom) datasets. "Albedo" refers to the pre-cosine color that approximates albedo. Our approach synthesizes more accurate 3D shapes than pi-GAN and GRAF, and also learns to disentangle shading with albedo. + +# 4 Experiments + +In this section, we evaluate the proposed ShadeGAN on 3D-aware image synthesis. We also show that ShadeGAN learns much more accurate 3D shapes than previous methods, and in the meantime allows explicit control over lighting conditions. The datasets used include CelebA [43], BFM [13], and Cats [44], all of which contain only unconstrained 2D RGB images. + +Implementation. In terms of model architectures, we adopt a SIREN-based MLP [45] as the generator and a convolutional neural network as the discriminator following [4]. For the prior distribution of lighting conditions, we use Unsup3d [39] to estimate the lighting conditions of real data and subsequently fit a multivariate Gaussian distribution of $\mu = (l,k_a,k_d)$ as the prior. A hand-crafted prior distribution is also included in the ablation study. In quantitative study, we let the pre-cosine color $a$ be conditioned on the lighting condition $\mu$ as well as the viewing direction $d$ unless otherwise stated. In qualitative study, we observe that removing view conditioning achieves slightly better 3D shapes for CelebA and BFM datasets. Thus, we show results without view conditioning for these two datasets in the main paper, and put those with view conditioning in Fig. 4 of the supplementary material. Other implementation details are also provided in the supplementary. + +![](images/9273174af49f57bbb6c66e11d9b1370d1904e4a357a164926f4abf08602e4216.jpg) +Figure 5: Generated face images and their 3D meshes. + +![](images/abbc6f3eb06d42682b208967b4d54d2afda98dc2899ed48bc499f8c0066cd4b3.jpg) +Figure 6: Qualitative ablation. See the main text for discussions. + +Table 1: Comparisons on the BFM dataset. We report FID $(128^{2})$ for image synthesis, and SIDE $(\times 10^{-2})$ and MAD (deg.) for the accuracy of 3D shapes. ' indicates not available. Results of pi-GAN and Ours are averaged over 5 runs. + +
MethodFID ↓SIDE ↓MAD ↓
Supervised-0.41010.78
Unsup3d [39]-0.79316.51
GAN2Shape [41]-0.75614.81
GRAF [5]53.41.85726.60
pi-GAN [4]16.7±0.20.727±0.01220.09±0.23
Ours17.7±0.20.607±0.00714.52±0.11
+ +Table 2: Comparisons on the CelebA and Cats datasets. The image resolution is $128^{2}$ . + +
DatasetMethodFID ↓MAD ↓
CelebAGRAF43.030.48
pi-GAN15.727.22
Ours16.220.49
CatsGRAF30.365.47
pi-GAN10.733.48
Ours10.325.47
+ +Comparison with baselines. We compare ShadeGAN with two state-of-the-art generative implicit models, namely GRAF [5] and pi-GAN [4]. Specifically, Fig. 4 includes both synthesized images as well as their corresponding 3D meshes, which are obtained by performing marching cubes on the volume density $\sigma$ . While GRAF and pi-GAN could synthesize images with controllable poses, their learned 3D shapes are inaccurate and noisy. In contrast, our approach not only synthesizes photorealistic 3D-consistent images, but also learns much more accurate 3D shapes and surface normals, indicating the effectiveness of the proposed multi-lighting constraint as a regularization. More synthesized images and their corresponding shapes are included in Fig.5. Besides more accurate 3D shapes, ShadeGAN can also learn the albedo and diffuse shading components inherently. As shown in Fig. 4, although not perfect, ShadeGAN has managed to disentangle shading and albedo with satisfying quality, as such disentanglement is a natural solution to the multi-lighting constraint. + +The quality of learned 3D shapes is quantitatively evaluated on the BFM dataset. Specifically, we use each of the generative implicit models to generate $50\mathrm{k}$ images and their corresponding depth maps. Image-depth pairs from each model are used as training data to train an additional convolutional neural network (CNN) that learns to predict the depth map of an input image. We then test each trained CNN on the BFM test set and compare its predictions to the ground-truth depth maps as a measurement of the quality of learned 3D shapes. Following [39], we report the scale-invariant depth error (SIDE) and mean angle deviation (MAD) metrics. The results are included in Tab. 1, where ShadeGAN significantly outperforms GRAF and pi-GAN. Besides, ShadeGAN also outperforms other advanced unsupervised 3D shape learning approaches including Unsup3d [39] and GAN2Shape [41], demonstrating its large potential in unsupervised 3D shapes learning. In terms of image quality, Tab. 1 includes the FID [46] scores of images synthesized by different models, where the FID score of ShadeGAN is slightly inferior to pi-GAN in BFM and CelebA. Intuitively, this is caused by the gap between our approximated shading (i.e. Lambertian shading) and the real illumination, which can be potentially avoided by adopting more realistic shading models and improving the lighting prior. + +In Tab. 2, we also show the quantitative results of different models on CelebA and Cats. To evaluate the learned shape, we use each generative implicit model to generate 2k front-view images and their corresponding depth maps. While these datasets do not have ground truth depth, we report MAD obtained by testing pretrained Unsup3d models [39] on these generated image-depth pairs as + +Table 3: Ablation study on the BFM dataset. + +
No.MethodFID ↓SIDE ↓MAD ↓
(1)ShadeGAN17.70.60714.52
(2)local shading30.10.75418.18
(3)w/o light19.20.61814.53
(4)w/o view18.60.62214.88
(5)manual prior20.20.64315.38
(6)+efficient18.20.67314.72
+ +Table 4: Training and inference time cost on CelebA. The efficient volume rendering significantly improves training and inference speed. + +
MethodTrain (h)Inference (s)FID
ShadeGAN92.30.34316.4
+efficient70.20.17916.2
pi-GAN56.80.20415.7
+efficient46.90.11415.9
+ +![](images/9eac9735b094b2261fd54ba11b931f39de034719d5416d0ae1e97973ed01ed18.jpg) +Figure 7: Visualization of depths predicted by our depth tracking network and those calculated via volume rendering. +Figure 8: Illumination-aware image synthesis. ShadeGAN allows explicit control over the lighting. The pre-cosine color (albedo) is independent of lighting in (a) and is conditioned on lighting in (b). We show results of adding a specular term in (c). + +![](images/cb5499921c4fa6b6d7dd7d6e325123baf4ed038039dd487cb4e7a3a1dd1f3247.jpg) +(a) w/o light condition + +![](images/3c44fbbbfa751542ee85f84f5d48bf7e59d2f8add799d6f8e86bdb81f0f90101.jpg) +(b) with light condition +(c) with specular + +![](images/f5f0ceda76e10f90d31c2a4427c7ba19730405498ac82cc888b78c8b31791e32.jpg) + +a reference. As we can observe, results on CelebA and Cat are consistent with those on the BFM dataset. + +Ablation studies. We further study the effects of several design choices in ShadeGAN. First, we perform local points-specific shading as mentioned in the discussion of Sec. 3.2. As Tab. 3 No.(2) and Fig. 6 (b) show, the results of such a local shading strategy are notably worse than the original one, which indicates that taking the magnitude of $\nabla_{\pmb{x}}\sigma$ into account is beneficial. Besides, the results of Tab. 3 No.(3) and No.(4) imply that removing $\pmb{a}$ 's dependence on the lighting $\pmb{\mu}$ or the viewpoint $\pmb{d}$ could lead to a slight performance drop. The results of using a simple manually tuned lighting prior are provided in Tab. 3 No.(5) and Fig. 6 (c), which are only moderately worse than the results of using a data-driven prior, and the generated shapes are still significantly better than the ones produced by existing approaches. + +To verify the effectiveness of the proposed efficient volume rendering technique, we include its effects on image quality and training/inference time in Tab. 3 No.(6) and Tab. 4. It is observed that the efficient volume rendering has marginal effects on the performance, but significantly reduces the training and inference time by $24\%$ and $48\%$ for ShadeGAN. Moreover, in Fig. 7 we visualize the depth maps predicted by our surface tracking network and those obtained via volume rendering. It is shown that under varying identities and camera poses, the surface tracking network could consistently predict depth values that are quite close to the real surface positions, so that we can sample points near the predicted surface for rendering without sacrificing image quality. + +Illumination-aware image synthesis. As ShadeGAN models the shading process, it by design allows explicit control over the lighting condition. We provide such illumination-aware image synthesis results in Fig.8, where ShadeGAN generates promising images under different lighting directions. We also show that in cases where the predicted $\pmb{a}$ is conditioned on the lighting condition $\pmb{\mu}$ , $\pmb{a}$ would slightly change w.r.t. the lighting condition, e.g., it would be brighter in areas having a overly dim shading in order to make the final image more natural. Besides, we could optionally add a specular term $k_{s}\max (0,\pmb {h}\cdot \pmb {n})^{p}$ in Eq. 4 (i.e., Blinn-Phong shading [47], where $h$ is the bisector of the angle between the viewpoint and the lighting direction) to create specular highlight effects, as shown in Fig.8 (c). + +GAN inversion. ShadeGAN could also be used to reconstruct a given target image by performing GAN inversion. As shown in Fig. 9 such inversion allows us to obtain several factors of the image, including the 3D shape, surface normal, approximated albedo, and shading. Besides, we can further perform view synthesis and relighting by changing the viewpoint and lighting condition. The implementation of GAN inversion is provided in the supplementary material. + +![](images/b40f0976b97a566f2d363f1621ecbb7faba740ebe00643056ded7f820c671ea3.jpg) +Real image + +![](images/61b12d194c55f5b206c3952a04a8bb0175e70cdc596ca2d76a332500caff8afb.jpg) +Reconstruction + +![](images/1e6e11bf5a38886cbfe8f0a41485a735f7391ce127e10a9292ed8fbce4de5198.jpg) +3D Mesh + +![](images/0e0e36145785e457dff801dd25c30128da01723fb5171a7abe5751ba4d8ea50f.jpg) +Normal + +![](images/110df1cdc522c9e48b7a5a9d53019707ce4a2060c8ec421c8df30a19348f7ca8.jpg) +Albedo +Figure 9: GAN inversion for real image editing. + +![](images/33c4501396b2000570e3cee1b00640735fb2b5d426d7473d40f92fb08ac4dd92.jpg) +Diffuse shading + +![](images/56594643911b6174d0615e084fd166f2c40c099c5729952dea0054112bea6adf.jpg) +View synthesis + +![](images/25e9f12322bc739c5d4017b568573331d5970d8d1e6a358cb521efe378dbaac1.jpg) + +![](images/2d8f1b3dea51554eefc1293422efb708cc1111b5e070ef040d372eb32243bce9.jpg) +Relighting + +**Discussions.** As the Lambertian shading we used is an approximation to the real illumination, the albedo learned by ShadeGAN is not perfectly disentangled. Our approach does not consider the spatially-varying material properties of objects as well. In the future, we intend to incorporate more sophisticated shading models to learn better disentangled generative reflectance fields. + +# 5 Conclusion + +In this work, we present ShadeGAN, a new generative implicit model for shape-accurate 3D-aware image synthesis. We have shown that the multi-lighting constraint, achieved in ShadeGAN by explicit illumination modeling, significantly helps learning accurate 3D shapes from 2D images. ShadeGAN also allows us to control the lighting condition during image synthesis, achieving natural image relighting effects. To reduce the computational cost, we have further devised a light-weighted surface tracking network, which enables an efficient volume rendering technique for generative implicit models, achieving significant acceleration on both training and inference speed. A generative model with shape-accurate 3D representation could broaden its applications in vision and graphics, and our work has taken a solid step towards this goal. + +Acknowledgment. We would like to thank Eric R. Chan for sharing the codebase of pi-GAN. This study is supported under the ERC Consolidator Grant 4DRepLy (770784). This study is also supported under the RIE2020 Industry Alignment Fund - Industry Collaboration Projects (IAF-ICP) Funding Initiative, as well as cash and in-kind contribution from the industry partner(s). + +# References + +[1] T. Karras, S. Laine, and T. Aila, "A style-based generator architecture for generative adversarial networks," in CVPR, 2019. +[2] T. Karras, S. Laine, M. Aittala, J. Hellsten, J. Lehtinen, and T. Aila, "Analyzing and improving the image quality of stylegan," in CVPR, 2020. +[3] A. Brock, J. Donahue, and K. Simonyan, "Large scale gan training for high fidelity natural image synthesis," in ICLR, 2019. +[4] E. R. Chan, M. Monteiro, P. Kellnhofer, J. Wu, and G. Wetzstein, "pi-gan: Periodic implicit generative adversarial networks for 3d-aware image synthesis," in CVPR, 2021. +[5] K. Schwarz, Y. Liao, M. Niemeyer, and A. Geiger, "Graf: Generative radiance fields for 3d-aware image synthesis," in NeurIPS, 2020. +[6] B. Mildenhall, P. P. Srinivasan, M. Tancik, J. T. Barron, R. Ramamoorthi, and R. Ng, “Nerf: Representing scenes as neural radiance fields for view synthesis,” in ECCV, 2020. +[7] R. J. Woodham, "Photometric method for determining surface orientation from multiple images," Optical engineering, vol. 19, no. 1, p. 191139, 1980. +[8] L. Liu, J. Gu, K. Zaw Lin, T.-S. Chua, and C. Theobalt, “Neural sparse voxel fields,” in NeurIPS, 2020. +[9] A. Yu, R. Li, M. Tancik, H. Li, R. Ng, and A. Kanazawa, "PlenOctrees for real-time rendering of neural radiance fields," in arXiv, 2021. +[10] C. Reiser, S. Peng, Y. Liao, and A. Geiger, "Kilonerf: Speeding up neural radiance fields with thousands of tiny mlps," arXiv preprint arXiv:2103.13744, 2021. +[11] S. J. Garbin, M. Kowalski, M. Johnson, J. Shotton, and J. Valentin, "Fastnerf: High-fidelity neural rendering at 200fps," arXiv preprint arXiv:2103.10380, 2021. +[12] T. Neff, P. Stadlbauer, M. Parger, A. Kurz, C. R. A. Chaitanya, A. Kaplanyan, and M. Steinberger, "Donerf: Towards real-time rendering of neural radiance fields using depth oracle networks," arXiv preprint arXiv:2103.03231, 2021. + +[13] P. Paysan, R. Knothe, B. Amberg, S. Romdhani, and T. Vetter, "A 3d face model for pose and illumination invariant face recognition," in 2009 Sixth IEEE International Conference on Advanced Video and Signal Based Surveillance, IEEE, 2009. +[14] M. Boss, R. Braun, V. Jampani, J. T. Barron, C. Liu, and H. Lensch, “Nerd: Neural reflectance decomposition from image collections,” arXiv preprint arXiv:2012.03918, 2020. +[15] S. Bi, Z. Xu, P. Srinivasan, B. Mildenhall, K. Sunkavalli, M. Hasan, Y. Hold-Geoffroy, D. Kriegman, and R. Ramamoorthi, "Neural reflectance fields for appearance acquisition," arXiv preprint arXiv:2008.03824, 2020. +[16] P. P. Srinivasan, B. Deng, X. Zhang, M. Tancik, B. Mildenhall, and J. T. Barron, "Nerv: Neural reflectance and visibility fields for relighting and view synthesis," in CVPR, 2021. +[17] D. B. Lindell, J. N. Martel, and G. Wetzstein, "Autoint: Automatic integration for fast neural volume rendering," arXiv preprint arXiv:2012.01714, 2020. +[18] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio, "Generative adversarial nets," in NIPS, 2014. +[19] J. Wu, C. Zhang, T. Xue, B. Freeman, and J. Tenenbaum, “Learning a probabilistic latent space of object shapes via 3d generative-adversarial modeling,” in NIPS, 2016. +[20] H. A. Alhajla, S. K. Mustikovela, A. Geiger, and C. Rother, "Geometric image synthesis," in ACCV, Springer, 2018. +[21] X. Chen, D. Cohen-Or, B. Chen, and N. J. Mitra, "Towards a neural graphics pipeline for controllable image generation," Computer Graphics Forum, vol. 40, no. 2, 2021. +[22] J.-Y. Zhu, Z. Zhang, C. Zhang, J. Wu, A. Torralba, J. Tenenbaum, and B. Freeman, "Visual object networks: Image generation with disentangled 3d representations," in NeurIPS, 2018. +[23] T. Nguyen-Phuoc, C. Li, L. Theis, C. Richardt, and Y.-L. Yang, "Hologan: Unsupervised learning of 3d representations from natural images," in ICCV, 2019. +[24] T. Nguyen-Phuoc, C. Richardt, L. Mai, Y.-L. Yang, and N. Mitra, "Blockgan: Learning 3d object-aware scene representations from unlabelled images," in NeurIPS, Nov 2020. +[25] Y. Liao, K. Schwarz, L. Mescheder, and A. Geiger, "Towards unsupervised learning of generative models for 3d controllable image synthesis," in CVPR, 2020. +[26] P. Henzler, N. J. Mitra, and T. Ritschel, "Escaping plato's cave: 3d shape from adversarial rendering," in ICCV, 2019. +[27] A. Szabó, G. Meishvili, and P. Favaro, "Unsupervised generative 3d shape learning from natural images," arXiv preprint arXiv:1910.00287, 2019. +[28] M. Niemeyer and A. Geiger, "Giraffe: Representing scenes as compositional generative neural feature fields," in CVPR, 2021. +[29] A. Tewari, M. Elgharib, G. Bharaj, F. Bernard, H.-P. Seidel, P. Pérez, M. Zollhofer, and C. Theobalt, "Stylerig: Rigging stylegan for 3d control over portrait images," in CVPR, 2020. +[30] T. Yenamandra, A. Tewari, F. Bernard, H.-P. Seidel, M. Elgharib, D. Cremers, and C. Theobalt, "i3dmm: Deep implicit 3d morphable model of human heads," in CVPR, 2021. +[31] S. Tulsiani, N. Kulkarni, and A. Gupta, "Implicit mesh reconstruction from unannotated image collections," arXiv preprint arXiv:2007.08504, 2020. +[32] S. Goel, A. Kanazawa, and J. Malik, "Shape and viewpoint without keypoints," ECCV, 2020. +[33] L. Tran and X. Liu, "Nonlinear 3d face morphable model," in CVPR, 2018. +[34] A. Kanazawa, S. Tulsiani, A. A. Efros, and J. Malik, "Learning category-specific mesh reconstruction from image collections," in ECCV, 2018. +[35] A. Kanazawa, M. J. Black, D. W. Jacobs, and J. Malik, "End-to-end recovery of human shape and pose," in CVPR, 2018. +[36] S. Sanyal, T. Bolkart, H. Feng, and M. J. Black, “Learning to regress 3d face shape and expression from an image without 3d supervision,” in CVPR, 2019. +[37] J. Shang, T. Shen, S. Li, L. Zhou, M. Zhen, T. Fang, and L. Quan, "Self-supervised monocular 3d face reconstruction by occlusion-aware multi-view geometry consistency," ECCV, 2020. + +[38] M. Sahasrabudhe, Z. Shu, E. Bartrum, R. Alp Guler, D. Samaras, and I. Kokkinos, "Lifting autoencoders: Unsupervised learning of a fully-disentangled 3d morphable model using deep non-rigid structure from motion," in ICCV Workshops, 2019. +[39] S. Wu, C. Rupprecht, and A. Vedaldi, "Unsupervised learning of probably symmetric deformable 3d objects from images in the wild," in CVPR, 2020. +[40] X. Li, S. Liu, K. Kim, S. De Mello, V. Jampani, M.-H. Yang, and J. Kautz, "Self-supervised single-view 3d reconstruction via semantic consistency," ECCV, 2020. +[41] X. Pan, B. Dai, Z. Liu, C. C. Loy, and P. Luo, "Do 2d gans know 3d shape? unsupervised 3d shape reconstruction from 2d image gans," in ICLR, 2021. +[42] L. Mescheder, A. Geiger, and S. Nowozin, "Which training methods for gans do actually converge?", in ICML, 2018. +[43] Z. Liu, P. Luo, X. Wang, and X. Tang, “Deep learning face attributes in the wild,” in ICCV, 2015. +[44] W. Zhang, J. Sun, and X. Tang, "Cat head detection-how to effectively exploit shape and texture features," in ECCV, 2008. +[45] V. Sitzmann, J. Martel, A. Bergman, D. Lindell, and G. Wetzstein, "Implicit neural representations with periodic activation functions," in NeurIPS, 2020. +[46] M. Heusel, H. Ramsauer, T. Unterthiner, B. Nessler, and S. Hochreiter, "Gans trained by a two time-scale update rule converge to a local nash equilibrium," in NeurIPS, 2017. +[47] B. T. Phong, "Illumination for computer generated pictures," Communications of the ACM, vol. 18, no. 6, pp. 311-317, 1975. +[48] E. Perez, F. Strub, H. De Vries, V. Dumoulin, and A. Courville, "Film: Visual reasoning with a general conditioning layer," in AAAI, 2018. +[49] R. Liu, J. Lehman, P. Molino, F. P. Such, E. Frank, A. Sergeev, and J. Yosinski, "An intriguing failing of convolutional neural networks and the coordconv solution," in NeurIPS, 2018. +[50] K. He, X. Zhang, S. Ren, and J. Sun, "Deep residual learning for image recognition," in CVPR, 2016. +[51] Y. Wu and K. He, "Group normalization," in ECCV, 2018. +[52] S. Ioffe and C. Szegedy, "Batch normalization: Accelerating deep network training by reducing internal covariate shift," in ICML, 2015. +[53] D. P. Kingma and J. Ba, “Adam: A method for stochastic optimization,” arXiv preprint arXiv:1412.6980, 2014. +[54] "Unsup3d." https://github.com/elliottwu/unsup3d. +[55] "Celeba." http://mmlab.ie.ie.cuhk.edu.hk/projects/CelebA.html. +[56] “Cats.” https://web.archive.org/web/20150520175645/http://137.189.35.203/WebUI/CatDatabase/catData.html. +[57] Y. Choi, Y. Uh, J. Yoo, and J.-W. Ha, "Stargan v2: Diverse image synthesis for multiple domains," in CVPR, 2020. \ No newline at end of file diff --git a/ashadingguidedgenerativeimplicitmodelforshapeaccurate3dawareimagesynthesis/images.zip b/ashadingguidedgenerativeimplicitmodelforshapeaccurate3dawareimagesynthesis/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e74f486f2ebd4f23dd5c09310e692c39b064bbc5 --- /dev/null +++ b/ashadingguidedgenerativeimplicitmodelforshapeaccurate3dawareimagesynthesis/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:53fb4cdf0d7f2b6d13742d31af45d781278164487a0babcd23b56ee5583724f3 +size 622391 diff --git a/ashadingguidedgenerativeimplicitmodelforshapeaccurate3dawareimagesynthesis/layout.json b/ashadingguidedgenerativeimplicitmodelforshapeaccurate3dawareimagesynthesis/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..b71455ba2ba88b4c931da7e9c37ddc48bd8f513d --- /dev/null +++ b/ashadingguidedgenerativeimplicitmodelforshapeaccurate3dawareimagesynthesis/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:dcf477d0592b816ecbf9551a753b3ff63289d042b4f6b3280b5f550f57f24f42 +size 426966 diff --git a/asinglegradientstepfindsadversarialexamplesonrandomtwolayersneuralnetworks/765ee37d-7e6d-4f63-9d11-80007a3579b5_content_list.json b/asinglegradientstepfindsadversarialexamplesonrandomtwolayersneuralnetworks/765ee37d-7e6d-4f63-9d11-80007a3579b5_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..98e348207cedb8ba546b2d0d97c99fa58abaa446 --- /dev/null +++ b/asinglegradientstepfindsadversarialexamplesonrandomtwolayersneuralnetworks/765ee37d-7e6d-4f63-9d11-80007a3579b5_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bb5b9166782dfe04deb02ec6d8085404e99e34d1a8bd676ff0d24ce009a21529 +size 78297 diff --git a/asinglegradientstepfindsadversarialexamplesonrandomtwolayersneuralnetworks/765ee37d-7e6d-4f63-9d11-80007a3579b5_model.json b/asinglegradientstepfindsadversarialexamplesonrandomtwolayersneuralnetworks/765ee37d-7e6d-4f63-9d11-80007a3579b5_model.json new file mode 100644 index 0000000000000000000000000000000000000000..ddda290fb7c42e91b53f55c142b7016c0b43ef8f --- /dev/null +++ b/asinglegradientstepfindsadversarialexamplesonrandomtwolayersneuralnetworks/765ee37d-7e6d-4f63-9d11-80007a3579b5_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e4e21e18743bf4d8711139d0c41991ab37e4e8704288bdfca3ff5eb7f76f3e10 +size 89583 diff --git a/asinglegradientstepfindsadversarialexamplesonrandomtwolayersneuralnetworks/765ee37d-7e6d-4f63-9d11-80007a3579b5_origin.pdf b/asinglegradientstepfindsadversarialexamplesonrandomtwolayersneuralnetworks/765ee37d-7e6d-4f63-9d11-80007a3579b5_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..299d51537c0409c520c1926c88a8b3a09f3c169e --- /dev/null +++ b/asinglegradientstepfindsadversarialexamplesonrandomtwolayersneuralnetworks/765ee37d-7e6d-4f63-9d11-80007a3579b5_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6c0cbc0d893029b2c10297acc8848a5f004ceb189f9d296026fecdcba3241921 +size 730130 diff --git a/asinglegradientstepfindsadversarialexamplesonrandomtwolayersneuralnetworks/full.md b/asinglegradientstepfindsadversarialexamplesonrandomtwolayersneuralnetworks/full.md new file mode 100644 index 0000000000000000000000000000000000000000..7750251a2fba3dc680d03d29c184eef846643a23 --- /dev/null +++ b/asinglegradientstepfindsadversarialexamplesonrandomtwolayersneuralnetworks/full.md @@ -0,0 +1,436 @@ +# A single gradient step finds adversarial examples on random two-layers neural networks + +Sebastien Bubeck +Microsoft Research + +Yeshwanth Cherapanamjeri +UC Berkeley + +Gauthier Gidel* +Mila, Université de Montréal + +Rémi Tachet des Combes +Microsoft Research + +# Abstract + +Daniely and Schacham [2020] recently showed that gradient descent finds adversarial examples on random undercomplete two-layers ReLU neural networks. The term "undercomplete" refers to the fact that their proof only holds when the number of neurons is a vanishing fraction of the ambient dimension. We extend their result to the overcomplete case, where the number of neurons is larger than the dimension (yet also subexponential in the dimension). In fact we prove that a single step of gradient descent suffices. We also show this result for any subexponential width random neural network with smooth activation function. + +# 1 Introduction + +We study the random two-layers neural network model, $f: \mathbb{R}^d \to \mathbb{R}$ defined by + +$$ +f (x) = \frac {1}{\sqrt {k}} \sum_ {\ell = 1} ^ {k} a _ {\ell} \psi \left(w _ {\ell} \cdot x\right), \tag {1} +$$ + +where $\psi : \mathbb{R} \to \mathbb{R}$ is a fixed non-linearity, the weight vectors $w_{\ell} \in \mathbb{R}^{d}$ are i.i.d. from a Gaussian $\mathcal{N}\left(0, \frac{1}{d} \mathrm{I}_{d}\right)$ (so they are roughly unit norm vectors), and the coefficients $a_{\ell} \in \mathbb{R}$ are independent from the weight vectors and i.i.d. uniformly distributed in $\{-1, +1\}$ . With this parametrization, the central limit theorem says that, for $x \in \sqrt{d} \cdot \mathbb{S}^{d-1}$ (so that $w_{\ell} \cdot x \sim \mathcal{N}(0, 1)$ ) and large width $k$ , the distribution of $f(x)$ is approximately a centered Gaussian with variance $\mathbb{E}_{X \sim \mathcal{N}(0, 1)}[\psi(X)^2]$ . + +Our goal is to study the concept of adversarial examples in this random model. We say that $\delta \in \mathbb{R}^d$ is an adversarial perturbation at $x \in \mathbb{R}^d$ if $\| \delta \| \ll \| x \|$ and $\mathrm{sign}(f(x)) \neq \mathrm{sign}(f(x + \delta))$ . In this case, we call $x + \delta$ an adversarial example. Our main result is that, while $|f(x)| = O(1)$ with high probability, a single gradient step on $f$ (i.e., a perturbation of the form $\delta = \eta \nabla f(x)$ for some $\eta \in \mathbb{R}$ ) suffices to find such adversarial examples, with roughly $\| \delta \| \simeq \frac{\|x\|}{\sqrt{d}} = 1$ . Note, here that gradients are taken with respect to the input to the network as opposed to the weights of the network. We prove this statement for networks of subexponential width (e.g., $k \ll \exp(o(d))$ ) with both smooth and ReLU activation functions. We first state our result for smooth activation functions in the following theorem. + +Theorem 1. Let $\gamma \in (0,1)$ and $\psi$ be non-constant, Lipschitz and with Lipschitz derivative. There exists constants $C_1,C_2,C_3,C_4$ depending on $\psi$ such that the following holds true. Assume $k\geq$ + +$C_1\log^3 (1 / \gamma)$ and $d\geq C_2\log (k / \gamma)\log (1 / \gamma)$ , and let $\eta \in \mathbb{R}$ such that $|\eta | = C_3\frac{\sqrt{\log(1 / \gamma)}}{\|\nabla f(x)\|^2}$ and $\mathrm{sign}(\eta) = -\mathrm{sign}(f(x))$ . Then, with probability at least $1 - \gamma$ , one has: + +$$ +\operatorname {s i g n} (f (x)) \neq \operatorname {s i g n} (f (x + \eta \nabla f (x))). +$$ + +Moreover we have $\| \eta \nabla f(x)\| \leq C_4\sqrt{\log(1 / \gamma)}$ + +Note that our proof of Theorem 1 in Section 2 easily gives explicit values for $C_1, C_2, C_3, C_4$ . Also note that by re-arranging the constraint on $d$ in Theorem 1 and setting $\gamma = 1 / \mathrm{poly}(d)$ , the subexponential width condition is of the form $k \ll \exp(o(d))$ . + +Our second main result establishes similar behavior for the non-smooth ReLU activation unit. + +Theorem 2. Let $\gamma \in (0,1)$ and $\psi(t) = \max(0,t)$ . There exist constants $C_1, C_2, C_3, C_4, C_5$ such that the following holds true. Assume + +$$ +C _ {1} \log^ {6} (d) \log (1 / \gamma) \leq k, \quad C _ {2} \log^ {3} (d) \log (1 / \gamma) \leq d, \quad C _ {3} \log^ {4} (k) \log (1 / \gamma) \leq \frac {d}{\log (d)} +$$ + +and let $\eta \in \mathbb{R}$ such that $|\eta| = C_4 \frac{\sqrt{\log(1 / \gamma)}}{\|\nabla f(x)\|^2}$ and $\mathrm{sign}(\eta) = -\mathrm{sign}(f(x))$ . Then, with probability at least $1 - \gamma$ , one has: + +$$ +\operatorname {s i g n} (f (x)) \neq \operatorname {s i g n} (f (x + \eta \nabla f (x))). +$$ + +Moreover, we have $\| \eta \nabla f(x)\| \leq C_5\sqrt{\log(1 / \gamma)}$ + +As before, note that the subexponential condition on the width in the above Theorem is of the form $k \ll \exp(d^{0.24})$ . In fact by modifying a bit the proof we can get a condition of the form $k \ll \exp(d^{\rho})$ for any $\rho < 1/2$ , but for the sake of clarity we only prove the weaker version stated above. The proof for the ReLU activation is broken into two separate cases focusing on the overlapping regimes: + +$$ +\text {C a s e 1 :} k \gtrsim d \log^ {2} (d) \quad \text {a n d} \quad \text {C a s e 2 :} \log^ {6} (d) \log (1 / \gamma) \lesssim k \lesssim d \log^ {3} d, +$$ + +as the proofs for the two settings use distinct arguments. The proof for the first regime is similar to the proof for Theorem 1 while the second uses a refinement of an argument by Daniely and Schacham [2020]. These arguments are carried out in Section 3. We would like to note that our results and corresponding proofs are extendible to the setting where $a_{\ell}$ are drawn from a normal distribution with minor modifications. We include the simpler setting with Bernoulli activations in the last layer for the sake of conceptual clarity. Intuitively, the strong concentration (and anti-concentration) properties of the normal distribution coupled with a conditioning argument on the magnitudes of the weights in the final layer yield similar results for gaussian setting as well. Additionally, due to the scale invariance of the ReLU activation function, our results also hold true for any distribution over $x$ as long as $\mathbb{P}\{x = 0\} = 0$ and for smooth activations when $\mathbb{P}\left\{\| x\| = \Theta (\sqrt{d})\right\} = 1$ . Finally, our results also hold when a bias unit is introduced; in this setting, we simply project our perturbation $\delta$ onto the $((d - 1)$ -dimensional) subspace of perturbations which leave the bias unit unchanged. + +# 1.1 Related works + +The existence of adversarial examples in neural network architectures was first evidenced in the seminal paper of Szegedy et al. [2014], where the authors found adversarial examples by using the L-BFGS optimization procedure. Shortly after this work, it was hypothesized in Goodfellow et al. [2015] that the existence of adversarial examples stems from an excessive "linearity" of neural network models. This hypothesis was experimentally confirmed by showing that a single step of gradient descent suffices to find adversarial perturbations (the so-called fast gradient sign method -FGSM). Our theorems can be thought of as a theoretical confirmation of the hypothesis in Goodfellow et al. [2015]. In fact, as explained in Section 1.2, our proofs proceed exactly by showing that "most" two-layers neural networks behave "mostly" linearly over "vast" regions of input space. + +We note that not all networks are susceptible to one-step gradient attacks to find adversarial examples. Indeed, in Goodfellow et al. [2015], it was shown that adversarial training can be used to build networks that are somewhat robust to one-step gradient attacks. Interestingly, Madry et al. [2018] showed that such models remain susceptible to multi-steps gradient attacks, and empirically demonstrated that better robustness can be achieved with adversarial training using multi-steps gradient + +attacks. Understanding this phenomenon theoretically remains a challenge, see for example Allen-Zhu and Li [2020] for a proposed approach, and Moosavi-Dezfooli et al. [2019], Qin et al. [2019] for discussion/algorithmsic consequences of the relation with the phenomenon of gradient obfuscation (Papernot et al. [2017], Athalye et al. [2018]). + +Our work is a direct follow-up of Daniely and Schacham [2020] (which itself follows Shamir et al. [2019]). Daniely and Schacham prove that multi-steps gradient descent finds adversarial examples for ReLU random networks of the form (1), as long as the number of neurons is much smaller than the dimension (i.e., $k = o(d)$ ). They explicitly conjecture that this condition is not necessary, and indeed we exponentially improve it in Theorem 2 (see below for a discussion of $k$ exponential in the dimension). We note that Daniely and Schacham went beyond two-layers neural networks, and conjectured (and proved for shrinking layers) that gradient descent finds adversarial examples on random multi-layers neural networks. We give some experimental confirmation of this multi-layer conjecture in Section 4. + +The ultra-wide case $k = \exp(\Omega(d))$ remains open. This exponential size case seems of a different nature than the polynomial size we tackle here, at least for the ReLU activation function. In particular, it is likely that the behavior with exponential width would be closely tied to the actual limit case $k = +\infty$ , where the random model (1) yields a Gaussian process. Namely, for $k = +\infty$ , $f$ is a Gaussian process indexed by the sphere (say if we restrict to inputs $x \in \sqrt{d} \cdot \mathbb{S}^{d-1}$ ), with $f(x) \sim \mathcal{N}(0, \mathbb{E}_{X \sim \mathcal{N}(0,1)}[\psi(X)])$ and $\mathbb{E}[f(x)f(y)] = \mathbb{E}_{X,Y \sim \mathcal{N}(0,1)}[\mathbb{E}_{[XY] = x \cdot y}[\psi(X)\psi(Y)]$ . For example if the activation function is a Hermite polynomial of degree $p$ , then $f$ would be a spherical $p$ -spin glass model. This polynomial case is particularly well-understood, and in fact the landscape we describe below in Section 1.2 was already described in this case by Ben Arous et al. [2020] (in particular Corollary 59) indicating that adversarial examples would likely continue to persist in the ultra-wide setting. It would be interesting to see if the $p$ -spin glass landscape literature can be extended to non-polynomial activation functions, and to a finite (but possibly exponential in $d$ ) $k$ . A step in this latter direction was recently taken in Eldan et al. [2021], where convergence rates to the Gaussian process limit where given both for polynomial activations and for the ReLU. Finally we note that for a smooth activation it might be that there is a more direct argument to remove the subexponential width condition in Theorem 1 (in technical terms, the proof of Proposition 2 could leverage a better argument than our naive upper bound on $\mathrm{Lip}(\Phi)$ ). + +Finally, we note that, in practice, it has been found that there exists "universal" adversarial perturbations that generalize across both inputs and neural networks, Moosavi-Dezfooli et al. [2017]. For the case of ReLU activation (Theorem 2), we could in fact prove our result by replacing the gradient step with a step in the direction $\sum_{\ell=1}^{k} a_{\ell} w_{\ell}$ , which is indeed a direction independent of the input $x$ , thus proving the existence of "universal" perturbations (generalizing across inputs) for our model. + +# 1.2 The landscape of random two-layers neural networks + +For a smooth non-linearity $\psi$ , we have + +$$ +\nabla f (x) = \frac {1}{\sqrt {k}} \sum_ {\ell = 1} ^ {k} a _ {\ell} w _ {\ell} \psi^ {\prime} (w _ {\ell} \cdot x) \quad \text {a n d} \quad \nabla^ {2} f (x) = \frac {1}{\sqrt {k}} \sum_ {\ell = 1} ^ {k} a _ {\ell} w _ {\ell} w _ {\ell} ^ {\top} \psi^ {\prime \prime} (w _ {\ell} \cdot x). +$$ + +We already claimed in the introduction that, with high probability the value of $f(x)$ was bounded: + +$$ +\text {U p p e r - B o u n d e d} \quad \text {V a l u e}: \quad | f (x) | = O (1). \tag {2} +$$ + +We alluded to the CLT for this claim, but it is also easy to guess it intuitively by noting that: + +$$ +\mathbb {E} [ f (x) ^ {2} ] = \mathbb {E} \left[ \frac {1}{k} \sum_ {\ell , \ell^ {\prime} = 1} ^ {k} a _ {\ell} a _ {\ell^ {\prime}} \psi (w _ {\ell} \cdot x) \psi (w _ {\ell^ {\prime}} \cdot x) \right] = \mathbb {E} _ {X \sim \mathcal {N} (0, 1)} [ \psi (X) ^ {2} ], +$$ + +as $\mathbb{E}[a_{\ell}a_{\ell^{\prime}}] = \mathbb{1}\left\{\ell = \ell^{\prime}\right\}$ . The formal proof of (2) (and all other claims we make here) will eventually be a simple application of the classical Bernstein concentration inequality. Similarly, it is easy to see that (noticing that $\mathbb{E}[\| \nabla f(x)\| ^2 ] = \mathbb{E}_{X\sim \mathcal{N}(0,1)}[\psi '(X)^2 ]$ ), with high probability, the norm of the gradient of $f(x)$ is bounded below (note that we can also show that it is bounded above). + +$$ +\text {L o w e r - B o u n d e d G r a i d e n t}: \quad \| \nabla f (x) \| = \Omega (1). \tag {3} +$$ + +A slightly more difficult calculation, although classical too, is that + +$$ +\text {U p p e r - B o u n d e d H e s s i a n}: \quad \| \nabla^ {2} f (x) \| _ {\mathrm {o p}} = \widetilde {O} \left(\frac {1}{\sqrt {d}}\right). \tag {4} +$$ + +Indeed one can simply note that, for any $u \in \mathbb{S}^{d-1}$ , $u^\top \nabla^2 f(x)u = \frac{1}{\sqrt{k}} \sum_{\ell=1}^k a_\ell (w_\ell \cdot u)^2 \psi''(w_\ell \cdot x)$ is approximately distributed as a centered Gaussian with variance (through a heuristic application of the asymptotic central limit theorem): + +$$ +\mathbb {E} _ {W, Z \sim \mathcal {N} (0, 1): \mathbb {E} [ W Z ] = \frac {x \cdot u}{\sqrt {d}}} \left[ \left(\frac {W}{\sqrt {d}}\right) ^ {4} \psi^ {\prime \prime} (Z) ^ {2} \right], +$$ + +so that with probability at least $1 - \gamma$ one can expect $u^{\top}\nabla^{2}f(x)u$ to be of order $\frac{\sqrt{\log(1 / \gamma)}}{d}$ , and thus by taking a union bound over a discretization of the sphere $\mathbb{S}^{d - 1}$ , one can show inequality (4). In fact, interestingly, one can even hope that (4) holds true for an entire ball around $x$ : with appropriate smoothness over $\psi$ (say $C^{2,1}$ smoothness), this could be obtained by another union bound over a second discretization of a $d$ -dimensional ball. In other words, we can expect with high probability: + +$$ +\forall x \in \mathbb {R} ^ {d}: \| x \| = \operatorname {p o l y} (d), \text {o n e h a s} \| \nabla^ {2} f (x) \| _ {\mathrm {o p}} = \widetilde {O} \left(\frac {1}{\sqrt {d}}\right). \tag {5} +$$ + +Equations (2), (3), and (5) paint a rather clear geometric picture. There are essentially two scales around a fixed $x \in \sqrt{d} \cdot \mathbb{S}^{d-1}$ : The macroscopic scale, where one considers a perturbation $x + \delta$ with $\| \delta \| = \Omega(\sqrt{d})$ , and the mesoscopic scale where $\| \delta \| = o(\sqrt{d})$ (we use this term because for the ReLU network there will also be a microscopic scale, with $\| \delta \| = o(1)$ ). At the macroscopic scale the landscape of $f$ might be very complicated, but our crucial observation is that the picture at the mesoscopic scale is dramatically simpler. Namely, at the mesoscopic scale, the function $f$ is essentially linear, since one has (thanks to (3) and (5)) + +$$ +\text {A p p r o x i m a t e L i n e a r i t y}: \quad \| \nabla f (x) - \nabla f (x + \delta) \| = o (\| \nabla f (x) \|), \forall \delta : \| \delta \| = o (\sqrt {d}). \tag {6} +$$ + +Moreover, since the height of the function is at most a constant (by (2)) and the norm of the gradient is constant, it suffices to step at a constant distance in the direction of the gradient (or negative gradient) to change the sign of $f$ . Assuming without any loss of generality that $f(x) > 0$ , we combine (2), (3), and (6) using a standard descent lemma (Lemma 3): + +$$ +\begin{array}{l} f (x - \eta \nabla f (x)) \leq \underbrace {f (x)} _ {O (1) \text {b y} (2)} - \eta \underbrace {\| \nabla f (x) \|} _ {\Omega (1) \text {b y} (3)} \left(\underbrace {\| \nabla f (x) \|} _ {\Omega (1) \text {b y} (3)} - \underbrace {\sup _ {\frac {\| \delta \|}{\| \nabla f (x) \|} \leq \eta} \| \nabla f (x) - \nabla f (x + \delta) \|}\right) (7) \\ \leq C _ {1} - C _ {2} \eta < 0 \quad (\text {f o r} C _ {1} / C _ {2} < \eta < C _ {3} \sqrt {d}) (8) \\ \end{array} +$$ + +where $C_1, C_2$ and $C_3$ are constants that do not depend on $k$ and $d$ . In words: a single step of gradient descent (or ascent) with a $O(1)$ step-size suffices to find an adversarial example, and moreover the adversarial perturbation $\delta$ satisfies $\| \delta \| = O(1) = O(\| x \| / \sqrt{d})$ . + +# 1.3 Proof strategy + +The starting point of the proof for both the smooth and ReLU case is to show (2) and (3), which we essentially do below in Section 1.4. In the smooth case, one could then prove formally (4) and conclude as indicated in the last paragraph of Section 1.2. Of course, (4) is simply ill-defined for the ReLU case, so one has to take a different route. Instead, we propose to directly prove (6), that is we study the difference of gradients at the mesoscopic scale. Using that $\| h\| = \sup_{v\in \mathbb{S}^{d - 1}}v\cdot h$ , we thus need to control (for some $R = o(\sqrt{d})$ ): + +$$ +\sup _ {\delta \in \mathbb {R} ^ {d}: \| \delta \| \leq R} \| \nabla f (x) - \nabla f (x + \delta) \| = \sup _ {\substack {v \in \mathbb {S} ^ {d - 1}, \\ \delta \in \mathbb {R} ^ {d}: \| \delta \| \leq R}} \frac {1}{\sqrt {k}} \sum_ {\ell = 1} ^ {k} a _ {\ell} \left(w _ {\ell} \cdot v\right) \left(\psi^ {\prime} \left(w _ {\ell} \cdot x\right) - \psi^ {\prime} \left(w _ {\ell} \cdot (x + \delta)\right)\right). \tag{9} +$$ + +We execute this strategy first for the smooth case in Section 2. We then prove the ReLU case in Section 3, where we face an extraneous difficulty since the gradient is not Lipschitz at very small scale, which introduces a third scale (the microscopic scale) that has to be dealt with differently. Technically, this issue appears when we try to move from the discretization over $v$ and $\delta$ in (9) to the whole space (a so-called $\varepsilon$ -net argument). + +# 1.4 Scaling of value and gradient + +Here we show how to prove (2) and (3) (in fact, for our purpose, we only need the one-sided inequality $\| \nabla f(x)\| = \Omega (1))$ under very mild conditions on $\psi$ which will be satisfied for both ReLU and smooth activations. We will repeatedly use Bernstein's inequality which we restate here for convenience (see e.g., Theorem 2.10 in Boucheron et al. [2013]): + +Theorem 3 (Bernstein's inequality). Let $(X_{\ell})$ be i.i.d. centered random variables such that for all integers $q \geq 2$ , $\mathbb{E}[|X_{\ell}|^q] \leq \frac{q!}{2} \sigma^2 c^{q-2}$ for fixed $\sigma, c > 0$ . Then, with probability at least $1 - \gamma$ : + +$$ +\sum_ {\ell = 1} ^ {k} X _ {\ell} \leq \sqrt {2 \sigma^ {2} k \log (1 / \gamma)} + c \log (1 / \gamma). \tag {10} +$$ + +We will also use repeatedly that $\mathbb{E}_{X\sim \mathcal{N}(0,1)}[|X|^q]\le (q - 1)!!\le \frac{q!}{2}$ , as well as the following concentration of $\chi^2$ random variables (see e.g., (2.19) in Wainwright [2019]): let $X_{1},\ldots ,X_{k}$ be i.i.d. standard Gaussians, then with probability at least $1 - \gamma$ , one has: + +$$ +\left| \sum_ {\ell = 1} ^ {k} X _ {\ell} ^ {2} - k \right| \leq 4 \sqrt {k \log (2 / \gamma)}. \tag {11} +$$ + +We can now proceed to our various results. + +Lemma 1 (Bounded Value). Assume that there exists $\sigma, c > 0$ such that for all integers $q \geq 2$ , $\mathbb{E}_{X \sim \mathcal{N}(0,1)}[|\psi(X)|^q] \leq \frac{q!}{2} \sigma^2 c^{q-2}$ . Then with probability at least $1 - \gamma$ one has + +$$ +| f (x) | \leq \sqrt {2 \sigma^ {2} \log (1 / \gamma)} + \frac {c \log (1 / \gamma)}{\sqrt {k}}. +$$ + +Proof sketch. Since $\frac{1}{\sqrt{k}}\sum_{\ell = 1}^{k}a_{\ell}\psi (w_{\ell}\cdot x)$ , we use Bernstein's inequality on $X_{\ell} = a_{\ell}\psi (w_{\ell}\cdot x)$ . + +Lemma 2 (Lower-Bounded Gradient). Let $\psi$ be differentiable almost everywhere, and assume that there exists $\sigma', c' > 0$ such that for all integers $q \geq 2$ , $\mathbb{E}_{X \sim \mathcal{N}(0,1)}[|\psi'(X)|^{2q}] \leq \frac{q!}{2}\sigma'^2c'^{q-2}$ . Then with probability at least $1 - \gamma$ , + +$$ +\| \nabla f (x) \| \geq \left(\mathbb {E} _ {X \sim \mathcal {N} (0, 1)} [ | \psi^ {\prime} (X) | ^ {2} ] - \left(\sqrt {\frac {2 \sigma^ {\prime 2} \log (2 / \gamma)}{k}} + \frac {c ^ {\prime} \log (2 / \gamma)}{k}\right)\right) ^ {1 / 2} \left(1 - 5 \sqrt {\frac {\log (4 / \gamma)}{d}}\right). +$$ + +Proof sketch. Let $P = \mathrm{I}_d - \frac{xx^\top}{d}$ be the projection on the orthogonal complement of the span of $x$ . We have $\| \nabla f(x) \| \geq \| P\nabla f(x) \| = \left\| \frac{1}{\sqrt{k}}\sum_{\ell=1}^k Pa_\ell w_\ell \psi'(w_\ell \cdot x) \right\|$ where $a_\ell Pw_\ell$ is independent of $w_\ell \cdot x$ and is distributed as $\mathcal{N}\left(0, \frac{1}{d}\mathrm{I}_{d-1}\right)$ . We conclude by conditioning on the values $(w_\ell \cdot x)_{\ell \in [k]}$ and using the concentration results (10) and (11). + +# 2 Smooth Non-Linearity (Theorem 1) + +In this section, we consider a 1-Lipschitz and $L$ -smooth activation function, that is for all $s,t\in \mathbb{R}$ + +$$ +| \psi (s) - \psi (t) | \leq | s - t | \text {a n d} | \psi^ {\prime} (s) - \psi^ {\prime} (t) | \leq L | s - t |. \tag {12} +$$ + +We also assume $\psi(0) = 0$ and denote $c_{\psi}^2 = \mathbb{E}_{X \sim \mathcal{N}(0,1)}[(\psi'(X))^2]$ which we assume to be non-zero (that is $\psi$ is not a constant function). + +Proposition 1 (Upper-Bounded Value and Lower-Bounded Gradient). Under the above assumptions, one has with probability at least $1 - \gamma$ , + +$$ +| f (x) | \leq \sqrt {2 \log \left(\frac {1}{\gamma}\right)} \left(1 + \sqrt {\frac {\log \left(\frac {2}{\gamma}\right)}{k}}\right) +$$ + +$$ +a n d \quad \| \nabla f (x) \| \geq \left(c _ {\psi} ^ {2} - \sqrt {\frac {2 \log \left(\frac {4}{\gamma}\right)}{k}} \left(1 + \sqrt {\frac {\log \left(\frac {4}{\gamma}\right)}{k}}\right)\right) ^ {1 / 2} \left(1 - 5 \sqrt {\frac {\log \left(\frac {8}{\gamma}\right)}{d}}\right). +$$ + +Particularly, there exists $C > 0$ such that for $k \geq C \log(2/\gamma)$ and $d \geq C \log(8/\gamma)$ we have + +$$ +| f (x) | \leq 2 \sqrt {\log (1 / \gamma)} \quad a n d \quad \| \nabla f (x) \| \geq c _ {\psi} / 2. \tag {13} +$$ + +Proof. With (12) we have $|\psi(X)| \leq |X|$ and thus in Lemma 1 we can take $\sigma = c = 1$ which yields the first claimed equation. For the second equation we use that $|\psi'(X)| \leq 1$ (since $\psi$ is 1-Lipschitz) and thus, in Lemma 2, we can also take $\sigma' = c' = 1$ yielding the second claimed equation. + +Next, we need to control (9) where we use crucially the smoothness of the activation function. + +Proposition 2 (Bounded Variations). Let $R \geq 1$ . With probability at least $1 - \gamma$ one has + +$$ +\sup _ {\delta \in \mathbb {R} ^ {d}: \| \delta \| \leq R} \| \nabla f (x) - \nabla f (x + \delta) \| \leq 2 0 R L \left(\sqrt {\frac {\log (R k / \gamma)}{d}} + \frac {\log (1 / \gamma)}{\sqrt {k}}\right). +$$ + +Particularly, for any $c > 0$ , there exists $C_1, C_2$ such that if $k \geq C_1 R^2 \log^2(1 / \gamma)$ and $d \geq C_2 R^2 \log(Rk / \gamma)$ then + +$$ +\sup _ {\delta \in \mathbb {R} ^ {d}: \| \delta \| \leq R} \| \nabla f (x) - \nabla f (x + \delta) \| \leq c. \tag {14} +$$ + +Proof sketch. Our plan is to use the fact that $\| h \| = \sup_{v \in \mathbb{S}^{d-1}} v \cdot h$ . Thus, we first show, by using Bernstein's inequality on $X_{\ell} = \frac{a_{\ell}}{L}(w_{\ell} \cdot v)(\psi'(w_{\ell} \cdot x) - \psi'(w_{\ell} \cdot (x + \delta))$ , that if we fix $\delta \in \mathbb{R}^d$ such that $\| \delta \| \leq R$ and $v \in \mathbb{S}^{d-1}$ , then with probability at least $1 - \gamma$ one has: + +$$ +\Phi (v, \delta) := \langle \nabla f (x) - \nabla f (x + \delta), v \rangle = \frac {L}{\sqrt {k}} \sum_ {\ell = 1} ^ {k} X _ {l} \leq \frac {4 R L}{d} \sqrt {\log (1 / \gamma)} \left(1 + \sqrt {\frac {\log (1 / \gamma)}{k}}\right). +$$ + +Let $\Omega \coloneqq \{(v,\delta):\| v\| = 1,\| \delta \| \leq R\}$ and $N_{\varepsilon}$ be an $\varepsilon$ -net over $\Omega$ with $\varepsilon = 1 / k$ . By a union bound over $N_{\varepsilon}$ (whose size is at most $(10kR)^{2d}$ [Vershynin, 2018, Corollary 4.2.13]), we obtain with probability at least $1 - \gamma$ : + +$$ +\begin{array}{l} \sup _ {(v, \delta) \in \Omega} \Phi (v, \delta) \leq \sup _ {(v, \delta) \in N _ {\varepsilon}} \Phi (v, \delta) + \sup _ {(v, \delta), (v ^ {\prime}, \delta^ {\prime}) \in \Omega : \| v - v ^ {\prime} \| + \| \delta - \delta^ {\prime} \| \leq \varepsilon} | \Phi (v, \delta) - \Phi (v ^ {\prime}, \delta^ {\prime}) | \\ \leq \frac {4 R L}{d} \sqrt {2 d \log (R k) + \log (1 / \gamma)} \left(1 + \sqrt {\frac {2 d \log (R k) + \log (1 / \gamma)}{k}}\right) + \frac {\mathrm {L i p} (\Phi)}{k}. \\ \end{array} +$$ + +Then we show that the variations of $\Phi$ can be upper-bounded by a $RL$ times a $\chi^2$ random variable and use (11) to show that with probability at least $1 - \gamma$ , + +$$ +\operatorname {L i p} (\Phi) \leq R L \left(\sqrt {k} + 4 \sqrt {\frac {\log (1 / \gamma)}{d}}\right). +$$ + +Finally we can turn to the proof of Theorem 1. Let us first recall this theorem. + +Theorem 1. Let $\gamma \in (0,1)$ and $\psi$ be non-constant, Lipschitz and with Lipschitz derivative. There exists constants $C_1, C_2, C_3, C_4$ depending on $\psi$ such that the following holds true. Assume $k \geq C_1 \log^3(1/\gamma)$ and $d \geq C_2 \log(k/\gamma) \log(1/\gamma)$ , and let $\eta \in \mathbb{R}$ such that $|\eta| = C_3 \sqrt{\log(1/\gamma)} \| \nabla f(x) \|^{-2}$ and $\mathrm{sign}(\eta) = -\mathrm{sign}(f(x))$ . Then with probability at least $1 - \gamma$ one has: + +$$ +\operatorname {s i g n} (f (x)) \neq \operatorname {s i g n} (f (x + \eta \nabla f (x))). +$$ + +Moreover we have $\| \eta \nabla f(x)\| \leq C_4\sqrt{\log(1 / \gamma)}$ + +Proof. We make the following claims which hold with probability at least $1 - \gamma$ . Without any loss of generality we can assume that $f(x) > 0$ , we will use a standard descent lemma (Lemma 3) and the previous propositions to get that, + +$$ +f (x - \eta \nabla f (x)) \leq \underbrace {f (x)} _ {O (1) \text {b y} (1 3)} - \eta \underbrace {\| \nabla f (x) \|} _ {\Omega (1) \text {b y} (1 3)} \left(\underbrace {\| \nabla f (x) \|} _ {\Omega (1) \text {b y} (1 3)} - \underbrace {\sup _ {\| \nabla f (x) \| \leq \eta} \| \nabla f (x) - \nabla f (x + \delta) \|} _ {o (1) \text {b y} (1 4)}\right). \tag {15} +$$ + +Formally, let us set $\eta = \frac{32}{c_{\psi}^2\|\nabla f(x)\|^2}\sqrt{\log(1 / \gamma)}$ , $R = \frac{64}{c_{\psi}^3}\sqrt{\log(1 / \gamma)}$ , $k \geq C_1R^2\log^2(1 / \gamma)$ and $d \geq C_2R^2\log(Rk / \gamma)$ where $C_1$ and $C_2$ are large enough such that (13) and (14) are valid with $c = \frac{c_{\psi}}{4}$ . By Proposition 1 we have that $\|\nabla f(x)\| \geq c_{\psi} / 2$ and $\eta \|\nabla f(x)\|^2 = \frac{32}{c_{\psi}^2}\sqrt{\log(1 / \gamma)} \geq \frac{16}{c_{\psi}^2}|f(x)|$ . Moreover, Proposition 2 shows that for all $\delta$ such that $\|\delta\| \leq |\eta| \|\nabla f(x)\| \leq \frac{64}{c_{\psi}^3}\sqrt{\log(1 / \gamma)} = R$ , we thus have $\|\nabla f(x) - \nabla f(x + \delta)\| \leq c := \frac{c_{\psi}}{4}$ . Consequently, + +$$ +f (x - \eta \nabla f (x)) \leq f (x) - \eta \| \nabla f (x) \| \left(\frac {c _ {\psi}}{2} - \frac {c _ {\psi}}{4}\right) \leq f (x) - \eta \frac {c _ {\psi} ^ {2}}{8} \leq - f (x). \tag {16} +$$ + +Thus, with a single gradient step of size at most $R = \frac{64}{c_{\psi}^3}\sqrt{\log(1 / \gamma)}$ , we switched the sign of $f$ . + +# 3 ReLU Non-Linearity (Theorem 2) + +In this section, we consider the ReLU non-linearity $\psi(t) = \max(0, t)$ . We start by showing that $f(x)$ is upper bounded and that $\|\nabla f(x)\|$ is lower-bounded. + +Proposition 3 (Upper-Bounded Value and Lower-Bounded Gradient). With probability at least $1 - \gamma$ + +$$ +| f (x) | \leq \sqrt {2 \log (2 / \gamma)} \left(1 + \sqrt {\frac {\log (2 / \gamma)}{k}}\right) +$$ + +$$ +a n d \quad \| \nabla f (x) \| \geq \left(\frac {1}{2} - \sqrt {\frac {2 \log (4 / \gamma)}{k}} \left(1 + \sqrt {\frac {\log (1 / \gamma)}{k}}\right)\right) ^ {1 / 2} \left(1 - 5 \sqrt {\frac {\log (4 / \gamma)}{d}}\right). +$$ + +Particularly, there exists $C > 0$ such that for $k \geq C\log(1/\gamma)$ and $d \geq C\log(4/\gamma)$ we have + +$$ +| f (x) | \leq 2 \sqrt {\log (2 / \gamma)} \quad a n d \quad \| \nabla f (x) \| \geq \frac {1}{4}. \tag {17} +$$ + +Proof. In Lemma 1 and Lemma 2, we can take $\sigma = c = \sigma' = c' = 1$ (since $|\psi(X)| \leq |X|$ and $|\psi'(X)| \leq 1$ ), which concludes the proof. + +Now we split the control of the gradient variation into two cases: the large width case ( $Cd\log^2 d \lesssim k$ ) and the small width case ( $\log^6(d)\log(1/\gamma) \lesssim k \lesssim d\log^3 d$ ). + +Proposition 4. (Bounded Variations - Large Width Case) Let $1 \leq R \leq \sqrt{d}/2$ , $\sqrt{k} \geq 52$ and $d \geq \log(1/\gamma)$ . Then, with probability at least $1 - \gamma$ , one has + +$$ +\sup _ {\delta \in \mathbb {R} ^ {d}: \| \delta \| \leq R} \| \nabla f (x) - \nabla f (x + \delta) \| \leq 2 0 \left(R \log^ {2} (R k) \sqrt {\frac {\log d}{d}}\right) ^ {1 / 4} + 4 0 \sqrt {\frac {d}{k}} \log (R k). +$$ + +Particularly, for any $c > 0$ , there exists $C_1, C_2$ such that if $C_1 d \log^2(Rk) \leq k$ and $C_2 \log^4(Rk) R^2 \leq \frac{d}{\log(d)}$ , then we have, + +$$ +\sup _ {\delta \in \mathbb {R} ^ {d}: \| \delta \| \leq R} \| \nabla f (x) - \nabla f (x + \delta) \| \leq c. \tag {18} +$$ + +Proof sketch. In the smooth case (Proposition 2) we did so by using crucially the smoothness of the activation function. Here, instead of smoothness, we will use that only few activations can change when you make microscopic move (i.e., between $x + \delta$ and $x + \delta'$ with $\| \delta - \delta' \| = o(1)$ ). The key observation that for any $\delta$ such that $\| \delta \| \leq R$ , + +$$ +\mathbb {P} \left(\operatorname {s i g n} \left(w _ {\ell} \cdot x\right) \neq \operatorname {s i g n} \left(w _ {\ell} \cdot (x + \delta)\right)\right) \leq R \sqrt {\frac {2 \log (d)}{d}} + \frac {1}{d}. \tag {19} +$$ + +We can then use this result to bound the variation of $\nabla f(x)$ along a fixed direction. If we fix $\delta \in \mathbb{R}^d$ such that $\| \delta \| \leq R$ (with $R\geq 1$ ) and $v\in \mathbb{S}^{d - 1}$ , then with probability at least $1 - \gamma$ one has: + +$$ +\Phi (v, \delta) := \langle \nabla f (x) - \nabla f (x + \delta), v \rangle = \frac {1}{\sqrt {k}} \sum_ {\ell = 1} ^ {k} X _ {l} \leq 2 \sqrt {\frac {\log (\frac {1}{\gamma})}{d}} \left(\left(2 R \sqrt {\frac {\log (d)}{d}}\right) ^ {\frac {1}{4}} + \sqrt {\frac {\log (\frac {1}{\gamma})}{k}}\right). +$$ + +This inequality is proven via Bernstein's inequality on $X_{\ell} \coloneqq a_{\ell}(w_{\ell} \cdot v)(\psi'(w_{\ell} \cdot x) - \psi'(w_{\ell} \cdot (x + \delta)))$ where we use (19) to prove + +$$ +\mathbb {E} [ | X _ {\ell} | ^ {q} ] \leq \sqrt {\mathbb {E} [ | w _ {\ell} \cdot v | ^ {2 q} ] \times \mathbb {P} (\operatorname {s i g n} (w _ {\ell} \cdot x) \neq \operatorname {s i g n} (w _ {\ell} \cdot (x + \delta)))} \leq \frac {q !}{2} c ^ {q - 2} \times \sigma^ {2}, \tag {20} +$$ + +with $\sigma = \frac{2}{\sqrt{d}} \times \left(2R\sqrt{\frac{\log(d)}{d}}\right)^{1/4}$ and $c = \frac{2}{\sqrt{d}}$ . + +Then, similarly as in the proof of Proposition 2, we use a covering argument (but this time with an $\varepsilon$ -Net of size $\varepsilon = R^{-4/3}k^{-4}$ ) to show that, + +$$ +\begin{array}{l} \sup _ {(v, \delta) \in \Omega} \Phi (v, \delta) \leq \sup _ {(v, \delta) \in N _ {\varepsilon}} \Phi (v, \delta) + \sup _ {(v, \delta), (v ^ {\prime}, \delta^ {\prime}) \in \Omega : \| v - v ^ {\prime} \| + \| \delta - \delta^ {\prime} \| \leq \varepsilon} | \Phi (v, \delta) - \Phi (v ^ {\prime}, \delta^ {\prime}) | \\ \leq 2 \sqrt {\frac {1 0 d \log (R k) + \log (2 / \gamma)}{d}} \left(\left(2 R \sqrt {\frac {\log (d)}{d}}\right) ^ {1 / 4} + \sqrt {\frac {1 0 d \log (R k) + \log (2 / \gamma)}{k}}\right) \\ + \sup _ {(v, \delta), (v ^ {\prime}, \delta^ {\prime}) \in \Omega : \| v - v ^ {\prime} \| + \| \delta - \delta^ {\prime} \| \leq \varepsilon} | \Phi (v, \delta) - \Phi (v ^ {\prime}, \delta^ {\prime}) |. \tag {21} \\ \end{array} +$$ + +By using $\chi^2$ concentration, it is easy to see that with probability at least $1 - \gamma$ : + +$$ +\left| \Phi (\delta , v) - \Phi (\delta , v ^ {\prime}) \right| \leq \| v - v ^ {\prime} \| \sqrt {k + 4 k \sqrt {\frac {\log (k / \gamma)}{d}}}. \tag {22} +$$ + +By using (19) we are able to show that with probability $1 - \delta$ for any $(v, \delta) \in N_{\varepsilon}$ there is at most $4d$ different activated neurons between $\Phi(v, \delta)$ and $\Phi(v, \delta')$ and thus by applying a concentration result of Lipschitz function of Gaussians we get, + +$$ +\left| \Phi (\delta , v) - \Phi \left(\delta^ {\prime}, v\right) \right| \leq 1 8 \sqrt {\frac {d}{k}} \sqrt {\log 4 k + \frac {\log 8 / \gamma}{d}}. \tag {23} +$$ + +Combining (21), (22), and (23), we get + +$$ +\sup _ {\delta \in \mathbb {R} ^ {d}: \| \delta \| \leq R} \| \nabla f (x) - \nabla f (x + \delta) \| \leq 2 0 \left(R \log^ {2} (R k) \sqrt {\frac {\log d}{d}}\right) ^ {1 / 4} + 4 0 \sqrt {\frac {d}{k}} \log (R k). +$$ + +Proposition 5 (Bounded Variations - Small Width Case). Let $20\log^3 d\cdot \log 1 / \gamma \leq k\leq d\log^3 d$ and $d\geq 20\cdot \log^3 d\cdot \log 1 / \gamma$ . Then, with probability at least $1 - \gamma$ , we have: + +$$ +\sup_{\delta \in \mathbb{R}^{d},\| \delta \| \leq \frac{\sqrt{k}}{\log^{6}d}}\| \nabla f(x) - \nabla f(x + \delta)\| \leq \frac{60}{\log d}. +$$ + +Proof sketch. In the small width regime we assume $20\log^3 d\cdot \log 1 / \delta \leq k\leq d\log^3 d$ . The idea of the proof is to control the operator norm of $W$ (where $f(x) = \frac{1}{\sqrt{k}} a^{\top}\psi (W^{\top}x)$ ) as well as the number of neurons with a too small activation. With high probability, we show that we have, + +$$ +\| W \| \leq 3 \cdot \left(1 + \sqrt {\frac {1 0 (k + \log 1 / \delta)}{d}}\right), \quad \# \left\{i: | \langle w _ {i}, x \rangle | \leq \frac {1}{\log^ {3} d} \right\} \leq 2 \cdot \frac {k}{\log^ {3} d}. +$$ + +Thus, uniformly on $\left\{y:\| x - y\| \leq \frac{\sqrt{k}}{\log^6d}\right\}$ the cardinal of $T_{y}:= \{i:\operatorname {sgn}\langle w_{i},x\rangle \neq \operatorname {sgn}\langle w_{i},y\rangle \}$ is upper-bounded: + +$$ +\left| T _ {y} \right| \leq 3 0 0 k / \log^ {3} d := B. \tag {24} +$$ + +We can conclude the proof by using an union bound and a concentration inequality on Gaussians. + +$$ +\| \nabla f(x) - \nabla f(y)\| = \frac{1}{\sqrt{k}}\left\| \sum_{\ell \in T}a_{\ell}w_{\ell}\right\| \leq \sup_{\substack{A\subset [k]\\ |A|\leq B}}\frac{1}{\sqrt{k}}\left\| \sum_{\ell \in T}a_{\ell}w_{\ell}\right\| \leq \sqrt{\frac{B}{k}}\left(1 + \sqrt{\frac{B\log k + \log\frac{4}{\delta}}{d}}\right). +$$ + +We can now prove our final result. + +Theorem 2. Let $\gamma \in (0,1)$ and $\psi(t) = \max(0,t)$ . There exist constants $C_1, C_2, C_3, C_4, C_5$ such that the following holds true. Assume + +$$ +C _ {1} \log^ {6} (d) \log (1 / \gamma) \leq k, \quad C _ {2} \log^ {3} (d) \log (1 / \gamma) \leq d, \quad C _ {3} \log^ {4} (k) \log (1 / \gamma) \leq \frac {d}{\log (d)}, +$$ + +and let $\eta \in \mathbb{R}$ such that $|\eta| = C_4 \frac{\sqrt{\log(1 / \gamma)}}{\|\nabla f(x)\|^2}$ and $\mathrm{sign}(\eta) = -\mathrm{sign}(f(x))$ . Then with probability at least $1 - \gamma$ one has: + +$$ +\operatorname {s i g n} (f (x)) \neq \operatorname {s i g n} (f (x + \eta \nabla f (x))). +$$ + +Moreover we have $\| \eta \nabla f(x)\| \leq C_5\sqrt{\log(1 / \gamma)}$ + +Proof. The proof is the same as for Theorem 1 using Proposition 3 instead of Proposition 1 and Proposition 4 or Proposition 5 replacing Proposition 2. $\square$ + +# 4 Experiments + +Setting. To verify our theoretical findings, we run some experiments to measure empirically the probability of finding an adversarial example in the direction $\nabla f(x)$ . More precisely, we take a random point $x$ of norm $\sqrt{d}$ and initialize a network using the procedure described in Section 1 $^2$ . We then find the smallest $\eta$ such that a gradient step $\eta \nabla f(x)$ changes the sign of the function. $\eta$ is of the opposite sign of $f(x)$ and we limit our search to $|\eta| < 20$ . We explore various values of $d$ and $k$ , as well as deeper networks with $L = 1$ through $L = 6$ hidden layers. All hidden layers are of width $k$ . For our experiments, we used ReLU activation units and the standard deviations reported in Figure 1 are computed over 100 random network initializations for each choice of architecture and 100 random input points for each such initialization. + +Results. Figure 2a shows the average of the smallest $\eta$ required to switch the sign of the function. We note that the average only includes cases where an $\eta$ was indeed found. Figure 2b shows the gradient norm in $x$ (all cases included). As we see, both the smallest $\eta$ and the gradient norm are approximately constant both in $d$ and in $k$ . This finding also holds for deeper networks (see Appendix D). In Figure 1, we show the fraction of examples (out of 10,000 samples) whose sign is switched. We see that with $L = 1$ and values of $d$ and $k$ larger than 50, $100\%$ of samples are switched. This confirms our theoretical results. Once again, we observe the same statement holds for deeper networks. The values of $d$ and $k$ at which $100\%$ switching is reached appears to grow with $L^3$ . Additionally, we track the value of the smallest $\eta$ required to switch the sign of the function, and the gradient norm w.r.t $x$ . Both are approximately constant in $d$ and in $k$ . This finding also holds for deeper networks (see Appendix D for the curves). + +![](images/8d8bd3a777199640eaf0e404d2384ac4f896a26b3e57de77fff2c0ef0ddb2086.jpg) + +![](images/73893fabec387eea76c908d5c2adb275723a80eea3f3bd26560651e9529f053e.jpg) + +![](images/f66e75fe98911ff833b72770b08dd5fa7863560a69055a45198772c1f068b293.jpg) + +![](images/79c7803915204ae86630ce5e1d18fefc6a429ae3c8a3cf3bf00692c507fba387.jpg) +Figure 1: Fraction of inputs with an adversarial example found after a single gradient step, for various input dimensions $d$ , hidden layer widths $k$ and number of hidden layers $L$ . For each pair $(k, L)$ , we report the average over 100 network initializations and 100 values of $x$ per initialization. The colored area represents one standard deviation. + +![](images/38f8e5a0502eccd84b9a9bd575951889f586e153ef0a63548fe4bc43fb78c6fa.jpg) + +![](images/fb6db87c845ec8db8ba86ceeab9a0672cf900d82a788c833e9557728c5a3273f.jpg) + +# Acknowledgment + +We thank Mark Sellke for pointing out to us the reference Ben Arous et al. [2020], and Peter Bartlett for several discussions on this problem. + +# 5 Disclosure of Funding and Competing Interests + +GG research is supported by the Canada CIFAR AI Chair Program and an IVADO grant. YC gratefully acknowledges the support of the NSF through grants DMS-2023505 and DMS-2031883, the Simons Foundation through award #814639, and Microsoft through the BAIR Open Research Commons. We declare no competing interests. + +# References + +Zeyuan Allen-Zhu and Yuanzhi Li. Feature purification: How adversarial training performs robust deep learning. arXiv preprint arXiv:2005.10190, 2020. +Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. In International Conference on Machine Learning, 2018. +Gérard Ben Arous, Eliran Subag, and Ofer Zeitouni. Geometry and temperature chaos in mixed spherical spin glasses at low temperature: the perturbative regime. Communications on Pure and Applied Mathematics, 2020. +Stéphane Boucheron, Gábor Lugosi, and Pascal Massart. Concentration inequalities: A nonasymptotic theory of independence. Oxford university press, 2013. +Amit Daniely and Hadas Schacham. Most ReLU networks suffer from $\ell^2$ adversarial perturbations. In Advances in Neural Information Processing Systems, 2020. +Ronen Eldan, Dan Mikulincer, and Tselil Schramm. Non-asymptotic approximations of neural networks by gaussian processes. arXiv preprint arXiv:2102.08668, 2021. +Ian Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In International Conference on Learning Representations, 2015. + +Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. In International Conference on Learning Representations, 2018. +Michael Mitzenmacher and Eli Upfal. Probability and computing: Randomization and probabilistic techniques in algorithms and data analysis. Cambridge university press, 2017. +Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, Omar Fawzi, and Pascal Frossard. Universal adversarial perturbations. In Proceedings of the IEEE conference on computer vision and pattern recognition, 2017. +Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, Jonathan Uesato, and Pascal Frossard. Robustness via curvature regularization, and vice versa. In 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2019. +Nicolas Papernot, Patrick McDaniel, Ian Goodfellow, Somesh Jha, Z Berkay Celik, and Ananthram Swami. Practical black-box attacks against machine learning. In Proceedings of the 2017 ACM on Asia conference on computer and communications security, 2017. +Chongli Qin, James Martens, Sven Gowal, Dilip Krishnan, Krishnamurthy Dvijotham, Alhussein Fawzi, Soham De, Robert Stanforth, and Pushmeet Kohli. Adversarial robustness through local linearization. In Advances in Neural Information Processing Systems, 2019. +Adi Shamir, Itay Safran, Eyal Ronen, and Orr Dunkelman. A simple explanation for the existence of adversarial examples with small hamming distance. arXiv preprint arXiv:1901.10861, 2019. +Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In International Conference on Learning Representations, 2014. +Roman Vershynin. Introduction to the non-asymptotic analysis of random matrices. In Compressed Sensing: Theory and Practice. Cambridge University Preteess, 2012. +Roman Vershynin. High-dimensional probability. Cambridge Series in Statistical and Probabilistic Mathematics. Cambridge University Press, Cambridge, 2018. +Martin J Wainwright. High-dimensional statistics: A non-asymptotic viewpoint. Cambridge University Press, 2019. \ No newline at end of file diff --git a/asinglegradientstepfindsadversarialexamplesonrandomtwolayersneuralnetworks/images.zip b/asinglegradientstepfindsadversarialexamplesonrandomtwolayersneuralnetworks/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..0bbf305ab2d207c9c9b1d12d45f3a511c9ee238f --- /dev/null +++ b/asinglegradientstepfindsadversarialexamplesonrandomtwolayersneuralnetworks/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a4a5061d2362535cac84a2f3aa03de171de297a6b638cbf8c5b26eb2ab136a8 +size 551481 diff --git a/asinglegradientstepfindsadversarialexamplesonrandomtwolayersneuralnetworks/layout.json b/asinglegradientstepfindsadversarialexamplesonrandomtwolayersneuralnetworks/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..972fb77a60af2408200e9d3083726cd57ed38d3e --- /dev/null +++ b/asinglegradientstepfindsadversarialexamplesonrandomtwolayersneuralnetworks/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b12aabd30a85c568e8d488be036000ddcb29298d3ce740b9b6465432ff1c7894 +size 540283 diff --git a/astochasticnewtonalgorithmfordistributedconvexoptimization/138a87fb-d2d5-4512-a2a5-0cfd2ccf8297_content_list.json b/astochasticnewtonalgorithmfordistributedconvexoptimization/138a87fb-d2d5-4512-a2a5-0cfd2ccf8297_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..787b32a098482238486a027be6725e6381c8eeb4 --- /dev/null +++ b/astochasticnewtonalgorithmfordistributedconvexoptimization/138a87fb-d2d5-4512-a2a5-0cfd2ccf8297_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d92316e017f421f0babe12f4b0914f5a766bf26c9f7f9c66b6ed7a65011cb0d +size 86652 diff --git a/astochasticnewtonalgorithmfordistributedconvexoptimization/138a87fb-d2d5-4512-a2a5-0cfd2ccf8297_model.json b/astochasticnewtonalgorithmfordistributedconvexoptimization/138a87fb-d2d5-4512-a2a5-0cfd2ccf8297_model.json new file mode 100644 index 0000000000000000000000000000000000000000..73317c5e277bcdbaaa5db789bb7142c652b22e18 --- /dev/null +++ b/astochasticnewtonalgorithmfordistributedconvexoptimization/138a87fb-d2d5-4512-a2a5-0cfd2ccf8297_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45f2e3d7800e01c07cbae40b4bae04d9b02a625f56952fc9a2ff91e8afa25ce3 +size 107351 diff --git a/astochasticnewtonalgorithmfordistributedconvexoptimization/138a87fb-d2d5-4512-a2a5-0cfd2ccf8297_origin.pdf b/astochasticnewtonalgorithmfordistributedconvexoptimization/138a87fb-d2d5-4512-a2a5-0cfd2ccf8297_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..15a62b83fa8d2a0bdcec408e4049cc46ce52d12b --- /dev/null +++ b/astochasticnewtonalgorithmfordistributedconvexoptimization/138a87fb-d2d5-4512-a2a5-0cfd2ccf8297_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:88262fbeee74fb2e399491c2dd011ab8c4858c54703c2a3efc1b56d27f4a72d3 +size 516560 diff --git a/astochasticnewtonalgorithmfordistributedconvexoptimization/full.md b/astochasticnewtonalgorithmfordistributedconvexoptimization/full.md new file mode 100644 index 0000000000000000000000000000000000000000..fd8d6b4d030aa2c32e5c1ce4291391ee15976659 --- /dev/null +++ b/astochasticnewtonalgorithmfordistributedconvexoptimization/full.md @@ -0,0 +1,471 @@ +# A Stochastic Newton Algorithm for Distributed Convex Optimization + +# Brian Bullins + +Toyota Technological Institute at Chicago bbullins@ttic.edu + +# Kumar Kshitij Patel + +Toyota Technological Institute at Chicago kkpatel@ttic.edu + +# Ohad Shamir + +Weizmann Institute of Science ohad.shamir@weizmann.ac.il + +# Nathan Srebro + +Toyota Technological Institute at Chicago nati@ttic.edu + +# Blake Woodworth + +Toyota Technological Institute at Chicago blake@ttic.edu + +# Abstract + +We propose and analyze a stochastic Newton algorithm for homogeneous distributed stochastic convex optimization, where each machine can calculate stochastic gradients of the same population objective, as well as stochastic Hessian-vector products (products of an independent unbiased estimator of the Hessian of the population objective with arbitrary vectors), with many such stochastic computations performed between rounds of communication. We show that our method can reduce the number, and frequency, of required communication rounds compared to existing methods without hurting performance, by proving convergence guarantees for quasi-self-concordant objectives (e.g., logistic regression), alongside empirical evidence. + +# 1 Introduction + +Stochastic optimization methods that leverage parallelism have proven immensely useful in modern optimization problems. Recent advances in machine learning have highlighted their importance as these techniques now rely on millions of parameters and increasingly large training sets. + +While there are many possible ways of parallelizing optimization algorithms, we consider the intermittent communication setting (Zinkevich et al., 2010; Cotter et al., 2011; Dekel et al., 2012; Shamir et al., 2014; Woodworth et al., 2018, 2021), where $M$ parallel machines work together to optimize an objective during $R$ rounds of communication, and where during each round each machine may perform some basic operation (e.g., access the objective by invoking some oracle) $K$ times, and then communicate with all other machines. An important example of this setting is when this basic operation gives independent, unbiased stochastic estimates of the gradient, in which case this setting includes algorithms like Local SGD (Zinkevich et al., 2010; Coppola, 2015; Zhou and Cong, 2018; Stich, 2019; Woodworth et al., 2020a), Minibatch SGD (Dekel et al., 2012), Minibatch AC-SA (Ghadimi and Lan, 2012), and many others. + +We are motivated by the observation of Woodworth et al. (2020a) that for quadratic objectives, first-order methods such as one-shot averaging (Zinkevich et al., 2010; Zhang et al., 2013)—a special case of Local SGD with a single round of communication—can optimize the objective to a very high degree of accuracy. This prompts trying to reduce the task of optimizing general convex objectives to a short sequence of quadratic problems. Indeed, this is precisely the idea behind many second-order algorithms including Newton's method (Nesterov and Nemirovskii, 1994), trust-region methods + +Table 1: Convergence guarantees for different algorithms in the intermittent communication setting. Notation is as follows: $H$ : smoothness; $U$ : third-order-smoothness; $\sigma$ : stochastic gradient variance; $\rho$ : stochastic Hessian-vector product variance; $g(x;z)$ : stochastic gradient oracle; $h(x,u;z')$ : stochastic Hessian-vector product oracle (see Section 2 for complete details). For the sake of clarity, we omit additional constants and logarithmic factors. + +
Algorithm +(Reference)Convergence RateAssumption, +Oracle Access
Local SGD +(Woodworth et al., 2020a)HB2/KR + σB/√MKR + H1/3σ2/3B4/3A1
g(x;z)
FEDAC +(Yuan and Ma, 2020)HB2/KR2 + σB/√MKR + min{H1/3σ2/3B4/3,K1/3R, H1/2σ1/2B3/2}A1
g(x;z)
Local SGD +(Yuan and Ma, 2020)HB2/KR + σB/√MKR + U1/3σ2/3B5/3A3 (3rd-order Smooth)
g(x;z)
FEDAC +(Yuan and Ma, 2020)HB2/KR2 + σB/√MKR + H1/3σ2/3B4/3,M1/3K1/3R + U1/3σ2/3B5/3A3 (3rd-order Smooth)
g(x;z)
FEDSN +(Theorem 1)exp. decay + HB2/KR + σB/√MKR + ρB2/√KRA2 (QSC)
g(x;z), h(x,u;z')
+ +(Nocedal and Wright, 2006), and cubic regularization (Nesterov and Polyak, 2006), as well as methods that go beyond second-order information (Nesterov, 2019; Bullins, 2020). + +Computing each Newton step requires solving, for convex $F$ , a linear system of the form $\nabla^2 F(x)\Delta x = -\nabla F(x)$ . Unfortunately, this may be prohibitive in a high dimensional setting, and may not even be feasible if $F$ is only accessible through a stochastic oracle in a streaming fashion, as is the case in the setting we consider. To avoid these issues, we reformulate the Newton step as the solution to a convex quadratic problem, $\min_{\Delta x}\frac{1}{2}\Delta x^\top \nabla^2 F(x)\Delta x + \nabla F(x)^\top \Delta x$ , which we then solve using one-shot averaging. Conveniently, computing stochastic gradient estimates for this quadratic objective does not require computing the full Hessian matrix, as it only requires stochastic gradients and stochastic Hessian-vector products. This is attractive computationally since, for many problems, the cost of computing stochastic Hessian-vector products is similar to the cost of computing stochastic gradients, and both involve similar operations (Pearlmutter, 1994). Furthermore, highlighting the importance of these estimates, recent works have relied on Hessian-vector products to attain faster rates for reaching approximate stationary points in both deterministic (Agarwal et al., 2017; Carmon et al., 2018) and stochastic (Allen-Zhu, 2018; Arjevani et al., 2020) non-convex optimization. + +In the context of distributed optimization, second-order methods have shown promise in the empirical risk minimization (ERM) setting, whereby estimates of $F$ are constructed by distributing the component functions of the finite-sum problem across machines. Such methods which leverage this structure have since been shown to lead to improved communication efficiency (Shamir et al., 2014; Zhang and Xiao, 2015; Reddi et al., 2016; Wang et al., 2018; Crane and Roosta, 2019; Islamov et al., 2021; Gupta et al., 2021). An important difference, however, is that these methods work in a batch setting, meaning they allow for repeated access to the same $K$ examples each round on each machine, giving a total of $MK$ samples. In contrast, we work in the stochastic (one-pass, streaming) setting, and so our model independently samples a fresh set of $MK$ examples per round, for a total of $MKR$ examples (see Appendix G.5 for an empirical comparison). + +# Our results + +Our primary algorithmic contribution, which we present in Section 3 (and include a sketch in Appendix A), is the method FEDERATED-STOCHASTIC-NEWTON (FEDSN), a distributed approximate Newton method which leverages the benefits of one-shot averaging for quadratic problems. We pro + +vide in Section 3, under the condition of quasi-self-concordance (Bach, 2010), the main guarantees of our method (Theorem 1). In Section 4 we show how, for some regimes in terms of $M$ , $K$ , and $R$ , our method may improve upon the rates of previous first-order methods, including FEDAC (Yuan and Ma, 2020). In Section 5, we compare a more practical version of our method, FEDSN-LITE (Algorithm 6) against the other methods, showing we can significantly reduce communication compared to other first-order methods. + +# 2 Preliminaries + +We consider the following optimization problem: + +$$ +\min _ {x \in \mathbb {R} ^ {d}} F (x), \tag {1} +$$ + +and throughout we use $F^{*}$ to denote the minimum of this problem. We further use $\| \cdot \|$ to denote the standard $\ell_{2}$ norm, we let $\| x\|_{\mathbf{A}}\coloneqq \sqrt{x^{\top}\mathbf{A}x}$ for a positive semidefinite matrix $\mathbf{A}$ , and we let $\mathbf{I}$ denote the identity matrix of order $d$ . + +Next, we establish several sets of assumptions, beginning with those which are standard for smooth, stochastic, distributed convex optimization. We would note that we are working in the homogeneous distributed setting (i.e., each machine may access the same distribution), rather than the heterogeneous setting (Khaled et al., 2019; Karimireddy et al., 2019; Koloskova et al., 2020; Woodworth et al., 2020b; Khaled et al., 2020). + +# Assumption 1 (A1). + +(a) $F$ is convex, differentiable, and $H$ -smooth, i.e., for all $x,y \in \mathbb{R}^d$ , $F(y) \leq F(x) + \nabla F(x)^\top (y - x) + \frac{H}{2}\| y - x\|^2$ . +(b) There is a minimizer $x^{*}\in \arg \min_{x}F(x)$ such that $\| x^{*}\| \leq B$ +(c) We are given access to a stochastic first-order oracle in the form of an estimator $g: \mathbb{R}^d \times \mathcal{Z} \mapsto \mathbb{R}^d$ , and a distribution $\mathcal{D}$ on $\mathcal{Z}$ such that, for any $x \in \mathbb{R}^d$ queried by the algorithm, the oracle draws $z \sim \mathcal{D}$ , and the algorithm observes an estimate $g(x;z)$ that satisfies: +(i) $g(x;z)$ is an unbiased gradient estimate, i.e., $\mathbb{E}_z g(x;z) = \nabla F(x)$ . +(ii) $g(x;z)$ has bounded variance, i.e., $\mathbb{E}_z\| g(x;z) - \nabla F(x)\| ^2\leq \sigma^2$ + +In order to provide guarantees for Newton-type methods, we will require additional notions of smoothness. In particular, we consider $\alpha$ -quasi-self-concordance (QSC) (Bach, 2010), which for convex and three-times differentiable $F$ is satisfied for $\alpha \geq 0$ when, for all $x \in \mathrm{dom}(F)$ , $v, u \in \mathbb{R}^d$ , + +$$ +\left| \nabla^ {3} F (x) [ v, u, u ] \right| \leq \alpha \| v \| (\nabla^ {2} F (x) [ u, u ]), +$$ + +where we define + +$$ +\nabla^ {k} F (x) [ u _ {1}, u _ {2}, \dots , u _ {k} ] := \frac {\partial^ {k}}{\partial u _ {1} , \partial u _ {2} , \dots , \partial u _ {k}} | _ {t _ {1} = 0, t _ {2} = 0, \dots , t _ {k} = 0} F (x + t _ {1} u _ {1} + t _ {2} u _ {2} + \dots + t _ {k} u _ {k}), +$$ + +for $k \geq 1$ , i.e., the $k^{th}$ directional derivative of $F$ at $x$ along the directions $u_{1}, u_{2}, \ldots, u_{k}$ . Related to this is the condition of $\alpha$ -self-concordance, which has proven useful for classic problems in linear optimization (Nesterov and Nemirovskii, 1994), whereby for all $x \in \operatorname{dom}(F), u \in \mathbb{R}^d$ , + +$$ +\left| \nabla^ {3} F (x) [ u, u, u ] \right| \leq 2 \alpha (\nabla^ {2} F (x) [ u, u ]) ^ {3 / 2}. +$$ + +Though quasi-self-concordance is perhaps not as widely studied as self-concordance, recent work has brought its usefulness to light in the context of machine learning (Bach, 2010; Karimireddy et al., 2018; Carmon et al., 2020). Notably, for logistic regression, i.e., problems of the form + +$$ +\min _ {x} F (x) = \frac {1}{N} \sum_ {i = 1} ^ {N} \log \left(1 + e ^ {- b _ {i} \langle a _ {i}, x \rangle}\right), \tag {2} +$$ + +we observe that $\alpha$ -quasi-self-concordance holds with $\alpha \leq \max_{i}\{\|b_{i}a_{i}\|\}$ . Interestingly, this function is not self-concordant, thus highlighting the importance of introducing the notion of QSC for such problems, and indeed, neither of these conditions implies the other in general. + +We now introduce further assumptions in terms of both additional oracle access and other smoothness notions. The following outlines the requirements for the stochastic Hessian-vector products, though we again stress that the practical cost of such an oracle is often on the order of that for stochastic gradients (Pearlmutter, 1994; Allen-Zhu, 2018). + +Assumption 2 (A2). In addition to Assumption 1, we have: + +(a) $F$ is three-times differentiable and $\alpha$ -quasi-self-concordant, i.e., for all $x, v, u \in \mathbb{R}^d$ , $\left|\nabla^3 F(x)[v, u, u]\right| \leq \alpha \|v\| \nabla^2 F(x)[u, u]$ . +(b) We are given access to a stochastic Hessian-vector product oracle in the form of an estimator $h: \mathbb{R}^d \times \mathbb{R}^d \times \mathcal{Z} \mapsto \mathbb{R}^d$ , and a distribution $\mathcal{D}$ on $\mathcal{Z}$ such that, for any pair $x, u \in \mathbb{R}^d$ queried by the algorithm, the oracle draws $z' \sim \mathcal{D}$ , and the algorithm observes an estimate $h(x, u; z')$ that satisfies: + +(i) $h(x,u;z')$ is an unbiased Hessian-vector product estimate, i.e., $\mathbb{E}_{z'}h(x,u;z') = \nabla F^2(x)u$ . +(ii) $h(x,u;z^{\prime})$ has bounded variance of the form $\mathbb{E}_{z^{\prime}}\| h(x,u;z^{\prime}) - \nabla^{2}F(x)u\|^{2}\leq \rho^{2}\| u\|^{2}$ + +Meanwhile, other works (e.g., Yuan and Ma, 2020) require different control over third-order smoothness and fourth central moment. We do not require this assumption in our analysis, and include it here for comparison. + +Assumption 3 (A3). In addition to Assumption 1, we have: + +(a) $F$ is twice-differentiable and $U$ -third-order-smooth, i.e., for all $x, y \in \mathbb{R}^d$ , $F(y) \leq F(x) + \nabla F(x)^\top(y - x) + \frac{1}{2}\left\langle \nabla^2 F(x)(y - x), y - x \right\rangle + \frac{U}{6} \|y - x\|^3$ . +(b) $g(x;z)$ has bounded fourth central moment, i.e., $\mathbb{E}_z\| g(x;z) - \nabla F(x)\| ^4\leq \sigma^4$ + +# 3 Main results + +We begin by describing our main algorithm, FEDSN (Algorithm 1). Namely, our aim is to solve convex minimization problems $\min_x F(x)$ , subject to Assumption 2. + +# Algorithm 1 FEDERATED-STOCHASTIC-NEWTON, a.k.a., FEDSN(x0) + +(Operating on objective $F(\cdot)$ with stochastic gradient $g(\cdot; \cdot)$ and Hessian-vector product $h(\cdot; \cdot, \cdot)$ oracles.) + +Input: $x_0\in \mathbb{R}^d$ + +Hyperparameters: $T$ : main iterations; and $\bar{\xi}$ : local stability (see Table 4). + +Output: Approximate solution to $\min_x F(x)$ See Theorem 1 for $t = 0,1,\ldots ,T - 1$ do + +$$ +\Delta \tilde {x} _ {t} = \operatorname {C o n s t r a i n e d - Q u a d r a t i c - S o l v e r} (x _ {t}) \quad \begin{array}{c} \triangleright \text {A p p r o x .} \min _ {u: \| u \| \leq \frac {1}{2} \bar {r}} ^ {\frac {\bar {\xi}}{2}} u ^ {\top} \nabla^ {2} F (x _ {t}) u \\ + \nabla F (x _ {t}) ^ {\top} u \end{array} +$$ + +Update: $x_{t + 1} = x_t + \Delta \tilde{x}_t$ + +Return: $x_{T}$ + +We will rely throughout the paper on several hyperparameter settings and parameter functions, which we collect in Tables 3 and 4. Recall that $M$ is the amount of parallel workers, $R$ is the number of rounds of communication, $K$ is the number of basic operations performed between rounds of communication, and $H$ , $B$ , $\sigma$ , $\alpha$ , and $\rho$ are as defined in Assumptions 1 and 2. + +Among our assumptions, we note in particular the condition of quasi-self-concordance, under which several works have provided efficient optimization methods. For example, Bach (2010) analyzes Newton's method under QSC conditions, in a manner analogous to that of standard self-concordance analyses, to establish its behavior in the region of quadratic $(\log \log (1 / \epsilon))$ convergence. More recently, both Karimireddy et al. (2018) and Carmon et al. (2020) have presented methods which rely instead on a trust-region approach, whereby, for a given iterate $x_{t}$ , each iteration amounts to approximately solving a constrained subproblem of the form $\min_{\Delta x:\| \Delta x\| \leq c}\frac{\xi}{2}\Delta x^{\top}\nabla^{2}F(x_{t})\Delta x + \nabla F(x_{t})^{\top}\Delta x$ , for some $\xi \geq 1$ and problem-dependent radius $c > 0$ . This stands in contrast to the + +
Hyperparameter SettingDescription
T := [R/4ζ log2((R/ζ))] (for ζ = 4096 + 4(80 + 32 log K + 24 log(1 + 2αB))2)Main iterations
β := 0Momentum
r := min{32B/T log(TK), 1/5α}Trust-region radius
ξ := exp(αr)Local stability
λ := max{2eH/K-2, 2ρ/√K, 32eH log(51200)/K, 4ρ√2 log(51200)/√K,Regularization bound
320√2ρ/√MK, 320σ/r√MK, 8eH/K-16}
N := [1 + 5/2 log H(B+5Tr/3λr)]Binary search iterations
C := [8 log{log2N(4 + eH/λ + 80H(B+5Tr/λr))}]Reg. quadratic repetitions
+ +Table 2: Hyperparameters $T$ , $\beta ,\bar{r},\bar{\xi },\bar{\lambda },N$ ,and $C$ ,as used by FEDSN and its subroutines. + +
Parameter FunctionDescription
ηk(λ) :=ηλ4/λ{8/λ max{ξH+λ, ρ2/λ}+k-K/2}K≤2/λmax{ξH+λ, ρ2/λ} or k<K/2Reg. quad. +stepsizes
wk(λ) :=(1-ληλ+η2λρ2)-k-10/λmax{ξH+λ, ρ2/λ}K≤2/λmax{ξH+λ, ρ2/λ} and k<K/2Reg. quad. +weights
+ k-K/2-1K>2/λmax{ξH+λ, ρ2/λ} and k≥K/2
+ +Table 3: Parameter functions $\eta_{k}(\lambda)$ and $w_{k}(\lambda)$ , as used by FEDSN and its subroutines, where $\bar{\xi}$ is as defined in Table 4, and where $\eta_{\lambda}$ denotes $\eta (\lambda) := \frac{1}{2}\min \left\{\frac{1}{\xi H + \lambda},\frac{\lambda}{\rho^2}\right\}$ . + +unconstrained minimization problem $\min_{\Delta x} \frac{\xi}{2} \Delta x^{\top} \nabla^{2} F(x) \Delta x + \nabla F(x)^{\top} \Delta x$ , which, as we may recall, forms the basis of the standard (damped) Newton method. Carmon et al. (2020) further use their trust-region subroutine to approximately implement a certain $\ell_{2}$ -ball minimization oracle, which they combine with an acceleration scheme (Monteiro and Svaiter, 2013). + +These results show, at a high level, that as long as the radius of the constrained quadratic (trust-region) subproblem is not too large, it is possible to make sufficient progress on the global problem by approximately solving the quadratic subproblem. Our method proceeds in a similar fashion: each iteration of Algorithm 1 provides an approximate solution to a constrained quadratic problem. To begin, we follow Karimireddy et al. (2018) in defining $\delta(r)$ -local (Hessian) stability. + +Definition 1. Let $\delta : \mathbb{R}^{+} \mapsto \mathbb{R}^{+}$ . We say that a twice-differentiable and convex function $F$ is $\delta(r)$ -locally stable if, for any $r > 0$ and any $x, y \in \mathbb{R}^d$ ( $x \neq y$ ) such that $\|x - y\| \leq r$ and $\|x - y\|_{\nabla^2 F(x)} > 0$ , we have $\|x - y\|_{\nabla^2 F(y)} \leq \delta(r) \|x - y\|_{\nabla^2 F(x)}$ . + +As the next lemma shows, quasi-self-concordance is sufficient to provide this type of local stability. + +Lemma 1 (Theorem I (Karimireddy et al., 2018)). If $F$ is $\alpha$ -quasi-self-concordant, then $F$ is $\delta(r) = \exp(\alpha r)$ -locally stable. + +The advantage of local stability is that it ensures that approximate solutions to locally-defined constrained quadratic problems can guarantee progress on the global objective, and we state this more formally in the following lemma. Note that this lemma is similar to (Theorem IV Karimireddy et al., 2018), though we allow for an additive error in the subproblem solves in addition to the multiplicative error, and its proof can be found in Appendix B. + +Lemma 2. Let $F$ satisfy Assumption 2 and be $\delta(r)$ -locally stable for $\delta: \mathbb{R}^+ \mapsto \mathbb{R}^+$ , let $x_0 \in \mathbb{R}^d$ be as input to FEDSN (Algorithm 1), let $c > 0$ , let $\theta \in [0,1)$ , and define $Q_t(\Delta x) := \frac{\delta(5c)}{2}\Delta x^\top \nabla^2 F(x_t)\Delta x + \nabla F(x_t)^\top \Delta x$ , where $x_t$ is the $t^{th}$ iterate of Algorithm 1. Furthermore, suppose we are given that in each iteration of Algorithm 1, $\|\Delta \tilde{x}_t\| \leq 5c$ and + +$$ +\mathbb {E} Q _ {t} (\Delta \tilde {x} _ {t}) - \min _ {\Delta x: \| \Delta x \| \leq \frac {1}{2} c} Q _ {t} (\Delta x) \leq \theta \left(Q _ {t} (0) - \min _ {\Delta x: \| \Delta x \| \leq \frac {1}{2} c} Q _ {t} (\Delta x)\right) + \epsilon , +$$ + +for $\epsilon > 0$ . Then for each $T \geq 0$ , Algorithm 1 guarantees + +$$ +\mathbb {E} F (x _ {T}) - F ^ {*} \leq \mathbb {E} [ F (x _ {0}) - F ^ {*} ] \exp \left(- \frac {T c (1 - \theta)}{2 B \delta (\frac {1}{2} c) \delta (5 c)}\right) + \frac {2 B \delta (\frac {1}{2} c) d (5 c) \epsilon}{c (1 - \theta)}. +$$ + +We have now seen how to turn approximate solutions of constrained quadratic problems into an approximate minimizer of the overall objective. We next need to ensure that the output of our method CONSTRAINED-QUADRATIC-SOLVER (Algorithm 2) meets the conditions of Lemma 2. As previously discussed, Woodworth et al. (2020a) showed that first-order methods can very accurately optimize unconstrained quadratic objectives using a single round of communication; however, here we need to optimize a quadratic problem subject to a norm constraint. Our constrained quadratic solver is thus based on the following idea: the minimizer of the constrained problem $\min_{x:\| x\| \leq c}Q(x)$ is the same as the minimizer of the unconstrained problem $\min_x Q(x) + \frac{\lambda^*}{2}\| x\|^2$ for some problem-dependent regularization parameter $\lambda^{*}$ . While the algorithm does not know what $\lambda^{*}$ should be a priori, we show that it can be found with sufficient confidence using binary search. Lemma 3, proven in Appendix C, provides the relevant guarantees. + +Lemma 3. Let $F$ satisfy Assumption 2, let $x$ be as input to CONSTRAINED-QUADRATIC-SOLVER (Algorithm 2), let $\bar{\xi}$ be as in Table 4, define + +$$ +\begin{array}{l} Q (u) := \frac {\bar {\xi}}{2} u ^ {\top} \nabla^ {2} F (x) u + \nabla F (x) ^ {\top} u, \quad Q _ {\lambda} (u) := \frac {1}{2} u ^ {\top} (\bar {\xi} \nabla^ {2} F (x) + \lambda \mathbf {I}) u + \nabla F (x) ^ {\top} u, \\ u _ {\lambda} ^ {*} := \arg \min _ {u} Q _ {\lambda} (u), \qquad r ^ {*} (\lambda) := \| u _ {\lambda} ^ {*} \|, \\ \end{array} +$$ + +and let $\lambda_r$ denote, for any $r > 0$ , the value such that $r^*(\lambda_r) = r$ . Let $\hat{u}$ be the output of Algorithm 2 for hyperparameters $\bar{r}, \xi, \bar{\lambda}, N$ and $C$ as in Table 4, and suppose the output $\tilde{u}_\lambda$ of REGULARIZED-QUADRATIC-SOLVER $(x, \lambda)$ satisfies for all $\lambda \geq \bar{\lambda}$ that + +$$ +\mathbb {E} Q _ {\lambda} (\tilde {u} _ {\lambda}) - \min _ {u} Q _ {\lambda} (u) \leq \epsilon (\lambda) := \frac {\lambda \left(r ^ {*} (\lambda) ^ {2} + \bar {r} ^ {2}\right)}{8 0 0}. +$$ + +Then $\| \hat{u}\| \leq 5\bar{r}$ and + +$$ +\mathbb {E} Q (\hat {u}) - \min _ {u: \| u \| \leq \frac {1}{2} \bar {r}} Q (u) \leq \frac {3}{4} \left(Q (0) - \min _ {u: \| u \| \leq \frac {1}{2} \bar {r}} Q (u)\right) + \epsilon \left(\lambda_ {4 \bar {r}}\right) + \frac {\bar {\lambda} \bar {r} ^ {2}}{4}. +$$ + +We now show that using one-shot averaging (Zinkevich et al., 2010; Zhang et al., 2012) with $M$ machines—i.e., averaging the results of $M$ independent runs of SGD—suffices to solve each quadratic problem to the desired accuracy. The following lemma, which we prove in Appendix D, establishes that REGULARIZED-QUADRATIC-SOLVER (Algorithm 3) supplies Algorithm 2 with an output $\hat{u}$ that satisfies the conditions of Lemma 3. + +Algorithm 2 CONSTRAINED-QUADRATIC-SOLVER(x) + +(Operating on objective $F(\cdot)$ with stochastic gradient $g(\cdot; \cdot)$ and Hessian-vector product $h(\cdot; \cdot, \cdot)$ oracles.) + +Input: $x\in \mathbb{R}^d$ + +Hyperparameters: $\bar{r}$ : trust-region radius; $\bar{\xi}$ : local stability; $\bar{\lambda}$ : regularization bound; $N$ : binary search iterations; and $C$ : reg. quadratic repetitions (see Table 4). + +Output: Approximate solution to $\min_{u:\| u\| \leq \frac{1}{2}\bar{r}}\frac{\xi}{2} u^{\top}\nabla^{2}F(x)u + \nabla F(x)^{\top}u$ See Lemma 3 + +$$ +\Lambda_ {1} = \left\{\bar {\lambda} \left(\frac {3}{2}\right) ^ {n - 1}: n = 1, \dots , N \right\} +$$ + +$$ +i \leftarrow 1 +$$ + +while $\Lambda_{i}\neq \emptyset$ do + +$$ +\lambda^ {(i)} = \operatorname {M e d i a n} \left(\Lambda_ {i}\right) +$$ + +$$ +\mathbf {f o r} c = 1, \dots , C \mathbf {d o} +$$ + +$$ +\tilde {u} ^ {(i, c)} = \text {R E G U L A R I Z E D - Q U A D R A T I C - S O L V E R} (x, \lambda^ {(i)}) +$$ + +$$ +\left. \left| \left\{\tilde {u} ^ {(i, c)}: \| \tilde {u} ^ {(i, c)} \| \in \left[ \frac {3}{2} \bar {r}, \frac {7}{2} \bar {r} \right] \right\} \right| > \frac {C}{2} \right. \text {t h e n} +$$ + +$$ +\tilde {u} = \text {R E G U L A R I Z E D - Q U A D R A T I C - S O L V E R} (x, \lambda^ {(i)}) +$$ + +$$ +\textbf{Return:} \hat{u} = \min \Bigl\{1,\frac{5\bar{r}}{\| \hat{u}\|}\Bigr \} \tilde{u} +$$ + +$$ +\text {e l s e i f} \left| \left\{\tilde {u} ^ {(i, c)}: \| \tilde {u} ^ {(i, c)} \| \leq \frac {5}{2} \bar {r} \right\} \right| > \frac {C}{2} \text {t h e n} +$$ + +$$ +\Lambda_ {i + 1} = \left\{\lambda^ {\prime} \in \Lambda_ {i}: \lambda^ {\prime} < \lambda^ {(i)} \right\} +$$ + +$$ +\text {e l s e i f} \left| \left\{\tilde {u} ^ {(i, c)}: \| \tilde {u} ^ {(i, c)} \| > \frac {5}{2} \bar {r} \right\} \right| > \frac {C}{2} \text {t h e n} +$$ + +$$ +\Lambda_ {i + 1} = \left\{\lambda^ {\prime} \in \Lambda_ {i}: \lambda^ {\prime} > \lambda^ {(i)} \right\} +$$ + +$$ +\mathrm {e l s e} +$$ + +$$ +\text {R e t u r n}: \hat {u} = 0 +$$ + +$$ +i \leftarrow i + 1 +$$ + +$$ +\tilde {u} = \text {R E G U L A R I Z E D - Q U A D R A T I C - S O L V E R} (x, \bar {\lambda}) +$$ + +$$ +\textbf{Return:} \hat{u} = \min \Bigl\{1, \frac{5\bar{r}}{\| \hat{u}\|}\Bigr \} \tilde{u} +$$ + +Lemma 4. Let $F$ satisfy Assumption 2, let $x \in \mathbb{R}^d$ , $\lambda \in \mathbb{R}^+$ be as input to REGULARIZED-QUADRATIC-SOLVER (Algorithm 3), let $Q_{\lambda}(u) = \frac{1}{2} u^\top (\bar{\xi}\nabla^2 F(x) + \lambda \mathbf{I})u + \nabla F(x)^\top u$ , let $Q_{\lambda}^{*} \coloneqq \min_u Q_{\lambda}(u)$ , let $u^{*} \coloneqq \arg \min_u Q_{\lambda}(u)$ , and let stochastic first-order and stochastic Hessian-vector product oracles for $F$ , as defined in Assumptions 1 and 2, respectively, be available for each call to REGULARIZED-QUADRATIC-GRADIENT-ACCESS (Algorithm 4), for either Case 1 (Different-Samples) or Case 2 (Same-Sample). Let $\hat{u}$ , as output by Algorithm 3, be a weighted average of the iterates of $M$ independent runs of SGD with step sizes $\eta_0(\lambda), \dots, \eta_{K - 1}(\lambda)$ , i.e., $\hat{u} = \frac{1}{M\sum_{k = 0}^{K - 1}w_k}\sum_{m = 1}^{M}\sum_{k = 0}^{K - 1}w_ku_k^m$ . Then, for both Cases 1 and 2, + +$$ +\mathbb {E} Q _ {\lambda} (\hat {u}) - Q _ {\lambda} ^ {*} \leq \left\{ \begin{array}{l l} 2 \max \Bigl \{\bar {\xi} H + \lambda , \frac {\rho^ {2}}{\lambda} \Bigr \} \| u ^ {*} \| ^ {2} \min \Bigl \{\frac {1}{K}, \exp \Bigl (- \frac {K + 1}{4} \min \Bigl \{\frac {\lambda}{\bar {\xi} H + \lambda}, \frac {\lambda^ {2}}{\rho^ {2}} \Bigr \} \Bigr) \Bigr \} \\ \hskip 1 4. 2 2 6 3 7 8 p t + \frac {2 (\sigma^ {2} + \rho^ {2} \| u ^ {*} \| ^ {2})}{\lambda M K} i f K \leq \frac {2}{\lambda} \max \Bigl \{\bar {\xi} H + \lambda , \frac {\rho^ {2}}{\lambda} \Bigr \} \\ 9 6 \lambda \| u ^ {*} \| ^ {2} \exp \Bigl (- \frac {K}{8} \min \Bigl \{\frac {\lambda}{\bar {\xi} H + \lambda}, \frac {\lambda^ {2}}{\rho^ {2}} \Bigr \} \Bigr) + \frac {9 6 (\sigma^ {2} + \rho^ {2} \| u ^ {*} \| ^ {2})}{\lambda M K} \\ i f K > \frac {2}{\lambda} \max \Bigl \{\bar {\xi} H + \lambda , \frac {\rho^ {2}}{\lambda} \Bigr \}. \end{array} \right. +$$ + +Our analysis for Algorithm 3 is based on ideas similar to those of Woodworth et al. (2020a), whereby the algorithm may access the stochastic oracles via REGULARIZED-QUADRATIC-GRADIENT-ACCESS (Algorithm 4). However, additional care must be taken to account for the fact that Algorithm 4 supplies stochastic gradient estimates of the quadratic subproblems $Q_{\lambda}(u)$ as per the oracles models described in Assumptions 1 and 2. Thus, the estimates—based in part on stochastic Hessian-vector products—have variance that scales with the norm of the respective iterates of Algorithm 3 (see Assumption 2(b.ii)). + +# Algorithm 3 REGULARIZED-QUADRATIC-SOLVER(x,λ) + +(Operating on objective $F(\cdot)$ with stochastic gradient $g(\cdot; \cdot)$ and Hessian-vector product $h(\cdot; \cdot, \cdot)$ oracles.) + +Input: $x\in \mathbb{R}^d$ $\lambda \in \mathbb{R}^{+}$ + +Hyperparameters: $\beta$ : momentum; $\bar{\xi}$ : local stability; and parameter functions $\eta_k(\lambda)$ , $w_k(\lambda)$ (see Tables 3 and 4). + +Output: Approximate solution to $\min_u Q_\lambda(u) = \frac{1}{2} u^\top (\bar{\xi}\nabla^2 F(x) + \lambda\mathbf{I})u + \nabla F(x)^\top u$ See Lemma 4 + +Initialize: $u_0^1,\ldots ,u_0^M = 0$ $\triangleright$ Initial iterates on each machine + +for Each machine $m = 1,\ldots ,M$ in parallel do + +for $k = 0,\dots ,K - 1$ do + +$$ +\gamma \left(u _ {k} ^ {m}; z _ {k} ^ {m}, z _ {k} ^ {\prime m}\right) = \text {R E G U L A R I Z E D - Q U A D R A T I C - G R A D I E N T - A C C E S S} \left(x, u _ {k} ^ {m}, \lambda\right) +$$ + +$$ +u _ {k + 1} ^ {m} = u _ {k} ^ {m} - \eta_ {k} (\lambda) \gamma \left(u _ {k} ^ {m}; z _ {k} ^ {m}, z _ {k} ^ {\prime m}\right) + \mathbb {1} _ {\{k > 0 \}} \beta \left(u _ {k} ^ {m} - u _ {k - 1} ^ {m}\right) ^ {2} +$$ + +Return: $\tilde{u} = \frac{1}{M\sum_{k=1}^{K}w_k(\lambda)}\sum_{m=1}^{M}\sum_{k=1}^{K}w_k(\lambda)u_k^m$ + +We also note two possible cases for the oracle access: Case 1 (Different-Samples) in Algorithm 4 requires both a call to a stochastic first-order oracle (which draws $z \sim \mathcal{D}$ ) and a call to a stochastic Hessian-vector product oracle (which draws a different $z' \sim \mathcal{D}$ ); while Case 2 (Same-Sample) allows both stochastic estimators to be observed for the same random sample $z \sim \mathcal{D}$ . These cases differ by only a small constant factor in the final convergence rate, and we base our practical method on this single sample model. We refer the reader to Appendix G.4 for discussion of these settings. + +# Algorithm 4 REGULARIZED-QUADRATIC-GRADIENT-ACCESS $(x,u,\lambda)$ + +(Operating on objective $F(\cdot)$ with stochastic gradient $g(\cdot; \cdot)$ and Hessian-vector product $h(\cdot; \cdot, \cdot)$ oracles.) + +Input: $x, u \in \mathbb{R}^d$ , $\lambda \in \mathbb{R}^+$ . + +Hyperparameters: $\bar{\xi}$ : local stability (see Table 4). + +Output: $\gamma (u;z,z^{\prime})$ s.t. $\mathbb{E}_{z,z^{\prime}}[\gamma (u;z,z^{\prime})] = \nabla Q_{\lambda}(u)$ and $\mathbb{E}_{z,z^{\prime}}\| \gamma (u;z,z^{\prime}) - \nabla Q_{\lambda}(u)\|^{2}\leq \sigma^{2} + \rho^{2}\| u\|^{2}$ + +Case 1: Different-Samples $(z, z'$ drawn independently for each stochastic oracle) + +- Query the stochastic first-order oracle at $x$ (as in Assumption 1(c)), so that the oracle draws $z \sim \mathcal{D}$ , and observe $g(x;z)$ +- Query the stochastic Hessian-vector product oracle at $x$ and $u$ (as in Assumption 2(b)), so that the oracle draws $z' \sim \mathcal{D}$ , and observe $h(x, u; z')$ + +Case 2: Same-Sample (Same $z' = z$ used for both stochastic oracles) + +- Query the stochastic first-order oracle at $x$ (as in Assumption 1(c)), so that the oracle draws $z \sim \mathcal{D}$ , and observe $g(x;z)$ +- Query the stochastic Hessian-vector product oracle at $x$ and $u$ (as in Assumption 2(b)) for $z' = z$ , and observe $h(x, u; z')$ + +$$ +\gamma (u; z, z ^ {\prime}) := \bar {\xi} h (x, u; z ^ {\prime}) + \lambda u + g (x; z) +$$ + +Return: $\gamma (u;z,z^{\prime})$ + +Finally, having analyzed Algorithms 1, 2, 3, and 4, we may put them all together to provide our main theoretical result, whose proof can be found in Appendix E. + +Theorem 1. Let $F$ satisfy Assumption 2. Then, for $K \geq 175$ and $R \geq \tilde{\Omega}(1)$ , and for hyperparameters $T$ , $\beta$ , $\bar{r}$ , $\bar{\xi}$ , $\bar{\lambda}$ , $N$ , $C$ and parameter functions $\eta_k(\lambda)$ , $w_k(\lambda)$ as in Tables 3 and 4, the output of FEDSN (Algorithm 1) with initial point $x_0 \in \mathbb{R}^d$ , using Algorithms 2, 3, and 4 (for both Cases 1 and 2) + +satisfies + +$$ +\mathbb {E} [ F (x _ {T}) ] - F ^ {*} \leq H B ^ {2} \left(\exp \left(- \frac {R}{\tilde {O} (\alpha B)}\right) + \exp \left(- \frac {K}{O (1)}\right)\right) + \tilde {O} \left(\frac {\sigma B}{\sqrt {M K}} + \frac {H B ^ {2}}{K R} + \frac {\rho B ^ {2}}{\sqrt {K} R}\right), +$$ + +where $\tilde{\Omega},\tilde{O}$ hide terms logarithmic in $R,K$ ,and $\alpha B$ + +# 4 Comparison with related methods and lower bounds + +In this section, we compare our algorithm's guarantees with those of FEDAC, and we include additional comparisons in Appendix F. A difficulty in making this comparison is determining the "typical" relative scale of the parameters $H$ , $\sigma$ , $U$ , $\alpha$ , and $\rho$ . Drawing inspiration from training generalized linear models, we consider a natural scaling of the parameters that arises when the objective has the form $F(x) = \mathbb{E}_z\ell(\langle x,z\rangle)$ , where $|\ell'|, |\ell''|$ , and $|\ell'''|$ are $O(1)$ , and where $\| z\| \leq D$ ; this holds, e.g., for logistic regression problems (see (2)). In this case, upper bounds on the derivatives of $F$ will generally scale with $\| z\|$ . So if we assume that $\| z\| \leq D$ for some $D$ , then the derivatives of $F$ would scale as $\| \nabla F(x)\| \lesssim D$ , $\| \nabla^2 F(x)\|_{\mathrm{op}} \lesssim D^2$ , and $\| \nabla^3 F(x)\|_{\mathrm{op}} \lesssim D^3$ , where $\| \cdot \|_{\mathrm{op}}$ denotes the operator norm. Thus, we will take $H = D^2$ , $\sigma = D$ , $U = D^3$ , $\alpha = D$ , and $\rho = D^2$ . These parameters could have different relationships, but we focus on this regime for simplicity. + +In addition to working within this natural scaling, we consider the case where we have access to sufficient machines (i.e., $M \gtrsim \frac{KR^3}{D^2B^2}$ ) and for $K$ large enough. We explore various regimes w.r.t. both the number of rounds of communication $R$ and the "size" of the problem $DB$ . Thus, ignoring constants and terms logarithmic in $R$ , $K$ , and $\alpha B$ , our upper bound from Theorem 1 reduces to + +$$ +\mathbb {E} F (\hat {x}) - F ^ {*} \lesssim D ^ {2} B ^ {2} \exp \left(- \frac {R}{D B}\right) + D ^ {2} B ^ {2} \exp (- K) + \frac {D ^ {2} B ^ {2}}{K R ^ {3 / 2}} + \frac {D ^ {2} B ^ {2}}{K R} + \frac {D ^ {2} B ^ {2}}{\sqrt {K} R} \approx \frac {D ^ {2} B ^ {2}}{\sqrt {K} R}. +$$ + +# Comparison with FEDAC + +The previous best known first-order distributed method under third-order smoothness assumptions is FEDAC (Yuan and Ma, 2020), an accelerated variant of Local SGD, which achieves a guarantee of + +$$ +\mathbb {E} F (\hat {x}) - F ^ {*} \leq \tilde {O} \left(\frac {H B ^ {2}}{K R ^ {2}} + \frac {\sigma B}{\sqrt {M K R}} + \frac {H ^ {1 / 3} \sigma^ {2 / 3} B ^ {4 / 3}}{M ^ {1 / 3} K ^ {1 / 3} R} + \frac {U ^ {1 / 3} \sigma^ {2 / 3} B ^ {5 / 3}}{K ^ {1 / 3} R ^ {4 / 3}}\right). +$$ + +For the setting as outlined above, this bound reduces to + +$$ +\mathbb {E} F (\hat {x}) - F ^ {*} \lesssim \frac {D ^ {2} B ^ {2}}{K R ^ {2}} + \frac {D ^ {5 / 3} B ^ {5 / 3}}{K ^ {1 / 3} R ^ {4 / 3}}. +$$ + +In the case where $DB$ is not too large ( $DB \lesssim K^2 R^2$ ), the dominant term for FEDAC is $\frac{D^{5/3} B^{5/3}}{K^{1/3} R^{4/3}}$ , and so we see that our algorithm improves upon FEDAC as long as $R \lesssim \frac{\sqrt{K}}{DB}$ , whereas for $R \gtrsim \frac{\sqrt{K}}{DB}$ , FEDAC provides better guarantees than FEDSN. + +# Comparison with first-order lower bounds + +Woodworth et al. (2021) provide lower bounds under other smoothness conditions, including quasi-self-concordance, which are relevant to the current work. Roughly speaking, they show that under Assumption 2(a), no first-order intermittent communication algorithm can guarantee suboptimality less than (ignoring constant and $\log M$ factors) + +$$ +\mathbb {E} F (\hat {x}) - F ^ {*} \geq \frac {H B ^ {2}}{K ^ {2} R ^ {2}} + \frac {\sigma B}{\sqrt {M K R}} + \min \left\{\frac {H B ^ {2}}{R ^ {2}}, \frac {\alpha \sigma B ^ {2}}{\sqrt {K} R ^ {2}}, \frac {\sigma B}{\sqrt {K R}} \right\}. +$$ + +In the same parameter regime as above, the lower bound reduces to + +$$ +\mathbb {E} F (\hat {x}) - F ^ {*} \gtrsim \frac {D ^ {2} B ^ {2}}{K ^ {2} R ^ {2}} + \min \left\{\frac {D ^ {2} B ^ {2}}{\sqrt {K} R ^ {2}}, \frac {D B}{\sqrt {K R}} \right\}. +$$ + +Comparing this lower bound with our guarantee in Theorem 1, we see that, when $DB = O(1)$ and the number of rounds of communication is small (e.g., $R = O(\log K)$ ), our approximate Newton method can (ignoring $\log K$ factors) achieve an upper bound of $\mathbb{E}F(\hat{x}) - F^{*} \lesssim 1 / \sqrt{K}$ . Therefore, in this important regime, FEDSN matches the lower bound under Assumption 2(a), albeit using a stronger oracle. No prior work has matched this lower bound, and so we do not know whether such an oracle is necessary in order to achieve it, or if perhaps the stronger oracle allows for breaking it. + +![](images/fc53a26dc2858a617802aaa5fa76492d2d7cde8ec2415da973df99a14334e3e8.jpg) + +![](images/96aaf36fc72b87b4a38837f9d682642d15cf902211f9e7e073bf89a53ca4e42f.jpg) +(a) + +![](images/30fce39f555937a2436d51020e0d9944a0614fd8de5b3c7b88398bb6b32b9994.jpg) +Figure 1: Empirical comparison of FEDSN-LITE (Algorithm 6) to other methods (see Appendix G.1) on the LIBSVM a9a (Chang and Lin, 2011; Dua and Graff, 2017) dataset for minimizing: (a) in-sample, and (b) out-of-sample unregularized logistic regression loss using $M \in \{100, 200\}$ machines. We vary the frequency of communication (horizontal axis of each plot), while keeping the total number of steps on each machine (theoretical parallel runtime) fixed at $KR = 100$ . Thus, every point in the sub-plot is a separately tuned instance of an algorithm, where each algorithm besides FEDAC solves an unregularized ERM problem and reports (a) the best relative sub-optimality w.r.t. the optimal minimizer and (b) the best validation loss on a held-out dataset. All results are averaged over multiple runs (see Appendix G.3 for full details). + +![](images/62a91231aa28aa5e0463b5e03f52892729170c2d22c317ea7915f5b5c9428364.jpg) +(b) + +![](images/1bce84bc966241e625d6ce24593a3365cc23fa4aff9db62aa464411e9eaad49d.jpg) + +# 5 Experiments + +In Appendix G.1 we present a more practical variant of FEDSN called FEDSN-LITE (Algorithm 6), which does away with the search over the regularization parameter as in Algorithm 2. We compare FEDSN-LITE against the two variants of FEDAC (Algorithm 7, Yuan and Ma (2020)), Minibatch SGD (Algorithm 9, Dekel et al. (2012)), and Local SGD (Algorithm 8, Zinkevich et al. (2010)). We also study the effect of adding Polyak's momentum, which we denote by $\beta$ , to these algorithms (see Appendix G.1). FEDAC is mainly presented and analyzed for strongly convex functions by Yuan and Ma (2020). In fact, they assume the knowledge of the strong convexity constant to tune FEDAC, which is typically hard to know unless the function is explicitly regularized. To handle general convex functions, Yuan and Ma (2020) build some internal regularization into FEDAC (see Appendix E.2 in their paper). However, their hyperparameter recommendations in this setting also depend on unknowns such as the smoothness of the function and the variance of the stochastic gradients. This poses a difficulty in comparing FEDAC to the other algorithms, which do not require the knowledge of these unknowns. + +To overcome this we take the more carefully optimized version of FEDAC for strongly convex functions and tune its internal regularization and learning rate. This emulates the setting where the objective is assumed to be just convex but FEDAC sees a strongly convex function instead. In our experiments in Figure 6, we notice that FEDSN-LITE is either competitive with or outperforms the other baselines. This is especially true for the sparse communication settings, which are of most practical interest. A more comprehensive set of experiments can be found in Appendix G.2 along with full implementational details in Appendix G.3.3 + +# 6 Conclusion + +In this work, we have shown how to more efficiently optimize convex quasi-self-concordant objectives by leveraging parallel methods for quadratic problems. Our method can, in some parameter regimes, improve upon existing stochastic methods while maintaining a similar computational cost, and we have further seen how our method may provide empirical improvements in the low communication regime. It remains open whether the same guarantees we achieve here can also be achieved using only independent stochastic gradients (a single stochastic gradient on each sample), or whether in the distributed stochastic setting access to Hessian-vector products is strictly more powerful than access to only independent stochastic gradients. + +Acknowledgements. This research was partially supported by NSF-BSF award 1718970. BW is supported by a Google Research PhD Fellowship. We also thank all the anonymous reviewers for their time and suggestions. + +# References + +Naman Agarwal, Zeyuan Allen-Zhu, Brian Bullins, Elad Hazan, and Tengyu Ma. Finding approximate local minima faster than gradient descent. In Proceedings of the 49th Annual ACM SIGACT Symposium on Theory of Computing, pages 1195-1199, 2017. +Zeyuan Allen-Zhu. Natasha 2: faster non-convex optimization than sgd. In Advances in Neural Information Processing Systems, pages 2680-2691, 2018. +Yossi Arjevani, Yair Carmon, John C Duchi, Dylan J Foster, Ayush Sekhari, and Karthik Sridharan. Second-order information in non-convex stochastic optimization: Power and limitations. In Conference on Learning Theory, pages 242–299. PMLR, 2020. +Francis Bach. Self-concordant analysis for logistic regression. Electronic Journal of Statistics, 4: 384-414, 2010. +Stephen Boyd and Lieven Vandenberghe. Convex Optimization. Cambridge University Press, 2004. +Brian Bullins. Highly smooth minimization of non-smooth problems. In Conference on Learning Theory, pages 988-1030. PMLR, 2020. +Yair Carmon, John C Duchi, Oliver Hinder, and Aaron Sidford. Accelerated methods for nonconvex optimization. SIAM Journal on Optimization, 28(2):1751-1772, 2018. +Yair Carmon, Arun Jambulapati, Qijia Jiang, Yujia Jin, Yin Tat Lee, Aaron Sidford, and Kevin Tian. Acceleration with a ball optimization oracle. In Advances in Neural Information Processing Systems, volume 33, 2020. +Chih-Chung Chang and Chih-Jen Lin. LIBSVM: A library for support vector machines. ACM Transactions on Intelligent Systems and Technology, 2:27:1-27:27, 2011. Software available at http://www.csie.ntu.edu.tw/~cjlin/libsvm. +Greg Coppola. Iterative parameter mixing for distributed large-margin training of structured predictors for natural language processing. PhD thesis, The University of Edinburgh, 2015. +Andrew Cotter, Ohad Shamir, Nati Srebro, and Karthik Sridharan. Better mini-batch algorithms via accelerated gradient methods. In Advances in Neural Information Processing Systems, volume 24, pages 1647-1655, 2011. +Rixon Crane and Fred Roosta. Dingo: Distributed Newton-type method for gradient-norm optimization. In Advances in Neural Information Processing Systems, volume 32, 2019. +Ofer Dekel, Ran Gilad-Bachrach, Ohad Shamir, and Lin Xiao. Optimal distributed online prediction using mini-batches. Journal of Machine Learning Research, 13(Jan):165-202, 2012. +Dheeru Dua and Casey Graff. UCI machine learning repository, 2017. URL http://archive.ics.uci.edu/ml. +Saeed Ghadimi and Guanghui Lan. Optimal stochastic approximation algorithms for strongly convex stochastic composite optimization i: A generic algorithmic framework. SIAM Journal on Optimization, 22(4):1469-1492, 2012. +Vipul Gupta, Avishek Ghosh, Michal Derezinski, Rajiv Khanna, Kannan Ramchandran, and Michael Mahoney. LocalNewton: Reducing communication bottleneck for distributed learning. arXiv preprint arXiv:2105.07320, 2021. +Rustem Islamov, Xun Qian, and Peter Richtárik. Distributed second order methods with fast rates and compressed communication. arXiv preprint arXiv:2102.07158, 2021. +Sai Praneeth Karimireddy, Sebastian U Stich, and Martin Jaggi. Global linear convergence of Newton's method without strong-convexity or lipschitz gradients. arXiv preprint arXiv:1806.00413, 2018. +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. arXiv preprint arXiv:1910.06378, 2019. + +Ahmed Khaled, Konstantin Mishchenko, and Peter Richtárik. First analysis of local gd on heterogeneous data. arXiv preprint arXiv:1909.04715, 2019. +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, pages 4519-4529. PMLR, 2020. +Anastasia Koloskova, Nicolas Loizou, Sadra Boreiri, Martin Jaggi, and Sebastian Stich. A unified theory of decentralized sgd with changing topology and local updates. In International Conference on Machine Learning, pages 5381-5393. PMLR, 2020. +Guanghui Lan. An optimal method for stochastic composite optimization. Mathematical Programming, 133(1-2):365-397, 2012. +Renato DC Monteiro and Benar Fux Svaiter. An accelerated hybrid proximal extragradient method for convex optimization and its implications to second-order methods. SIAM Journal on Optimization, 23(2):1092-1125, 2013. +Yurii Nesterov. Introductory lectures on convex programming volume i: Basic course. Lecture notes, 3(4):5, 1998. +Yurii Nesterov. Implementable tensor methods in unconstrained convex optimization. Mathematical Programming, pages 1-27, 2019. +Yurii Nesterov and Arkadii Nemirovskii. Interior-point polynomial algorithms in convex programming. SIAM, 1994. +Yurii Nesterov and Boris T Polyak. Cubic regularization of Newton method and its global performance. Mathematical Programming, 108(1):177-205, 2006. +Jorge Nocedal and Stephen Wright. Numerical optimization. Springer Science & Business Media, 2006. +Barak A Pearlmutter. Fast exact multiplication by the Hessian. Neural Computation, 6(1):147-160, 1994. +Sashank J Reddi, Jakub Konečný, Peter Richtárik, Barnabás Poczós, and Alex Smola. Aide: Fast and communication efficient distributed optimization. arXiv preprint arXiv:1608.06879, 2016. +Ohad Shamir, Nati Srebro, and Tong Zhang. Communication-efficient distributed optimization using an approximate Newton-type method. In International Conference on Machine Learning, pages 1000-1008. PMLR, 2014. +Sebastian U Stich. Local sgd converges fast and communicates little. In International Conference on Learning Representations, 2019. +Shusen Wang, Fred Roosta, Peng Xu, and Michael W Mahoney. Giant: Globally improved approximate Newton method for distributed optimization. Advances in Neural Information Processing Systems, 31:2332-2342, 2018. +Blake Woodworth, Kumar Kshitij Patel, Sebastian Stich, Zhen Dai, Brian Bullins, Brendan McMahan, Ohad Shamir, and Nathan Srebro. Is local sgd better than minibatch sgd? In International Conference on Machine Learning, pages 10334-10343. PMLR, 2020a. +Blake Woodworth, Brian Bullins, Ohad Shamir, and Nathan Srebro. The min-max complexity of distributed stochastic convex optimization with intermittent communication. In Conference on Learning Theory. PMLR, 2021. +Blake E Woodworth, Jialei Wang, Adam Smith, Brendan McMahan, and Nati Srebro. Graph oracle models, lower bounds, and gaps for parallel stochastic optimization. Advances in Neural Information Processing Systems, 31:8496-8506, 2018. +Blake E Woodworth, Kumar Kshitij Patel, and Nati Srebro. Minibatch vs local sgd for heterogeneous distributed learning. Advances in Neural Information Processing Systems, 33:6281-6292, 2020b. +Honglin Yuan and Tengyu Ma. Federated accelerated stochastic gradient descent. In Advances in Neural Information Processing Systems, 2020. +Yuchen Zhang and Lin Xiao. Disco: Distributed optimization for self-concordant empirical loss. In International Conference on Machine Learning, pages 362-370. PMLR, 2015. + +Yuchen Zhang, Martin J Wainwright, and John C Duchi. Communication-efficient algorithms for statistical optimization. In Advances in Neural Information Processing Systems, pages 1502-1510, 2012. +Yuchen Zhang, John C Duchi, and Martin J Wainwright. Communication-efficient algorithms for statistical optimization. The Journal of Machine Learning Research, 14(1):3321-3363, 2013. +Fan Zhou and Guojing Cong. On the convergence properties of a k-step averaging stochastic gradient descent algorithm for nonconvex optimization. In Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, IJCAI-18, pages 3219-3227. International Joint Conferences on Artificial Intelligence Organization, 7 2018. doi: 10.24963/ijcai.2018/447. +Martin Zinkevich, Markus Weimer, Lihong Li, and Alex J Smola. Parallelized stochastic gradient descent. In Advances in Neural Information Processing Systems, pages 2595-2603, 2010. \ No newline at end of file diff --git a/astochasticnewtonalgorithmfordistributedconvexoptimization/images.zip b/astochasticnewtonalgorithmfordistributedconvexoptimization/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..de20c33fcbed787a39055f3779c67116007dba68 --- /dev/null +++ b/astochasticnewtonalgorithmfordistributedconvexoptimization/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:62d387d4e26769646e96dfdafda6f64d4646efc13696a8727317b489e67d6161 +size 499614 diff --git a/astochasticnewtonalgorithmfordistributedconvexoptimization/layout.json b/astochasticnewtonalgorithmfordistributedconvexoptimization/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..dc4961f658bf46f1b9a9c17413233f67be64d39d --- /dev/null +++ b/astochasticnewtonalgorithmfordistributedconvexoptimization/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:50b3f80474a25fd5631a20ffbe668cf8ca80ed6a75c3e87920b172c0a22a15bc +size 607428 diff --git a/asurrogateobjectiveframeworkforpredictionprogrammingwithsoftconstraints/9db960bb-c237-446e-b242-3afc27b80d44_content_list.json b/asurrogateobjectiveframeworkforpredictionprogrammingwithsoftconstraints/9db960bb-c237-446e-b242-3afc27b80d44_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..2471b74d21ac9a90f93ee9bba4e4e24f75c80ae6 --- /dev/null +++ b/asurrogateobjectiveframeworkforpredictionprogrammingwithsoftconstraints/9db960bb-c237-446e-b242-3afc27b80d44_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:441e906a57dd4c490c24932632c863c16ea74508886ce88f748774e25d6442ad +size 85820 diff --git a/asurrogateobjectiveframeworkforpredictionprogrammingwithsoftconstraints/9db960bb-c237-446e-b242-3afc27b80d44_model.json b/asurrogateobjectiveframeworkforpredictionprogrammingwithsoftconstraints/9db960bb-c237-446e-b242-3afc27b80d44_model.json new file mode 100644 index 0000000000000000000000000000000000000000..0beab54aac8c8c64ed70b22ee1163d44c71fdb01 --- /dev/null +++ b/asurrogateobjectiveframeworkforpredictionprogrammingwithsoftconstraints/9db960bb-c237-446e-b242-3afc27b80d44_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8aebfbced1d3fe3e8dde6b9e06edd6af9e1ed3f0b968d61444b37abcab591b06 +size 106012 diff --git a/asurrogateobjectiveframeworkforpredictionprogrammingwithsoftconstraints/9db960bb-c237-446e-b242-3afc27b80d44_origin.pdf b/asurrogateobjectiveframeworkforpredictionprogrammingwithsoftconstraints/9db960bb-c237-446e-b242-3afc27b80d44_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1bb906d740c796043a3298b6abe1ad5f988792c5 --- /dev/null +++ b/asurrogateobjectiveframeworkforpredictionprogrammingwithsoftconstraints/9db960bb-c237-446e-b242-3afc27b80d44_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6fdec260190a7947031738449a530ed2dd593c6bdabfcfac248dcf7853dd800c +size 480303 diff --git a/asurrogateobjectiveframeworkforpredictionprogrammingwithsoftconstraints/full.md b/asurrogateobjectiveframeworkforpredictionprogrammingwithsoftconstraints/full.md new file mode 100644 index 0000000000000000000000000000000000000000..eccf321defc3c5c26c0ae1ccc19c02c1e1c3cf68 --- /dev/null +++ b/asurrogateobjectiveframeworkforpredictionprogrammingwithsoftconstraints/full.md @@ -0,0 +1,354 @@ +# A Surrogate Objective Framework for Prediction+Optimization with Soft Constraints + +# Kai Yan* + +Department of Computer Science + +University of Illinois at Urbana-Champaign + +Urbana, IL 61801 + +kaiyan3@illinois.edu + +# Jie Yan + +Microsoft Research + +Beijing, China + +jiey@microsoft.com + +# Chuan Luo + +Microsoft Research + +Beijing, china + +chuan.luo@microsoft.com + +# Liting Chen* + +Microsoft Research + +Beijing, China + +98chenliting@gmail.com + +# Qingwei Lin† + +Microsoft Research + +Beijing, China + +qlin@microsoft.com + +# Dongmei Zhang + +Microsoft Research + +Beijing, China + +dongmeiz@microsoft.com + +# Abstract + +Prediction+optimization is a common real-world paradigm where we have to predict problem parameters before solving the optimization problem. However, the criteria by which the prediction model is trained are often inconsistent with the goal of the downstream optimization problem. Recently, decision-focused prediction approaches, such as SPO+ and direct optimization, have been proposed to fill this gap. However, they cannot directly handle the soft constraints with the max operator required in many real-world objectives. This paper proposes a novel analytically differentiable surrogate objective framework for real-world linear and semi-definite negative quadratic programming problems with soft linear and non-negative hard constraints. This framework gives the theoretical bounds on constraints' multipliers, and derives the closed-form solution with respect to predictive parameters and thus gradients for any variable in the problem. We evaluate our method in three applications extended with soft constraints: synthetic linear programming, portfolio optimization, and resource provisioning, demonstrating that our method outperforms traditional two-staged methods and other decision-focused approaches. + +# 1 Introduction + +Mathematical optimization (a.k.a. mathematical programming), e.g., linear and quadratic programming, has been widely applied in decision-making processes, such as resource scheduling [1], goods production planning [2], portfolio optimization [3], and power scheduling [4]. In practice, problem parameters (e.g., goods demands, and equity returns) are often contextual and predicted by models with observed features (e.g., history time series). With the popularity of machine learning techniques and increasing available data, prediction+optimization has become a normal paradigm [5]. + +Prediction becomes critical to the performance of the full prediction+optimization workflow since modern optimization solvers (e.g., Gurobi [6] and CPLEX [7]) can already efficiently find optimal solutions for most large scale optimization problems. Traditionally, prediction is treated separately as a general supervised learning problem and learned through minimizing a generic loss function (e.g., mean squared error for regression). However, studies have shown that minimization of the fitting errors does not necessarily lead to better final decision performance [8, 9, 10, 11]. + +Recently, a lot of efforts on using optimization objective to guide the learning of prediction models have been made, which are decision-focused when training prediction models instead of using traditional prediction metrics, e.g. mean squared error losses. For linear objectives, the 'Smart Predict then Optimize' ([10]) proposes the SPO+ loss function to measure the prediction errors against optimization objectives, while direct optimization ([12]) updates the prediction model's parameters by perturbation. For quadratic objectives, OptNet [13, 14] implements the optimization as an implicit layer whose gradients can be computed by differentiating the KKT conditions and then back propagates to prediction neural network. CVXPY [15] uses similar technologies with OptNet but extends to more general cases of convex optimization. However, all the above state-of-the-art approaches do not contain the soft constraints in their objectives. In this paper, We consider linear 'soft-constraints', a penalty in the form of $\max(z, 0)$ , where $z = Cx - d$ is a projection of decision variable $x \in \mathbb{R}^n$ and context variables $C \in \mathbb{R}^{m \times n}$ , $d \in \mathbb{R}^m$ . Such soft constraints are often required in practice: for example, they could be the waste of provisioned resources over demands or the extra tax paid when violating regulatory rules. Unfortunately, the $\max(\cdot, 0)$ operator is not differentiable and thus cannot be directly handled by these existing approaches. To differentiate soft constraints is a primary motivation of this paper. + +In this paper, we derive a surrogate objective framework for a broad set of real-world linear and quadratic programming problems with linear soft constraints and implement decision-focused differentiable predictions, with the assumption of non-negativity of hard constraint parameters. The framework consists of three steps: 1) rewriting all hard constraints into piece-wise linear soft constraints with a bounded penalty multiplier; 2) using a differentiable element-wise surrogate to substitute the piece-wise objective, and solving the original function numerically to decide which segment the optimal point is on; 3) analytically solving the local surrogate and obtaining the gradient; the gradient is identical to that of the piecewise surrogate since the surrogate is convex/concave such that the optimal point is unique. + +Our main contributions are summarized as follows. First, we propose a differentiable surrogate objective function that incorporates both soft and hard constraints. As the foundation of our methodology, in Section 3, we prove that, with reasonable assumptions generally satisfied in the real world, for linear and semi-definite negative quadratic programming problems, the constraints can be transformed into soft constraints; then we propose an analytically differentiable surrogate function for the soft constraints $\max(\cdot, 0)$ . Second, we present the derived analytical and closed-form solutions for three representative optimization problems extended with soft constraints in Section 4 - linear programming with soft constraints, quadratic programming with soft constraints, and asymmetric soft constraint minimization. Unlike KKT-based differentiation methods, our method makes the calculation of gradients straightforward for predicting context parameters in any part of the problem. Finally, we apply with theoretical derivations and evaluate our approach in three scenarios, including synthetic linear programming, portfolio optimization, and resource provisioning in Section 4, empirically demonstrate that our method outperforms two-stage and other predict+optimization approaches. + +# 2 Preliminaries + +# 2.1 Real-world Optimization Problems with Soft Constraints + +Our target is to solve the broad set of real-world mathematical optimization problems extended with a $\max(z, 0)$ term in their objectives where $z$ depends on decision variables and predicted context parameters. In practice, $\max(z, 0)$ is very common; for example, it may model overhead of under-provisioning, over-provisioning of goods, and penalty of soft regulation violations in investment portfolios. We call the above $\max(z, 0)$ term in an objective as soft constraints, where $z \leq 0$ is allowed to violate as long as the objective improves. + +The general problem formulation is + +$$ +\max _ {x} g (\theta , x) - \alpha^ {T} \max (z, 0), z = C x - d, \text {s . t .} A x \leq b, B x = c, x \geq 0 \tag {1} +$$ + +where $g$ is a utility function, $x \in \mathbb{R}^n$ the decision variable, and $\theta \in \mathbb{R}^n$ the predicted parameters. + +Based on observations on a broad set of practical problem settings, we impose two assumptions on the formulation, which serves as the basis of following derivations in this paper. First, we assume $A \in \mathbb{R}^{m_1 \times n} \geq 0$ , $b \in \mathbb{R}^{m_1} \geq 0$ , $B \in \mathbb{R}^{m_2 \times n} \geq 0$ , and $c \in \mathbb{R}^{m_2} \geq 0$ hold. This is because for problems with constraint on weights, quantities or their thresholds, these parameters are naturally non-negative. Second, we assume the linearity of soft constraints, that is $z = Cx - d$ , where $z \in \mathbb{R}^{m_3}$ , $C \in \mathbb{R}^{m_3 \times n}$ , and $d \in \mathbb{R}^{m_3}$ . This form of soft constraints make sense in wide application situations when describing the penalty of goods under-provisioning or over-provisioning, a vanish in marginal profits, or running out of current materials. + +Now we look into three representative instances of Eq.1, extracted from real-world applications. + +Linear programming with soft constraints, where $g(x,\theta) = \theta^T x$ . The problem formulation is + +$$ +\max _ {x} \theta^ {T} x - \alpha^ {T} \max (C x - d, 0), \text {s . t .} A x \leq b, B x = c, x \geq 0 \tag {2} +$$ + +where $\alpha \geq 0$ . Consider the application of logistics where $\theta$ represents goods' prices, $\{A, B, C\}$ are the capability of transportation tools, and $\{b, c\}$ are the thresholds. Obviously, $A, b, B, c \geq 0$ hold. + +Quadratic programming with soft constraints, where $g(\theta, x) = \theta^T x - x^T Q x$ . One example is the classic minimum variance portfolio problem [16] with semi-definite positive covariance matrix $Q$ and expected return $\theta$ to be predicted. We extend it with soft constraints which, for example, may represent regulations on portions of equities for some fund types. Formally with $\alpha \geq 0$ , we have: + +$$ +\max _ {x} \theta^ {T} x - x ^ {T} Q x - \alpha^ {T} \max (C x - d, 0), \text {s . t .} B x = c, x \geq 0. \tag {3} +$$ + +Optimization of asymmetric soft constraints. This set of optimization problems have the objective to match some expected quantities by penalizing excess and deficiency with probably different weights. Such formulation represents widespread resource provisioning problems, e.g., power[4] and cloud resources[1], where we minimize the cost of under-provisioning and over-provisioning against demands. Formally with $\alpha_{1},\alpha_{2} > 0$ , we have: + +$$ +\max _ {x} - \left(\alpha_ {1} ^ {T} \max (C x - d, 0) + \alpha_ {2} ^ {T} \max (d - C x, 0)\right), \text {s . t .} B x = c, x \geq 0. \tag {4} +$$ + +In this paper, we consider a challenging task where $C$ is a matrix to be predicted with known constants $d$ . In reality, the $Cx - d$ term may represent the "wasted" part when satisfying the actual need of $d$ . + +# 2.2 Prediction+Optimization + +For compactness we write Eq.1 as $\max_{x\in \mathcal{X}}f(x,\theta)$ , where $f$ is the objective function and $\mathcal{X}$ is the feasible domain. The solver for $f$ is to solve $x^{*} = \operatorname{argmax}_{x\in \mathcal{X}}f(x,\theta)$ . With parameters $\theta$ known, Eq.2-4 can be solved by mature solvers like Gurobi [6] and CPLEX [7]. + +In prediction+optimization, $\theta$ is unknown and needs to be predicted from some observed features $\xi \in \Xi$ . The prediction model is trained on a dataset $D = \{(\xi_i,\theta_i)\}_{i = 1}^N$ . In this paper, we consider the prediction model, namely $\Phi$ , as a neural network parameterized with $\psi$ . In traditional supervised learning, $\Phi_{\psi}$ is learned by minimizing a generic loss, e.g., L1 (Mean Absolute Error) or L2 (Mean Squared Error), which measures the expected distance between predictions and real values. However, such loss minimization is often inconsistent with the optimization objective $f$ , especially when the prediction model is biased [11]. + +Instead, decision-focused learning directly optimizes $\psi$ with respect to the optimization objective $f$ , that is, $\max_{\psi} \mathbf{E}_{(\xi, \theta) \sim D}[f(\hat{x^{*}}(\Phi_{\psi}(\xi)), \theta)]$ . The full computational flow is illustrated in Fig.1. In the gradient-based learning, update of $\psi$ 's gradient is $\frac{\partial r}{\partial \psi} = \frac{\partial \hat{\theta}}{\partial \psi} \frac{\partial \hat{x^{*}}}{\partial \hat{\theta}} \frac{\partial r}{\partial \hat{x^{*}}}$ , where utility $r = f(\hat{x^{*}}, \theta)$ . The Jacobian $\partial \hat{\theta} / \partial \psi$ is computed implicitly by auto-differentiation of deep learning frameworks (e.g., PyTorch [17]), and $\partial r / \partial \hat{x^{*}}$ is analytical. The main challenge is to compute $\partial \hat{x^{*}} / \partial \hat{\theta}$ , which depends on differentiating the argmax operation. One recent approach is to rewrite the objective to be convex (by adding a quadratic regularizer if necessary), build and differentiate the optimality conditions (e.g., + +![](images/dc669ac26f1f43cc56f0042507c60498731625418a7515e05cbd11a0db2ed9d7.jpg) +Figure 1: Computation graph of the decision-focused prediction methods. + +KKT conditions) [18] which map $\hat{\theta}$ to the solution $x^*$ , and then apply implicit function theorem to obtain $\partial x^* / \partial \hat{\theta}$ . Alternatively, in this paper we propose a novel approach that rewrites the problem as an unconstrained problem with soft constraints and derives analytical solutions, based on our observations on the real-world problem structures and coefficient properties. + +# 3 Methodology + +Our main idea is to derive a surrogate function for $f$ with a closed-form solution such that the Jacobian $\frac{\partial x}{\partial \theta}$ is analytical, making the computation of gradient straightforward. Unlike other recent work [13, 14, 15, 3], our method does not need to solve KKT optimality condition system. Instead, by adding reasonable costs for infeasibility, we convert the constrained problem into an unconstrained one. With the assumption of concavity, we prove that there exist constant vectors $\beta_{1}, \beta_{2}, \beta_{3}$ , such that Eq.1 can be equivalently transformed into an unconstrained problem: + +$$ +\max _ {x} L (x) = \max _ {x} g (x, \theta) - \alpha^ {T} \max (C x - d, 0) - \beta_ {1} ^ {T} \max (A x - b, 0) - \beta_ {2} ^ {T} | B x - c | - \beta_ {3} ^ {T} \max (- x, 0) \tag {5} +$$ + +The structure of this section is as follows. Section 3.1 proves that the three types of hard constraints can be softened by deriving bounds of $\beta_{1},\beta_{2},\beta_{3}$ ; for this paper, we will assign each entry of the three vectors the equal value (with a slight abuse of notation, we denote $\beta_{1} = \beta_{2} = \beta_{3} = \beta$ for the proofs of bounds; we align with the worst bound applicable to the problem formulation.) Section 3.2 proposes a novel surrogate function of $\max (\cdot ,0)$ , such that the analytical form of $\frac{\partial x}{\partial\theta}$ can be easily derived via techniques of implicit differentiation [18] and matrix differential calculus [19] on equations derived by convexity [20]. Based on such derived $\frac{\partial x}{\partial\theta}$ , we develop our end-to-end learning algorithm of prediction+optimization whose detailed procedure is described in Appendix C. + +# 3.1 Softening the Hard Constraints + +For any hard constraints $w = Ax - b \leq 0$ , we denote its equivalent soft constraints as $H(w) = \beta^T \max (w, 0)$ . $H(w)$ should satisfy two conditions: 1) for $w \leq 0$ (feasible $x$ ), $H(w) = 0$ ; 2) for $w \geq 0$ (infeasible $x$ ), $H(w)$ is larger than the utility gain (i.e., improvement of the objective value) $R = f(x, \theta) - \max_{x_1: A x_1 \leq b} f(x_1, \theta)$ by violating $Ax - b \leq 0$ . Intuitively, the second condition requires a sufficiently large-valued $\beta > 0$ to ensure that the optimization on the unconstrained surrogate objective never violates the original $Ax \leq b$ ; to make this possible, we assume that the l2-norm of the derivative of the objective $f$ before conversion is bounded by constant $E$ . The difficulty of requirement 2) is that the distance of a point to the convex hull $l$ is not bounded by the sum of distances between the point and each hyper-plane in general cases, so the utility gain obtained from violating constraints is unbounded. Fig. 2-(a) shows such an example which features the small angle between hyper-planes of the activated cone. We will refer such kind of 'unbounding' as "acute angles" below. + +The main effort of this subsection is to analyze and bound the effect caused by such acute angles. Given a convex hull $\mathcal{C} = \{z\in \mathbb{R}^n |Az\leq b\}$ ( $A\geq 0$ is not required here) and any point $x\notin \mathcal{C}$ , let $x_0\in \mathcal{C}$ be the nearest point of $\mathcal{C}$ to $x$ , and $A^\prime x\geq b^\prime$ represent all active constraints at $x$ , then all such active constraints must pass through $x_0$ . The domain $\mathcal{K} = \{z\in \mathbb{R}^n |A'z\geq b'\}$ is a cone or degraded + +![](images/bf44c8f7eb9f30e0698231f093b048931f7c1e1b317cfafdab9eb9520c658b40.jpg) +(a) 2D acute angle + +![](images/188281e70797f272a7c5b1a50ddf6f2f366b7cadabc28d11f8ce56f7bd0c648a.jpg) +(b) 3D acute angle +Figure 2: (a) and (b) are 2 and 3-dimensional "acute angles"; (c) and (d) shows two corresponding activated cones for given acute angles. The green area is the feasible region, $x$ is the red point and $x_0$ is the yellow point; the red $\theta$ is the derivative of an objective $g(x, \theta) = \theta^T x$ . + +![](images/96c423151f5d7e87a8938e7c6baeb19926bc5220c59005e9a19fa365a8201c2b.jpg) +(c) Non-degraded cone + +![](images/e06c6882e1d8e0d4439f17dff20db6e2a7a798e2b5a6d36b5a4b99982c4e505e.jpg) +(d) Degraded cone + +cone where the tip of the cone is a subspace of $R^n$ . For the rest of the paper, we will call $\mathcal{K}$ activated cone, as shown in Fig. 2. Note that for any degraded activated cone, $x - x_0$ is always perpendicular to the tip subspace; therefore, we may project the cone onto the complementary space of the tip and get the same multiplier bound on the projected activated cone with lower dimensions. + +Ideally, we aim to eliminate the utility gain $R$ obtained from violating $A'x \leq b'$ with the penalty $\beta^T (A'x - b')$ , i.e., ensure $\beta^T (A'x - b') \geq R$ hold for any $x$ . For the compactness of symbols and simplicity, we will assume that the main objective is $g(x,\theta) = \theta^T x$ in this section; however note that our proofs apply with the existence of soft constraints and quadratic terms in $g$ , which is discussed at the beginning of Appendix A. With such assumption, we now give a crucial lemma, which is the core of our proof for most of our theorem: + +Lemma 1. (Bounding the utility gain) Let $R = f(x, \theta) - \max_{x_1 \in \mathcal{C}} f(x_1, \theta)$ be the utility gain, then $R \leq f(x, \theta) - f(x_0, \theta) \leq \frac{E}{\cos p_0} \sum_{i=1}^{n} (A'_i x - b'_i)$ , where $x$ is an infeasible point, $A' x \leq b'$ the active constraints at $x$ , $p_0 = \angle (A'_i^*, \theta^*)$ where $A'_i^*$ and $\theta^*$ are the optimal solutions of $\max_{\theta} \min_{A'_i'} \cos \angle (A'_i, \theta)$ (i.e., the maximin angle between $\theta$ and any hyperplane of the activated cone $\mathcal{K} = \{z \in \mathbb{R}^n | z - x_0 \in \text{cone}(A')\}$ ), and $x_0$ the projection of $x$ to the tip of cone $\mathcal{C} = \{z \in \mathbb{R}^n | A' z \leq b'\}$ . $E$ is the upper bound of $||\theta||_2$ . $\angle (\cdot, \cdot)$ denotes the angle of two vectors. + +Thus, $\frac{E}{\cos p_0} \mathbf{1}$ is a feasible choice of $\beta$ , and it suffices by finding the lower bound for $\cos p_0$ . For the rest of the section, we find the lower bound of $\cos p_0$ by exploiting the assumed properties of $A'$ , e.g., $A' \geq 0$ ; we give the explanation of the full proofs for all theoretical results in Appendix A. + +# 3.1.1 Conversion of Inequality Constraints $Ax \leq b$ + +Let us first consider the constraints $w = Ax - b \leq 0$ , where $A \geq 0, b \geq 0$ . It is easy to prove that given $A \geq 0$ and $b \geq 0$ , the distance of a point to the convex hull $Ax \leq b$ is bounded. More rigorously, we have the following theorem, which guarantees the feasibility of softening the hard constraints of inequalities $Ax \leq b$ : + +Theorem 2. Assume the optimization objective $\theta^T x$ with constraints $Ax \leq b$ , where $A \geq 0$ , and $b \geq 0$ . Then, the utility gain $R$ obtained from violating $Ax - b \leq 0$ has an upper bound of $O(\sum_{i} \max(w_i, 0) E)$ , where $w = A'x - b'$ , and $A'x \leq b'$ is the active constraints. + +# 3.1.2 Conversion of Inequality Constraints $x \geq 0$ + +With inequality constraints $Ax \leq b$ converted, we now further enforce $x \geq 0$ into soft constraints. It seems that the constraint of this type may form a very small angle to those in $w = Ax - b$ . However, as $-x$ is aligned with the axes, we can augment $x \geq 0$ into soft constraints by proving the following theorem: + +Theorem 3. When there is at least one entry of $x \geq 0$ in the activated cone, the utility gain $R$ from deviating the feasible region is bounded by $O\left(\frac{n^{1.5}E\sum_{i}\max(w_{i},0)}{\sin p}\right)$ , where $p$ is the smallest angle between axes and other constraint hyper-planes and $w$ is the union of $Ax - b$ and $-x$ . + +Hence, we can set $\beta = O\left(\frac{n^{1.5}E}{\sin p}\right)$ . Specially, for binary constraints we may set $\beta = O(n^{1.5}E)$ : + +Corollary 4. For binary constraints where the entries of $A$ are either 0 or 1, the utility gain $R$ of violating $x \geq 0$ constraint is bounded by $O(n^{1.5}E\sum_{i}\max (w_{i},0))$ , where $w_{i} = A_{i}x - b_{i}$ or $-x$ . + +which gives a better bound for a set of unweighted item selection problem (e.g. select at most $k$ items from a particular subset). + +# 3.1.3 Conversion of Equality Constraints $Bx = c$ + +Finally, we convert $Bx = c$ into soft constraints. This is particularly difficult, as $Bx = c$ implies both $Bx \leq c$ and $-Bx \leq -c$ , which will almost always cause acute angles. Let's first consider a special case where there is only one equality constraint and $A$ is an element matrix $I^{n \times n}$ . + +Theorem 5. If there is only one equality constraint $Bx = c$ (i.e., $B$ degrades as a row vector, such like $\sum_{i} x_{i} = 1$ ) and special inequality constraints $x \geq 0$ , $Ix \leq b$ , then the utility gain $R$ from violating constraints is bounded by $O\left(\frac{n^{1.5} E \sum_{i} \max(w_{i}, 0)}{\sin p}\right)$ , where $p$ is the same with theorem 3, $w$ is the union of $Bx - c$ and $-x$ . + +Intuitively, when there is only one equality constraint, the equality constraint can be viewed as an unequal one, for at most one side of the constraint can be in a non-degraded activated cone. Thus, we can directly apply the proof of Theorem 2 and 3, deriving the same bound $O\left(\frac{n^{1.5}E}{\sin p}\right)$ for $\beta$ . + +Finally, we give bounds for general $Ax \leq b$ , $Bx = c$ with $A, b, B, c \geq 0$ as below: + +Theorem 6. Given constraints $Ax \leq b, x \geq 0$ , and $Bx = c$ , where $A, B, b, c \geq 0$ , the utility gain $R$ obtained from violating constraints is bounded by $O(\sqrt{n}\lambda_{max}\sum_{i}\max (w_{i},0))$ , where $\lambda_{max}$ is the upper bound for eigenvalues of $P^T P$ ( $P: x \to Px$ is an orthogonal transformation for an $n$ -sized subset of normalized row vectors in $A, B$ and $-I$ ), and $w$ is the union of all active constraints from $Ax \leq b, x \geq 0, Bx \leq c$ and $-Bx \leq -c$ . + +In this theorem, $P$ is generated by taking an arbitrary $n$ -sized subset from the union of row vectors in $A, B$ and $-I$ , orthogonalizing the subset, and using the orthogonal transformation matrix as $P$ ; there are $\binom{n+m_1+m_2}{n}$ different cases of $P$ , and $\lambda_{max}$ is the upper bound of eigenvalues of $PTP$ over all possible cases of $P$ . Note that there are no direct bounds on $\lambda_{max}$ with respect to $n$ and the angles between hyper-planes. However, empirical results (see Appendix A for details) show that for a diverse set of synthetic data distributions, $\lambda_{max} = O(n^2)$ follows. Therefore, empirically we can use a bound $O\left(\frac{n^{2.5}E}{\sin p}\right)$ for $\beta$ . So far, we have proven that all hard constraints can be transformed into soft constraints with bounded multipliers. For compactness, Eq.5 is rewritten in a unified form: + +$$ +L (x) = g (x, \theta) - \gamma^ {T} \cdot \max \left(C ^ {\prime} x - d ^ {\prime}\right), \text {w h e r e} \gamma = \left[ \begin{array}{c} \alpha \\ O \left(\frac {n ^ {2 . 5} E}{\sin p}\right) \mathbf {1} \end{array} \right], C ^ {\prime} = \left[ \begin{array}{c} C \\ A \\ - B \\ B \\ - I \end{array} \right], d ^ {\prime} = \left[ \begin{array}{c} d \\ b \\ - c \\ c \\ 0 \end{array} \right] \tag {6} +$$ + +# 3.2 The Unconstrained Soft Constraints + +As Eq.5 is non-differentiable for the max operator, we need to seek a relaxing surrogate for differentiation. The most apparent choice of the derivative of such surrogate $S(z)$ for $z = C'x - d'$ is sigmoidal functions; however, it is difficult to derive a closed-form solution for such functions, since sigmoidal functions yield $z$ in the denominator, and $z$ cannot be directly solved because $C$ is not invertible (referring to Appendix B for detailed reasons). Therefore, we have to consider a piecewise roundabout where we can first numerically solve the optimal point to determine which segment the optimal point is on, and then expand the segment to the whole space. To make this feasible, two assumptions must be made: 1) this function must be differentiable, and 2) the optimal point must be unique; to ensure this, the surrogate should be a convex/concave piece-wise function. The second property is for maintaining the optimal point upon segment expansion. Fortunately, there is one simple surrogate function satisfying our requirement: + +$$ +S (z) = \left\{ \begin{array}{l l} 0 & \text {i f} z < - \frac {1}{4 K} \\ K \left(z + \frac {1}{4 K}\right) ^ {2} & \text {i f} - \frac {1}{4 K} \leq z \leq \frac {1}{4 K} \\ z & \text {i f} z \geq \frac {1}{4 K} \end{array} \right. \tag {7} +$$ + +Let $M$ and $U$ be diagonal matrices as the indicator of $S(z)$ , which are $M_{i,i} = 2K\left[-\frac{1}{4K}\leq z_i\leq \frac{1}{4K}\right]$ and $U_{i,i} = \left[\frac{1}{4K} < z_i\right]$ , where $[\cdot ]$ is an indicator function. $K > 0$ is a hyper-parameter that needs to be balanced. Larger $K$ makes the function closer to original; however, if $K$ is too large, then the training process would be destabilized, because when the prediction error is large at the start of the training process, $\frac{\partial f}{\partial\hat{\theta}} |_{\hat{x}}$ might be too steep. Then consider the optimal point for the unconstrained optimization problem maximizing $\theta^T x - \gamma^T\max (C'x - d',0)$ , by differentiating on both sides, we can obtain: + +$$ +\theta = C ^ {\prime T} M \operatorname {d i a g} (\gamma) \left(C ^ {\prime} x - d ^ {\prime}\right) + C ^ {\prime T} \left(\frac {1}{4 K} M + U\right) \gamma \tag {8} +$$ + +This equation reveals the closed-form solution of $x$ with respect to $\theta$ , and thus the calculation of $\frac{\partial x}{\partial \theta}$ becomes straightforward: + +$$ +\frac {\partial x}{\partial \theta} = \left(C ^ {\prime T} M \operatorname {d i a g} (\gamma) C ^ {\prime}\right) ^ {- 1} \tag {9} +$$ + +$C^T M \mathrm{diag}(\gamma) C'$ is invertible as long as at least $n$ soft constraints are on the quadratic segment (i.e., active), which is the necessary condition to fix a particular optimal point $n$ in $\mathcal{R}^n$ . With such solution, we can train our prediction model with stochastic gradient descent (SGD). For each batch of problem instances, we first solve optimization problems numerically using solvers like Gurobi to get the matrix $M$ and $U$ , and then calculate gradients with the analytical solution. The parameters of the prediction model are updated by such gradients. The sketch of our algorithm is outlined in Appendix C. + +# 4 Applications and Experiments + +We apply and evaluate our approach on the three problems described in Section 2, i.e., linear programming, quadratic programming, and asymmetric soft constraint minimization. These problems are closely related to three applications respectively: synthetic linear programming, portfolio optimization, and resource provisioning, which are constructed using synthetic or real-world datasets. The detailed derivation of gradients for each application can be found in Appendix D. + +In our experiments, the performance is measured in regret, which is the difference between the objective value when solving optimization over predicted parameters and the objective value when solving optimization over actual parameters. For each experiment, we choose two generic two-stage methods with $L1$ -loss and $L2$ -loss, as well as decision-focused methods for comparison baselines. We choose both SPO+[10] and DF proposed by Wilder et al. [9] for synthetic linear programming and DF only for portfolio optimization, as the former is specially designed for linear objective. For resource provisioning, we use a problem-specific weighted L1 loss, as both SPO+ and DF are not designed for gradients with respect to variables in the soft constraints. All reported results for each method are obtained by averaging on 15 independent runs with different random seeds. + +As real-world data is more lenient than extreme cases, in practice we use a much lower empirical bound than the upper bound proved in section 3.1., e.g., constants of around 20 and $5\sqrt{n}$ where $n$ is the number of dimensions of decision variables. One rule of thumb is to start from a reasonable constant or a constant times $\sqrt{n}$ , where such "reasonable constant" is the product of a constant factor (e.g. $5 - 10$ ) and a roughly estimated upper bound of $\| \theta \|_2$ (which corresponds to $E$ in our bounds) with specific problem settings; then alternately increase the constant and time an extra $\sqrt{n}$ while resetting the constant until the program stops diverging, and the hard constraints are satisfied. In our experiments, we hardly observe situations where such process goes for two or more steps. + +# 4.1 Synthetic Linear Programming + +Problem setup. The prediction dataset $\{(\xi_i,\theta_i)\}_{i = 1}^N$ is generated by a general structural causal model ([21]), ensuring it is representative and consistent with physical process in nature. The programming parameters are generated for various scales in numbers of decision variables, hard constraints, and soft constraints. Full details are given in Appendix E. + +Regret (the lower, the better) + +
NProblem SizeL1L2SPO+ [10]DF [9]Ours
100(40, 40, 0)2.454±0.2322.493±0.2952.506±0.2942.478±0.4252.258±0.311
(40, 40, 20)2.626±0.3072.664±0.3032.667±0.2812.536±0.3762.350±0.263
(80, 80, 0)5.736±0.2915.831±0.3615.711±0.3095.756±0.3175.200±0.506
(80, 80, 40)4.786±0.4034.786±0.5964.939±0.3824.902±0.5374.570±0.390
1000(40, 40, 0)1.463±0.1431.447±0.1551.454±0.1481.434±0.2681.346±0.144
(40, 40, 20)1.626±0.1411.613±0.1101.618±0.1031.529±0.1511.506±0.102
(80, 80, 0)3.768±0.1323.718±0.1173.573±0.1133.532±0.1023.431±0.100
(80, 80, 40)2.982±0.1762.913±0.1722.879±0.1483.351±0.2122.781±0.165
5000(40, 40, 0)1.077±0.1051.080±0.1091.090±0.1051.078±0.0921.037±0.100
(40, 40, 20)1.283±0.0701.277±0.0771.298±0.0771.291±0.0911.220±0.071
(80, 80, 0)2.959±0.0862.943±0.0912.926±0.0792.869±0.0852.845±0.064
(80, 80, 40)2.239±0.1222.224±0.1062.234±0.1222.748±0.1652.172±0.098
+ +Table 1: Performance comparison (regret mean with std. deviation) for the synthetic linear programming problem. $N$ is the size of the training dataset, and problem size is a triplet (# of decision variables' dimension, # of hard constraints, # of soft constraints). + +Experimental setup. All five methods use the same prediction model - a fully connected neural network of two hidden layers with 128 neurons for each and ReLU [22] for activation. We use AdaGrad [23] as the optimizer, with learning rate 0.01 and gradient clipped at $1e - 4$ . We train each method for 40 epochs, and early stop when valid performance degrades for 4 consecutive epochs. Specially, to make DF[9] work right on the non-differentiable soft constraints, we first use black-box solvers to determine whether each soft constraint is active on the optimal point, and then optimize with its local expression (i.e. 2nd-order Taylor expansion at optimal point). + +Performance analysis. Our experiments cover four programming problem scales with three prediction dataset sizes. Results are summarized in Table 1. In all cases, our method performs consistently better than two-stage methods, DF and SPO+. Even for the cases with only hard constraints (i.e., the third parameter of problem size is 0), our method still has significant advantage, demonstrating its effectiveness on handling hard constraints. Surprisingly, although the main objective is linear, SPO+ often performs even worse than two-stage methods. Detailed analysis (see the appendix) shows that SPO+ quickly reaches the test optimality and then over-fits. This may be due to that, unlike our method, SPO+ loss is not designed to align with the soft constraints. This unawareness of soft constraint is also why DF is performing worse than our method, as DF is working on an optimization landscape that is non-differentiable at the boundary of soft constraints, on which the optimal point usually lies. Besides, with the increment of the samples in train data, the performance of all methods is improved significantly and the performance gap among ours and two-stage methods becomes narrow, which implies that prediction of two-stage methods becomes better and with lower biases. Even so, our method has better sample efficiency than two-stage methods. + +We also investigated the effect of the hyper-parameter $K$ in our surrogate max function, detailed in the appendix. Through our experiments, $K$ 's effect to regret is not monotonic, and its optimal value varies for different problem sizes. Interestingly, $K$ 's effect is approximately smooth. Thus, in practice, we use simple grid search to efficiently find the best setting of $K$ . + +# 4.2 Portfolio Optimization + +Problem and experimental setup. The prediction dataset is daily price data of SP500 from 2004 to 2017 downloaded by Quandl API [24] with the same settings in [3]. We use the same fix as that in linear programming experiment to make DF[9] work with non-differentiable soft constraints, which was also used in [3] for non-convex optimization applications. Most settings are aligned with those in [3], including dataset configuration, prediction model, learning rate (0.01), optimizer (Adam), gradient clip (0.01) and number of training epochs (20). We set the number of soft constraints to 0.4 times of $n$ , where $n$ is the number of candidate equities. For the soft constraint $\alpha^T \max(Cx - d, 0)$ , $\alpha = \frac{15}{n} v$ , where each element of $v$ is generated randomly at uniform from (0, 1); the elements of matrix $C$ is generated independently from $\{0, 1\}$ , where the probability of 0 is 0.9 and 1 is 0.1. $K$ is set as 100. + +Regret measured in $\%$ (the lower, the better) + +
#EquitiesL1L2DF [9]ours(K = 100)
504.426±0.3864.472±0.3854.016±0.3893.662±0.238
1004.262±0.2314.320±0.2293.500±0.2523.214±0.138
1503.878±0.2813.950±0.2873.419±0.2813.109±0.162
2003.755±0.2363.822±0.2733.406±0.2873.152±0.183
2503.721±0.2053.751±0.2123.335±0.1753.212±0.135
+ +Table 2: Performance comparison (regret mean with std. deviation) for portfolio optimization. +Regret (the lower, the better) + +
α1/α2L1L2Weighted L1Ours(K=0.05)
100105.061±21.95493.193±29.81579.014±32.06920.829±8.289
1013.061±2.71313.275±6.2087.743±1.3052.746±1.296
14.267±0.6185.136±0.7224.267±0.6185.839±0.512
0.110.846±1.60613.619±2.19516.462±2.09310.240±1.248
0.0199.145±21.159118.112±29.957230.825±91.18494.341±29.821
+ +Table 3: Performance comparison (regret mean with std. deviation) for resource provisioning. + +Performance analysis. Table 2 summarizes the experimental results. In total, on all problem sizes (#equities), our method performs consistently and significantly better than both two-stage (L1 and L2) methods and the decision focused DF[9]. Among the three baselines, DF is significantly better than two-stage methods, similar to results in [3]. In fact, DF under this setting can be viewed as a variant of our method with infinite $K$ and no conversion of softening $\sum_{i} x_{i} = 1$ . The comparison to DF also demonstrates the advantage of our method on processing such non-differentiable cases against the simple 2nd-order Taylor expansion. Besides, with the increment of the number of equities, regrets of all methods decrease, which indicates that for the constraint $\sum_{i} x_{i} = 1$ , larger number of equities brings smaller entries of $x$ on average (with the presence of $Q$ , there are many non-zero entries of $x$ ), lowering the impact of prediction error for any single entry. + +# 4.3 Resource Provisioning + +Problem setup. We use ERCOT energy dataset [25], which contains hourly data of energy output from 2013 to 2018, 52535 data points in total. We use the last $20\%$ samples for test. We aim to predict the matrix $C \in \mathbb{R}^{24 \times 8}$ , the loads of 24 hours in 8 regions. The decision variable $x$ is 8-dimensional, and $d = 0.5 \times 1 + 0.1N(0,1)$ . We test five sets of $(\alpha_{1},\alpha_{2})$ , with $\alpha_{1} / \alpha_{2}$ ranging from 100 to 0.01. + +Experimental setup. We use AdaGrad with learning rate of 0.01, and clip the gradient with norm 0.01. For the prediction model, we use McElWee's network [26] which was highly optimized for this task, with $(8 \times 24 \times 77)$ -dimensional numerical features and embedding ones as input. + +Performance analysis. Table 3 shows the experimental results. The absolute value of regret differs largely across different ratios of $\alpha_{1} / \alpha_{2}$ . Our method is better than other methods, except for $\alpha_{1} / \alpha_{2} = 1$ , where the desired objective is exactly $L1$ -loss and thus $L1$ performs the best. Interestingly, compared to L1/L2, the Weighted L1 performs better when $\alpha_{1} / \alpha_{2} > 1$ , but relatively worse otherwise. This is probably due to the dataset's inherent sample bias (e.g., asymmetric distribution and occasional peaks), which causes the systematic bias (usually underestimation) of the prediction model. This bias exacerbates, when superposed with weighted penalty multipliers which encourage the existing bias to fall on the wrong side. Besides, the large variance for weighted L1 at $\alpha_{1} / \alpha_{2} = 0.01$ is caused by a pair of outliers. + +# 5 Related Work + +Differentiating argmin/argmax through optimality conditions. For convex optimization problems, the KKT conditions map coefficients to the set of solutions, and thus can be differentiated for argmin using implicit function theorem. Following this idea, existing work developed implicit layers of argmin in neural network, including OptNet [13] for quadratic programs (QP) problems and CVXPY [14] for more general convex optimization problems. Further with linear relaxation and + +QP regularization, Wilder et al. derived an end-to-end framework for combinatorial programs [9], which accelerates the computation by leverage the low-rank properties of decision vectors [3], and is further extended to mixed integer linear programs in MIPaaS [27]. Besides, for the relaxed LP problems, instead of differentiating KKT conditions, IntOpt [28] proposes an interior point based approach which computes gradients by differentiating homogeneous self-dual formulation. + +Optimizing surrogate loss functions. Elmachtoub and Grigas [10] proposed a convex surrogate loss function, namely SPO+, measuring the decision error induced by a prediction, which can handle polyhedral, convex and mixed integer programs with linear objectives. TOPNet [29] proposes a learned surrogate approach for exotic forms of decision loss functions, which however is hard to generalize to handle constrained programs. + +Differentiating argmin is critical for gradient methods to optimize decision-focused prediction models. Many kinds of efforts, including regularization for specific problems (e.g., differentiable dynamic programming [30], differentiable submodular optimization [31]), reparameterization [32], perturbation [33] and direct optimization ([12]), are spent for optimization with discrete or continuous variables and still actively investigated. + +As a comparison, our work proposes a surrogate loss function for constrained linear and quadratic programs extended with soft constraints, where the soft constraints were not considered principally in previous work. Also, unlike OptNet [13] and CVXPY [15], our method does not need to solve KKT conditions. Instead, by adding reasonable costs for infeasibility, we convert the constrained optimization problem into an unconstrained one while keeping the same solution set, and then derive the required Jacobian analytically. To some degree, we reinvent the exact function [34] in prediction+optimization. + +# 6 Conclusion + +In this paper, we have proposed a novel surrogate objective framework for prediction+optimization problems on linear and semi-definite negative quadratic objectives with linear soft constraints. The framework gives the theoretical bounds on constraints' multipliers, and derives the closed-form solution as well as their gradients with respect to problem parameters required to predict by a model. We first convert the hard constraints into soft ones with reasonably large constant multipliers, making the problem unconstrained, and then optimize a piecewise surrogate locally. We apply and empirically validate our method on three applications against traditional two-stage methods and other end-to-end decision-focused methods. We believe our work is an important enhancement to the current prediction+optimization toolbox. There are two directions for the future work: one is to seek solutions which can deal with hard constraint parameters with negative entries, and the other is to develop the distributional prediction model rather than existing point estimation, to improve robustness of current prediction+optimization methods. + +# References + +[1] Chuan Luo, Bo Qiao, Xin Chen, Pu Zhao, Randolph Yao, Hongyu Zhang, Wei Wu, Andrew Zhou, and Qingwei Lin. Intelligent virtual machine provisioning in cloud computing. In Proceedings of IJCAI 2020, pages 1495-1502, 2020. +[2] Sirikarn Chansombat, Pupong Pongcharoen, and Christian Hicks. A mixed-integer linear programming model for integrated production and preventive maintenance scheduling in the capital goods industry. International Journal of Production Research, 57:1–22, 04 2018. doi: 10.1080/00207543.2018.1459923. +[3] Kai Wang, Bryan Wilder, Andrew Perrault, and Milind Tambe. Automatically learning compact quality-aware surrogates for optimization problems. In NeurIPS 2020, Vancouver, Canada, 2020. +[4] Emir Demirovi, Peter Stuckey, Tias Guns, James Bailey, Christopher Leckie, Kotagiri Ramamohanarao, and Jeffrey Chan. Dynamic programming for predict+optimise. Proceedings of the AAAI Conference on Artificial Intelligence, 34:1444-1451, 04 2020. doi: 10.1609/aaai.v34i02.5502. +[5] Gartheenan Ganeshapillai, John Guttag, and Andrew Lo. Learning connections in financial time series. In Sanjoy Dasgupta and David McAllester, editors, Proceedings of the 30th International Conference on Machine Learning, volume 28 of Proceedings of Machine Learning Research, pages 109-117, Atlanta, Georgia, USA, 17-19 Jun 2013. PMLR. +[6] LLC Gurobi Optimization. Gurobi optimizer reference manual, 2021. URL http://www.gurobi.com. +[7] IBM ILOG Cplex. Release notes for cplex 20.1.0. 2020. URL https://www.ibm.com/docs/en/icos/20.1.0?topic=2010-release-notes-cplex. +[8] Yoshua Bengio. Using a financial training criterion rather than a prediction criterion. Int. J. Neural Syst., 8(4):433-443, 1997. doi: 10.1142/S0129065797000422. URL https://doi.org/10.1142/S0129065797000422. +[9] Bryan Wilder, Bistra Dilkina, and Milind Tambe. Melding the data-decisions pipeline: Decision-focused learning for combinatorial optimization. In The Thirty-Third AAAI Conference on Artificial Intelligence, pages 1658–1665. AAAI Press, 2019. +[10] Adam Elmachtoub and Paul Grigas. Smart "predict, then optimize". Management Science, 10 2017. doi: 10.1287/mnsc.2020.3922. +[11] Priya L. Donti, Brandon Amos, and J. Zico Kolter. Task-based end-to-end model learning in stochastic optimization. In Proceedings of the 31st International Conference on Neural Information Processing Systems, NIPS'17, page 5490-5500, Red Hook, NY, USA, 2017. Curran Associates Inc. ISBN 9781510860964. +[12] Yang Song, Alexander Schwing, Richard, and Raquel Urtasun. Training deep neural networks via direct loss minimization. In Proceedings of The 33rd International Conference on Machine Learning, volume 48 of Proceedings of Machine Learning Research, pages 2169-2177, New York, New York, USA, 20-22 Jun 2016. PMLR. +[13] Brandon Amos and J. Zico Kolter. OptNet: Differentiable optimization as a layer in neural networks. In Doina Precup and Yee Whye Teh, editors, Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pages 136-145, International Convention Centre, Sydney, Australia, 06-11 Aug 2017. PMLR. URL http://proceedings.mlr.press/v70/amos17a.html. +[14] Brandon Amos. Differentiable Optimization-Based Modeling for Machine Learning. PhD thesis, Carnegie Mellon University, May 2019. +[15] Akshay Agrawal, Brandon Amos, Shane Barratt, Stephen Boyd, Steven Diamond, and J. Zico Kolter. Differentiable convex optimization layers. In Advances in Neural Information Processing Systems, volume 32, pages 9562-9574. Curran Associates, Inc., 2019. + +[16] Harry M. Markowitz. Portfolio Selection: Efficient Diversification of Investments. Yale University Press, 1959. ISBN 9780300013726. URL http://www.jstor.org/stable/j.ctt1bh4c8h. +[17] 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, high-performance deep learning library. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems 32, pages 8024-8035. Curran Associates, Inc., 2019. +[18] A. Griewank and A. Walther. Evaluating Derivatives: Principles and Techniques of Algorithmic Differentiation, Second Edition. Other Titles in Applied Mathematics. Society for Industrial and Applied Mathematics (SIAM, 3600 Market Street, Floor 6, Philadelphia, PA 19104), 2008. ISBN 9780898717761. +[19] Jan R. Magnus Jan R. Magnus. Matrix Differential Calculus with Applications in Statistics and Econometrics, Third Edition. Wiley Series in Probability and Statistics. Wiley, 2019. ISBN 9781119541202. +[20] Stephen Boyd and Lieven Vandenberghe. Convex Optimization. Cambridge University Press, 2004. +[21] Jonas Peters, Dominik Janzing, and Bernhard Schölkopf. Elements of causal inference. The MIT Press, 2017. +[22] Vinod Nair and Geoffrey E. Hinton. Rectified linear units improve restricted boltzmann machines. In Proceedings of the 27th International Conference on International Conference on Machine Learning, ICML'10, page 807-814, Madison, WI, USA, 2010. Omnipress. ISBN 9781605589077. +[23] John Duchi, Elad Hazan, and Yoram Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research, 12:2121-2159, 07 2011. +[24] Sp500 data set. 2021. URL https://docs.quandl.com/. +[25] Ercot data set. 2021. URL https://github.com/kmcelwee/mediumBlog/tree/master/load_forecast/data. +[26] Kevin McElwee. Predict daily electric consumption with neural networks, 2020. URL https://www.brownanalytics.com/load-forecasting. +[27] Aaron Ferber, Bryan Wilder, Bistra Dilkina, and Milind Tambe. Mipaal: Mixed integer program as a layer. In AAAI Conference on Artificial Intelligence, 2020. +[28] Jayanta Mandi and Tias Guns. Interior point solving for lp-based prediction+optimisation. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 7272-7282. Curran Associates, Inc., 2020. +[29] Di Chen, Yada Zhu, Xiaodong Cui, and Carla Gomes. Task-based learning via task-oriented prediction network with applications in finance. In Christian Bessiere, editor, Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, IJCAI-20, pages 4476-4482. International Joint Conferences on Artificial Intelligence Organization, 7 2020. doi: 10.24963/ijcai.2020/617. URL https://doi.org/10.24963/ijcai.2020/617. Special Track on AI in FinTech. +[30] Arthur Mensch and Mathieu Blondel. Differentiable dynamic programming for structured prediction and attention. In 35th International Conference on Machine Learning, volume 80, pages 3459-3468, 2018. +[31] Josip Djolonga and Andreas Krause. Differentiable learning of submodular models. In Advances in Neural Information Processing Systems, volume 30, pages 1013-1023. Curran Associates, Inc., 2017. + +[32] Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. In Proceedings of the 31st International Conference on International Conference on Machine Learning - Volume 32, ICML'14, page II-1278-II-1286. JMLR.org, 2014. +[33] Quentin Berthet, Mathieu Blondel, Olivier Teboul, Marco Cuturi, Jean-Philippe Vert, and Francis Bach. Learning with differentiable perturbed optimizers. arXiv preprint arXiv:2002.08676, 2020. +[34] Dimitri P Bertsekas. Nonlinear programming. Journal of the Operational Research Society, 48 (3):334-334, 1997. + +# Checklist + +1. For all authors... + +(a) Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope? [Yes] +(b) Did you describe the limitations of your work? [Yes] +(c) Did you discuss any potential negative societal impacts of your work? [Yes] +(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] + +2. If you are including theoretical results... + +(a) Did you state the full set of assumptions of all theoretical results? [Yes] +(b) Did you include complete proofs of all theoretical results? [Yes] + +3. If you ran experiments... + +(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] +(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] +(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] +(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] + +4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... + +(a) If your work uses existing assets, did you cite the creators? [Yes] +(b) Did you mention the license of the assets? [Yes] +(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] +(d) Did you discuss whether and how consent was obtained from people whose data you're using/curating? [Yes] +(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes] + +5. If you used crowdsourcing or conducted research with human subjects... + +(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] We did not use crowdsourcing, nor did we conduct research with human subjects. +(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] +(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] \ No newline at end of file diff --git a/asurrogateobjectiveframeworkforpredictionprogrammingwithsoftconstraints/images.zip b/asurrogateobjectiveframeworkforpredictionprogrammingwithsoftconstraints/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..fae4b57e9fb2378acee30f57e6e75c1f3629680c --- /dev/null +++ b/asurrogateobjectiveframeworkforpredictionprogrammingwithsoftconstraints/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7fbe86889d8c1566ecdfc69e69e6aef5343f385d510723b6bdd87df5c09be504 +size 310814 diff --git a/asurrogateobjectiveframeworkforpredictionprogrammingwithsoftconstraints/layout.json b/asurrogateobjectiveframeworkforpredictionprogrammingwithsoftconstraints/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7f9e69868d625cad6a7de14f9e59aba2b4ce055f --- /dev/null +++ b/asurrogateobjectiveframeworkforpredictionprogrammingwithsoftconstraints/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cc09ad1e088f66e9c79e49461ca1475e17821ee2b6618911fe7bd8811f80cb85 +size 588727 diff --git a/atheoreticalanalysisoffinetuningwithlinearteachers/873bfc8e-5e3d-4b3f-9879-400afb5295b0_content_list.json b/atheoreticalanalysisoffinetuningwithlinearteachers/873bfc8e-5e3d-4b3f-9879-400afb5295b0_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..f2e9c3bc1ae215218172053487c3d4e8c1dfdaba --- /dev/null +++ b/atheoreticalanalysisoffinetuningwithlinearteachers/873bfc8e-5e3d-4b3f-9879-400afb5295b0_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:adae62b0561e314471d26eee1494771535b191e685fb3757fddf47813fd7a00d +size 85142 diff --git a/atheoreticalanalysisoffinetuningwithlinearteachers/873bfc8e-5e3d-4b3f-9879-400afb5295b0_model.json b/atheoreticalanalysisoffinetuningwithlinearteachers/873bfc8e-5e3d-4b3f-9879-400afb5295b0_model.json new file mode 100644 index 0000000000000000000000000000000000000000..56f95111f5cd1c2a2422dd9833f09fc92ff513cf --- /dev/null +++ b/atheoreticalanalysisoffinetuningwithlinearteachers/873bfc8e-5e3d-4b3f-9879-400afb5295b0_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cd4036dfb19c59f5e79a7bc0692b3f1b848c39716642be87cd9006f9c6ab04a3 +size 103397 diff --git a/atheoreticalanalysisoffinetuningwithlinearteachers/873bfc8e-5e3d-4b3f-9879-400afb5295b0_origin.pdf b/atheoreticalanalysisoffinetuningwithlinearteachers/873bfc8e-5e3d-4b3f-9879-400afb5295b0_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..66520ef2e48ba1f39e1c7ef12c139c4674c70d99 --- /dev/null +++ b/atheoreticalanalysisoffinetuningwithlinearteachers/873bfc8e-5e3d-4b3f-9879-400afb5295b0_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d044e494491bd72ae4aac19f7f65949a21a5696156f4baac3a882cbd5015900c +size 425909 diff --git a/atheoreticalanalysisoffinetuningwithlinearteachers/full.md b/atheoreticalanalysisoffinetuningwithlinearteachers/full.md new file mode 100644 index 0000000000000000000000000000000000000000..0d8ea67a16ebdb34132cbdb5be6d60f5982423e0 --- /dev/null +++ b/atheoreticalanalysisoffinetuningwithlinearteachers/full.md @@ -0,0 +1,357 @@ +# A Theoretical Analysis of Fine-tuning with Linear Teachers + +Gal Shachaf + +Blavatnik School of Computer Science, Tel Aviv University, Israel + +Alon Brutzkus + +Blavatnik School of Computer Science, Tel Aviv University, Israel + +Amir Globerson + +Blavatnik School of Computer Science, + +Tel Aviv University, Israel + +and Google Research + +# Abstract + +Fine-tuning is a common practice in deep learning, achieving excellent generalization results on downstream tasks using relatively little training data. Although widely used in practice, it is lacking strong theoretical understanding. Here we analyze the sample complexity of this scheme for regression with linear teachers in several architectures. Intuitively, the success of fine-tuning depends on the similarity between the source tasks and the target task, however measuring this similarity is non trivial. We show that generalization is related to a measure that considers the relation between the source task, target task and covariance structure of the target data. In the setting of linear regression, we show that under realistic settings a substantial sample complexity reduction is plausible when the above measure is low. For deep linear regression, we present a novel result regarding the inductive bias of gradient-based training when the network is initialized with pretrained weights. Using this result we show that the similarity measure for this setting is also affected by the depth of the network. We further present results on shallow ReLU models, and analyze the dependence of sample complexity on source and target tasks in this setting. + +# 1 Introduction + +In recent years fine-tuning has emerged as an effective approach to learning tasks with relatively little labeled data. In this setting, a model is first trained on a source task where much data is available (e.g., masked language modeling for BERT), and then it is further tuned using gradient descent methods on labeled data of a target task [1, 2, 3, 4]. Furthermore, it has been observed that fine-tuning can outperform the strategy of fixing the representation learned on the source task, mainly in natural language processing [1, 5]. Despite its empirical success, fine-tuning is poorly understood from a theoretical perspective. One apparent conundrum is that fine-tuned models can be much larger than the number of target training points, resulting in a heavily overparameterized model that is prone to overfitting and poor generalization. Thus, the answer must lie in the fact that fine-tuning is performed with gradient descent and not an arbitrary algorithm that could potentially "ignore" the source task [6]. Here we set out to formalize this problem and understand the factors that determine whether fine-tuning will succeed. We note that this question can be viewed as part of the general quest to understand the implicit bias of gradient based methods [6, 7, 8, 9, 10, 11, 12, 13], but in the particular context of fine-tuning. + +We begin by highlighting the obvious link between fine-tuning and initialization. Namely, the only difference between "standard" training of a target task and fine-tuning on it, is the initial value of the model weights before beginning the gradient updates. Our goal is to understand the interplay between the model parameters at initialization (namely the source task), the target distribution, and the accuracy of the fine-tuned model. A natural hypothesis is that the distance between the pretrained and fine-tuned model weights is what governs the success of fine-tuning. Indeed, some argue that this is both the key to bound the generalization error of a model and the implicit regularization of gradient-based methods [14, 15, 16, 17]. However, this approach has been discouraged both by empirical testing of the generalization bounds inspired by it [18] and by theoretical works showing this cannot be the inductive bias in deep neural networks [19]. Our results further establish the hypothesis that the success of fine-tuning is affected by other factors. + +In this paper we focus on the case in which both source and target regression tasks are linear functions of the input. We start by considering one layer linear networks, and derive novel sample complexity results for fine-tuning. We then proceed to the more complex case of deep linear networks, and prove a novel result characterizing the fine-tuned model as a function of both the weights after pretraining and the depth of the network, and use it to derive corresponding generalization results. + +Our results provide several surprising insights. First, we show that the covariance structure of the target data has a significant effect on the success of fine-tuning. In particular, sample complexity is affected by the degree of alignment between the source-target weight difference and the eigenvectors of the target covariance. Second, we find a strong connection between the depth of the network and the results of the fine-tuning process, since deeper networks will serve to cancel the effect of scale differences between source and target tasks. Our results are corroborated by empirical evaluations. + +We conclude with results on ReLU networks, providing the first sample complexity result for fine-tuning. For the case of linear teachers, this asserts a simple connection between the source and target models and the test error of fine-tuning. + +Taken together, our results demonstrate that fine-tuning is affected not only by some notion of distance between the source and target tasks, but also by the target covariance and the architecture of the model. These results can potentially lead to improved accuracy in this setting via appropriate design of the tasks used for pretraining and the choice of the model architecture. + +# 2 Related work + +Empirical work [20] has shown that two instances of models initialized from pre-trained weights are more similar in features space than those initialized randomly. Other works [21, 22, 23] have shown that fine-tuned models generalize well when the representation used by the target task is similar to the one used by the source tasks. + +In linear regression, [24] showed that gradient descent finds the solution with minimal distance to the initial weights. More recently, attention has turned towards the phenomenon of "benign overfitting" [25, 26] in high dimensional linear regression, where despite fitting noise in training data, population risk may be low. Theoretical analysis of this setting [25] studied how it is affected by the data covariance structure. Benign overfitting was also recently analyzed in the context of ridge-regression [27] and online stochastic gradient descent [28]. Our work continues this line of work on high dimensional regression, but differs from the above papers as we start from a source task, then train on a fixed training set from a target task and consider the global optimum of the this training loss (unlike online SGD). Furthermore, we go beyond the linear regression framework, and obtain surprising characteristics of fine-tuning in deep linear networks. + +For linear regression with deep linear models, [29] have recently shown an implicit bias for a two-layer network with deterministic initialization, and [30] have shown an implicit bias for a network with arbitrary depth and near-zero random initialization. Our work generalizes the inductive bias found by [29] to a network of arbitrary depth, and analyses the generalization error of such networks for infinite depth. For linear regression with shallow linear networks [31] have shown a generalization bound that depends only on the norm of the target task, which we use in Section 6. + +# 3 Preliminaries and settings + +Notations Let $\| \cdot \|$ be the $L^2$ norm for vectors and the spectral norm for matrices. For a vector $\pmb{v}$ we denote $\hat{\pmb{v}}\triangleq \frac{\pmb{v}}{\|\pmb{v}\|}$ . For a matrix $\mathbf{M}\in \mathbb{R}^{d\times d}$ and some $0\leq m\leq d$ , we define $\mathbf{M}_{\leq m}\in \mathbb{R}^{d\times m}$ to be the matrix containing the first $m$ columns of $\mathbf{M}$ . Similarly, we let $\mathbf{M}_{>m}$ denote the matrix containing the columns from $m + 1$ to $d$ in $\mathbf{M}$ . + +Let $\mathcal{D}$ be a distribution over $\mathbb{R}^d$ . Let $\pmb{\Sigma}$ be the covariance matrix of $\mathcal{D}$ and let $\mathbf{V}\pmb{\Lambda}\mathbf{V}^\top$ be its eigenvalue decomposition such that $\lambda_1 \geq \dots \geq \lambda_d$ . We define the projection matrices: + +$$ +\mathbf {P} _ {\leq k} \triangleq \mathbf {V} _ {\leq k} \mathbf {V} _ {\leq k} ^ {\top}; \quad \mathbf {P} _ {> k} \triangleq \mathbf {V} _ {> k} \mathbf {V} _ {> k} ^ {\top}, +$$ + +projecting onto the span of the top $k$ eigenvectors of $\pmb{\Sigma}$ , onto the span of the $d - k$ bottom eigenvectors of $\pmb{\Sigma}$ , respectively. We will refer to the former as the "top- $k$ span" of $\pmb{\Sigma}$ , and to the latter as the "bottom- $k$ span" of $\pmb{\Sigma}$ . + +Let $\mathbf{X} \in \mathbb{R}^{n \times d}$ be the row matrix of $n < d$ samples drawn from $\mathcal{D}$ , and denote the empirical covariance matrix $\frac{1}{n} \mathbf{X}^T \mathbf{X}$ by $\tilde{\boldsymbol{\Sigma}}$ . Define $\mathbf{P}_{\parallel}$ to be the projection matrix into the row space of $\mathbf{X}$ , and $\mathbf{P}_{\perp}$ to be the projection matrix into its orthogonal complement, i.e.: + +$$ +\mathbf {P} _ {\parallel} \triangleq \mathbf {X} ^ {\top} (\mathbf {X X} ^ {\top}) ^ {- 1} \mathbf {X}, \quad \mathbf {P} _ {\perp} \triangleq \mathbf {I} - \mathbf {P} _ {\parallel}. +$$ + +Consider a set of parameters $\Theta$ , and let $\Theta(t)$ denote the set of parameters at time $t$ . We denote the output of a model whose weights are $\Theta(t)$ on a vector $\mathbf{x}$ by $f(\mathbf{x}; \Theta(t)) \in \mathbb{R}$ . In the different sections of this work we will overload $f$ with different architectures. + +We consider the problem of fine-tuning based transfer learning in regression tasks with linear teachers. Let $\pmb{\theta}_T\in \mathbb{R}^d$ be the ground-truth parameters of the target task, i.e. the linear teacher which we wish to learn, and $\mathbf{y}\in \mathbb{R}^n$ be the target labels of $\mathbf{X}$ , s.t. $\mathbf{y} = \mathbf{X}\pmb{\theta}_T$ . + +We define $L(\Theta)$ to be the empirical MSE loss on $\mathbf{X},\mathbf{y}$ and define $R(\Theta)$ as the $\mathcal{D}$ population loss: + +$$ +L (\boldsymbol {\Theta}) \triangleq \frac {1}{n} \| f (\mathbf {X}, \boldsymbol {\Theta}) - \mathbf {y} \| _ {2} ^ {2}, \quad R (\boldsymbol {\Theta}) \triangleq \mathbb {E} _ {\mathbf {x} \sim \mathcal {D}} \left[ \left(\mathbf {x} ^ {\top} \boldsymbol {\theta} _ {T} - f (\mathbf {x}, \boldsymbol {\Theta})\right) ^ {2} \right]. +$$ + +We separate the training procedure into two parts. In the first "pretraining" part, we train a model on $n_S$ pretraining samples $\mathbf{X}_S \in \mathbb{R}^{n_S \times d}$ labeled by a linear teacher $\pmb{\theta}_S$ (i.e., $\mathbf{y}_S = \mathbf{X}_S \pmb{\theta}_S \in \mathbb{R}^{n_S}$ ), resulting in the set of model weights $\Theta_S$ . In the second part, which we call fine-tuning, we initialize a model with the pretrained weights $\Theta(0) = \Theta_S$ and learn the target task by optimizing $L(\Theta(t))$ . + +Optimization is done by either gradient descent (GD) or gradient flow (GF). Let $\pmb{\theta}(t)$ be some weight vector or weight matrix in $\Theta(t)$ . The dynamics for gradient descent optimization with some learning rate $\eta > 0$ are $\pmb{\theta}(t + 1) = \pmb{\theta}(t) - \eta \frac{\partial L(\Theta(t))}{\partial \pmb{\theta}(t)}$ , and the dynamics for gradient flow are $\dot{\pmb{\theta}}(t) = -\frac{\partial L(\Theta(t))}{\partial \pmb{\theta}(t)}$ . Next we state several assumptions about our setup. + +Assumption 3.1. $\mathbf{X}\mathbf{X}^{\mathrm{T}}$ is non-singular. i.e. the rows of $\mathbf{X}$ are linearly-independent. + +This assumption holds with high probability for, e.g., a continuous distribution with support over a non-zero measure set. This assumption is only used for simplicity, as the high probability can be incorporated into the analysis. + +Assumption 3.2 (Perfect pretraining). The pretraining optimization process learns the linear teacher perfectly, e.g. for linear regression we assume that $f(\mathbf{x},\Theta_S) = \mathbf{x}^\top \pmb {\theta}_S$ , for $\mathbf{x}\sim \mathcal{D}$ + +Notice that for linear and deep linear models, perfect pretraining can be achieved when $n_S \geq d$ . Our results can be easily extended to the case where the equality $f(\mathbf{x}, \boldsymbol{\Theta}_S) = \mathbf{x}^\top \boldsymbol{\theta}_S$ holds approximately and with high probability, but for simplicity we assume equality. + +Assumption 3.3 (Zero train loss). The fine-tuning converges, i.e. $\lim_{t\to \infty}L(\Theta (t)) = 0$ + +We note that when $f$ is standard linear regression, arbitrarily small train loss can be obtained via gradient descent. For deep linear networks, it can be shown [32] that under suitable initialization a global optimum can be reached, and thus Assumption 3.3 holds for this framework as well. + +# 4 Analyzing fine-tuning in linear regression + +In this section we analyze fine-tuning for the case of linear teachers for linear regression when using gradient descent for optimization. We define $\Theta(t) = \mathbf{w}(t) \in \mathbb{R}^d$ and overload $f(\mathbf{x}, \Theta(t)) \triangleq \mathbf{x}^\top \mathbf{w}(t)$ . In what follows we denote the parameter learned in the fine-tuning process by $\gamma \triangleq \lim_{t \to \infty} \mathbf{w}(t)$ . + +# 4.1 Results + +The following known results (e.g., [24, 25, 10]) show the inductive bias of gradient descent with non-zero initialization in under-determined linear regression and the corresponding population loss. + +Theorem 4.1. [24, 25, 10] When $f(\mathbf{x}, \Theta)$ is a linear function, fine-tuning with $GD$ under Assumption 3.1, Assumption 3.2 and Assumption 3.3 results in the following model: + +$$ +\gamma = \mathbf {P} _ {\perp} \boldsymbol {\theta} _ {S} + \mathbf {P} _ {\parallel} \boldsymbol {\theta} _ {T}, \tag {1} +$$ + +and + +$$ +R (\boldsymbol {\gamma}) = \left\| \boldsymbol {\Sigma} ^ {1 / 2} \mathbf {P} _ {\perp} \left(\boldsymbol {\theta} _ {T} - \boldsymbol {\theta} _ {S}\right) \right\| ^ {2}. \tag {2} +$$ + +Theorem 4.1 provides two interesting observations: the first is that $\gamma$ consists of two parts, one which is the projection of the initial weights $\theta_{S}$ into the null space of $\mathbf{X}$ , and the other which is the projection of $\theta_{T}$ into the span of $\mathbf{X}$ . The second observation is that the population risk depends solely on the difference $\theta_{T} - \theta_{S}$ that is projected to the null space of the data. For completeness, the proof of Theorem 4.1 is given in the supplementary. + +Theorem 4.1 depends on the data matrix $\mathbf{X}$ (via $\mathbf{P}_{\parallel}, \mathbf{P}_{\perp}$ ). However, to better understand the properties of fine-tuning, a high probability bound on $R$ that does not depend on $\mathbf{X}$ is desirable. We provide such a bound, highlighting the dependence of the population risk on the source and target tasks, and the target covariance $\boldsymbol{\Sigma}$ . + +Theorem 4.2. Assume the conditions of Theorem 4.1 hold, and assume that the rows of $\mathbf{X}$ are i.i.d. subgaussian centered random vectors. Then, there exists a constant $c > 0$ , such that, for all $\delta \geq 1$ and for all $1 \leq m \leq d$ such that $\lambda_{m} > 0$ , with probability at least $1 - e^{-\delta}$ over $\mathbf{X}$ , the population risk $R(\gamma)$ is bounded by: + +$$ +2 g (\boldsymbol {\lambda}, \delta , n) ^ {3} \frac {\left\| \mathbf {P} _ {\leq m} \left(\boldsymbol {\theta} _ {T} - \boldsymbol {\theta} _ {S}\right) \right\| ^ {2}}{\lambda_ {m} ^ {2}} + 2 g (\boldsymbol {\lambda}, \delta , n) \left\| \mathbf {P} _ {> m} \left(\boldsymbol {\theta} _ {T} - \boldsymbol {\theta} _ {S}\right) \right\| ^ {2}, \tag {3} +$$ + +where $g(\pmb {\lambda},\delta ,n) = c\lambda_{1}\max \{\sqrt{\frac{\sum_{i}\lambda_{i}}{n\lambda_{1}}},\frac{\sum_{i}\lambda_{i}}{n\lambda_{1}},\sqrt{\frac{\delta}{n}},\frac{\delta}{n}\}$ and $\left\| \tilde{\pmb{\Sigma}} -\pmb {\Sigma}\right\| \leq g(\pmb {\lambda},\delta ,n)$ + +In the proof, we address the randomness of $\mathbf{P}_{\perp}(\boldsymbol{\theta}_T - \boldsymbol{\theta}_S)$ in (2), by decomposing $\boldsymbol{\theta}_T - \boldsymbol{\theta}_S$ into its top- $k$ span and bottom- $k$ span components, and then applying the Davis-Kahan $\sin(\Theta)$ theorem [33] to bound the norm of the projection of the former to the null space of the data. The full proof is given in the supp. + +The bound in Theorem 4.2 has two key components. The first is the function $g(\boldsymbol{\lambda}, \delta, n)$ that captures how well the covariance $\boldsymbol{\Sigma}$ is estimated, and shows the dependence of the bound on the number of train samples used (as it depends on $n^{-0.5}$ ). The second relates to the two matrix norms of $\boldsymbol{\theta}_T - \boldsymbol{\theta}_S$ with respect to different parts of the covariance $\boldsymbol{\Sigma}$ . Notice that the term relating to the top- $k$ span decreases like $n^{-1.5}$ , while the term relating to bottom- $k$ span decreases like $n^{-0.5}$ . + +This theorem highlights the conditions under which fine-tuning is expected to perform well. For small enough $n$ s.t. $g(\pmb{\lambda}, \delta, n) > 1$ , the bound mainly depends on $\| \mathbf{P}_{\leq m}(\pmb{\theta}_T - \pmb{\theta}_S) \|$ . In this case, the bound will be low if $\pmb{\theta}_T$ and $\pmb{\theta}_S$ are close in the span of the top eigenvectors of the target distribution. On the other hand, for large enough $n$ s.t. $g(\pmb{\lambda}, \delta, n) < 1$ , the bound mainly depends on $\| \mathbf{P}_{>m}(\pmb{\theta}_T - \pmb{\theta}_S) \|$ . Thus, the bound will be low if $\pmb{\theta}_T$ and $\pmb{\theta}_S$ are close in the span of the bottom eigenvectors of the target distribution. + +We conclude with a remark regarding the integer $m$ appearing in the bound, in the case where $g(\lambda, \delta, n) < 1$ . While finding the exact $m$ that minimizes the bound is not straightforward, the trade-off in selecting it suggests taking the largest $m$ which holds $\lambda_{m+1} \approx \lambda_m$ . This will "cover" more of $\mathbf{P}_{>m}\left(\pmb{\theta}_T - \pmb{\theta}_S\right)$ without greatly increasing the left part of (3). + +Table 1: Correlation coefficient $R^2$ between the accuracy on different transfer tasks in MNIST and various population risk upper bounds. Each value is a mean over 10 calculations of $R^2$ with different initialization, and each $R^2$ is calculated from 20 points, each one representing a mean accuracy value of 25 random samples. + +
Number of Samples1015202530
||θT- θS||20.69 ± 0.030.68 ± 0.040.66 ± 0.040.64 ± 0.030.62 ± 0.02
Bound from [25]0.73 ± 0.030.75 ± 0.030.74 ± 0.030.71 ± 0.020.67 ± 0.02
Ours for m = 20.86 ± 0.020.89 ± 0.020.84 ± 0.020.75 ± 0.010.69 ± 0.02
+ +# 4.2 Experiments + +In Figure 1 we empirically verify the conclusions from the bound in (3). We set $d = 1000$ and design the target covariance $\pmb{\Sigma}$ s.t. the first $m = 50$ eigenvalues are significantly larger than the rest (1.5 vs. 0.3). We then consider two settings for $\pmb{\theta}_T - \pmb{\theta}_S$ . In the first, which we call "Top Eigen Align", we select $\pmb{\theta}_T$ and $\pmb{\theta}_S$ such that $\mathbf{P}_{\leq m}(\pmb{\theta}_T - \pmb{\theta}_S) = 0$ . In the second which we call "Bottom Eigen Align" we set $\mathbf{P}_{>m}(\pmb{\theta}_T - \pmb{\theta}_S) = 0$ . In both settings we use the same norm $\| \pmb{\theta}_T - \pmb{\theta}_S \|_2$ , to show that the bound is not affected by this norm. + +As discussed above, our bound suggests better generalization performance of "Bottom Eigen Align" for large $n$ and better performance of "Top Eigen Align" for small $n$ . Indeed, we see that while for very few samples "Top Eigen Align" has a lower population loss than "Bottom Eigen Align", the population loss of "Bottom Eigen Align" drops significantly as $n$ grows, and drops to zero well before $n = d$ . + +We next evaluate the bound on fine-tuning tasks taken from the MNIST dataset [34], and compare it to alternative bounds. Specifically, since we do not expect bounds to be numerically accurate, we calculate the correlation between the actual risk in the experiment and the risk predicted by the bounds. The task we consider (both source and target) is binary classification, which we model as regression to outputs $\{-1, + 1\}$ . We generate $K$ source-target task pairs (e.g., source task is label 2 vs label 3 and target tasks is label 5 vs label 6). For each such pair we perform source training followed by fine-tuning to target. We then record both the 0-1 error on an independent test set and the value predicted by the bounds. This way we obtain $K$ pairs of points (i.e., actual error vs bound), and calculate the $R^2$ for these pairs, indicating the level to which the bound agrees with the actual error. In addition to our bound in (3), we consider the following: the norm of source-target difference $\| \pmb {\theta}_T - \pmb {\theta}_S\|^2$ and a bound adapted from [25] to the case of fine-tuning. The results in Table 1 show that there is a strong correlation between our bound and the actual error, and the correlation is weaker for the other bounds. + +# 5 Analyzing fine-tuning in deep linear networks + +In this section we focus on the setting of overparameterized deep linear networks. Although the resulting function is linear in its inputs, like in the previous section, we shall see that the effect of fine-tuning is markedly different. Previous works (e.g. [35, 36]) have shown that linear networks exhibit many interesting properties which make them a good study case towards more complex non-linear networks. + +We consider networks with $L$ layers, given by the following matrices: $\Theta(t) = \{\mathbf{W}_1(t), \dots, \mathbf{W}_L(t)\}$ . s.t. $\mathbf{W}_j(t) \in \mathbb{R}^{d_j - 1 \times d_j}$ , $d_0 = d$ , $d_L = 1$ and for $1 \leq j \leq L - 1: d_j \geq d$ . We also define: + +$$ +\boldsymbol {\beta} (t) = \mathbf {W} _ {1} (t) \cdot \mathbf {W} _ {2} (t) \dots \mathbf {W} _ {L} (t), +$$ + +such that $f(\mathbf{x};\Theta (t))(t) = \mathbf{x}^{\top}\pmb {\beta}(t)$ . From Assumption 3.2, we have that $\beta (0) = \theta_{S}$ + +We recall the condition of perfect balancedness (or 0-balancedness) [32]: + +Definition 5.1. The weights of a depth $L$ deep linear network at time $t$ are called 0-balanced if: + +$$ +\mathbf {W} _ {j} (t) ^ {\top} \mathbf {W} _ {j} (t) = \mathbf {W} _ {j + 1} (t) \mathbf {W} _ {j + 1} (t) ^ {\top} \quad f o r \quad j \in [ L - 1 ]. \tag {4} +$$ + +![](images/7e07ac2c72469900a18f9b16282b07e36bd397f2d2d2aec0a40a7069f27a156d.jpg) +Figure 1: Comparison between different $\pmb{\theta}_T - \pmb{\theta}_S$ . "Top Eigen Align" is the linear predictor initialized with $\mathbf{P}_{\leq m}(\pmb{\theta}_T - \pmb{\theta}_S) = 0$ and "Bottom Eigen Align" is the linear predictor initialized with $\mathbf{P}_{>m}(\pmb{\theta}_T - \pmb{\theta}_S) = 0$ , for $m = 50$ . The top $m$ eigenvalues have the value 1.5, compared to the rest which have the value 0.3. + +Our analysis requires the initial random initialization (prior to pretraining) to be 0-balanced, which can be achieved with a near zero random initialization, as discussed in [32]. We provide three results on the effect of fine-tuning in this setting. The first result shows the inductive bias of fine-tuning a depth $L$ deep linear network (Theorem 5.2), which holds for arbitrary $L$ and generalizes known results for $L = 1$ (Theorem 4.1) and $L = 2$ [29]. The second result analyzes the population risk of such a predictor when $L \to \infty$ for certain settings (Theorem 5.3 and Theorem 5.4). The third result shows why fixing the first layer (or any set of layers containing the first layer) after pretraining can harm fine-tuning (Theorem 5.5). + +The next theorem characterizes the model learned by fine-tuning in the above setting (it can thus be viewed as the deep-linear version of the $L = 1$ result in Theorem 4.1): + +Theorem 5.2. Assume that before pretraining, the weights of the model were 0-balanced and that Assumption 3.1, Assumption 3.2 and Assumption 3.3 hold. Then: + +$$ +\lim _ {t \rightarrow \infty} \beta (t) = \left(\frac {\| \lim _ {t \rightarrow \infty} \boldsymbol {\beta} (t) \|}{\| \boldsymbol {\theta} _ {S} \|}\right) ^ {\frac {L - 1}{L}} \mathbf {P} _ {\perp} \boldsymbol {\theta} _ {S} + \mathbf {P} _ {\|} \boldsymbol {\theta} _ {T} \tag {5} +$$ + +and: + +$$ +\lim _ {L \rightarrow \infty} \lim _ {t \rightarrow \infty} \beta (t) = \frac {\| \mathbf {P} _ {\parallel} \boldsymbol {\theta} _ {T} \|}{\| \mathbf {P} _ {\parallel} \boldsymbol {\theta} _ {S} \|} \mathbf {P} _ {\perp} \boldsymbol {\theta} _ {S} + \mathbf {P} _ {\parallel} \boldsymbol {\theta} _ {T}. \tag {6} +$$ + +To prove this, we focus on $\mathbf{W}_1$ , and notice that the gradients $\dot{\mathbf{W}}_1(t)$ are in the span of $\mathbf{X}$ , and hence $\mathbf{P}_{\perp} \mathbf{W}_1(0)$ and its norm remain static during the GF optimization ([30]). We then analyze the norm of the fine-tuned model by using the 0-balancedness property of the weights and the min-norm solution to the equivalent linear regression problem, and achieve (5). (6) is achieved by calculating the limit w.r.t. $L$ . The proof of Theorem 5.2 is given in the supplementary. + +Although the expression in (5) is not a closed form expression for $\lim_{t\to \infty}\beta (t)$ (because $\| \lim_{t\to \infty}\beta (t)\|$ appears on the RHS), taking $L$ to infinity (6) does result in a closed form expression and demonstrates the effect of increasing model depth. As in (1), we see that the end-to-end equivalent has two components: one which is parallel to the data and one which is orthogonal to it. However, while in (1) the orthogonal component has the original norm of the orthogonal projection of $\theta_S$ , the expression in (6) offers a re-scaling of the norm of this component by some ratio that also depends on $\theta_T$ . Presenting this phenomenon for the infinity depth limit might look impractical, but the empirical results given in this section show that the effect of depth is apparent even for models of relatively small depth. + +# 5.1 When Does Depth Help Fine-Tuning? + +In this subsection we wish to understand the effect of depth on the population risk of the fine-tuned model. For simplicity we focus on the limit in (6), and denote $\beta = \lim_{L\to \infty}\lim_{t\to \infty}\beta (t)$ . + +Since the linear network is a linear function of $x$ , we can derive an expression for the population risk of the network, similar to (2): + +$$ +R (\boldsymbol {\beta}) = \left\| \boldsymbol {\Sigma} ^ {\frac {1}{2}} \mathbf {P} _ {\perp} \left(\boldsymbol {\theta} _ {T} - \frac {\left\| \mathbf {P} _ {\parallel} \boldsymbol {\theta} _ {T} \right\|}{\left\| \mathbf {P} _ {\parallel} \boldsymbol {\theta} _ {S} \right\|} \boldsymbol {\theta} _ {S}\right) \right\| ^ {2}. \tag {7} +$$ + +However, since $\mathbf{P}_{\parallel}$ depends on the random matrix $\mathbf{X}$ , without further assumptions this expression by itself is not enough to understand the behaviour of $R(\beta)$ . Theorem 5.3 and Theorem 5.4 analyze cases for which a bound on (7) can be achieved, showing that it depends on $\| \pmb{\theta}_T\|$ ( $\hat{\pmb{\theta}}_T - \hat{\pmb{\theta}}_S$ ), i.e. the product of the norm of $\pmb{\theta}_T$ and the difference of the normalized $\hat{\pmb{\theta}}_T$ and $\pmb{\theta}_S$ , compared to (2) which depends on the difference between the un-normalized vectors. This observation further highlights the fact that the distance between source and target vectors is not a good predictor of fine-tuning accuracy for some architectures, as fine-tuning can still succeed even if the source and target are very far as long as they are aligned. + +We formalize this in the following result, where $\theta_T$ is identical to $\theta_S$ in direction, but not in norm. + +Theorem 5.3. Assume that the conditions of Theorem 5.2 hold, and that $\hat{\theta}_T = \hat{\theta}_S$ . Namely: + +$$ +\boldsymbol {\theta} _ {T} = \alpha \boldsymbol {\theta} _ {S}, \quad f o r \quad \alpha > 0, +$$ + +then for $L\to \infty$ the risk of the end-to-end solution $\beta$ is + +$$ +R (\beta) = 0, +$$ + +while for the $L = 1$ solution $\gamma$ , the risk is: + +$$ +R (\boldsymbol {\gamma}) = \left(\frac {\alpha - 1}{\alpha}\right) ^ {2} \| \boldsymbol {\Sigma} ^ {1 / 2} \mathbf {P} _ {\perp} \boldsymbol {\theta} _ {T} \| ^ {2} \neq 0 \quad f o r \quad \alpha \neq 1, \alpha > 0. \tag {8} +$$ + +This setting highlights our conclusion on the role of alignment in deep linear models: if the tasks are aligned, the deep linear predictor achieves zero generalization even with a single sample, while the population risk of the $L = 1$ predictor still depends on $n$ . + +Another example for this behaviour can be seen when $\mathbf{X}$ is i.i.d Gaussian (i.e., $\mathcal{D} = \mathcal{N}(0,1)^d$ ). + +Theorem 5.4. Assume that the conditions of Theorem 5.2 hold, and let $\mathbf{X} \sim \mathcal{N}(0,1)^d$ . Suppose $n \leq d$ , then there exists a constant $c > 0$ such that for any $\epsilon > 0$ with probability at least $1 - 4\exp(-c\epsilon^2 n) - 4\exp(-c\epsilon^2 (d - n))$ the population risk for the $L \to \infty$ end-to-end predictor $\beta$ is bounded as follows: + +$$ +R (\boldsymbol {\beta}) \leq \frac {d - n}{d} (1 + \epsilon) ^ {2} \| \boldsymbol {\theta} _ {T} \| ^ {2} \left\| \hat {\boldsymbol {\theta}} _ {T} - \hat {\boldsymbol {\theta}} _ {S} \right\| ^ {2} + \frac {d - n}{d} \zeta (\| \boldsymbol {\theta} _ {T} \|) ^ {2}, \tag {9} +$$ + +for $\zeta (\| \pmb {\theta}_T\|)\approx \epsilon \| \pmb {\theta}_T\|$ . For the $L = 1$ linear regression solution $\gamma$ this risk is bounded by + +$$ +R (\boldsymbol {\gamma}) \leq \frac {d - n}{d} (1 + \epsilon) ^ {2} \| \boldsymbol {\theta} _ {T} - \boldsymbol {\theta} _ {S} \| ^ {2}. \tag {10} +$$ + +The above result is a direct analysis of (7) when $\boldsymbol{\Sigma} = \mathbf{I}$ by using Lemma 5.3.2 from [37] to analyze the effects of $\mathbf{P}_{\parallel}, \mathbf{P}_{\perp}$ . Comparing (9) and (10), we see that while (10) depends on the distance between the two un-normalized tasks, (9) depends on the norm of the target task and the alignment of the tasks, but not at all on the norm of the source task. The proofs of Theorem 5.3 and Theorem 5.4 are given in the supp. + +# 5.2 Deep linear fine-tuning with fixing the first layer(s) + +A common trick when performing fine-tuning is to fix, or "freeze" (i.e. not train), the first $k$ layers of a model during the optimization on the target task. This method reduces the risk of over-fitting these layers to the small training set. The next theorem shows that for deep linear networks this method degenerates the training process. + +![](images/f3eb2e073608dced6cf7559ebb78e0ed9b5cf7e83daf5724dfb98346a81fdc05.jpg) +(a) + +![](images/904e8548b8e74808cfc79e96c9a9d85bc0cbba545671b0267b66f88a5e2a147a.jpg) +(b) +Figure 2: (a) The effect of depth on fine-tuning when $\theta_T$ is a $\alpha$ scaled, $\epsilon$ noised version of $\theta_S$ with $d/10$ samples. (b) The effect of changing the scale of either source weights or target weights in a 7-layers model. + +Theorem 5.5. Assume the setting of Theorem 5.2. Then, if we freeze the first layer (or any number $k$ of first layers) during fine-tuning, the fine-tuned model will be given by $\langle \pmb {\beta}(t),\pmb {x}\rangle = c\langle \mathbf{x},\pmb{\theta}_S\rangle$ , for some constant $c$ . + +The key idea in the proof is to show that the product of the $k$ first layers is equal to $\theta_{S}$ up to a scaling factor, which is a result of [30]. The result implies that after fine-tuning the model is still equal to the source task, independently of the target task. Thus, fine-tuning essentially fails completely, and its error cannot be reduced with additional target data. + +![](images/7761c89d4602bd0a7db54819ebfdbb89242e23a761d6d0e51cd1552477685530.jpg) +Figure 3: A network whose first layer is fixed has a constant generalization loss due to degeneration effect in Theorem 5.5. + +This result is achieved under the assumption of 0-balancedness prior to pretraining, which happens e.g. when initializing the weights with an infinitesimally small variance, as this property leads to the degeneracy of the output of the frozen k-layers. Though the proof of Theorem 5.5 depends on this 0-balancedness property of the network, the experiments shown in Figure 3 were conducted with a small initialization scale, that is not guaranteed to result in 0-balancedness, but rather in $\delta$ -approximate balancedness [32] when $\delta$ is small. These experiments show empirically that the phenomenon of learning failure is observed even when $\delta > 0$ . Intuitively, this is because the effective rank of the weight matrices is close to one, and thus learning the second layer is an ill-conditioned problem, which leads to slower convergence and can prevent the model from fine-tuning on the target data with a constant gradient step. + +A possible workaround to this failure of learning would be to initialize the weights prior to pretraining with a larger scale of initialization (e.g. with Xavier [38]), thus increasing the rank of each layer and preventing degeneracy. Pre-training with multiple source tasks (as suggested in e.g. [22]) may also help the fine-tuning optimization. + +# 5.3 Experiments + +We next describe experiments that support the results in this section. Theorem 5.3 predicts that deeper nets will successfully learn a case where source and target vectors are aligned, but with different norms. This is demonstrated in Figure 2a where source and target tasks are related via $\theta_T = \alpha \hat{\theta}_S + \epsilon$ , where $\epsilon$ is a standard Gaussian vector whose norm is approximately $0.5\|\pmb{\theta}_S\|$ . It can be seen that when $\alpha \approx 1$ , there is no difference between models of different depth. However, as $\alpha$ increases, adding depth has a positive effect on fine-tuning accuracy. Theorem 5.4 predicts that the test loss for a deep linear model would depend only on the alignment of $\pmb{\theta}_S$ and $\pmb{\theta}_T$ (i.e. $\|\hat{\pmb{\theta}}_T - \hat{\pmb{\theta}}_S\|$ ) and on the $\|\pmb{\theta}_T\|$ , but not on $\|\pmb{\theta}_S\|$ . This is demonstrated in Figure 2b where source and target task are initialized s.t. $\|\hat{\pmb{\theta}}_T - \hat{\pmb{\theta}}_S\| \approx 0.1$ . In each experiment, either $\pmb{\theta}_T = \alpha \hat{\pmb{\theta}}_T$ or $\pmb{\theta}_S = \alpha \hat{\pmb{\theta}}_S$ , where $\alpha$ is the "Scaling Factor", and the other has norm of 1. It can be seen that increasing the norm of the target vector harms generalization much more than increasing the norm of the source vector, as the theorem predicts, even for a relatively shallow model. + +Theorem 5.5 states that fixing the first layer in deep linear nets can result in failure to fine-tune. We illustrate this empirically in Figure 3, where we compare three two-layer linear models on the same target task: 1) A "Frozen" model that fixes the first layer after pretraining. 2) A "Vanilla" model that trains the network from scratch on the target, ignoring the source pre-training. 3) A "Finetune" model that first trains on source and fine-tunes to target. As predicted by theory, the "frozen" model's performance is poor, and fine-tuning has better sample complexity. + +# 6 Analyzing fine-tuning in shallow ReLU networks + +Analyzing optimization and generalization in non-linear networks is challenging. However, analysis in the Neural Tangent Kernel (NTK) regime is sometimes simpler [39, 31]. Thus, here we take a first step towards understanding fine-tuning in non-linear networks by analyzing this problem in the NTK regime. Specifically, we consider the setting of a two-layer ReLU network with $m$ neurons in the hidden layer. Hence, we consider $\Theta(t) = \{\mathbf{W}(t), \mathbf{a}\}$ and $f(\mathbf{x}; \Theta(t)) = \frac{1}{\sqrt{m}} \sum_{r=1}^{m} a_r \sigma(\mathbf{x}^\top \mathbf{w}_r(t))$ where $\sigma$ is the ReLU function, $\mathbf{w}_1(t), \ldots, \mathbf{w}_m(t) \in \mathbb{R}^d$ , the rows of $\mathbf{W}(t)$ , are vectors in the first layer, and $\mathbf{a} \in \{-1,1\}^m$ is the vector of weights in the second layer. We initialize $\mathbf{a}$ uniformly and fix it during optimization as in [39]. Before pretraining, the first layer parameters are initialized from a standard Gaussian with variance $\kappa^2$ . We also assume that $\|\mathbf{x}\| = 1$ for all $\mathbf{x}$ samples from $\mathcal{D}$ . We let $f(\mathbf{X}, \Theta) \in \mathbb{R}^n$ be the vector of predictions of $f$ on the data $\mathbf{X}$ . + +For the next theorem we do not assume linear teachers, and instead assume an arbitrary labeling function $g_{S}$ such that $\mathbf{y}_S = g_S(\mathbf{X}_S)$ , for $\mathbf{X}_S \in \mathbb{R}^{ns \times d}$ , $\mathbf{y}_S \in \mathbb{R}^{ns}$ the pretraining data and labels, respectively. We also assume that $\mathbf{y} = g_T(\mathbf{X})$ for some arbitrary function $g_{T}$ . For simplicity, we assume $|y|_i \leq 1$ for $i \in [n]$ . We consider a setting where the pretraining phase is done using a two-layer network in the NTK regime, under the assumptions of Theorem 4.1 from [31] with respect to the variables $m, \kappa, \eta$ and sufficiently many iterations. Next, in the fine-tuning phase, we train a network initialized with the weights given by the pretraining phase. We use the same value of $m$ for the fine-tuning phase. We rely on the analysis given in [39, 31] and achieve an upper bound on the population risk of the fine-tuned model: + +Theorem 6.1. Fix a failure probability $\delta \in (0,1)$ . We assume that Assumption 3.1 holds. Suppose $\kappa = O\left(\frac{\lambda_0\delta}{n}\right)$ , $m \geq \kappa^{-2}$ poly $(n,n_S,\lambda_0^{-1},\delta^{-1})$ . Consider any loss function $\ell : \mathbb{R} \times \mathbb{R} \to [0,1]$ that is 1-Lipschitz in the first argument such that $\ell(y,y) = 0$ . Then with probability at least $1 - \delta$ , the two-layer neural network $f(\cdot, \Theta(t))$ fine-tuned by $GD$ for $t \geq \Omega\left(\frac{1}{\eta\lambda_0}\log\|\tilde{\mathbf{y}}\|_2^{-1}\right)$ iterations has population loss: + +$$ +R (\boldsymbol {\Theta} (t)) \leq 2 \sqrt {\frac {\tilde {\mathbf {y}} ^ {\top} \left(\mathbf {H} ^ {\infty}\right) ^ {- 1} \tilde {\mathbf {y}}}{n}} + O \left(\sqrt {\frac {\log \frac {n}{\lambda_ {0} \delta}}{n}}\right), \tag {11} +$$ + +$$ +f o r \tilde {\mathbf {y}} \equiv \mathbf {y} - f (\mathbf {X}, \boldsymbol {\Theta} (0)). +$$ + +The above result shows that the true risk of the fine-tuned model is related to the distance of learned outputs $\mathbf{y}$ from the outputs after pretraining $f(\mathbf{X},\Theta (0))$ . The proof of Theorem 6.1 is given in the supp. + +As in previous NTK regime analyses, this result holds when the weights of the fine-tuned model do not "move" too far away from the weights at random initialization. Thus, the proof approach is to bound the distance between the Gram matrix $\mathbf{H}(t)$ and the infinite-width gram matrix $\mathbf{H}^{\infty}$ with a decreasing function in $m$ . The main challenge is that the weights $\mathbf{W}(0)$ are not initialized i.i.d as described above. To address this we provide a careful analysis of the dynamics and show that $\mathbf{H}(t)$ is close to $\mathbf{H}$ at random initialization, even when considering the pretraining phase, which in turn is close to $\mathbf{H}^{\infty}$ . + +We next apply our results to the case of linear source and target tasks. We thus assume that $g_{S}, g_{T}$ are linear functions with parameters $\theta_{S}, \theta_{T}$ . For simplicity of exposition we assume $f(\mathbf{x}, \Theta(0)) = \mathbf{x}^{\top} \theta_{S}$ exactly (Assumption 3.2). Before bounding the risk of fine-tuning we bound the RHS of (11) in the linear case: + +Corollary 6.2. Suppose that $g_{S}(\mathbf{X}) \triangleq \mathbf{X}^{\top} \pmb{\theta}_{S}$ , $g_{T}(\mathbf{X}) \triangleq \mathbf{X}^{\top} \pmb{\theta}_{T}$ , and assume Assumption 3.2 holds. Then, $\sqrt{\tilde{\pmb{y}}^{\top} (\mathbf{H}^{\infty})^{-1} \tilde{\pmb{y}}} \leq 3 \| \pmb{\theta}_{T} - \pmb{\theta}_{S} \|_{2}$ . + +This is a direct corollary of Theorem 6.1 from [31] on $\tilde{\mathbf{y}}$ defined above. Theorem 6.1 and Corollary 6.2 result in the a bound on the risk of the fine-tuned model: + +Corollary 6.3. Under the conditions of Theorem 6.1 and Corollary 6.2, it holds that + +$$ +R (\boldsymbol {\Theta} (t)) \leq \frac {6 \| \boldsymbol {\theta} _ {T} - \boldsymbol {\theta} _ {S} \| _ {2}}{\sqrt {n}} + O \left(\sqrt {\frac {\log \frac {n}{\lambda_ {0} \delta}}{n}}\right). +$$ + +We note that fine-tuning is improved as the distance between source and target decreases. In our analysis of linear networks (Theorem 4.2 and Theorem 5.4) we obtained a more fine-grained result depending on the covariance structure. We conjecture that the non-linear case will have similar results, which will likely involve the covariance structure in the NTK feature space. + +# 7 Discussion + +This paper gives a fine-grained analysis of the process of fine-tuning with linear teachers in several different architectures. It offers insights into the inductive bias of gradient-descent and the implied relation between the source task, the target task and the target covariance that is needed for this process to succeed. We believe our conclusions pave a way towards understanding why some pretrained models work better than others and what biases are transferred from those models during fine-tuning. + +A limitation of our work is the simplicity of the models analyzed, and it would certainly be interesting to extend these. Our setting deals only with linear teachers, and assumes the label noise to be zero. Furthermore, we only show upper bounds on the population risk, and not matching lower bounds. For deep linear networks we assume a certain initialization which is less standard than normalized initializers such as Xavier. For non-linear models, we analyze the simple model of a shallow ReLU network, and only in the NTK regime. + +An interesting direction to explore is formulating a bound similar to Theorem 4.2 for regression in the RKHS space given by the NTK, where the covariance is now over the RKHS space and thus more challenging to analyze. Another interesting setting is classification with exponential losses. Since the classifier learned by GD in this case has diverging norm, it is not clear how fine-tuning is beneficial, although in practice it often is. We leave these questions for future work. + +# Acknowledgments and Disclosure of Funding + +This work has been supported by the Israeli Science Foundation research grant 1186/18 and the Yandex Initiative for Machine Learning. AB is supported by the Google Doctoral Fellowship in Machine Learning. + +# References + +[1] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pages 4171–4186, 2019. +[2] Kenton Lee, Ming-Wei Chang, and Kristina Toutanova. Latent retrieval for weakly supervised open domain question answering. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 6086–6096, 2019. +[3] Mor Geva, Ankit Gupta, and Jonathan Berant. Injecting numerical reasoning skills into language models. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 946-958, 2020. +[4] Suchin Gururangan, Ana Marasovic, Swabha Swayamdipta, Kyle Lo, Iz Beltagy, Doug Downey, and Noah A Smith. Don't stop pretraining: Adapt language models to domains and tasks. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, pages 8342-8360, 2020. +[5] Matthew E Peters, Sebastian Ruder, and Noah A Smith. To tune or not to tune? adapting pretrained representations to diverse tasks. In Proceedings of the 4th Workshop on Representation Learning for NLP (RepL4NLP-2019), pages 7–14, 2019. +[6] Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. In 5th International Conference on Learning Representations, ICLR 2017, Toulouse, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017. +[7] Kaifeng Lyu and Jian Li. Gradient descent maximizes the margin of homogeneous neural networks. In International Conference on Learning Representations, 2019. +[8] Blake Woodworth, Suriya Gunasekar, Jason D Lee, Edward Moroshko, Pedro Savarese, Itay Golan, Daniel Soudry, and Nathan Srebro. Kernel and rich regimes in overparametrized models. In Conference on Learning Theory, pages 3635-3673. PMLR, 2020. +[9] Lenaic Chizat and Francis Bach. Implicit bias of gradient descent for wide two-layer neural networks trained with the logistic loss. In Conference on Learning Theory, pages 1305-1338. PMLR, 2020. +[10] Jingfeng Wu, Difan Zou, Vladimir Braverman, and Quanquan Gu. Direction matters: On the implicit bias of stochastic gradient descent with moderate learning rate. In International Conference on Learning Representations, 2021. +[11] Edward Moroshko, Blake E Woodworth, Suriya Gunasekar, Jason D Lee, Nati Srebro, and Daniel Soudry. Implicit bias in deep linear classification: Initialization scale vs training accuracy. Advances in Neural Information Processing Systems, 33, 2020. +[12] Sanjeev Arora, Nadav Cohen, Wei Hu, and Yuping Luo. Implicit regularization in deep matrix factorization. Advances in Neural Information Processing Systems, 32, 2019. +[13] Roei Sarussi, Alon Brutzkus, and Amir Globerson. Towards understanding learning in neural networks with linear teachers. In International Conference on Machine Learning, 2021. +[14] Vaishnavh Nagarajan and J Zico Kolter. Generalization in deep networks: The role of distance from initialization. arXiv preprint arXiv:1901.01672, 2019. +[15] Mingchen Li, Mahdi Soltanolkotabi, and Samet Oymak. Gradient descent with early stopping is provably robust to label noise for overparameterized neural networks. In International Conference on Artificial Intelligence and Statistics, pages 4313-4324. PMLR, 2020. +[16] Behnam Neyshabur, Zhiyuan Li, Srinadh Bhojanapalli, Yann LeCun, and Nathan Srebro. Towards understanding the role of over-parametrization in generalization of neural networks. In International Conference on Learning Representations (ICLR), 2019. + +[17] Gintare Karolina Dziugaite and Daniel M Roy. Computing nonvacuous generalization bounds for deep (stochastic) neural networks with many more parameters than training data. arXiv preprint arXiv:1703.11008, 2017. +[18] Yiding Jiang, Behnam Neyshabur, Hossein Mobahi, Dilip Krishnan, and Samy Bengio. Fantastic generalization measures and where to find them. arXiv preprint arXiv:1912.02178, 2019. +[19] Noam Razin and Nadav Cohen. Implicit regularization in deep learning may not be explainable by norms. In Advances in Neural Information Processing Systems (NeurIPS), 2020. +[20] Behnam Neyshabur, Hanie Sedghi, and Chiyuan Zhang. What is being transferred in transfer learning? arXiv preprint arXiv:2008.11687, 2020. +[21] Kurtland Chua, Qi Lei, and Jason D Lee. How fine-tuning allows for effective meta-learning. arXiv preprint arXiv:2105.02221, 2021. +[22] Simon Shaolei Du, Wei Hu, Sham M. Kakade, Jason D. Lee, and Qi Lei. Few-shot learning via learning the representation, provably. In International Conference on Learning Representations, 2021. +[23] Daniel McNamara and Maria-Florina Balcan. Risk bounds for transferring representations with and without fine-tuning. In International Conference on Machine Learning, pages 2373–2381. PMLR, 2017. +[24] Suriya Gunasekar, Jason Lee, Daniel Soudry, and Nathan Srebro. Characterizing implicit bias in terms of optimization geometry. In International Conference on Machine Learning, pages 1832-1841. PMLR, 2018. +[25] 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. +[26] Trevor Hastie, Andrea Montanari, Saharon Rosset, and Ryan J Tibshirani. Surprises in high-dimensional ridgeless least squares interpolation. arXiv preprint arXiv:1903.08560, 2019. +[27] Alexander Tsigler and Peter L Bartlett. Benign overfitting in ridge regression. arXiv preprint arXiv:2009.14286, 2020. +[28] Difan Zou, Jingfeng Wu, Vladimir Braverman, Quanquan Gu, and Sham M Kakade. Benign overfitting of constant-stepsize sgd for linear regression. arXiv preprint arXiv:2103.12692, 2021. +[29] Shahar Azulay, Edward Moroshko, Mor Shpigel Nacson, Blake Woodworth, Nathan Srebro, Amir Globerson, and Daniel Soudry. On the implicit bias of initialization shape: Beyond infinitesimal mirror descent. arXiv preprint arXiv:2102.09769, 2021. +[30] Chulhee Yun, Shankar Krishnan, and Hossein Mobahi. A unifying view on implicit bias in training linear neural networks. In International Conference on Learning Representations, 2020. +[31] Sanjeev Arora, Simon Du, Wei Hu, Zhiyuan Li, and Ruosong Wang. Fine-grained analysis of optimization and generalization for overparameterized two-layer neural networks. In International Conference on Machine Learning, pages 322-332. PMLR, 2019. +[32] Sanjeev Arora, Nadav Cohen, Noah Golowich, and Wei Hu. A convergence analysis of gradient descent for deep linear neural networks. In International Conference on Learning Representations, 2018. +[33] Chandler Davis and William Morton Kahan. The rotation of eigenvectors by a perturbation. iii. SIAM Journal on Numerical Analysis, 7(1):1-46, 1970. +[34] Yann LeCun and Corinna Cortes. MNIST handwritten digit database. 2010. + +[35] Sanjeev Arora, Nadav Cohen, and Elad Hazan. On the optimization of deep networks: Implicit acceleration by overparameterization. In International Conference on Machine Learning, pages 244-253. PMLR, 2018. +[36] Ziwei Ji and Matus Telgarsky. Gradient descent aligns the layers of deep linear networks. In 7th International Conference on Learning Representations, ICLR 2019, 2019. +[37] Roman Vershynin. High-dimensional probability: An introduction with applications in data science, volume 47. Cambridge university press, 2018. +[38] Xavier Glorot and Yoshua Bengio. Understanding the difficulty of training deep feedforward neural networks. In Yee Whye Teh and Mike Titterington, editors, Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, volume 9 of Proceedings of Machine Learning Research, pages 249–256, Chia Laguna Resort, Sardinia, Italy, 13–15 May 2010. PMLR. +[39] Simon S Du, Xiyu Zhai, Barnabas Poczos, and Aarti Singh. Gradient descent provably optimizes over-parameterized neural networks. In International Conference on Learning Representations, 2018. +[40] 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, high-performance deep learning library. In H. Wallach, H. Larochelle, A. Beygelzimer, F. d'Alché-Buc, E. Fox, and R. Garnett, editors, Advances in Neural Information Processing Systems 32, pages 8024-8035. Curran Associates, Inc., 2019. +[41] Charles R. Harris, K. Jarrod Millman, Stefan J. van der Walt, Ralf Gommers, Pauli Virtanen, David Cournapeau, Eric Wieser, Julian Taylor, Sebastian Berg, Nathaniel J. Smith, Robert Kern, Matti Picus, Stephan Hoyer, Marten H. van Kerkwijk, Matthew Brett, Allan Haldane, Jaime Fernández del Río, Mark Wiebe, Pearu Peterson, Pierre Gérard-Marchant, Kevin Sheppard, Tyler Reddy, Warren Weckesser, Hameer Abbasi, Christoph Gohlke, and Travis E. Oliphant. Array programming with NumPy. Nature, 585(7825):357-362, September 2020. +[42] Pauli Virtanen, Ralf Gommers, Travis E. Oliphant, Matt Haberland, Tyler Reddy, David Cournapeau, Evgeni Burovski, PEARU Peterson, Warren Weckesser, Jonathan Bright, Stéfan J. van der Walt, Matthew Brett, Joshua Wilson, K. Jarrod Millman, Nikolay Mayorov, Andrew R. J. Nelson, Eric Jones, Robert Kern, Eric Larson, C J Carey, Ilhan Polat, Yu Feng, Eric W. Moore, Jake VanderPlas, Denis Laxalde, Josef Perktold, Robert Cimrman, Ian Henriksen, E. A. Quintero, Charles R. Harris, Anne M. Archibald, Antonio H. Ribeiro, Fabian Pedregosa, Paul van Mulbregt, and SciPy 1.0 Contributors. SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python. Nature Methods, 17:261-272, 2020. +[43] John D. Hunter. Matplotlib: A 2d graphics environment. Computing in Science Engineering, 9(3):90-95, 2007. +[44] Vladimir Koltchinskii and Karim Lounici. Concentration inequalities and moment bounds for sample covariance operators. Bernoulli, 23(1):110-133, 2017. +[45] jlewk (https://mathoverflow.net/users/141760/jlewk). Difference between identity and a random projection. MathOverflow. URL: https://mathoverflow.net/q/393720 (version: 2021-05-25). +[46] Keyulu Xu, Mozhi Zhang, Jingling Li, Simon S Du, Ken-ichi Kawarabayashi, and Stefanie Jegelka. How neural networks extrapolate: From feedforward to graph neural networks. arXiv preprint arXiv:2009.11848, 2020. \ No newline at end of file diff --git a/atheoreticalanalysisoffinetuningwithlinearteachers/images.zip b/atheoreticalanalysisoffinetuningwithlinearteachers/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e4e4f8a461c08544822390e225271daeb01b5848 --- /dev/null +++ b/atheoreticalanalysisoffinetuningwithlinearteachers/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f0a90539da189bdc3b92b8bb4ccc520d6b1684a50b771383cf41482c5dc388fc +size 202571 diff --git a/atheoreticalanalysisoffinetuningwithlinearteachers/layout.json b/atheoreticalanalysisoffinetuningwithlinearteachers/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..a94bc2731a80b2605109751372269e09e1d7ccf7 --- /dev/null +++ b/atheoreticalanalysisoffinetuningwithlinearteachers/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f9d06fc62a79dfcc442a0f610afc33db09ff652b63c5ed5a116a809f55ea53c +size 564928 diff --git a/atheorydrivenselflabelingrefinementmethodforcontrastiverepresentationlearning/e9f85367-c5b9-46f3-990d-1237664176b8_content_list.json b/atheorydrivenselflabelingrefinementmethodforcontrastiverepresentationlearning/e9f85367-c5b9-46f3-990d-1237664176b8_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..63041a8c5743c6b006ec400b6c72e464a7eb9c5c --- /dev/null +++ b/atheorydrivenselflabelingrefinementmethodforcontrastiverepresentationlearning/e9f85367-c5b9-46f3-990d-1237664176b8_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:790aab1a1f89e07cede6a091ddc53835af6d45994bba289c39d21b1cabde8bd9 +size 103896 diff --git a/atheorydrivenselflabelingrefinementmethodforcontrastiverepresentationlearning/e9f85367-c5b9-46f3-990d-1237664176b8_model.json b/atheorydrivenselflabelingrefinementmethodforcontrastiverepresentationlearning/e9f85367-c5b9-46f3-990d-1237664176b8_model.json new file mode 100644 index 0000000000000000000000000000000000000000..ba86d3b76a5d70a3f773c01b4ed188851779f280 --- /dev/null +++ b/atheorydrivenselflabelingrefinementmethodforcontrastiverepresentationlearning/e9f85367-c5b9-46f3-990d-1237664176b8_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0624fb238f185729a4a5c7f7abf40a473b45eb60f21fe05a308f2ae2a9cb2771 +size 128801 diff --git a/atheorydrivenselflabelingrefinementmethodforcontrastiverepresentationlearning/e9f85367-c5b9-46f3-990d-1237664176b8_origin.pdf b/atheorydrivenselflabelingrefinementmethodforcontrastiverepresentationlearning/e9f85367-c5b9-46f3-990d-1237664176b8_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..65f8779b5b24beaaac99748c14e3a00e91392cb3 --- /dev/null +++ b/atheorydrivenselflabelingrefinementmethodforcontrastiverepresentationlearning/e9f85367-c5b9-46f3-990d-1237664176b8_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2cfbbcb129dee07bc704d7d47d19370b5b748e2e58e113d1a8901a7ab9cd6f55 +size 420836 diff --git a/atheorydrivenselflabelingrefinementmethodforcontrastiverepresentationlearning/full.md b/atheorydrivenselflabelingrefinementmethodforcontrastiverepresentationlearning/full.md new file mode 100644 index 0000000000000000000000000000000000000000..ffbe52e42f22b5b7c4ac357746c337a60586e34c --- /dev/null +++ b/atheorydrivenselflabelingrefinementmethodforcontrastiverepresentationlearning/full.md @@ -0,0 +1,381 @@ +# A Theory-Driven Self-Labeling Refinement Method for Contrastive Representation Learning + +Pan Zhou* Caiming Xiong* Xiao-Tong Yuan† Steven Hoi* * Salesforce Research + +† Nanjing University of Information Science & Technology panzhou3@gmail.com {cxiong, shoi} @ salesforce.com xtyuan@nuist.edu.cn + +# Abstract + +For an image query, unsupervised contrastive learning labels crops of the same image as positives, and other image crops as negatives. Although intuitive, such a native label assignment strategy cannot reveal the underlying semantic similarity between a query and its positives and negatives, and impairs performance, since some negatives are semantically similar to the query or even share the same semantic class as the query. In this work, we first prove that for contrastive learning, inaccurate label assignment heavily impairs its generalization for semantic instance discrimination, while accurate labels benefit its generalization. Inspired by this theory, we propose a novel self-labeling refinement approach for contrastive learning. It improves the label quality via two complementary modules: (i) self-labeling refinery (SLR) to generate accurate labels and (ii) momentum mixup (MM) to enhance similarity between query and its positive. SLR uses a positive of a query to estimate semantic similarity between a query and its positive and negatives, and combines estimated similarity with vanilla label assignment in contrastive learning to iteratively generate more accurate and informative soft labels. We theoretically show that our SLR can exactly recover the true semantic labels of label-corrupted data, and supervises networks to achieve zero prediction error on classification tasks. MM randomly combines queries and positives to increase semantic similarity between the generated virtual queries and their positives so as to improves label accuracy. Experimental results on CIFAR10, ImageNet, VOC and COCO show the effectiveness of our method. + +# 1 Introduction + +Self-supervised learning (SSL) is an effective approach to learn features without manual annotations, with great success witnessed to many downstream tasks, e.g. image classification and object detection [1-7]. The methodology of SSL is to construct a pretext task that can obtain data labels via well designing the task itself, and then build a network to learn from these tasks. For instance, by constructing jigsaw puzzle [8], spatial arrangement identification [9], orientation [10], or chromatic channels [11] as a pretext task, SSL learns high-qualified features from the pretext task that can well transfer to downstream tasks. As it gets rid of the manual annotation requirement in supervised deep learning, SSL has been widely attracted increasing researching interests [1, 12]. + +As a leading approach in SSL, contrastive learning [1, 4, 13-17] constructs a novel instance discrimination pretext task to train a network so that the representations of different crops (augmentations) of the same instance are close, while representations of different instances are far from each other. Specifically, for an image crop query, it randomly augments the same image to obtain a positive, and view other image crops as negatives. Then it constructs a one-hot label over the positive and negatives to pull the query together with its positive and push the query away its negatives in the feature space. + +Motivation. But the one-hot labels in contrastive learning are indeed inaccurate and uninformative because of the following two reasons. Firstly, for a query, it could be semantically similar or even more similar to some negatives than its positives. Indeed, some negatives even belong to the same semantic class as the query [18-20]. It holds in practice, as (i) to achieve good performance, one often uses sufficient negatives that are much more than the semantic class number, e.g. tens of thousands of negatives for ImageNet [21] in MoCo [1], unavoidably leading to the issue on negatives; (ii) even for the same image, especially for an image containing different objects which occurs in ImageNet, random augmentations, e.g. crop, provide crops with (slightly) different semantic information, and thus some of the huge negatives could be more similar to query. Secondly, samples from different classes also have some similarity which is not characterized in the one-hot labels. For example, given a query cat, it is often more similar to a dog than a car though both dog and car are negatives. Learning from those similarity among samples is also important and can improve the performance. This point is also supported by knowledge distillation or self-training approaches [22, 23], where a teacher model or a currently-training model is used to predict semantic similarity of a sample on different classes for further supervising model training, achieving better performance. Therefore, the one-hot label cannot well reveal the semantic similarity between query and its positives and "negatives", and cannot guarantee the semantically similar samples to close each other, leading to performance degradation. + +Contributions. In this work, we alleviate the above label issue, and derive some new results and alternatives for contrastive learning. Particularly, we theoretically show that inaccurate labels impair the performance of contrastive learning. Then we propose a self-labeling refinement method to obtain more accurate labels for contrastive learning. Our main contributions are highlighted below. + +Our first contribution is proving that the generalization error of MoCo for instance discrimination linearly depends on the discrepancy between the estimated labels (e.g. one-hot labels) in MoCo and the true labels that really reflect semantical similarity between a query and its positives and negatives. Formally, given $n$ training queries $\mathcal{D} = \{\pmb{x}_i\}_{i=1}^n$ with estimated labels $\{\pmb{y}_i\}_{i=1}^n$ (e.g. one-hot labels in MoCo) and ground truth labels $\{\pmb{y}_i^*\}_{i=1}^n$ on their corresponding positives and negatives, the generalization error of MoCo for instance discrimination is lower bounded by $\mathcal{O}\left(\mathbb{E}_{\mathcal{D}}[\|\pmb{y} - \pmb{y}^*\|_2]\right)$ where $\mathbb{E}_{\mathcal{D}}[\|\pmb{y} - \pmb{y}^*\|_2] = \frac{1}{n}\sum_{i=1}^{n}\|\pmb{y}_i - \pmb{y}_i^*\|_2$ , and is upper bounded by $\mathcal{O}\left(\sqrt{\ln(|\mathcal{F}|)/n} + \mathbb{E}_{\mathcal{D}}[\|\pmb{y} - \pmb{y}^*\|_2]\right)$ , where $|\mathcal{F}|$ is the covering number of the network hypotheses in MoCo. It means that the more accurate of the estimated labels $\{\pmb{y}_i\}_{i=1}^n$ , the better generalization of MoCo for instance discrimination. + +Inspired by our theory, we propose a Self-lAbeliNg rEfinement (SANE) method which iteratively employs the network and data themselves to generate more accurate and informative soft labels for contrastive learning. SANE has two complementary modules: (i) Self-Labeling Refinery (SLR) to explicitly generate accurate labels, and (ii) Momentum Mixup (MM) to increase similarity between query and its positive and implicitly improve label accuracy. Given a query, SLR uses its one positive to estimate semantic similarity between the query and its keys (i.e. its positive and negatives) by computing their feature similarity, since a query and its positive come from the same image and should have close similarity on the same keys. Then SLR linearly combines the estimated similarity of a query with its vanilla one-hot label in contrastive learning to iteratively generate more accurate and informative soft labels. Our strategy is that at the early training stage, one-hot label has heavy combination weight to provide relatively accurate labels; along with more training, the estimated similarity becomes more accurate and informative, and its combination weight becomes larger as it explores useful underlying semantic information between the query and its keys that is missing in the one-hot labels. Besides, we prove that when the semantic labels in the instance discrimination task are corrupted, our SLR can exactly recover the true semantic labels of training data, and networks trained with our SLR can exactly predict the true semantic labels of test samples. + +Moreover, we introduce MM for contrastive learning to further reduce the possible label noise and also increase augmentation diversity. Specifically, we randomly combines queries $\{\pmb{x}_i\}_{i=1}^n$ and their positives $\{\widetilde{\pmb{x}}_i\}_{i=1}^n$ as $\pmb{x}_i' = \theta \pmb{x}_i + (1 - \theta) \widetilde{\pmb{x}}_k$ and estimate their labels as $\pmb{y}_i' = \theta \widetilde{\pmb{y}}_i + (1 - \theta) \widetilde{\pmb{y}}_k$ , where indexes $i$ and $k$ are randomly selected, $\widetilde{\pmb{y}}_i$ is the label of both $\pmb{x}_i$ and $\widetilde{\pmb{x}}_i$ estimated by our label refinery, and $\theta \in (0,1)$ is a random variable. In this way, the component $\widetilde{\pmb{x}}_k$ in the virtual query $\pmb{x}_i'$ directly increases the similarity between the query $\pmb{x}_i'$ and the positive key $\widetilde{\pmb{x}}_k$ . So the label weight $(1 - \theta)$ of label $\pmb{y}_i'$ on positive key $\widetilde{\pmb{x}}_i$ to bring $\pmb{x}_i'$ and $\widetilde{\pmb{x}}_k$ together is relatively accurate, as $\pmb{x}_i'$ really contains the semantic information of $\widetilde{\pmb{x}}_k$ . Meanwhile, the possible noise at the remaining positions of label $\pmb{y}_i'$ is scaled by $\theta$ and becomes smaller. In this way, MM also improves the label quality. + +Other Related Work. To estimate similarity between a query and its negatives, Wei et al. [20] approximated the similarity by computing cosine similarity between a positive and its negatives, and directly replaced the one-hot label for instance discrimination. Wang et al. [12] used similar similarity estimated on weak augmentations to supervise the learning of strong augmentations. In contrast, we respectively estimate the similarities of the query on all contrastive keys (its positive and negatives) and on only negatives, and linearly combines two estimated similarities with vanilla one-hot label to obtain more accurate and informative label with provable performance guarantee. Learning from noisy label, e.g. [24-26] also uses soft labels generalized by a network to denoise crop labels and supervise representation learning, and often focus on (semi-)supervised learning that differs from our self-supervised learning. + +Two relevant works [27, 28] performed vanilla mixup on all query instances to increase data diversity. Differently, our momentum mixup mainly aims to reduce label noise, as it randomly combines one query with one positive (instead of one query) of other instances to increase the similarity between the query and its its positive. Verma et al. [29] showed that mixup is a better domain-agnostic noise than Gaussian noise for positive pair construction. But they did not perform mixup on labels, which is contrast to [27, 28] and ours. See more discussion in Sec. 3.2 and empirical comparison in Sec. 4.3. + +# 2 Inspiration: A Generalization Analysis of MoCo + +In this section, we first briefly review the MoCo [1] method popularly studied for contrastive learning, and then analyze the impact of inaccurate label assignment on its generalization ability. + +Review of MoCo. The MoCo method contains an online network $f_{\mathbf{w}}$ and a target network $g_{\xi}$ receptively parameterized by $\mathbf{w}$ and $\pmb{\xi}$ . Both $f_{\mathbf{w}}$ and $g_{\pmb{\xi}}$ consists of a feature encoder and a projection head (e.g. 3-layered MLP). Given a minibatch $\{c_i\}_{i = 1}^s$ at each iteration, it first randomly augments each vanilla image $c_{i}$ into two views $(\pmb {x}_i,\widetilde{\pmb{x}}_i)$ and optimizes the following contrastive loss: + +$$ +\mathcal {L} _ {\mathrm {n}} (\boldsymbol {w}) = - \frac {1}{s} \sum_ {i = 1} ^ {s} \log \left(\frac {\sigma \left(\boldsymbol {x} _ {i} , \widetilde {\boldsymbol {x}} _ {i}\right)}{\sigma \left(\boldsymbol {x} _ {i} , \widetilde {\boldsymbol {x}} _ {i}\right) + \sum_ {l = 1} ^ {b} \sigma \left(\boldsymbol {x} _ {i} , \boldsymbol {b} _ {l}\right)}\right), \tag {1} +$$ + +where $\sigma (\pmb {x}_i,\widetilde{\pmb{x}}_i) = \exp \left(-\frac{\langle f(\pmb{x}_i),g(\widetilde{\pmb{x}}_i)\rangle}{\tau\|f(\pmb{x}_i)\|_2\cdot\|g(\widetilde{\pmb{x}}_i)\|_2}\right)$ with a temperature $\tau$ . The dictionary $B = \{b_{i}\}_{i = 1}^{b}$ denotes the negative keys of current minibatch queries $\{\pmb {x}_i\}_{i = 1}^s$ , and is often of huge size to achieve satisfactory performance, e.g. 65,536 in MoCo. In practice, $\pmb{B}$ in MoCo is updated by the minibatch features $\{g(\widetilde{\pmb{x}}_i)\}_{i = 1}^s$ in a first-in and first-out order. By fixing $g_{\xi}$ and updating $f_{\mathbf{w}}$ in Eqn. (1), MoCo pushes the query $\pmb{x}_i$ away from its negative keys in dictionary $\pmb{B}$ while pulling together its positive key $\widetilde{\pmb{x}}_i$ . For $g_{\xi}$ , it is updated via exponential moving average, i.e. $\pmb {\xi} = (1 - \iota)\pmb {\xi} + \iota \pmb{w}$ with a constant $\iota$ $\in (0,1)$ . + +From Eqn. (1), one can observe that MoCo views each image as an individual class and uses one-hot label $\mathbf{y} \in \mathbb{R}^{b + 1}$ (its nonzero position is at the position of its positive key) to train $f_{\mathbf{w}}$ . However, as mentioned in Sec. 1, the one-hot labels cannot reveal the semantic similarity between a query $x_{i}$ and its positive and negatives and thus impair representation learning. In the following, we theoretically analyze the effect of inaccurate labels to the generalization of MoCo for instance discrimination. + +Generalization Analysis. We focus on analyzing MoCo in the final training stage where the sample (key) distribution in the dictionary $B$ is almost fixed. This simplified setup is reasonable because (i) in the final training stage, the target network $g_{\xi}$ almost does not change due to the very small momentum updating parameter $\iota$ in practice and the oncoming convergence of the online network $f_{w}$ ; (ii) dictionary is sufficient large to cover different patterns in the dataset. This fixed sample distribution simplifies the analysis, and also provides valuable insights. + +Let $\mathcal{D} = \{(\pmb{x}_i, \widetilde{\pmb{x}}_i)\}_{i=1}^n$ denote the training positive pairs in MoCo sampled from an unknown distribution $\mathcal{S}$ . Moreover, the query $\pmb{x}_i$ has ground truth soft label $\pmb{y}_i^* \in \mathbb{R}^{b+1}$ over the key set $B_i = \{\widetilde{\pmb{x}}_i \cup B\}$ , where the $t$ -th entry $\pmb{y}_{it}^*$ measures the semantic similarity between $\pmb{x}_i$ and the $t$ -th key $\pmb{b}_t'$ in $\pmb{B}_i$ . In practice, given query $\pmb{x}_i$ and dictionary $B_i$ , MoCo estimates an one-hot label of $\pmb{x}_i$ as $\pmb{y}_i \in \mathbb{R}^{b+1}$ whose first entry is one and remaining entries are zero. So $\pmb{y}_i$ ignores the semantic similarity between $\pmb{x}_i$ and keys in $\pmb{B}_i$ , and differs from $\pmb{y}_i^*$ . Then MoCo minimizes an empirical risk: + +$$ +\tilde {\mathcal {Q}} \left(f _ {\boldsymbol {w}}\right) = \frac {1}{n} \sum_ {i = 1} ^ {n} \ell \left(h \left(f _ {\boldsymbol {w}} \left(\boldsymbol {x} _ {i}\right), \boldsymbol {B} _ {i}\right), \boldsymbol {y} _ {i}\right), \tag {2} +$$ + +where $h(f_{\boldsymbol{w}}(\boldsymbol{x}_i), \boldsymbol{B}_i) = [\sigma(\boldsymbol{x}_i, \widetilde{\boldsymbol{x}}_i), \sigma(\boldsymbol{x}_i, \boldsymbol{b}_1), \dots, \sigma(\boldsymbol{x}_i, \boldsymbol{b}_b)]$ denotes the predicted class probability, and $\ell(\cdot, \cdot)$ is cross-entropy loss. Ideally, one should sample sufficient pairs $(\boldsymbol{x}_i, \widetilde{\boldsymbol{x}}_i)$ from the distribution $\mathcal{S}$ and use the ground truth label $\boldsymbol{y}_i^*$ of $\boldsymbol{x}_i$ to minimize the population risk: + +$$ +\boldsymbol {\mathcal {Q}} \left(f _ {\boldsymbol {w}}\right) = \mathbb {E} _ {\left(\boldsymbol {x} _ {i}, \tilde {\boldsymbol {x}} _ {i}\right) \sim \boldsymbol {\mathcal {S}}} \left[ \ell \left(h \left(f _ {\boldsymbol {w}} \left(\boldsymbol {x} _ {i}\right), \boldsymbol {B} _ {i}\right), \boldsymbol {y} _ {i} ^ {*}\right) \right]. \tag {3} +$$ + +Here we assume the ground truth label $y_{i}^{*}$ is soft which is indeed more reasonable and stricter than the one-hot label setting especially for contrastive learning [22]. It is because soft label requires the networks to capture the semantic similarity between query and the instances in $B_{i}$ and bring semantically similar instances together, greatly helping downstream tasks (e.g. classification) where global semantic information is needed, while one-hot label only needs networks to distinguish each instance from others and does not consider the global semantic structures in the data. Actually, the semantic similarity among samples here is also known as "dark knowledge" in knowledge distillation [22] or "Bayes class-probability", and is often used to replace the one-hot label for training network with remarkable performance improvement in many tasks, e.g. classification [30]. As both the data distribution $S$ and the ground truth labels are unknown, MoCo optimizes the empirical risk $\tilde{\mathcal{Q}}(f_w)$ in (2) instead of the population risk $\mathcal{Q}(f_w)$ in (3). In this way, the optimal network $f_w$ by minimizing $\tilde{\mathcal{Q}}(f_w)$ differs from that via optimizing $\mathcal{Q}(f_w)$ . It is natural to ask whether $f_w$ by minimizing $\tilde{\mathcal{Q}}(f_w)$ can well perform instance discrimination task in contrastive learning, i.e. whether $f_w$ can capture the semantic similarity $(y_i^*)$ between any test sample $(x_i, \widetilde{x}_i) \sim S$ and the keys (samples) in $B_i$ . To solve this issue, Theorem 1 analyzes the generalization error of $f_w$ for instance discrimination. We are interested in the generalization error defined with the true soft labels to measure the semantic similarity learning performance of $f_w$ via optimizing $\mathcal{Q}(f_w)$ on the instance discrimination task which can often better reflect the performance on the downstream tasks. + +Theorem 1. Suppose $\ell(h(f_{\boldsymbol{w}}(\boldsymbol{x}), \boldsymbol{B}_{\boldsymbol{x}}), \boldsymbol{y}) \in [a_1, a_2]$ , $\ell(\cdot, \boldsymbol{y})$ is $L_y$ -Lipschitz w.r.t. $\boldsymbol{y}$ . Let $\mathcal{F}$ be a finite class of hypotheses $\ell(h(f_{\boldsymbol{w}}(\boldsymbol{x}), \boldsymbol{B}_{\boldsymbol{x}}), \boldsymbol{y}) : \boldsymbol{\mathcal{X}} \times \boldsymbol{\mathcal{Y}} \to \mathbb{R}$ and $|\mathcal{F}|$ be its covering number under $\| \cdot \|_{\infty}$ metric. + +(1) Let $\mathbb{E}_{\mathcal{D}\sim \mathcal{S}}[\| \pmb {y} - \pmb {y}^*\| _2] = \mathbb{E}_{\mathcal{D}\sim \mathcal{S}}\bigl [\frac{1}{n}\sum_{i = 1}^{n}\| \pmb {y}_i - \pmb {y}_i^*\| _2\bigr ]$ . For any $\nu \in (0,1)$ , it holds + +$$ +\begin{array}{l} \left| \mathcal {Q} (f _ {\boldsymbol {w}}) - \widetilde {\mathcal {Q}} (f _ {\boldsymbol {w}}) \right| \leq L _ {y} \mathbb {E} _ {\mathcal {D} \sim \mathcal {S}} \left[ \| \boldsymbol {y} - \boldsymbol {y} ^ {*} \| _ {2} \right] \\ + \sqrt {\frac {2 (a _ {2} - a _ {1}) ^ {2} V _ {\mathcal {D}} \ln (2 | \mathcal {F} | / \nu)}{n}} + \frac {7 (a _ {2} - a _ {1}) ^ {2} \ln (2 | \mathcal {F} | / \nu)}{3 (n - 1)}, \\ \end{array} +$$ + +with probability at least $1 - \nu$ , where $V_{\mathcal{D}}$ is the variance of $\ell(h(f(x), B_x), y^*)$ on the data $\mathcal{D}$ . + +(2) There exists a contrastive classification problem, a class of hypotheses $\ell(h(f_{\boldsymbol{w}}(\boldsymbol{x}), \boldsymbol{B}_{\boldsymbol{x}}), \boldsymbol{y}) : \mathcal{X} \times \mathcal{Y} \to \mathbb{R}$ and a constant $c_0$ such that the generalization error of $f_{\boldsymbol{w}}$ is lower bounded + +$$ +\left| \mathcal {Q} (f _ {\boldsymbol {w}}) - \widetilde {\mathcal {Q}} (f _ {\boldsymbol {w}}) \right| \geq c _ {0} \cdot \mathbb {E} _ {\mathcal {D} \sim \mathcal {S}} \left[ \| \boldsymbol {y} - \boldsymbol {y} ^ {*} \| _ {2} \right]. +$$ + +See its proof in Appendix B. Theorem 1 shows that for the task of learning semantic similarity between a query and its positive and negatives which is important for downstream tasks (e.g., classification), the generalization error of $f_{w}$ trained with the one-hot labels $y$ is upper bounded by $\mathcal{O}\big(\mathbb{E}_{\mathcal{D}\sim \mathcal{S}}[\| y - y^{*}\|_{2}] + \sqrt{V_{\mathcal{D}}\ln(|\mathcal{F}|) / n}\big)$ . It means that large training sample number $n$ gives small generalization error, as intuitively, model sees sufficient samples and can generalize better. The loss variance $V_{\mathcal{D}}$ on the dataset $\mathcal{D}$ measures data diversity: the larger data diversity $V_{\mathcal{D}}$ , the more challenging to learn a model with good generalization. Here we are particularly interested in the factor $\mathbb{E}_{\mathcal{D}\sim \mathcal{S}}[\| y - y^{*}\|_{2}]$ which reveals an important property: the higher accuracy of the training label $y$ to the ground truth label $y^{*}$ , the smaller generalization error. Moreover, Theorem 1 proves that there exists a contrastive classification problem such that the lower bound of generalization error depends on $\mathbb{E}_{\mathcal{D}\sim \mathcal{S}}[\| y - y^{*}\|_{2}]$ . So the upper bound of generalization error is tight in terms of $\mathbb{E}_{\mathcal{D}\sim \mathcal{S}}[\| y - y^{*}\|_{2}]$ . Thus, to better capture the underlying semantic similarity between query $x_{i}$ and samples in dictionary $B_{i}$ to bring semantically similar samples together and better solve downstream tasks, one should provide accurate label $y_{i}$ to the soft true label $y_{i}^{*}$ . In the following, we introduce our solution to estimate more accurate and informative soft labels for contrastive learning. + +# 3 Self-Labeling Refinement for Contrastive Learning + +Our Self-1AbeliNg rEfinement (SANE) approach for contrastive learning contains (i) Self-Labeling Refinery (SLR for short) and (ii) Momentum Mixup (MM) which complementally refine noisy labels + +respectively from label estimation and positive pair construction. SLR uses current training model and data to estimate more accurate and informative soft labels, while MM increases similarity between virtual query and its positive, and thus improves label accuracy. + +We begin by slightly modifying the instance discrimination task in MoCo. Specifically, for the query $\boldsymbol{x}_i$ in the current minibatch $\{(x_i, \widetilde{x}_i)\}_{i=1}^s$ , we maximize its similarity to its positive sample $\widetilde{x}_i$ in the key set $\bar{B} = \{\widetilde{x}_i\}_{i=1}^s \cup \{b_i\}_{i=1}^b$ and minimize its similarity to the remaining samples in $\bar{B}$ : + +$$ +\mathcal {L} _ {\mathrm {c}} \left(\boldsymbol {w}, \left\{\left(\boldsymbol {x} _ {i}, \boldsymbol {y} _ {i}\right) \right\}\right) = - \frac {1}{s} \sum_ {i = 1} ^ {s} \sum_ {k = 1} ^ {s + b} \boldsymbol {y} _ {i k} \log \left(\frac {\sigma \left(\boldsymbol {x} _ {i} , \bar {\boldsymbol {b}} _ {k}\right)}{\sum_ {l = 1} ^ {s + b} \sigma \left(\boldsymbol {x} _ {i} , \bar {\boldsymbol {b}} _ {l}\right)}\right), \tag {4} +$$ + +where $\bar{\pmb{b}}_k$ is the $k$ -th sample in $\bar{B}$ , and $\pmb{y}_i$ is the one-hot label of query $\pmb{x}_i$ whose $i$ -th entry $\pmb{y}_{ii}$ is one. In this way, the labels of current queries $\{\pmb{x}_i\}_{i=1}^s$ are defined on a shared set $\bar{B}$ , and can be linearly combined which is key for SLR & MM. Next, we aim to improve the quality of label $\pmb{y}_i$ in (4) below. + +# 3.1 Self-Labeling Refinery + +Methodology. As analyzed in Sec. 1 and 2, the one-hot labels in Eqn. (4) could not well reveal the semantic similarity between $\pmb{x}_i$ and the instance keys in the set $\bar{B}$ , and thus impairs good representation learning. To alleviate this issue, we introduce Self-Labeling Refinery (SLR) which employs network and data themselves to generate more accurate and informative labels, and improves the performance of contrastive learning. Specifically, to refine the one-hot label $y_i$ of query $\pmb{x}_i$ , SLR uses its positive instance $\widetilde{\pmb{x}}_i$ to estimate the underlying semantic similarity between $\pmb{x}_i$ and instances in $\bar{B} = \{\widetilde{\pmb{x}}_i\}_{i=1}^s \cup \{\pmb{b}_i\}_{i=1}^b$ , since $\pmb{x}_i$ and $\widetilde{\pmb{x}}_i$ come from the same image and should have close semantic similarity with instances in $\bar{B}$ . Let $\bar{b}_k$ be the $k$ -th sample in $\bar{B}$ . Then at the $t$ -th iteration, SLR first estimates the instance-class probability $p_i^t \in \mathbb{R}^{s + b}$ of $\pmb{x}_i$ on the set $\bar{B}$ whose $k$ -th entry is defined as + +$$ +\boldsymbol {p} _ {i k} ^ {t} = \frac {\sigma^ {1 / \tau^ {\prime}} (\widetilde {\boldsymbol {x}} _ {i} , \bar {\boldsymbol {b}} _ {k})}{\sum_ {l = 1} ^ {s + b} \sigma^ {1 / \tau^ {\prime}} (\widetilde {\boldsymbol {x}} _ {i} , \bar {\boldsymbol {b}} _ {l})}, \quad (\tau^ {\prime} \in (0, 1 ]). +$$ + +The constant $\tau'$ sharpens $p_i^t$ and removes some possible small noise, since smooth labels cannot well distill their knowledge to a network [31]. Then SLR uses $p_i^t$ to approximate the semantic similarity between $x_i$ and the instances in $\bar{B}$ and employs it as the soft label of $x_i$ for contrastive learning. + +However, since $\widetilde{\pmb{x}}_i$ is highly similar to itself, $p_{ii}^{t}$ could be much larger than others and conceals the similarity of other semantically similar instances in $\bar{B}$ . To alleviate this artificial effect, SLR removes $\widetilde{\pmb{x}}_i$ from the set $\bar{B}$ and re-estimates the similarity between $\pmb{x}_i$ and the remaining instances in $\bar{B}$ : + +$$ +\boldsymbol {q} _ {i k} ^ {t} = \frac {\sigma^ {1 / \tau^ {\prime}} (\widetilde {\boldsymbol {x}} _ {i} , \bar {\boldsymbol {b}} _ {k})}{\sum_ {l = 1 , l \neq i} ^ {s + b} \sigma^ {1 / \tau^ {\prime}} (\widetilde {\boldsymbol {x}} _ {i} , \bar {\boldsymbol {b}} _ {l})}, \quad \boldsymbol {q} _ {i i} ^ {t} = 0. +$$ + +Finally, SLR linearly combines the one-hot label $\pmb{y}_i$ and two label estimations, i.e. $\pmb{p}_i$ and $\pmb{q}_i$ , to obtain more accurate, robust and informative label $\bar{\pmb{y}}_i^t$ of $\pmb{x}_i$ at the $t$ -th iteration: + +$$ +\bar {\boldsymbol {y}} _ {i} ^ {t} = \left(1 - \alpha_ {t} - \beta_ {t}\right) \boldsymbol {y} _ {i} + \alpha_ {t} \boldsymbol {p} _ {i} ^ {t} + \beta_ {t} \boldsymbol {q} _ {i} ^ {t}, \tag {5} +$$ + +where $\alpha_{t}$ and $\beta_{t}$ are two constants. In our experiments, we set $\alpha_{t} = \mu \max_{k}p_{ik}^{t} / z$ and $\beta_{t} = \mu \max_{k}q_{ik}^{t} / z$ , where $z = 1 + \mu \max_{k}p_{ik}^{t} + \mu \max_{k}q_{ik}^{t}$ , the constants 1, $\max_{k}p_{ik}^{t}$ and $\max_{k}q_{ik}^{t}$ respectively denote the largest confidences of labels $y_{i}, p_{i}^{t}$ and $q_{i}^{t}$ on a certain class. Here hyperparameter $\mu$ controls the prior confidence of $p^t$ and $q^t$ . So SLR only has two parameters $\tau'$ and $\mu$ to tune. + +The Benefit Analysis of Label Refinery. Now we analyze the performance of our SLR on label-corrupted data. We first describe the dataset. Let $\{c_i\}_{i=1}^K \subset \mathbb{R}^d$ be $K$ vanilla samples belonging to $\bar{K} \leq K$ semantic classes, and $\{(x_i, y_i)\}_{i=1}^n \in \mathbb{R}^d \times \mathbb{R}$ be the random crops of $\{c_i\}_{i=1}^K$ . Since in practice, one often cares more the semantic class prediction performance of a model which often directly reflects the performance on the downstream tasks, we assume that the labels $\{y_i\}_{i=1}^n$ denote corrupted semantic-class labels. Accordingly, we will analyze whether SLR can refine the corrupted labels $\{y_i\}_{i=1}^n$ and whether it helps a model learn the essential semantic-class knowledge of $\{x_i\}_{i=1}^n$ . Finally, while allowing for multiple classes, we assume the labels are scalars and take values in $[-1, 1]$ interval for simplicity. We formally define our label-corrupted dataset below. + +Definition 1 $((\rho, \varepsilon, \delta)$ -corrupted dataset). Let $\{(\pmb{x}_i, \pmb{y}_i^*)\}_{i=1}^n$ denote the pairs of crops (augmentations) and ground-truth semantic label, where crop $\pmb{x}_i$ generated from the $t$ -th sample $\pmb{c}_t$ obeys $\| \pmb{x}_i - \pmb{c}_t \|_2 \leq \varepsilon$ with a constant $\varepsilon$ , and $\pmb{y}_i^* \in \{\gamma_t\}_{t=1}^K$ of $\pmb{x}_i$ is the label of $\pmb{c}_t$ . Moreover, samples and the crops are normalized, i.e. $\| \pmb{c}_i \|_2 = \| \pmb{x}_k \|_2 = 1 (\forall i, k)$ . Each $\pmb{c}_i$ has $n_i$ crops, where $c_l \frac{n}{K} \leq n_i \leq c_u \frac{n}{K}$ with two constants $c_l$ and $c_u$ . Besides, different classes are separated with a label separation $\delta$ : + +$$ +\left| \gamma_ {i} - \gamma_ {k} \right| \geq \delta , \quad \left\| \boldsymbol {c} _ {i} - \boldsymbol {c} _ {k} \right\| _ {2} \geq 2 \varepsilon , (\forall i \neq k). +$$ + +A $(\rho, \varepsilon, \delta)$ -corrupted dataset $\{(\pmb{x}_i, \pmb{y}_i)\}_{i=1}^n$ obeys the above conditions but with corrupted label $\{\pmb{y}_i\}_{i=1}^n$ . Specifically, for each sample $\pmb{c}_i$ , at most $\rho n_i$ augmentations are assigned to wrong labels in $\{\gamma_i\}_{i=1}^K$ . + +This data model is rich enough to model realistic data, since different clusters can be assigned to the same label. This definition allows for a fraction $\rho$ of corruptions in each cluster, and can well characterize the realistic data. + +Then we study a network of one hidden layer as an example to investigate the label refining performance of our SLR. The network parameterized by $\mathbf{W} \in \mathbb{R}^{k \times d}$ and $\mathbf{v} \in \mathbb{R}^k$ is defined as + +$$ +\boldsymbol {x} \in \mathbb {R} ^ {d} \mapsto f (\boldsymbol {W}, \boldsymbol {x}) = \boldsymbol {v} ^ {\top} \phi (\boldsymbol {W} \boldsymbol {x}), \tag {6} +$$ + +where $\phi$ is an activation function. Following [32-34] which analyze convergence of networks or robust learning of network, we fix $\pmb{v}$ to be a unit vector where half the entries are $1 / \sqrt{k}$ and other half are $-1 / \sqrt{k}$ to simplify exposition. So we only optimize over $\mathbf{W}$ that contains most network parameters and will be shown to be sufficient for label refinery. Then given a $(\rho ,\varepsilon ,\delta)$ -corrupted dataset $\{(x_i,y_i)\}_{i = 1}^n$ , at the $t$ -iteration we train the network via minimizing the quadratic loss: + +$$ +\mathcal {L} _ {t} (\boldsymbol {W}) = \frac {1}{2} \sum_ {i = 1} ^ {n} \left(\bar {\boldsymbol {y}} _ {i} ^ {t} - f (\boldsymbol {W}, \boldsymbol {x} _ {i})\right) ^ {2} = \frac {1}{2} \| \bar {\boldsymbol {y}} ^ {t} - f (\boldsymbol {W}, \boldsymbol {X}) \| _ {2} ^ {2}. +$$ + +Here the label $\bar{\pmb{y}}_i^t$ of sample $\pmb{x}_i$ is estimated by Eqn. (5) in which $\pmb{p}_i^t = f(\pmb{W}_t, \widetilde{\pmb{x}}_i)$ denotes predicted label by using the positive $\widetilde{\pmb{x}}_i$ of $\pmb{x}_i$ , i.e. $\| \widetilde{\pmb{x}}_i - \pmb{c}_l \|_2 \leq \varepsilon$ if $\pmb{x}_i$ is augmented from vanilla sample $\pmb{c}_l$ . We set $\beta_t = 0$ and $\tau' = 1$ for simplicity, as (i) performing nonlinear mapping on network output greatly increases analysis difficulty; (ii) our refinery (5) is still provably sufficient to refine labels when $\beta_t = 0$ and $\tau' = 1$ . Then we update $\pmb{W}$ via gradient descent algorithm with a learning rate $\eta$ : + +$$ +\boldsymbol {W} _ {t + 1} = \boldsymbol {W} _ {t} - \eta \nabla \mathcal {L} _ {t} (\boldsymbol {W} _ {t}). \tag {7} +$$ + +Following most works on network convergence analysis [32-40], we use gradient descent and quadratic loss, since (i) gradient descent is expectation version of stochastic one and often reveals similar convergence behaviors; (ii) one can expect similar results for other losses, e.g. cross entropy, but quadratic loss gives simpler gradient computation. For analysis, we impose mild assumptions on network (6) and our SLR, which are widely used in network analysis [41-46]. + +Assumption 1. For network (6), assume $\phi$ and its first- and second-order derivatives obey $|\phi(0)|, |\phi'(z)|, |\phi''(z)| \leq \Gamma$ for $\forall z$ and some $\Gamma \geq 1$ , the entries of initialization $\mathbf{W}_0$ obey i.i.d. $\mathcal{N}(0,1)$ . + +Assumption 2. Define network covariance matrix $\pmb{\Sigma}(\pmb{C}) = (\pmb{C}\pmb{C}^{\top})\odot \mathbb{E}_{\pmb{u}}[\phi^{\prime}(\pmb{C}\pmb{u})\phi^{\prime}(\pmb{C}\pmb{u})^{\top}]$ where $\pmb {C} = [c_1\dots c_K]^\top$ $\pmb {u}\sim \mathcal{N}(\pmb {0},\pmb {I})$ $\odot$ is the elementwise product. Let $\lambda (C) > 0$ be the minimum eigenvalue of $\pmb {\Sigma}(\pmb {C})$ . For label refinery, assume $3\sqrt{n}\sum_{t = 0}^{t_0 - 1}|\alpha_t - \alpha_{t + 1}|\leq \psi_1\| f(\pmb {W}_0,\pmb {X}) - \pmb {y}^*\| _2$ and $3\sqrt{n}\sum_{t = 0}^{t_0 - 1}\left(1 - \frac{\eta\alpha^2}{4}\right)^{t_0 - t}|\alpha_t - \alpha_{t + 1}|\leq \psi_2\| f(\pmb {W}_0,\pmb {X}) - \pmb {y}^*\| _2^2$ , where $t_0 = \frac{c_1K}{\eta n\lambda(C)}\log \bigl (\frac{\Gamma\sqrt{n\log K}}{(1 - \alpha_{max})\rho}\bigr)$ with three constants $\psi_{1},\psi_{2}$ and $c_{1}$ . Here $\alpha_{max}$ is defined as $\alpha_{max} = \max_{1\leq t\leq t_0}\alpha_t$ + +Assumption 1 is mild, as most differential activation functions, e.g. softplus and sigmoid, satisfy it, and the Gaussian initialization is used in practice. We assume Gaussian variance to be one for notation simplicity, but our technique is applicable to any constant variance. Assumption 2 requires that the discrepancy between $\alpha_{t}$ and $\alpha_{t + 1}$ until some iteration number $t_0$ are bounded, which holds by setting proper $\alpha_{t}$ . Here we assume $\beta_{t} = 0$ and $\tau^{\prime} = 1$ for simplicity, as (i) performing nonlinear mapping on network output greatly increases analysis difficulty; (ii) we will show that even though $\beta_{t} = 0$ and $\tau^{\prime} = 1$ , our refinery (5) is still provably sufficient to refine labels. For $\lambda (C)$ , many works [34, 41-44] empirically and theoretically show $\lambda (C) > 0$ . Based on these assumptions, we state our results in Theorem 2 with constants $c_{1}\sim c_{6}$ . + +Theorem 2. Assume $\{(\pmb{x}_i,\pmb{y}_i)\}_{i = 1}^n$ is a $(\rho ,\varepsilon ,\delta)$ -corrupted dataset with noiseless labels $\{\pmb{y}_i^*\}_{i = 1}^n$ . Let $\xi = \log \left(\frac{\Gamma\sqrt{n\log K}}{\rho}\right)$ . Suppose $\varepsilon$ and the number $k$ of hidden nodes satisfy $\varepsilon \leq c_2\min (\frac{\lambda(C)}{K\Gamma^2\xi^6},\frac{\rho}{\alpha_{max}})$ , $k\geq \frac{c_3K^2\Gamma^{10}\xi^6\|C\|^4}{\alpha_{max}^2\lambda(C)^4}$ . Let $\psi^{\prime} = 1 + \frac{\psi_{1}}{2} +\sqrt{\psi_{2}}$ . If step size $\eta \leq \frac{K}{2c_{up}n\Gamma^2\|C\|^2}$ , with probability $1 - 3 / K^{100} - K\exp (-100d)$ , after $t\geq t_0 = \frac{c_4K}{\eta n\lambda(C)}\log \left(\frac{\Gamma\sqrt{n\log K}}{(1 - \alpha_{max})\rho}\right)$ iterations, the gradient descent (7) satisfies: + +(1) By defining $\zeta = 4\rho +c_5\varepsilon \psi 'K\Gamma^3\xi \sqrt{\log K} /\lambda (C)$ and $\pmb{y}^{*} = [\pmb{y}_{1}^{*},\dots ,\pmb{y}_{n}^{*}]$ , the discrepancy between the label $\bar{\pmb{y}}^t$ estimated by our SLR (5) and the true label $\pmb{y}^{*}$ of the augmentation data $\{\pmb {x}_i\}_{i = 1}^n$ is bounded: + +$$ +\frac {1}{\sqrt {n}} \left\| \overline {{\boldsymbol {y}}} ^ {t} - \boldsymbol {y} ^ {*} \right\| _ {2} \leq \frac {1 - \alpha_ {t}}{\sqrt {n}} \left\| \boldsymbol {y} - \boldsymbol {y} ^ {*} \right\| _ {2} + \alpha_ {t} \zeta . +$$ + +where $\bar{\pmb{y}}^t = [\bar{\pmb{y}}_1^t,\dots ,\bar{\pmb{y}}_n^t ]$ . Moreover, if $\rho \leq \frac{\delta}{32}$ $\varepsilon \leq c_6\delta \min \left(\frac{\lambda(C)^2}{\psi'\Gamma^5K^2\xi^3},\frac{1}{\Gamma\sqrt{d}}\right)$ $1 - \frac{3}{4}\delta \leq \alpha_{t}$ , the estimated label $\bar{\pmb{y}}^t$ predicts true label $\pmb {y}_i^*$ of any crop $\pmb{x}_i$ .. + +$$ +\gamma_ {k ^ {*}} = \boldsymbol {y} _ {i} ^ {*} \quad w i t h \quad k ^ {*} = \operatorname * {a r g m i n} _ {1 \leq k \leq \bar {K}} | \bar {\boldsymbol {y}} _ {i} ^ {t} - \gamma_ {k} |. +$$ + +(2) By using the refined label $\bar{\mathbf{y}}^t$ in (5) to train network and letting $f(\mathbf{W}_t, \mathbf{X}) = [f(\mathbf{W}_t, \mathbf{x}_1), \dots, f(\mathbf{W}_t, \mathbf{x}_n)]$ , the error of network prediction on $\{\mathbf{x}_i\}_{i=1}^n$ is upper bounded + +$$ +\frac {1}{\sqrt {n}} \| f (\boldsymbol {W} _ {t}, \boldsymbol {X}) - \boldsymbol {y} ^ {*} \| _ {2} \leq \zeta . +$$ + +If assumptions on $\rho$ and $\varepsilon$ in (1) hold, for vanilla sample $c_{k} (\forall k = 1 \cdots K)$ , network $f(\mathbf{W}_{t}, \cdot)$ predicts the true semantic label $\gamma_{k}$ of its any augmentation $\mathbf{x}$ that satisfies $\| \mathbf{x} - c_{k} \|_{2} \leq \varepsilon$ : + +$$ +\gamma_ {k ^ {*}} = \gamma_ {k} \quad w i t h \quad k ^ {*} = \operatorname * {a r g m i n} _ {1 \leq i \leq K} | f (\boldsymbol {W} _ {t}, \boldsymbol {x}) - \gamma_ {i} |. +$$ + +See its proof roadmap and proof in Appendix C.2. The first result in Theorem 2 shows that after training iterations $t_0$ , the discrepancy between the label $\bar{\boldsymbol{y}}^t$ estimated by our label refinery (5), i.e. SLR, and ground truth label $\boldsymbol{y}^*$ of cropped training data $\{\boldsymbol{x}_i\}_{i=1}^n$ is upper bounded by $\mathcal{O}\big(\| \boldsymbol{y} - \boldsymbol{y}^*\|_2 + \zeta\big)$ . Both factors $\| \boldsymbol{y} - \boldsymbol{y}^*\|_2$ and $\rho$ in the factor $\zeta$ reflect the label error of the provided corrupted label $\boldsymbol{y}$ . Another important factor in $\zeta$ is the smallest eigenvalue $\lambda(C)$ of network covariance matrix $\Sigma(C)$ in Assumption 2. Typically, the performance of a network heavily relies on the data diversity even without label corruption. For instance, if two samples are nearly the same but have different labels, the learning of a network is difficult. $\lambda(C)$ can quantify this data diversity, as one can think of $\lambda(C)$ as a condition number associated with the network which measures the diversity of the vanilla samples $\{c_i\}_{i=1}^n$ . Intuitively, if there are two similar vanilla samples, $\Sigma(C)$ is trivially rank deficient and has small minimum eigenvalue, meaning more challenges to distinguish the augmentations $x$ generated from $c_i$ . Moreover, when the label corruption ratio $\rho$ and the augmentation distance $\varepsilon$ are small, the label $\bar{\boldsymbol{y}}_i^t$ estimated by our SLR can predict the true semantic label $\boldsymbol{y}_i^*$ for any crop sample $x_i$ , and thus can supervises a network to learn the essential semantic-class knowledges from $\{x_i\}_{i=1}^n$ . + +The second result in Theorem 2 shows that by using the refined label $\bar{\pmb{y}}^t$ in our SLR (5) to train network $f(\pmb {W},\cdot)$ , the error of network prediction on augmentations $\{\pmb {x}_i\}_{i = 1}^n$ can be upper bounded by $\zeta$ . Similarly, the factor $\rho$ and $\lambda (\pmb {C})$ in $\zeta$ respectively reflect the initial label error and the data diversity, which both reflect the learning difficulty for a model on the augmentation data $\{(x_i,y_i)\}_{i = 1}^n$ . More importantly, our results also guarantee the test performance of the trained network $f(\pmb {W}_t,\cdot)$ . Specifically, when the label corruption ratio $\rho$ and sample augmentation distance $\varepsilon$ are small, for any vanilla sample $c_{k}$ $(\forall k = 1\dots K)$ , the network $f(\pmb {W}_t,\cdot)$ trained by our SLR can exactly predict the true semantic label $\gamma_{k}$ of its any augmentation $\pmb{x}$ (i.e. $\| \pmb {x} - \pmb {c}_k\| _2\leq \varepsilon$ ). These results accord with Theorem 1 that shows the more accurate of training labels, the better generalization of the trained network. These results show the effectiveness of the refined labels by our method. + +# 3.2 Momentum Mixup + +Now we propose momentum mixup (MM) to further reduce the possible label noise in realistic data and increase the data diversity as well. Similar to vanilla mixup [47], we construct virtual instance as + +$$ +\boldsymbol {x} _ {i} ^ {\prime} = \theta \boldsymbol {x} _ {i} + (1 - \theta) \widetilde {\boldsymbol {x}} _ {k}, \quad \boldsymbol {y} _ {i} ^ {\prime} = \theta \bar {\boldsymbol {y}} _ {i} + (1 - \theta) \bar {\boldsymbol {y}} _ {k}, \quad \theta \sim \operatorname {B e t a} (\kappa , \kappa) \in [ 0, 1 ], \tag {8} +$$ + +where $\widetilde{\boldsymbol{x}}_k$ is randomly sampled from the key set $\{\widetilde{\boldsymbol{x}}_i\}_{i=1}^s$ , $\widetilde{\boldsymbol{y}}_i$ denotes the refined label by Eqn. (5), $\mathrm{Beta}(\kappa, \kappa)$ is a beta distribution. Here $\boldsymbol{x}_i$ and $\widetilde{\boldsymbol{x}}_i$ share the same label $\widetilde{\boldsymbol{y}}_i$ on the set $\bar{B} = \{\widetilde{\boldsymbol{x}}_i\}_{i=1}^s \cup \{\boldsymbol{b}_i\}_{i=1}^b$ , as they come from the same instance. We call the mixup (8) as "momentum mixup", since the sample $\widetilde{\boldsymbol{x}}_k$ is fed into the momentum-updated network $g_{\xi}$ , and plays a contrastive key for instance discrimination. So MM differs from the vanilla mixup used in [27, 28] where $\widetilde{\boldsymbol{x}}_k$ is replaced with $\boldsymbol{x}_k$ and both are fed into online network $f_w$ , and enjoys the following advantages. Firstly, MM can improve the accuracy of the label $y_i'$ compared with vanilla mixup. For explanation, assume $\widetilde{\boldsymbol{y}}_i$ in (8) is one-hot label. Then $\boldsymbol{x}_i'$ has two positive keys $\widetilde{\boldsymbol{x}}_i$ and $\widetilde{\boldsymbol{x}}_k$ in $\bar{B}$ decided by its label $y_i'$ . Accordingly, the component $\widetilde{\boldsymbol{x}}_k$ in $x_i' = \theta x_i + (1 - \theta) \widetilde{\boldsymbol{x}}_k$ directly increases the similarity between the query $x_i'$ and its positive key $\widetilde{\boldsymbol{x}}_k$ in $\bar{B}$ . So the label weight $(1 - \theta)$ of label $y_i'$ on the key $\widetilde{\boldsymbol{x}}_k$ to bring $x_i'$ and $\widetilde{\boldsymbol{x}}_k$ together is relatively accurate, as $x_i'$ really contains the semantic information of $\widetilde{\boldsymbol{x}}_k$ . Meanwhile, the sum of label weights in $y_i'$ on remaining instance in $\bar{B} \setminus \widetilde{\boldsymbol{x}}_k$ is scaled by $\theta$ , which also scales the possible label noise on instances in $\bar{B} \setminus \widetilde{\boldsymbol{x}}_k$ smaller due to $\theta < 1$ . By comparison, for vanilla mixup, the label weight $(1 - \theta)$ of label $y_i'$ on the key $\widetilde{\boldsymbol{x}}_i$ does not improve label accuracy. It is because the positive pair $x_k$ and $\widetilde{\boldsymbol{x}}_k$ are obtained via random augmentation, e.g. crop, and may not be semantically similar, meaning that the component $x_k$ in $x_i'$ could not increase similarity with $\widetilde{\boldsymbol{x}}_k$ . So its label weight $(1 - \theta)$ to push $x_i'$ close to the key $\widetilde{\boldsymbol{x}}_k$ is not as accurate as the one in MM. Another advantage of MM is that it allows us to use strong augmentation. As observed in [12], directly using strong augmentation in contrastive learning, e.g. MoCo, leads to performance degradation, since the instance obtained by strong augmentation often heavily differs from the one with weak augmentation. As aforementioned, the component $\widetilde{\boldsymbol{x}}_k$ in $x_i' = \theta x_i + (1 - \theta) \widetilde{\boldsymbol{x}}_k$ increases the similarity between the query $x_i'$ and the key $\widetilde{\boldsymbol{x}}_k$ in $\bar{B}$ , even though $(x_i, \widetilde{x}_i)$ is obtained via strong augmentation. So MM could reduce the matching difficulty between positive instances. + +With all the components in place, we are ready to define our proposed SANE model as follows: + +$$ +\mathcal {L} (\boldsymbol {w}) = (1 - \lambda) \mathcal {L} _ {\mathrm {c}} \left(\boldsymbol {w}, \left\{\left(\boldsymbol {x} _ {i}, \boldsymbol {y} _ {i}\right) \right\}\right) + \lambda \mathcal {L} _ {\mathrm {c}} \left(\boldsymbol {w}, \left\{\left(\boldsymbol {x} _ {i} ^ {\prime}, \boldsymbol {y} _ {i} ^ {\prime}\right) \right\}\right), \tag {9} +$$ + +where $\mathcal{L}_{\mathrm{c}}\big(\pmb {w},\{(x_i,\pmb {y}_i)\} \big)$ defined in Eqn. (4) denotes the vanilla contrastive loss with one-hot label $y_{i}$ , $\mathcal{L}_{\mathrm{c}}\big(\pmb {w},\{(\pmb{x}_i',\pmb{y}_i')\}\big)$ denotes the momentum mixup loss with label $\pmb{y}_i^{\prime}$ estimated by our self-labeling refinery (5), and $\lambda$ is a constant. Experimental results in Sec. 4 show the effectiveness of both loss terms. See algorithm details in Algorithm 1 of Appendix A. + +Limitation Discussion. SANE follows MoCo-alike framework and hopes to obtain a more accurate soft label of a query over its positive and negatives for instance discrimination. So one limitation of SANE is that it does not apply to BYOL-alike methods [6] that only pulls positive pair together and does not require any labels. However, momentum mixup in SANE which increases the similarity of positive pair may also benefit BYOL, which is left as our future work to thoroughly test. + +Societal Impact Discussion. As an unsupervised learning method, SANE could benefit many applications of societal interest where only low-resource labeled data are available, e.g. medical data [48], as SANE can use a mass of unlabeled data for pretraining and few labeled data for fine-tuning. But same to standard contrastive learning, SANE may suffer from learning bias caused by the potential data bias, and may provide bias or worse performance on smaller classes or groups. + +# 4 Experiments + +Our Pytorch code is available at https://openreview.net/forum?id=P84bifNCpFQ&referrer=%5BAuthor%20Console%5D. + +# 4.1 Evaluation Results on CIFAR10 and ImageNet + +Settings. We use ResNet50 [49] with a 3-layered MLP head for CIFAR10 [50] and ImageNet [21]. We first pretrain SANE, and then train a linear classifier on top of 2048-dimensional frozen features in ResNet50. With dictionary size 4, 096, we pretrain 2,000 epochs on CIFAR10 instead of 4,000 epochs of MoCo, BYOL, and i-Mix in [28]. Dictionary size on ImageNet is 65,536. For linear classifier, we train 200/100 epochs on CIFAR10/ImageNet. See all optimizer settings in + +Table 1: Classification accuracy $(\%)$ + +
CIFAR10 datasetKNNlinear evaluation
MoCo v2 [2]92.593.9
SimCLR [3, 4]94.0
BYOL [6]92.493.9
DACL [29]94.4
CLSA (strong) [12]93.494.9
i-Mix (+MoCo) [28]95.9
SANE95.296.1
SANE (strong)95.596.5
Supervised [28]95.5
+ +Table 2: Top-1 accuracy (%) under linear evaluation on ImageNet. + +
augmentationmethod (200 epochs)Top 1| method (≥800 epochs)Top 1
weakMoCo [1]60.8PIRL-800epochs [51]63.6
SimCLR [4]61.9CMC [52]66.2
CPC v2 [53]63.8SimCLR-800epochs [4]70.0
PCL [7]65.9MoCo v2-800epochs [2]71.1
MoCo v2 [2]67.5BYOL-1000epochs [6]74.3
CO2 [20]68.0SimSiam-800epochs [54]71.3
MixCo [27]68.4i-Mix-800epochs [28]71.3
SWAV-Multi [5]72.7SWAV-Multi-800epochs [5]75.3
SANE-Single70.6SANE-Single-800epochs73.0
SANE-Multi73.5SANE-Multi-800epochs75.7
strongCLSA-Single [12]69.4CLSA-Single-800epochs [12]72.2
CLSA-Multi [12]73.3CLSA-Multi-800epochs [12]76.2
SANE-Single70.1SANE-Single-800epochs73.5
SANE-Multi73.7SANE-Multi-800epochs76.4
strong + JigSawInfoMin Aug [55]70.1InfoMin Aug-800epochs [55]73.0
othersInstDisc [56]54.0BigBiGAN [57]56.6
LocalAgg [58]58.8SeLa-400epochs [59]61.5
Supervised [4]76.5Supervised [4]76.5
+ +Appendix A. We use standard data augmentations in [1] for + +pretraining and test unless otherwise stated. E.g., for test, we + +perform normalization on CIFAR10, and use center crop and normalization on ImageNet. For SANE, we set $\tau = 0.2$ , $\tau' = 0.8$ , $\kappa = 2$ in $\mathrm{Beta}(\kappa, \kappa)$ on CIFAR10, and $\tau = 0.2$ , $\tau' = 1$ , $\kappa = 0.1$ on ImageNet. For confidence $\mu$ , we increase it as $\mu_t = m_2 - (m_2 - m_1)(\cos(\pi t / T) + 1) / 2$ with current iteration $t$ and total training iteration $T$ . We set $m_1 = 0$ , $m_2 = 1$ on CIFAR10, and $m_1 = 0.5$ , $m_2 = 10$ on ImageNet. For KNN on CIFAR10, its neighborhood number is 50 and its temperature is 0.05. + +For CIFAR10, to fairly compare with [28], we crop each image into two views to construct the loss (9). For ImageNet, we follow CLSA [12] and train SANE in two settings. SANE-Single uses a single crop in momentum mixup loss $\mathcal{L}_{\mathrm{c}}\big(\boldsymbol {w},\{\langle \boldsymbol{x}_i',\boldsymbol{y}_i'\rangle \}\big)$ in (9) that crops each image to a smaller size of $96\times 96$ without much extra computational cost to process these small images. SANE-Multi crop each image into five sizes $224\times 224$ $192\times 192$ $160\times 160$ $128\times 128$ ,and $96\times 96$ and averages their momentum mixup losses. This ensures a fair comparison with CLSA and SwAV. Moreover, we use strong augmentation strategy in CLSA. Specifically, for the above small image, we randomly select an operation from 14 augmentations used in CLSA, and apply it to the image with a probability of 0.5, which is repeated 5 times. We use "(strong)" to mark whether we use strong augmentations on the small images in momentum mixup loss. Thus, SANE has almost the same training cost with CLSA, i.e. about 75 (198) hours with 8 GPUs, 200 epochs, batch size of 256 for SANE-Single (-Multi). For vanilla contrastive loss on ImageNet, we always use weak augmentations. See more details of the augmentation, loss construction, and pretraining cost on CIFAR10 and ImageNet in Appendix A. + +Results. Table 1 shows that with weak or strong augmentations, SANE always surpasses the baselines on CIFAR10. Moreover, SANE with strong (weak) augmentation improves supervised baseline by $1.0\%$ $(0.6\%)$ . + +Table 2 also shows that for ImageNet under weak augmentation setting, for 200 (800) epochs SANE-Multi respectively brings $0.8\%$ $(0.6\%)$ improvements over SwAV; with 200 (800) epochs, SANE-Single also beats the runner-up MixCo (i-Mix and SimSiam). Note, BYOL outperforms SANE-Single but was trained 1,000 epochs. With strong augmentation, SANE-Single and SANE-Multi also respectively outperform CLSA-Single and CLSA-Multi. Moreover, our self-supervised accuracy $76.4\%$ is very close to the accuracy $76.5\%$ of supervised baseline, and still improves $0.2\%$ over CLEAN-Multi even for this challenging case. These results show the superiority and robustness of SANE, thanks to its self-labeling refinery and momentum mixup which both improve label quality and thus bring semantically similar samples together. + +# 4.2 Transfer Results on Downstream Tasks + +Settings. We evaluate the pretrained SANE model on VOC [61] and COCO [62]. For classification, we train a linear classifier upon ResNet50 100 epochs by SGD. For object detection, we use the same protocol in [1] to fine-tune the pretrained ResNet50 based on detector2 [63] for fairness. On VOC, + +Table 3: Transfer learning results. + +
methodclassificationobject detection
VOC07VOC07+12COCO
AccuracyAP50AP
NPID++ [56]76.679.1
MoCo [1]79.881.5
PIRL [51]81.180.7
BoWNet [60]79.381.3
SimCLR [4]86.4
CO2 [20]85.282.7
i-Mix [28]82.7
MoCo v2 [2]87.182.542.0
SWAV-Multi [5]88.982.642.1
CLSA-Multi(strong)[12]93.683.242.3
SANE-Multi92.982.942.2
SANE-Multi (strong)94.083.442.4
Supervised [12]87.581.340.8
+ +Table 4: Effects of the components in SANE with strong augmentation on CIFAR10. + +
label p in (5)|label q in (5)|momentum mixup|accuracy (%)
93.7
94.6
94.5
94.8
94.9
95.2
95.1
95.9
+ +Table 5: Effects of parameter $\lambda$ in SANE with strong augmentation on CIFAR10. + +
regularization λ00.250.50.751
accuracy (%)94.395.895.995.594.5
+ +Table 6: Effects of various mixups on ImageNet. + +
Accuracy (%)MoCo+mixupMoCo+momentum mixup
CIFAR10 (weak)93.794.2
CIFAR10 (strong)93.394.8
ImageNet (weak)68.4 [27]69.0
+ +we train detection head with VOC07+12 trainval data and tested on VOC07 test data. On COCO, we train the head on train2017 set and evaluate on the val2017. See optimization settings in Appendix A. + +Results. Table 3 shows that SANE consistently outperforms the compared state-of-the-art approaches on both classification and object detection tasks, and enjoys better performance than supervised method pretrained on ImageNet. These results show the superior transferability of SANE behind which the potential reasons have been discussed in Sec. 4.1. + +# 4.3 Ablation Study + +We train SANE 1,000 epochs on CIFAR10 to investigate the effects of each component in SANE using strong augmentation. Table 4 shows the benefits of each component, i.e. the label estimations $p$ and $q$ in self-labeling refinery, and momentum mixup. + +To investigate the robustness of our SANE to the regularization parameter $\lambda$ in (9), we run 2,000 epochs on CIFAR10, and report the performance in Table 5. From the results, one can observe that the stable performance (robustness) of SANE on CIAFR10 when regularization parameter $\lambda$ in (9) varies in a large range, thus testifying the robustness of SANE. + +Then we compare our momentum mixup (8) with vanilla mixup in the works [27, 28]. Specifically, we use one-hot label in MoCo and replace $\widetilde{x}_j$ in (8) with the query $x_{j}$ to obtain "MoCo+ mixup", and ours with one-hot label can be viewed as "MoCo+momentum mixup". Then we train them 1,000 epochs on CIFAR10 with weak/strong augmentation, and 200 epochs on ImageNet with weak augmentations. The results in Table 6 show that with weak augmentation, momentum mixup respectively makes about $1.1\%$ and $0.6\%$ improvements over vanilla mixup in [27, 28] on CIFAR10 and ImageNet. Moreover, momentum mixup using strong augmentation has accuracy $94.8\%$ and improves its weak augmentation version, while vanilla mixup with strong augmentation suffers from performance degradation. It is because as discussed in Sec. 3.2, momentum mixup well reduces the possible label noise, especially for strong augmentations, and can enhance the performance more. + +# 5 Conclusion + +In this work, we prove the benefits of accurate labels to the generalization of contrastive learning. Inspired by this theory, we propose SANE to improve label quality in contrastive learning via self-labeling refinery and momentum mixup. The former uses the positive of a query to generate informative soft labels and combines with vanilla one-hot label to improve label quality. The latter randomly combines queries and positives to make virtual queries more similar to their corresponding positives, improving label accuracy. Experimental results testified the advantages of SANE. + +# Acknowledgements + +The authors sincerely thank the anonymous reviewers for their constructive comments on this work. + +1. Funding. Pan Zhou, Caiming Xiong and Steven HOI are supported by Salesforce, mainly for their GPU resource support. Xiao-Tong Yuan is supported in part by the National Key Research and Development Program of China under Grant No. 2018AAA0100400 and in part by the Natural Science Foundation of China (NSFC) under Grant No.61876090 and No.61936005. + +2. Competing Interests. Pan Zhou, Caiming Xiong and Steven HOI are staffs in Salesforce. XiaoTong Yuan works as a professor in Nanjing University of Information Science & Technology, Nanjing, China. + +# References + +[1] K. He, H. Fan, Y. Wu, S. Xie, and R. Girshick. Momentum contrast for unsupervised visual representation learning. In Proc. IEEE Conf. Computer Vision and Pattern Recognition, pages 9729-9738, 2020. +[2] X. Chen, H. Fan, R. Girshick, and K. He. Improved baselines with momentum contrastive learning. arXiv preprint arXiv:2003.04297, 2020. +[3] T. Chen, S. Kornblith, K. Swersky, M. Norouzi, and G. Hinton. Big self-supervised models are strong semi-supervised learners. In Proc. Conf. Neural Information Processing Systems, 2020. +[4] T. Chen, S. Kornblith, M. Norouzi, and G. Hinton. A simple framework for contrastive learning of visual representations. In Proc. Int'l Conf. Machine Learning, 2020. +[5] M. Caron, I. Misra, J. Mairal, P. Goyal, P. Bojanowski, and A. Joulin. Unsupervised learning of visual features by contrasting cluster assignments. In Proc. Conf. Neural Information Processing Systems, 2020. +[6] J. Grill, F. Strub, F. Altché, C. Tallec, P. Richemond, E. Buchatskaya, C. Doersch, B. Pires, Z. Guo, and M. Azar. Bootstrap your own latent: A new approach to self-supervised learning. In Proc. Conf. Neural Information Processing Systems, 2020. +[7] J. Li, P. Zhou, C. Xiong, R. Socher, and S. CH Hoi. Prototypical contrastive learning of unsupervised representations. In Int'l Conf. Learning Representations, 2021. +[8] M. Noroozi and P. Favaro. Unsupervised learning of visual representations by solving jigsaw puzzles. In Proc. European Conf. Computer Vision, pages 69-84. Springer, 2016. +[9] C. Doersch and A. Zisserman. Multi-task self-supervised visual learning. In IEEE International Conference on Computer Vision, pages 2051–2060, 2017. +[10] N. Komodakis and S. Gidaris. Unsupervised representation learning by predicting image rotations. 2018. +[11] R. Zhang, P. Isola, and A. Efros. Colorful image colorization. In Proc. European Conf. Computer Vision, pages 649-666. Springer, 2016. +[12] X. Wang and G. Qi. Contrastive learning with stronger augmentations. 2021. +[13] R. Hadsell, S. Chopra, and Y. LeCun. Dimensionality reduction by learning an invariant mapping. In Proc. IEEE Conf. Computer Vision and Pattern Recognition, volume 2, pages 1735-1742. IEEE, 2006. +[14] R. Hjelm, A. Fedorov, S. Lavoie-Marchildon, K. Grewal, P. Bachman, A. Trischler, and Y. Bengio. Learning deep representations by mutual information estimation and maximization. arXiv preprint arXiv:1808.06670, 2018. +[15] A. Oord, Y. Li, and O. Vinyals. Representation learning with contrastive predictive coding. arXiv preprint arXiv:1807.03748, 2018. +[16] P. Bachman, R. Hjelm, and W. Buchwalter. Learning representations by maximizing mutual information across views. In Proc. Conf. Neural Information Processing Systems, pages 15535-15545, 2019. +[17] S. Lin, P. Zhou, Z. Hu, S. Wang, R. Zhao, Y. Zheng, L. Lin, E. Xing, and X. Liang. Prototypical graph contrastive learning. arXiv preprint arXiv:2106.09645, 2021. +[18] S. Arora, H. Khandeparkar, M. Khodak, O. Plevrakis, and N. Saunshi. A theoretical analysis of contrastive unsupervised representation learning. In Proc. Int'l Conf. Machine Learning, pages 5628-5637, 2019. + +[19] C. Chuang, J. Robinson, Y. Lin, A. Torralba, and S. Jegelka. Debiased contrastive learning. In Proc. Conf. Neural Information Processing Systems, volume 33, 2020. +[20] C. Wei, H. Wang, W. Shen, and A. Yuille. Co2: Consistent contrast for unsupervised visual representation learning. arXiv preprint arXiv:2010.02217, 2020. +[21] J. Deng, W. Dong, R. Socher, L. Li, K. Li, and F. Li. Imagenet: A large-scale hierarchical image database. In Proc. IEEE Conf. Computer Vision and Pattern Recognition, pages 248-255. IEEE, 2009. +[22] G. Hinton, O. Vinyals, and J. Dean. Distilling the knowledge in a neural network. In Proc. Conf. Neural Information Processing Systems, 2015. +[23] H. Zhang, S. Lin, W. Liu, P. Zhou, J. Tang, X. Liang, and E. Xing. Iterative graph self-distillation. arXiv preprint arXiv:2010.12609, 2020. +[24] S. Reed, H. Lee, D. Anguelov, C. Szegedy, D. Erhan, and A. Rabinovich. Training deep neural networks on noisy labels with bootstrapping. arXiv preprint arXiv:1412.6596, 2014. +[25] H. Bagherinezhad, M. Horton, M. Rastegari, and A. Farhadi. Label refinery: Improving imagenet classification through label progression. arXiv preprint arXiv:1805.02641, 2018. +[26] D. Berthelot, N. Carlini, I. Goodfellow, N. Papernot, A. Oliver, and C. Raffel. Mixmatch: A holistic approach to semi-supervised learning. In Proc. Conf. Neural Information Processing Systems, pages 5049-5059, 2019. +[27] S. Kim, G. Lee, S. Bae, and S. Yun. Mixco: Mix-up contrastive learning for visual representation. arXiv preprint arXiv:2010.06300, 2020. +[28] K. Lee, Y. Zhu, K. Sohn, C. Li, J. Shin, and H. Lee. i-mix: A strategy for regularizing contrastive representation learning. arXiv preprint arXiv:2010.08887, 2020. +[29] V. Verma, M. Luong, K. Kawaguchi, H. Pham, and Q. Le. Towards domain-agnostic contrastive learning. arXiv preprint arXiv:2011.04419, 2020. +[30] G. Chen, W. Choi, X. Yu, T. Han, and M. Chandraker. Learning efficient object detection models with knowledge distillation. In Proc. Conf. Neural Information Processing Systems, pages 742-751, 2017. +[31] R. Müller, S. Kornblith, and G. Hinton. When does label smoothing help? In Proc. Conf. Neural Information Processing Systems, pages 4694-4703, 2019. +[32] Y. Li and Y. Liang. Learning overparameterized neural networks via stochastic gradient descent on structured data. In Proc. Conf. Neural Information Processing Systems, volume 31, pages 8157-8166, 2018. +[33] S. Oymak and M. Soltanolkotabi. Overparameterized nonlinear learning: Gradient descent takes the shortest path? In Proc. Int'l Conf. Machine Learning, pages 4951-4960, 2019. +[34] M. Li, M. Soltanolkotabi, and S. Oymak. Gradient descent with early stopping is provably robust to label noise for overparameterized neural networks. In Proc. Int'l Conf. Artificial Intelligence and Statistics, pages 4313-4324, 2020. +[35] P. Zhou, J. Feng, C. Ma, C. Xiong, S. Hoi, and W. E. Towards theoretically understanding why sgd generalizes better than adam in deep learning. In Proc. Conf. Neural Information Processing Systems, 2020. +[36] P. Zhou, X. Yuan, H. Xu, S. Yan, and J. Feng. Efficient meta learning via minibatch proximal update. In Proc. Conf. Neural Information Processing Systems, 2019. +[37] P. Zhou, C. Xiong, R. Socher, and S. Hoi. Theory-inspired path-regularized differential network architecture search. In Proc. Conf. Neural Information Processing Systems, 2020. +[38] P. Zhou, Y. Zou, X. Yuan, J. Feng, C. Xiong, and S Hoi. Task similarity aware meta learning: Theory-inspired improvement on maml. In Conf. Uncertainty in Artificial Intelligence, 2021. +[39] P. Zhou, H. Yan, X. Yuan, J. Feng, and S. Yan. Towards understanding why lookahead generalizes better than sgd and beyond. In Proc. Conf. Neural Information Processing Systems, 2021. +[40] Y. Bai, M. Chen, P. Zhou, T. Zhao, J. Lee, S. Kakade, H. Wang, and C. Xiong. How important is the train-validation split in meta-learning? In Proc. Int'l Conf. Machine Learning, 2021. + +[41] Z. Allen-Zhu, Y. Li, and Z. Song. A convergence theory for deep learning via over-parameterization. In Proc. Int'l Conf. Machine Learning, pages 242-252, 2019. +[42] B. Xie, Y. Liang, and L. Song. Diverse neural network learns true target functions. In Proc. Int'l Conf. Artificial Intelligence and Statistics, pages 1216-1224, 2017. +[43] S. Du, J. Lee, H. Li, L. Wang, and X. Zhai. Gradient descent finds global minima of deep neural networks. In Proc. Int'l Conf. Machine Learning, pages 1675-1685, 2019. +[44] S. Du, X. Zhai, B. Poczos, and A. Singh. Gradient descent provably optimizes over-parameterized neural networks. arXiv preprint arXiv:1810.02054, 2018. +[45] P. Zhou and J. Feng. Empirical risk landscape analysis for understanding deep neural networks. In Int'l Conf. Learning Representations, 2018. +[46] P. Zhou and J. Feng. Understanding generalization and optimization performance of deep cnns. In Proc. Int'l Conf. Machine Learning, 2018. +[47] H. Zhang, M. Cisse, Y. Dauphin, and D. Lopez-Paz. mixup: Beyond empirical risk minimization. arXiv preprint arXiv:1710.09412, 2017. +[48] R. Miotto, F. Wang, S. Wang, X. Jiang, and J. Dudley. Deep learning for healthcare: review, opportunities and challenges. Briefings in bioinformatics, 19(6):1236-1246, 2018. +[49] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning for image recognition. In Proc. IEEE Conf. Computer Vision and Pattern Recognition, pages 770-778, 2016. +[50] A. Krizhevsky and G. Hinton. Learning multiple layers of features from tiny images. 2009. +[51] I. Misra and L. Maaten. Self-supervised learning of pretext-invariant representations. In Proc. IEEE Conf. Computer Vision and Pattern Recognition, pages 6707-6717, 2020. +[52] Y. Tian, D. Krishnan, and P. Isola. Contrastive multiview coding. arXiv preprint arXiv:1906.05849, 2019. +[53] O. Henaff, A. Srinivas, J. De Fauw, A. Razavi, C. Doersch, S. Eslami, and A. Oord. Data-efficient image recognition with contrastive predictive coding. arXiv preprint arXiv:1905.09272, 2019. +[54] X. Chen and K. He. Exploring simple siamese representation learning. arXiv preprint arXiv:2011.10566, 2020. +[55] Y. Tian, C. Sun, B. Poole, D. Krishnan, C. Schmid, and P. Isola. What makes for good views for contrastive learning. arXiv preprint arXiv:2005.10243, 2020. +[56] Z. Wu, Y. Xiong, S. Yu, and D. Lin. Unsupervised feature learning via non-parametric instance discrimination. In Proc. IEEE Conf. Computer Vision and Pattern Recognition, pages 3733-3742, 2018. +[57] J. Donahue and K. Simonyan. Large scale adversarial representation learning. In Proc. Conf. Neural Information Processing Systems, pages 10542-10552, 2019. +[58] C. Zhuang, A. Lin, and D. Yamins. Local aggregation for unsupervised learning of visual embeddings. In IEEE International Conference on Computer Vision, pages 6002-6012, 2019. +[59] Y. Asano, C. Rupprecht, and A. Vedaldi. Self-labelling via simultaneous clustering and representation learning. arXiv preprint arXiv:1911.05371, 2019. +[60] S. Gidaris, A. Bursuc, N. Komodakis, P. Pérez, and M. Cord. Learning representations by predicting bags of visual words. In Proc. IEEE Conf. Computer Vision and Pattern Recognition, pages 6928-6938, 2020. +[61] M. Everingham, G. Van, C. Williams, J. Winn, and A. Zisserman. The Pascal visual object classes (voc) challenge. Int'l. J. Computer Vision, 88(2):303-338, 2010. +[62] T. Lin, M. Maire, S. Belongie, J. Hays, P. Perona, D. Ramanan, P. Dollar, and C. Zitnick. Microsoft coco: Common objects in context. In Proc. European Conf. Computer Vision, pages 740-755. Springer, 2014. +[63] Y. Wu, A. Kirillov, F. Massa, W. Lo, and R. Girshick. Detector2, 2019. + +# Checklist + +1. For all authors... + +(a) Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope? [Yes] +(b) Did you describe the limitations of your work? [Yes] We have briefly discussed the main limitations of our work at the end of Sec. 3.2. +(c) Did you discuss any potential negative societal impacts of your work? [Yes] We have briefly discussed the potential negative societal impact of our work at the end of Sec. 3.2. +(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] + +2. If you are including theoretical results... + +(a) Did you state the full set of assumptions of all theoretical results? [Yes] Please see the assumptions made in each theorem and corollary. +(b) Did you include complete proofs of all theoretical results? [Yes] We provide the complete proofs of all theories in Appendix. + +3. If you ran experiments... + +(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] Please see the attached code. We will further clean up models and other code, and release them online. +(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] Please see the detailed experimental settings in Sec. 4 and Appendix A. +(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [No] Since contrastive learning methods are computationally expensive, e.g. 6 days on single GPU for 2000 training epochs on CIFAR10 and 198 hours on 8 GPUs for 200 epochs onImagenet, it is not affordable for us to train several times. But from Tables 4 and 5 which show the ablation study of SANE, one can observe very consistent results. +(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] We use one single V100 GPU for training CIFAR10, and 32 GPUs for 800 training epochs on ImageNet. We mentioned this in Sec. 4.1 and provide more details in Appendix A. + +4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... + +(a) If your work uses existing assets, did you cite the creators? [Yes] Our codes are implemented based on MoCo, CLSA and detectron2. We have also mentioned this at line 375 in the manuscript and Appendix A. +(b) Did you mention the license of the assets? [Yes] The code of MoCo and CLSA satisfies "Creative Commons Attribution-NonCommercial 4.0 International Public License", which is also mentioned in Appendix A. +(c) Did you include any new assets either in the supplemental material or as a URL? [No] In Appendix, we provide more experimental results, more experimental settings, and proofs of all theories. +(d) Did you discuss whether and how consent was obtained from people whose data you're using/curating? [Yes] We use standard public datasets, including CIFAR10, ImageNet, VOC and COCO which allow researchers to use. +(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] We use standard public datasets, including CIFAR10, ImageNet, VOC and COCO which consist of objectives/views. + +5. If you used crowdsourcing or conducted research with human subjects... + +(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] + +(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] +(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] \ No newline at end of file diff --git a/atheorydrivenselflabelingrefinementmethodforcontrastiverepresentationlearning/images.zip b/atheorydrivenselflabelingrefinementmethodforcontrastiverepresentationlearning/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..3c8e76e9559ed0262527753f0ec3e07b31c0ba5a --- /dev/null +++ b/atheorydrivenselflabelingrefinementmethodforcontrastiverepresentationlearning/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:80bb21fedeff955c1b29f9e6cca165da3adedd30b1c5cb1d73155821ddcb9a00 +size 315511 diff --git a/atheorydrivenselflabelingrefinementmethodforcontrastiverepresentationlearning/layout.json b/atheorydrivenselflabelingrefinementmethodforcontrastiverepresentationlearning/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..fe0e26c55c6254036617b2c0ca5b55d134c35989 --- /dev/null +++ b/atheorydrivenselflabelingrefinementmethodforcontrastiverepresentationlearning/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:157c284c49c8c38f83d447347b27791a7e5edff10080842236c2e8d93d401321 +size 765270 diff --git a/atheoryofthedistortionperceptiontradeoffinwassersteinspace/8f9f0cb9-58d8-46a5-bd3a-3661a5186d7e_content_list.json b/atheoryofthedistortionperceptiontradeoffinwassersteinspace/8f9f0cb9-58d8-46a5-bd3a-3661a5186d7e_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..66d4825fb7af346ac6afb012f2c09cf3d1d1f9c8 --- /dev/null +++ b/atheoryofthedistortionperceptiontradeoffinwassersteinspace/8f9f0cb9-58d8-46a5-bd3a-3661a5186d7e_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:36a8c089a5d4122d5adb45b8721618fac0f28b0219bb08156c6640729a1aa1c4 +size 80720 diff --git a/atheoryofthedistortionperceptiontradeoffinwassersteinspace/8f9f0cb9-58d8-46a5-bd3a-3661a5186d7e_model.json b/atheoryofthedistortionperceptiontradeoffinwassersteinspace/8f9f0cb9-58d8-46a5-bd3a-3661a5186d7e_model.json new file mode 100644 index 0000000000000000000000000000000000000000..c8ba60a9537c9f95b890220f454503ae2f74fbe5 --- /dev/null +++ b/atheoryofthedistortionperceptiontradeoffinwassersteinspace/8f9f0cb9-58d8-46a5-bd3a-3661a5186d7e_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9abdfec5f62ce4fb57bcb6767a54b2741ea4aa2d84f0cd54b8ba57fd369f149 +size 95864 diff --git a/atheoryofthedistortionperceptiontradeoffinwassersteinspace/8f9f0cb9-58d8-46a5-bd3a-3661a5186d7e_origin.pdf b/atheoryofthedistortionperceptiontradeoffinwassersteinspace/8f9f0cb9-58d8-46a5-bd3a-3661a5186d7e_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..30fec74a42058bb303342615d7b9b224cca64cfd --- /dev/null +++ b/atheoryofthedistortionperceptiontradeoffinwassersteinspace/8f9f0cb9-58d8-46a5-bd3a-3661a5186d7e_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:67354a7836145693cc713c9ba735d17824f890647ca5be1b1e82a99dacc0fb11 +size 1396404 diff --git a/atheoryofthedistortionperceptiontradeoffinwassersteinspace/full.md b/atheoryofthedistortionperceptiontradeoffinwassersteinspace/full.md new file mode 100644 index 0000000000000000000000000000000000000000..1befc6dc093ac319169908ec83a2fa8ae144fc47 --- /dev/null +++ b/atheoryofthedistortionperceptiontradeoffinwassersteinspace/full.md @@ -0,0 +1,375 @@ +# A Theory of the Distortion-Perception Tradeoff in Wasserstein Space + +Dror Freirich + +Technion - Israel Institute of Technology + +drorfrc@gmail.com + +Tomer Michaeli + +Technion - Israel Institute of Technology + +tomer.m@ee.technion.ac.il + +Ron Meir + +Technion - Israel Institute of Technology + +rmeir@ee.technion.ac.il + +# Abstract + +The lower the distortion of an estimator, the more the distribution of its outputs generally deviates from the distribution of the signals it attempts to estimate. This phenomenon, known as the perception-distortion tradeoff, has captured significant attention in image restoration, where it implies that fidelity to ground truth images comes at the expense of perceptual quality (deviation from statistics of natural images). However, despite the increasing popularity of performing comparisons on the perception-distortion plane, there remains an important open question: what is the minimal distortion that can be achieved under a given perception constraint? In this paper, we derive a closed form expression for this distortion-perception (DP) function for the mean squared-error (MSE) distortion and the Wasserstein-2 perception index. We prove that the DP function is always quadratic, regardless of the underlying distribution. This stems from the fact that estimators on the DP curve form a geodesic in Wasserstein space. In the Gaussian setting, we further provide a closed form expression for such estimators. For general distributions, we show how these estimators can be constructed from the estimators at the two extremes of the tradeoff: The global MSE minimizer, and a minimizer of the MSE under a perfect perceptual quality constraint. The latter can be obtained as a stochastic transformation of the former. + +# 1 Introduction + +Inverse problems that involve signal reconstruction from partial or noisy measurements, arise in numerous scientific domains. Examples range from medical imaging to tomography, microscopy, astronomy and audio enhancement. In many such problems it is desired to design an estimator that $(i)$ has a small reconstruction error (low distortion), and $(ii)$ outputs reconstructions that cannot be told apart from valid signals (good perceptual quality). Interestingly, however, it has been shown that the lower the average distortion of an estimator, the more the distribution of its outputs generally deviates from the distribution of the signals it attempts to estimate [4]. In other words, low distortion generally comes at the price of poor perceptual quality, and vice versa. This phenomenon, known as the perception-distortion tradeoff, has found particular interest in the image restoration domain (see Fig. 1), where algorithms are now commonly being evaluated using both distortion measures and perception indices [5]. + +Unfortunately, despite the increasing popularity of performing comparisons on the perception-distortion plane, the minimal distortion that can be achieved under a given perception constraint (red curve in Fig. 1) remains an open question. Blau and Michaeli [4] investigated several properties + +![](images/7cc388d1181b64832772b6a0b57e6f817e9c3767543ec12784fb9f0d3ae5a700.jpg) +Low resolution input + +![](images/19224c8ef99120d4661310f1b6493efd3aa3d25bd5c99b2499f2583e98f8e0f4.jpg) +EDSR (low MSE, high FID) + +![](images/385c8ec4e48e7d28b98a959aa759878cecbfc2a93c5f6b9ecba4844341f2ec46.jpg) +ESRGAN (high MSE, low FID) + +![](images/6cbe7ad762e9a98b616b5857accf73f874a717e6b004d423759846c4d8e49b16.jpg) +Figure 1: Illustration of the distortion-perception tradeoff in super-resolution. A low resolution image (left) is fed to two state-of-the-art super-resolution algorithms (middle). EDSR [14] achieves a low MSE distortion, but produces blurry reconstructions with high FID values [10]. ESRGAN [31] outputs photo-realistic recoveries with low FID, but its MSE is significantly higher. This is a result of the distortion-perception tradeoff (right). Namely, estimators cannot simultaneously achieve a low distortion and have their outputs distributed like the signals they are designed to estimate. In this paper, we derive a closed form expression for the distortion-perception function (red curve) for the MSE distortion and Wasserstein-2 perception index. + +of this distortion-perception function, such as monotonicity and convexity. But beyond this rather general characterization, little is known about its precise nature. In this paper, we derive a closed form expression for the distortion-perception (DP) function for the special case where distortion is measured by mean squared-error (MSE) and perception is measured by the Wasserstein-2 distance between the probability laws of the estimate and the estimand. + +Our main contributions are: (i) We prove that the DP function is always quadratic in the perception constraint $P$ , regardless of the underlying distribution (Theorem 1). (ii) We show that it is possible to construct estimators on the DP curve from the estimators at the two extremes of the tradeoff (Theorem 3): The one that globally minimizes the MSE, and a minimizer of the MSE under a perfect perceptual quality constraint. The latter can be obtained as a stochastic transformation of the former. (iii) In the Gaussian setting, we further provide a closed form expression for optimal estimators and for the corresponding DP curve (Theorems 4 and 5). We show this Gaussian DP curve is a lower bound on the DP curve of any distribution having the same second order statistics. Finally, we illustrate our results, numerically and visually, in a super-resolution setting in Section 5. The proofs of all our theorems are provided in Appendix B. + +Our theoretical results shed light on several topics that are subject to much practical activity. Particularly, many recent works adress the task of diverse perceptual image reconstruction, by employing randomization among possible restorations [15, 3, 22, 1]. Commonly, such works attempt to sample from the posterior distribution of natural images given the degraded input image. This is done, for example, using priors over image patches [7], conditional generative models [18, 21], or implicit priors induced by deep denoiser networks [11]. Theoretically, posterior sampling leads to perfect perceptual quality (the restored outputs are distributed like the prior). However, a fundamental question is whether this is optimal in terms of distortion. As we show in Section 3.1, posterior sampling is often not an optimal strategy, in the sense that there exist perfect perceptual quality estimators that achieve lower distortion. + +Another topic of practical interest is the ability to traverse the distortion-perception tradeoff at test time, without having to train a different model for each working point. Recently, interpolation between distortion-oriented models and perception-oriented ones, has been suggested for this end. Existing methods include interpolation in pixel space [31] or in some latent space [26], interpolation between network weights [31, 32], and style transfer between a low-distortion reconstruction and a high perceptual quality one [6]. In light of this plethora of approaches, it is natural to ask which strategy is optimal. In Section 3.2 we show that for the MSE-Wasserstein-2 tradeoff, linear interpolation in pixel space leads to optimal estimators. We also discuss a geometric connection between interpolation and the fact that estimators on the DP curve form a geodesic in Wasserstein space. + +# 2 Problem setting and preliminaries + +# 2.1 The distortion-perception tradeoff + +Let $X, Y$ be random vectors taking values in $\mathbb{R}^{n_x}$ and $\mathbb{R}^{n_y}$ , respectively. We consider the problem of constructing an estimator $\hat{X}$ of $X$ based on $Y$ . Namely, we are interested in determining a conditional distribution $p_{\hat{X}|Y}$ such that $\hat{X}$ constitutes a good estimate of $X$ . For example, in the super-resolution setting shown in Fig. 1, $Y$ is the low resolution image (left), $X$ is the corresponding ground-truth high-resolution image (not shown), and $\hat{X}$ is a super-resolution reconstruction generated from $Y$ (e.g. the EDSR or ESRGAN estimators in the middle). + +In many practical cases, the goodness of an estimator is associated with two factors: (i) the degree to which $\hat{X}$ is close to $X$ on average (low distortion), and (ii) the degree to which the distribution of $\hat{X}$ is close to that of $X$ (good perceptual quality). An important question, then, is what is the minimal distortion that can be achieved under a given level of perceptual quality? and how can we construct estimators that achieve this lower bound? In mathematical language, we are interested in analyzing the distortion-perception (DP) function (defined similarly to the perception-distortion function of [4]) + +$$ +D (P) = \min _ {p _ {\hat {X} | Y}} \left\{\mathbb {E} [ d (X, \hat {X}) ]: d _ {p} \left(p _ {X}, p _ {\hat {X}}\right) \leq P \right\}. \tag {1} +$$ + +Here, $d:\mathbb{R}^{n_x}\times \mathbb{R}^{n_x}\to \mathbb{R}^+ \cup \{0\}$ is some distortion criterion, $d_{p}(\cdot ,\cdot)$ is some divergence between probability measures, and $p_{\hat{X}}$ is the probability measure on $\mathbb{R}^{n_x}$ induced by $p_{\hat{X} |Y}$ and $p_Y$ . The expectation is taken w.r.t. the measure $p_{X\hat{X}}$ induced by $p_{\hat{X} |Y}$ and $p_{XY}$ , where we assume that $\hat{X}$ is independent of $X$ given $Y$ . + +As discussed in [4], the function $D(P)$ is monotonically non-increasing and is convex whenever $d_p(\cdot, \cdot)$ is convex in its second argument (which is the case for most popular divergences). However, without further concrete assumptions on the distortion measure $d(\cdot, \cdot)$ and the perception index $d_p(\cdot, \cdot)$ , little can be said about the precise nature of $D(P)$ . + +Here, we focus our attention on the squared-error distortion $d(x,\hat{x}) = \| x - \hat{x}\| ^2$ and the Wasserstein-2 distance $d_{p}(p_{X},p_{\hat{X}}) = W_{2}(p_{X},p_{\hat{X}})$ , with which (1) reads + +$$ +D (P) = \min _ {p _ {\hat {X} | Y}} \left\{\mathbb {E} [ \| X - \hat {X} \| ^ {2} ]: W _ {2} \left(p _ {X}, p _ {\hat {X}}\right) \leq P \right\}. \tag {2} +$$ + +We assume that all distributions have finite first and second moments. In addition, from Theorem 3 below it will follow that the minimum is indeed attained, so that (2) is well defined. + +It is well known that the estimator minimizing the mean squared error (MSE) without any constraints, is given by $X^{*} = \mathbb{E}[X|Y]$ . This implies that $D(P)$ monotonically decreases until $P$ reaches $P^{*} \triangleq W_{2}(p_{X}, p_{X^{*}})$ , beyond which point $D(P)$ takes the constant value $D^{*} \triangleq \mathbb{E}[\|X - X^{*}\|^{2}]$ . This is illustrated in Fig. 2. It is also known that $D(0) \leq 2D^{*}$ since the posterior sampling estimator $p_{\hat{X}|Y} = p_{X|Y}$ achieves $W_{2}(p_{X}, p_{\hat{X}}) = 0$ and $\mathbb{E}[\|X - \hat{X}\|^{2}] = 2D^{*}$ [4]. However, apart from these rather general properties, the precise shape of the DP curve has not been determined to date, and neither have the estimators that achieve the optimum in (2). This is our goal in this paper. + +# 2.2 The Wasserstein and Gelbrich Distances + +Before we present our main results, we briefly survey a few properties of the Wasserstein distance, mostly taken from [20]. The Wasserstein- $p$ ( $p \geq 1$ ) distance between measures $\mu$ and $\gamma$ on a separable Banach space $\mathcal{X}$ with norm $\|\cdot\|$ is defined by + +$$ +W _ {p} ^ {p} (\mu , \gamma) \triangleq \inf \left\{\mathbb {E} _ {(U, V) \sim \nu} [ \| U - V \| ^ {p} ]: \nu \in \Pi (\mu , \gamma) \right\}, \tag {3} +$$ + +where $\Pi (\mu ,\gamma)$ is the set of all probabilities on $\mathcal{X}\times \mathcal{X}$ with marginals $\mu$ and $\gamma$ . A joint probability $\nu$ achieving the optimum in (3) is often referred to as optimal plan. The Wasserstein space of probability measures is defined as + +$$ +\mathcal {W} _ {p} (\mathcal {X}) \triangleq \left\{\gamma : \int_ {\mathcal {X}} \| x \| ^ {p} d \gamma < \infty \right\}, +$$ + +![](images/1c0bdd8bc779f42441e653be6bf48d82a7bb0f411d6fbf70641fe484c77f1a1a.jpg) +Figure 2: The MSE-Wasserstein-2 tradeoff and the geometry of optimal estimators. The left pane depicts the distortion-perception function for the MSE distortion and the Wasserstein-2 perception index. The minimal possible distortion, $D^{*}$ , is achieved by the estimator $X^{*} = E[X|Y]$ . The perception index attained by this estimator is $P^{*}$ . At the other extreme of the tradeoff, we know that $D(0) \leq 2D^{*}$ . The right pane shows the geometry of the distributions of optimal estimators in Wasserstein space. The minimal distortion $D(P)$ can be achieved by an estimator with distribution $\gamma_{P}$ , which lies on a straight line (or geodesic) between $p_{X}$ and $p_{X^{*}}$ . Its distance from the former is $W_{2}(p_{X},\gamma_{P}) = P$ and its distance from the latter is $W_{2}(p_{X^{*}},\gamma_{P}) = P^{*} - P$ . Therefore, $D(P) = D^{*} + W_{2}^{2}(p_{X^{*}},\gamma_{P}) = D^{*} + (P^{*} - P)^{2}$ . + +![](images/3ef1d50fdb6fa45dcb8125c2ddfe7a23dd0ddead2fb98b4dac31201778f4a8ab.jpg) + +and $W_{p}$ constitutes a metric on $\mathcal{W}_p(\mathcal{X})$ + +For any $(m_1, \Sigma_1)$ , $(m_2, \Sigma_2) \in \mathbb{R}^d \times \mathbb{S}_+^d$ (where $\mathbb{S}_+^d$ is the set of symmetric positive semidefinite matrices in $\mathbb{R}^{d \times d}$ ), the Gelbrich distance is defined as + +$$ +G ^ {2} \left(\left(m _ {1}, \Sigma_ {1}\right), \left(m _ {2}, \Sigma_ {2}\right)\right) \triangleq \| m _ {1} - m _ {2} \| _ {2} ^ {2} + \operatorname {T r} \left\{\Sigma_ {1} + \Sigma_ {2} - 2 \left(\Sigma_ {1} ^ {\frac {1}{2}} \Sigma_ {2} \Sigma_ {1} ^ {\frac {1}{2}}\right) ^ {\frac {1}{2}} \right\}. \tag {4} +$$ + +The root of a PSD matrix is always taken to be PSD. For any two probability measures $\mu_1, \mu_2$ on $\mathbb{R}^d$ with means and covariances $(m_1, \Sigma_1)$ , $(m_2, \Sigma_2)$ , from [8, Thm. 2.1] we have that + +$$ +W _ {2} ^ {2} \left(\mu_ {1}, \mu_ {2}\right) \geq G ^ {2} \left(\left(m _ {1}, \Sigma_ {1}\right), \left(m _ {2}, \Sigma_ {2}\right)\right). \tag {5} +$$ + +When $\mu_1 = \mathcal{N}(m_1, \Sigma_1)$ and $\mu_2 = \mathcal{N}(m_2, \Sigma_2)$ are Gaussian distributions on $\mathbb{R}^d$ , we have that $W_2(\mu_1, \mu_2) = G((m_1, \Sigma_1), (m_2, \Sigma_2))$ . This equality is obvious for non-singular measures but is true for any two Gaussian distributions [20, p. 18]. If $\Sigma_1$ and $\Sigma_2$ are non-singular, then the distribution attaining the optimum in (3) corresponds to + +$$ +U \sim \mathcal {N} \left(m _ {1}, \Sigma_ {1}\right), V = m _ {2} + T _ {1 \rightarrow 2} (U - m _ {1}), \tag {6} +$$ + +where + +$$ +T _ {1 \rightarrow 2} = \Sigma_ {1} ^ {- \frac {1}{2}} \left(\Sigma_ {1} ^ {\frac {1}{2}} \Sigma_ {2} \Sigma_ {1} ^ {\frac {1}{2}}\right) ^ {\frac {1}{2}} \Sigma_ {1} ^ {- \frac {1}{2}} \tag {7} +$$ + +is the optimal transformation pushing forward from $\mathcal{N}(0,\Sigma_1)$ to $\mathcal{N}(0,\Sigma_2)$ [12]. This transformation satisfies $\Sigma_{2} = T_{1\to 2}\Sigma_{1}T_{1\to 2}$ . For a discussion on singular distributions, please see App. A. + +# 3 Main results + +# 3.1 The MSE-Wasserstein-2 tradeoff + +The DP function (2) depends, of course, on the underlying joint probability $p_{XY}$ of the signal $X$ and measurements $Y$ . Our first key result is that this dependence can be expressed solely in terms of $D^{*}$ and $P^{*}$ . In other words, knowing the distortion and perception index attained by the minimum MSE estimator $X^{*}$ , suffices for determining $D(P)$ for any $P$ . + +Theorem 1 (The DP function). The DP function (2) is given by + +$$ +D (P) = D ^ {*} + \left[ \left(P ^ {*} - P\right) _ {+} \right] ^ {2}, \tag {8} +$$ + +where $(x)_{+} = \max (0,x)$ . Furthermore, an estimator achieving perception index $P$ and distortion $D(P)$ can always be constructed by applying a (possibly stochastic) transformation to $X^{*}$ . + +Theorem 1 is of practical importance because in many cases constructing an estimator that achieves a low MSE (i.e. an approximation of $X^{*}$ ) is a rather simple task. This is the case, for example, in image restoration with deep neural networks. There, it is common practice to train a network by minimizing its average squared error on a training set. Measuring the MSE of such a network on a large test set provides an approximation for $D^{*}$ . We can also obtain an approximation of at least a lower bound on $P^{*}$ by estimating the second order statistics of $X$ and $X^{*}$ . Specifically, recall that $P^{*}$ is lower bounded by the Gelbrich distance between $(m_{X},\Sigma_{X})$ and $(m_{X^{*}},\Sigma_{X^{*}})$ , which is given by $(G^{*})^{2}\triangleq \mathrm{Tr}\{\Sigma_{X} + \Sigma_{X^{*}} - 2(\Sigma_{X}^{1 / 2}\Sigma_{X^{*}}\Sigma_{X}^{1 / 2})^{1 / 2}\}$ (see (5)). Given approximations for $D^{*}$ and $G^{*}$ , we can approximate a lower bound on the DP function for any $P$ , + +$$ +D (P) \geq D ^ {*} + \left[ \left(G ^ {*} - P\right) _ {+} \right] ^ {2}. \tag {9} +$$ + +The bound is attained when $X$ and $Y$ are jointly Gaussian. + +Uniqueness A remark is in place regarding the uniqueness of an estimator achieving (8). As we discuss below, what defines an optimal estimator $\hat{X}$ is its joint distribution with $X^{*}$ . This joint distribution may not be unique, in which case the optimal estimator is not unique. Moreover, even if $p_{\hat{X} X^{*}}$ is unique, the uniqueness of the estimator is not guaranteed because there may be different conditional distributions $p_{\hat{X}|Y}$ that lead to the same optimal $p_{\hat{X} X^{*}}$ . In other words, given the optimal $p_{\hat{X} X^{*}}$ , one can choose any joint probability $p_{\hat{X} YX^{*}}$ that has marginals $p_{\hat{X} X^{*}}$ and $p_{YX^{*}}$ . One option is to take the estimator $\hat{X}$ to be a (possibly stochastic) transformation of $X^{*}$ , namely $p_{\hat{X} |Y} = p_{\hat{X} |X^{*}}p_{X^{*}|Y}$ . But there may be other options. In cases where either $Y$ or $\hat{X}$ are a deterministic transformation of $X^{*}$ (e.g. when $X^{*}$ has a density, or is an invertible function of $Y$ ), there is a unique joint distribution $p_{\hat{X} YX^{*}}$ with the given marginals [2, Lemma 5.3.2]. In this case, if $p_{\hat{X} X^{*}}$ is unique then so is the estimator $p_{\hat{X} |Y}$ . + +Randomness Under the settings of image restoration, many methods encourage diversity in their output by adding randomness [15, 3, 22]. In our setting, we may ask under what conditions there exists an optimal estimator $\hat{X}$ which is a deterministic function of $Y$ . For example, when $p_{Y} = \delta_{0}$ but $X$ has some non-atomic distribution, it is clear that no deterministic function of $Y$ can attain perfect perceptual quality. It turns out that a sufficient condition for the optimal $\hat{X}$ to be a deterministic function of $Y$ is that $X^{*}$ have a density. We discuss this in App. B and explicitly illustrate it in the Gaussian case (see Sec. 3.3), where if $X^{*}$ has a non-singular covariance matrix then $\hat{X}$ is a deterministic function of $Y$ . + +When is posterior sampling optimal? Many recent image restoration methods attempt to produce diverse high perceptual quality reconstructions by sampling from the posterior distribution $p_{X|Y}$ [7, 18, 11]. As discussed in [4], the posterior sampling estimator attains a perception index of 0 (namely $W_2(p_X, p_{\hat{X}}) = 0$ ) and distortion $2D^*$ . But an interesting question is: when is this strategy optimal? In other words, in what cases do we have that the DP function at $P = 0$ equals precisely $2D^*$ and is not strictly smaller? Note from the definition of the Wasserstein distance (3), that $(P^*)^2 = W_2^2(p_X, p_{X^*}) \leq \mathbb{E}[\|X - X^*\|^2] = D^*$ . Using this in (8) shows that the DP function at $P = 0$ is upper bounded by + +$$ +D (0) = D ^ {*} + \left(P ^ {*}\right) ^ {2} \leq 2 D ^ {*}, \tag {10} +$$ + +and the upper bound is attained when $(P^{*})^{2} = D^{*}$ . To see when this happens, observe that + +$$ +\left. \operatorname {T r} \left\{\Sigma_ {X} + \Sigma_ {X ^ {*}} - 2 \left(\Sigma_ {X} ^ {\frac {1}{2}} \Sigma_ {X ^ {*}} \Sigma_ {X} ^ {\frac {1}{2}}\right) ^ {\frac {1}{2}} \right\} = \left(G ^ {*}\right) ^ {2} \leq \left(P ^ {*}\right) ^ {2} \leq D ^ {*} = \operatorname {T r} \left\{\Sigma_ {X} - \Sigma_ {X ^ {*}} \right\}. \right. \tag {11} +$$ + +We can see that when $\mathrm{Tr}\{\Sigma_{X^*}\} = \mathrm{Tr}\{(\Sigma_X^{1 / 2}\Sigma_{X^*}\Sigma_X^{1 / 2})^{1 / 2}\}$ , the leftmost and rightmost sides become equal, and thus $(P^{*})^{2} = D^{*}$ . To understand the meaning of this condition, let us focus on the case where $\Sigma_{X}$ and $\Sigma_{X^*}$ are jointly diagonalizable. This is a reasonable assumption for natural images, + +where shift-invariance induces diagonalization by the Fourier basis [30]. In this case, the condition can be written in terms of the eigenvalues of the matrices, namely $\sum_{i}\lambda_{i}(\Sigma_{X^{*}}) = \sum_{i}\sqrt{\lambda_{i}(\Sigma_{X^{*}})\lambda_{i}(\Sigma_{X})}$ . This condition is satisfied when each $\lambda_{i}(\Sigma_{X^{*}})$ equals either $\lambda_{i}(\Sigma_{X})$ or 0. Namely, the $i$ th eigenvalue of the error covariance of $X^{*}$ , which is given by $\Sigma_{X} - \Sigma_{X^{*}}$ , is either $\lambda_{i}(\Sigma_{X})$ or 0. We conclude that posterior sampling is optimal when there exists a subspace $\mathcal{S}$ spanned by some of the eigenvectors of $\Sigma_{X}$ , such that the projection of $X$ onto $\mathcal{S}$ can be recovered from $Y$ with zero error, but the projection of $X$ onto $\mathcal{S}^{\perp}$ cannot be recovered at all (the optimal estimator is trivial). This is likely not the case in most practical scenarios. Therefore, it seems that posterior sampling is often not optimal. That is, posterior sampling can be improved upon in terms of MSE without any sacrifice in perceptual quality. + +# 3.2 Optimal estimators + +While Theorem 1 reveals the shape of the DP function, it does not provide a recipe for constructing optimal estimators on the DP tradeoff. We now discuss the nature of such estimators. + +Our first observation is that since $\hat{X}$ is independent of $X$ given $Y$ , its MSE can be decomposed as $\mathbb{E}[\| X - \hat{X}\|^2] = \mathbb{E}[\| X - X^*\|^2 + \mathbb{E}[\| X^* - \hat{X}\|^2]$ (see App. B). Therefore, the DP function (2) can be equivalently written as + +$$ +D (P) = D ^ {*} + \min _ {p _ {\hat {X} | Y}} \left\{\mathbb {E} [ \| \hat {X} - X ^ {*} \| ^ {2} ]: W _ {2} \left(p _ {X}, p _ {\hat {X}}\right) \leq P \right\}. \tag {12} +$$ + +Note that the objective in (12) depends on the MSE between $\hat{X}$ and $X^{*}$ , so that we can perform the minimization on $p_{\hat{X} |X^{*}}$ rather than on $p_{\hat{X} |Y}$ (once we determine the optimal $p_{\hat{X} |X^{*}}$ we can construct a consistent $p_{\hat{X} |Y}$ as discussed above). + +Now, let us start by examining the leftmost side of the curve $D(P)$ , which corresponds to a perfect perceptual quality estimator (i.e. $P = 0$ ). In this case, the constraint becomes $p_{\hat{X}} = p_X$ . Therefore, + +$$ +D (0) = D ^ {*} + \min _ {p _ {X X ^ {*}}} \left\{\mathbb {E} [ \| \hat {X} - X ^ {*} \| ^ {2} ]: p _ {\hat {X} X ^ {*}} \in \Pi \left(p _ {X}, p _ {X ^ {*}}\right) \right\}, \tag {13} +$$ + +where $\Pi(p_X, p_{X^*})$ is the set of all probabilities on $\mathbb{R}^{n_x} \times \mathbb{R}^{n_x}$ with marginals $p_X, p_{X^*}$ . One may readily recognize this as the optimization problem underlying the Wasserstein-2 distance between $p_X$ and $p_{X^*}$ . This leads us to the following conclusion. + +Theorem 2 (Optimal estimator for $P = 0$ ). Let $\hat{X}_0$ be an estimator achieving perception index 0 and MSE $D(0)$ . Then its joint distribution with $X^*$ attains the optimum in the definition of $W_2(p_X, p_{X^*})$ . Namely, $p_{\hat{X}_0X^*}$ is an optimal plan between $p_X$ and $p_{X^*}$ . + +Having understood the estimator $\hat{X}_0$ at the leftmost end of the tradeoff, we now turn to study optimal estimators for arbitrary $P$ . Interestingly, we can show that Problem (12) is equivalent to (see App. B) + +$$ +D (P) = D ^ {*} + \min _ {p _ {\hat {X}}} \left\{W _ {2} ^ {2} \left(p _ {\hat {X}}, p _ {X ^ {*}}\right): W _ {2} \left(p _ {\hat {X}}, p _ {X}\right) \leq P \right\}. \tag {14} +$$ + +Namely, an optimal $p_{\hat{X}}$ is closest to $p_{X^*}$ among all distributions within a ball of radius $P$ around $p_X$ , as illustrated in Fig. 2. Moreover, $p_{\hat{X} X^*}$ is an optimal plan between $p_{\hat{X}}$ and $p_{X^*}$ . As it turns out, this somewhat abstract viewpoint leads to a rather practical construction for $\hat{X}$ from the estimators $\hat{X}_0$ and $X^*$ at the two extremes of the tradeoff. Specifically, we have the following result. + +Theorem 3 (Optimal estimators for arbitrary $P$ ). Let $\hat{X}_0$ be an estimator achieving perception index 0 and MSE $D(0)$ . Then for any $P \in [0, P^*]$ , the estimator + +$$ +\hat {X} _ {P} = \left(1 - \frac {P}{P ^ {*}}\right) \hat {X} _ {0} + \frac {P}{P ^ {*}} X ^ {*} \tag {15} +$$ + +is optimal for perception index $P$ . Namely, it achieves perception index $P$ and distortion $D(P)$ . + +Theorem 3 has important implications for perceptual signal restoration. For example, in the task of image super-resolution, there exist many deep network based methods that achieve a low MSE [14, 29, 25]. These provide an approximation for $X^{*}$ . Moreover, there is an abundance of methods that achieve good perceptual quality at the price of a reasonable degradation in MSE (often by + +incorporating a GAN-based loss) [13, 31, 24]. These constitute approximations for $\hat{X}_0$ . However, achieving results that strike other prescribed balances between MSE and perceptual quality commonly require training a different model for each setting. Shoshan et al. [26] and Navarrete Michelini et al. [17] tried to address this difficulty by introducing new training techniques that allow traversing the distortion-perception tradeoff at test time. However, Theorem 3 shows that such specialized training methods are not required in our setting. Having a model that leads to low MSE and one that leads to good perceptual quality, it is possible to construct any other estimator on the DP tradeoff, by simply averaging the outputs of these two models with appropriate weights. We illustrate this in Sec. 5. + +# 3.3 The Gaussian setting + +When $X$ and $Y$ are jointly Gaussian, it is well known that the minimum MSE estimator $X^{*}$ is a linear function of the measurements $Y$ . However, it is not a priori clear whether all estimators along the DP tradeoff are linear in this case, and what kind of randomness they possess. As we now show, equipped with Theorem 3, we can obtain closed form expressions for optimal estimators for any $P$ . For simplicity, we assume here that $X$ and $Y$ have zero means and that $\Sigma_{X}, \Sigma_{Y} \succ 0$ . + +It is instructive to start by considering the simple case, where $\Sigma_{X^{*}}$ is non-singular (in Theorem 4 below we address the more general case of a possibly singular $\Sigma_{X^{*}}$ ). It is well known that + +$$ +X ^ {*} = \Sigma_ {X Y} \Sigma_ {Y} ^ {- 1} Y, \quad \Sigma_ {X ^ {*}} = \Sigma_ {X Y} \Sigma_ {Y} ^ {- 1} \Sigma_ {Y X}. \tag {16} +$$ + +Now, since we assumed that $\Sigma_{X},\Sigma_{X^{*}}\succ 0$ , we have from Theorem 2 and (6),(7) that + +$$ +\hat {X} _ {0} = \Sigma_ {X ^ {*}} ^ {- \frac {1}{2}} \left(\Sigma_ {X ^ {*}} ^ {\frac {1}{2}} \Sigma_ {X} \Sigma_ {X ^ {*}} ^ {\frac {1}{2}}\right) ^ {\frac {1}{2}} \Sigma_ {X ^ {*}} ^ {- \frac {1}{2}} X ^ {*}. \tag {17} +$$ + +Finally, we know that $P^{*} = G^{*}$ , which is given by the left-hand side of (11). Substituting these expressions into (15), we obtain that an optimal estimator for perception $P \in [0, G^{*}]$ is given by + +$$ +\hat {X} _ {P} = \left(\left(1 - \frac {P}{G ^ {*}}\right) \Sigma_ {X ^ {*}} ^ {- \frac {1}{2}} \left(\Sigma_ {X ^ {*}} ^ {\frac {1}{2}} \Sigma_ {X} \Sigma_ {X ^ {*}} ^ {\frac {1}{2}}\right) ^ {\frac {1}{2}} \Sigma_ {X ^ {*}} ^ {- \frac {1}{2}} + \frac {P}{G ^ {*}} I\right) \Sigma_ {X Y} \Sigma_ {Y} ^ {- 1} Y. \tag {18} +$$ + +As can be seen, this optimal estimator is a deterministic linear transformation of $Y$ for any $P$ . + +The setting just described does not cover the case where $Y$ is of lower dimensionality than $X$ because in that case $\Sigma_{X^*}$ is necessarily singular (it is a $n_x \times n_x$ matrix of rank at most $n_y$ ; see (16)). In this case, any deterministic linear function of $Y$ would result in an estimator $\hat{X}$ with a rank- $n_y$ covariance. Obviously, the distribution of such an estimator cannot be arbitrarily close to that of $\bar{X}$ , whose covariance has rank $n_x$ . What is the optimal estimator in this more general setting, then? + +Theorem 4 (Optimal estimators in the Gaussian case). Assume $X$ and $Y$ are zero-mean jointly Gaussian random vectors with $\Sigma_{X}, \Sigma_{Y} \succ 0$ . Denote $T^{*} \triangleq T_{p_{X} \to p_{X^{*}}} = \Sigma_{X}^{-1/2} (\Sigma_{X}^{1/2} \Sigma_{X^{*}} \Sigma_{X}^{1/2})^{1/2} \Sigma_{X}^{-1/2}$ . Then for any $P \in [0, G^{*}]$ , an estimator with perception index $P$ and MSE $D(P)$ can be constructed as + +$$ +\hat {X} _ {P} = \left(\left(1 - \frac {P}{G ^ {*}}\right) \Sigma_ {X} ^ {\frac {1}{2}} \left(\Sigma_ {X} ^ {\frac {1}{2}} \Sigma_ {X ^ {*}} \Sigma_ {X} ^ {\frac {1}{2}}\right) ^ {\frac {1}{2}} \Sigma_ {X} ^ {- \frac {1}{2}} \Sigma_ {X ^ {*}} ^ {\dagger} + \frac {P}{G ^ {*}} I\right) \Sigma_ {X Y} \Sigma_ {Y} ^ {- 1} Y + \left(1 - \frac {P}{G ^ {*}}\right) W, \tag {19} +$$ + +where $W$ is a zero-mean Gaussian noise with covariance $\Sigma_W = \Sigma_X^{1/2}(I - \Sigma_X^{1/2}T^*\Sigma_{X*}^\dagger T^*\Sigma_X^{1/2})\Sigma_X^{1/2}$ , which is independent of $Y, X$ , and $\Sigma_{X*}^\dagger$ is the pseudo-inverse of $\Sigma_{X*}$ . + +Note that in this case, we indeed have a random noise component that shapes the covariance of $\hat{X}_P$ to become closer to $\Sigma_{X}$ as $P$ gets closer to 0. It can be shown (see App. B) that when $\Sigma_{X^*}$ is invertible, $\Sigma_W = 0$ and (19) reduces to (18). Also note that, as in (18), the dependence of $\hat{X}_P$ on $Y$ in (19) is only through $X^{*} = \Sigma_{XY}\Sigma_{Y}^{-1}Y$ . + +As mentioned in Sec. 3.1, the optimal estimator is generally not unique. Interestingly, in the Gaussian setting we can explicitly characterize a set of optimal estimators. + +Theorem 5 (A set of optimal estimators in the Gaussian case). Consider the setting of Theorem 4. Let $\Sigma_{\hat{X}_0Y} \in \mathbb{R}^{n_x \times n_y}$ satisfy + +$$ +\Sigma_ {\hat {X} _ {0} Y} \Sigma_ {Y} ^ {- 1} \Sigma_ {Y X} = \Sigma_ {X} ^ {\frac {1}{2}} \left(\Sigma_ {X} ^ {\frac {1}{2}} \Sigma_ {X ^ {*}} \Sigma_ {X} ^ {\frac {1}{2}}\right) ^ {\frac {1}{2}} \Sigma_ {X} ^ {- \frac {1}{2}}, \tag {20} +$$ + +and $W_0$ be a zero-mean Gaussian noise with covariance + +$$ +\Sigma_ {W _ {0}} = \Sigma_ {X} - \Sigma_ {\hat {X} _ {0} Y} \Sigma_ {Y} ^ {- 1} \Sigma_ {\hat {X} _ {0} Y} ^ {T} \succeq 0 \tag {21} +$$ + +that is independent of $X, Y$ . Then, for any $P \in [0, G^*]$ , an optimal estimator with perception index $P$ can be obtained by + +$$ +\hat {X} _ {P} = \left(\left(1 - \frac {P}{G ^ {*}}\right) \Sigma_ {\hat {X} _ {0} Y} + \frac {P}{G ^ {*}} \Sigma_ {X Y}\right) \Sigma_ {Y} ^ {- 1} Y + \left(1 - \frac {P}{G ^ {*}}\right) W _ {0}. \tag {22} +$$ + +The estimator given in (19) is one solution to (20)-(21), but is generally not unique. + +# 3.4 A Comment on the MSE-Wasserstein- $p$ tradeoff + +While our results concern the MSE $-W_{2}$ tradeoff, they can be used to draw conclusions regarding the DP tradeoff with other divergences. In particular, (8) constitutes a lower bound on the MSE-Wasserstein- $p$ tradeoff for any $p \geq 2$ . Furthermore, we can show that the MSE $-W_{1}$ DP function is lower bounded by $D^{*} + [(P_{1}^{*} - P)_{+}]^{2}$ , where $P_{1}^{*} \triangleq W_{1}(p_{X}, p_{X^{*}})$ . + +Note that at the point $P = 0$ , the DP function coincides with (8) for any plausible divergence. For a detailed discussion, we kindly refer the reader to the Appendix. + +# 4 A geometric perspective on the distortion-perception tradeoff + +In this section we provide a geometric point of view on our main results. Specifically, we show that the results of Theorems 1 and 3 are a consequence of a more general geometric property of the space $\mathcal{W}_2(\mathbb{R}^{n_x})$ . In the Gaussian case, this is simplified to a geometry of covariance matrices. + +Recall from (14) that the optimal $p_{\hat{X}}$ is the one closest to $p_{X^*}$ (in terms of Wasserstein distance) among all measures at a distance $P$ from $p_X$ . This implies that to determine $p_{\hat{X}}$ , we should traverse the geodesic between $p_{X^*}$ and $p_X$ until reaching a distance of $P$ from $p_X$ . Furthermore, $p_{\hat{X} X^*}$ should be the optimal plan between $p_{\hat{X}}$ and $p_{X^*}$ . Interestingly, geodesics in Wasserstein spaces take a particularly simple form, and their explicit construction also turns out to satisfy the latter requirement. Specifically, let $\gamma, \mu$ be measures in $\mathcal{W}_2(\mathbb{R}^d)$ , let $\nu \in \Pi (\gamma ,\mu)$ be an optimal plan attaining $W_{2}(\gamma ,\mu)$ , and let $\pi_i$ denote the projection $\pi_i:\mathbb{R}^d\times \mathbb{R}^d\to \mathbb{R}^d$ such that $\pi_i((x_1,x_2)) = x_i$ , $i = 1,2$ . Then, the curve + +$$ +\gamma_ {t} \triangleq [ (1 - t) \pi_ {1} + t \pi_ {2} ] \# \nu , \quad t \in [ 0, 1 ] \tag {23} +$$ + +is a constant-speed geodesic from $\gamma$ to $\mu$ in $\mathcal{W}_2(\mathbb{R}^d)$ [2], where $\#$ is the push-forward operation1. Particularly, + +$$ +W _ {2} \left(\gamma_ {t}, \gamma_ {s}\right) = | t - s | W _ {2} (\gamma , \mu), \tag {24} +$$ + +and it follows that $W_{2}(\gamma_{t},\gamma) = tW_{2}(\gamma ,\mu)$ and $W_{2}(\gamma_{t},\mu) = (1 - t)W_{2}(\gamma ,\mu)$ . Furthermore, if $\gamma_t,t\in [0,1]$ is a constant-speed geodesic with $\gamma_0 = \gamma ,\gamma_1 = \mu$ , then the optimal plans between $\gamma ,\gamma_{t}$ and between $\gamma_{t},\mu$ are given by + +$$ +[ \pi_ {1}, (1 - t) \pi_ {1} + t \pi_ {2} ] \# \nu , \quad [ (1 - t) \pi_ {1} + t \pi_ {2}, \pi_ {2} ] \# \nu , \tag {25} +$$ + +respectively, where $\nu \in \Pi (\gamma ,\mu)$ is some optimal plan. Applying (23) to $(\hat{X}_0,X^*)\sim \nu$ with $t = P / P^{*}$ , we obtain (15), where we show that the obtained estimator achieves $\mathbb{E}[\| \hat{X}_P - X^*\| ^2 ] = (1 - t)^2 W_2^2 (p_X,p_{X^*})$ . This explains the result of Theorem 3. + +It is worth mentioning that this geometric interpretation is simplified under some common settings. For example, when $\gamma$ is absolutely continuous (w.r.t. the Lebesgue measure), we have a measurable map $T_{\gamma \to \mu}$ which is the solution to the optimal transport problem with the quadratic cost [20, Thm 1.6.2, p.16]. The geodesic (23) then takes the form + +$$ +\gamma_ {t} = \left[ I d + t \left(T _ {\gamma \rightarrow \mu} - I d\right)\right] \# \gamma , \quad t \in [ 0, 1 ]. \tag {26} +$$ + +Therefore, in our setting, if $\gamma = p_{X^*}$ has a density, then we can obtain $\hat{X}_P$ by the deterministic transformation $[X^{*} + \left(1 - \frac{P}{P^{*}}\right)\left(T_{p_{X^{*}}\to p_{X}}(X^{*}) - X^{*}\right)]$ (see Remark about randomness in Sec. 3.1). + +Further simplification arises when $\gamma, \mu$ are centered non-singular Gaussian measures, in which case $T_{\gamma \rightarrow \mu}$ is the linear and symmetric transformation (7). Then, $\gamma_t$ is a Gaussian measure with covariance $\Sigma_{\gamma_t} = T_t\Sigma_\gamma T_t$ , where $T_t \triangleq [I + t(T_{\gamma \rightarrow \mu} - I)]$ . Therefore, in the Gaussian case, the shortest path (23) between distributions is reduced to a trajectory in the geometry of covariance matrices induced by the Gelbrich distance [27]. If additionally $\Sigma_\gamma$ and $\Sigma_\mu$ commute, then the Gelbrich distance is further reduced to the $\ell^2$ -distance between matrices, as we discuss in App. D. + +# 5 Numerical illustration + +We now experimentally illustrate the results of Theorems 1 and 3. We compute distortion and perception indices for 13 super resolution algorithms in a $4 \times$ magnification task on the BSD100 dataset[2] [16]. We then demonstrate the efficiency of approximating the lower bound (9) on the distortion $D(P)$ , and of the estimators suggested in (15), in this practical setting. The evaluated algorithms include EDSR [14], ESRGAN [31], SinGAN [24], ZSSR [25], DIP [29], SRResNet variants which optimize MSE and $\mathrm{VGG}_{2,2}$ , SRGAN variants which optimize MSE, $\mathrm{VGG}_{2,2}$ and $\mathrm{VGG}_{5,4}$ in addition to an adversarial loss [13], ENet [23] ("PAT" and "E" variants), and the stochastic explorable SR method of [3] (ExpSR). Low resolution images were obtained by $4 \times$ downsampling of BSD100 images using a bicubic kernel. + +In Fig. 3 we plot each method on the distortion-perception plane. In the left pane, we consider natural (and reconstructed) images to be stationary random sources, and use $9 \times 9$ patches (totally $1.6 \times 10^{6}$ patches) to empirically estimate the mean and covariance matrix for the ground-truth images, and for the reconstructions produced by each method. We then use the estimated Gelbrich distances (4) between the patch distribution of each method and that of ground-truth images, as a perceptual quality index. Recall this is a lower bound on the Wasserstein distance. In the right pane of Fig. 3, we measure perception using the popular FID index [10], which relies on the Fréchet distance between deep feature distributions of ground-truth and reconstructed images (assuming they are normally distributed). FID is known to correlate well with visual quality, and while it is not directly related to our theory, we can see a qualitatively similar behavior to that depicted in the left pane. + +We consider the EDSR method [14] to constitute a good approximation for the minimum MSE estimator $X^{*}$ since it achieves the lowest MSE among the evaluated methods. We therefore estimate the lower bound (9) as + +$$ +\hat {D} (P) = D _ {\mathrm {E D S R}} + \left[ \left(P _ {\mathrm {E D S R}} - P\right) _ {+} \right] ^ {2}, +$$ + +where $D_{\mathrm{EDSR}}$ is the MSE of EDSR, and $P_{\mathrm{EDSR}}$ is the estimated Gelbrich distance between EDSR reconstructions and ground-truth images. Note the unoccupied region under the estimated curve in Fig. 3, which is indeed unattainable according to the theory. + +The figure also shows 9 estimators $\hat{X}_t$ , which we construct by interpolation between EDSR and ESRGAN, $\hat{X}_t = tX_{\mathrm{EDSR}} + (1 - t)X_{\mathrm{ESRGAN}}$ with $t \in [0,1]$ . We observe that estimators constructed using these two extreme points are closer to the optimal DP tradeoff than the other evaluated methods. This is true both for the Gelbrich perception index and for FID. In Fig. 4 we present a visual comparison between SRGAN-VGG2,2 [13] and our interpolated estimator $\hat{X}_{0.12}$ . Both achieve roughly the same RMSE distortion (18.08 for SRGAN, 18.14 for $\hat{X}_{0.12}$ ), but our estimator achieves a lower perception index. Namely, by using interpolation, we manage to achieve improvement in perceptual quality, without degradation in distortion. The improvement in visual quality is also apparent in the figure. Additional visual comparisons including more points along the DP curve and ground-truth images can be found in the Appendix. + +# 6 Conclusion + +In this paper we provide a full characterization of the distortion-perception tradeoff for the MSE distortion and the Wasserstein-2 perception index. We show that optimal estimators are obtained by interpolation between the minimum MSE estimator and an optimal perfect perceptual quality estimator. In the Gaussian case, we explicitly formulate these estimators. To the best of our knowledge, this is the first work to derive such closed-form expressions. Our work paves the way towards fully + +![](images/2fdd989c27161edfa30564f677a230c2328295edc23984c0ee8d0a9c541d34c6.jpg) +Figure 3: Evaluation of SR algorithms. We plot 13 algorithms (blue) on the Distortion-Perception plane. In the left pane, perception is measured using the Gelbrich distance between empirical means and covariances of patches from the ground-truth images and the reconstructed images. In the right pane, we measure perception using FID. In orange is the estimated lower bound (9), where we consider EDSR to be the global minimizer $X^{*}$ . Note the unoccupied region under the estimated curve, which is unattainable. We also plot 9 estimators $\hat{X}_t$ (Green) created by interpolation between EDSR and ESRGAN reconstructions, using different relative weights $t$ . Note that estimators constructed using these two extreme estimators are closer to the optimal DP curve than the compared methods. + +![](images/f463c4710df3de354c73c74708e85b2f7dadbeae8e166cfc27ac3d0836b84dbb.jpg) + +![](images/e91c7dbe2a5a219eb252e8e0a4c9657e7997f831f3936d1c5595ba2716e3cbbd.jpg) +Figure 4: A visual comparison between estimators with approximately the same MSE. Upper: SRGAN-VGG $_{2,2}$ . Lower: $\hat{X}_{0.12}$ , an interpolation between EDSR and ESRGAN using $t = 0.12$ . Observe the improvement in perceptual quality, without any significant degradation in distortion. + +understanding the DP tradeoff under more general distortions and perceptual criteria, and bridging between fidelity and visual quality at test-time, without training different models. + +Broader impact Synthesis of photo-realistic visual contents may raise concerns of inappropriate and malicious use. This is true for image generation in general (e.g. with GANs), but to some extent also for image restoration tasks like super-resolution. However, even without malicious intent, the outputs of a high perceptual quality algorithm can often not be very close to the ground truth images. In this paper we quantify this effect, by studying the best similarity (lowest distortion) one can hope to achieve with an algorithm having a prescribed level of perceptual quality. + +Acknowledgments This work was partially supported by grants 451/17 and 852/17 from the Israel Science Foundation, by the Ollendorff Center of the Viterbi Faculty of Electrical and Computer Engineering at the Technion, and by the Skillman chair in biomedical sciences. + +# References + +[1] Mohamed Abderrahmen Abid, Ihsen Hedhli, and Christian Gagné. A generative model for hallucinating diverse versions of super resolution images. arXiv preprint arXiv:2102.06624, 2021. +[2] Luigi Ambrosio, Nicola Gigli, and Giuseppe Savare. Gradient flows: in metric spaces and in the space of probability measures. Springer Science & Business Media, 2008. +[3] Yuval Bahat and Tomer Michaeli. Explorable super resolution. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2716-2725, 2020. +[4] Yochai Blau and Tomer Michaeli. The perception-distortion tradeoff. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 6228-6237, 2018. +[5] Yochai Blau, Roey Mechrez, Radu Timofte, Tomer Michaeli, and Lihi Zelnik-Manor. The 2018 PIRM challenge on perceptual image super-resolution. In Proceedings of the European Conference on Computer Vision (ECCV) Workshops, pages 0–0, 2018. +[6] Xin Deng. Enhancing image quality via style transfer for single image super-resolution. IEEE Signal Processing Letters, 25(4):571-575, 2018. +[7] Roy Friedman and Yair Weiss. Posterior sampling for image restoration using explicit patch priors. arXiv preprint arXiv:2104.09895, 2021. +[8] Matthias Gelbrich. On a formula for the 12 Wasserstein metric between measures on euclidean and hilbert spaces. Mathematische Nachrichten, 147(1):185-203, 1990. +[9] Robert M Gray. Toeplitz and circulant matrices: A review. 2006. +[10] 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. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017. URL https://proceedings.neurips.cc/paper/2017/file/8a1d694707eb0fefe65871369074926d-Paper.pdf. +[11] Bahjat Kawar, Gregory Vaksman, and Michael Elad. Stochastic image denoising by sampling from the posterior distribution. arXiv preprint arXiv:2101.09552, 2021. +[12] Martin Knott and Cyril S Smith. On the optimal mapping of distributions. Journal of Optimization Theory and Applications, 43(1):39-49, 1984. +[13] 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 super-resolution using a generative adversarial network. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4681-4690, 2017. +[14] 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, pages 136-144, 2017. +[15] Andreas Lugmayr, Martin Danelljan, Luc Van Gool, and Radu Timofte. Srlflow: Learning the super-resolution space with normalizing flow. In European Conference on Computer Vision, pages 715-732. Springer, 2020. +[16] David Martin, Charless Fowlkes, Doron Tal, and Jitendra Malik. A database of human segmented natural images and its application to evaluating segmentation algorithms and measuring ecological statistics. In Proceedings Eighth IEEE International Conference on Computer Vision. ICCV 2001, volume 2, pages 416-423. IEEE, 2001. +[17] Pablo Navarrete Michelini, Dan Zhu, and Hanwen Liu. Multi-scale recursive and perception-distortion controllable image super-resolution. In Proceedings of the European Conference on Computer Vision (ECCV) Workshops, pages 0–0, 2018. + +[18] Guy Ohayon, Theo Adrai, Gregory Vaksman, Michael Elad, and Peyman Milanfar. High perceptual quality image denoising with a posterior sampling cgan. arXiv preprint arXiv:2103.04192, 2021. +[19] Felix Otto and Cédric Villani. Generalization of an inequality by talagrand and links with the logarithmic sobolev inequality. Journal of Functional Analysis, 173(2):361-400, 2000. +[20] Victor M Panaretos and Yoav Zemel. An invitation to statistics in Wasserstein space. Springer Nature, 2020. +[21] Mangal Prakash, Alexander Krull, and Florian Jug. Divnoising: diversity denoising with fully convolutional variational autoencoders. arXiv preprint arXiv:2006.06072, 2020. +[22] Mangal Prakash, Mauricio Delbracio, Peyman Milanfar, and Florian Jug. Removing pixel noises and spatial artifacts with generative diversity denoising methods. arXiv preprint arXiv:2104.01374, 2021. +[23] Mehdi SM Sajjadi, Bernhard Scholkopf, and Michael Hirsch. Enhancenet: Single image super-resolution through automated texture synthesis. In Proceedings of the IEEE International Conference on Computer Vision, pages 4491-4500, 2017. +[24] Tamar Rott Shaham, Tali Dekel, and Tomer Michaeli. SinGAN: Learning a generative model from a single natural image. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 4570-4580, 2019. +[25] Assaf Shocher, Nadav Cohen, and Michal Irani. "zero-shot" super-resolution using deep internal learning. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 3118-3126, 2018. +[26] Alon Shoshan, Roey Mechrez, and Lihi Zelnik-Manor. Dynamic-net: Tuning the objective without re-training for synthesis tasks. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 3215-3223, 2019. +[27] Asuka Takatsu. On Wasserstein geometry of gaussian measures. In Probabilistic approach to geometry, pages 463-472. Mathematical Society of Japan, 2010. +[28] Michel Talagrand. Transportation cost for gaussian and other product measures. Geometric & Functional Analysis GAFA, 6(3):587-600, 1996. +[29] Dmitry Ulyanov, Andrea Vedaldi, and Victor Lempitsky. Deep image prior. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 9446-9454, 2018. +[30] Michael Unser. On the approximation of the discrete karhunen-loeve transform for stationary processes. Signal Processing, 7(3):231-249, 1984. +[31] Xintao Wang, Ke Yu, Shixiang Wu, Jinjin Gu, Yihao Liu, Chao Dong, Yu Qiao, and Chen Change Loy. ESRGAN: Enhanced super-resolution generative adversarial networks. In Proceedings of the European Conference on Computer Vision (ECCV) Workshops, pages 0–0, 2018. +[32] Xintao Wang, Ke Yu, Chao Dong, Xiaou Tang, and Chen Change Loy. Deep network interpolation for continuous imagery effect transition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1692-1701, 2019. +[33] Zhen Zhang, Mianzhi Wang, and Arye Nehorai. Optimal transport in reproducing kernel hilbert spaces: Theory and applications. IEEE transactions on pattern analysis and machine intelligence, 42(7):1741-1754, 2019. \ No newline at end of file diff --git a/atheoryofthedistortionperceptiontradeoffinwassersteinspace/images.zip b/atheoryofthedistortionperceptiontradeoffinwassersteinspace/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..6ad464778b3c33ab0bea204fb06b6fc0a2def6b8 --- /dev/null +++ b/atheoryofthedistortionperceptiontradeoffinwassersteinspace/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:246859dc95b3ac8fb0a58bd78de0eb0a21aa08d0ac85e50d5e5423995fc11dd6 +size 354928 diff --git a/atheoryofthedistortionperceptiontradeoffinwassersteinspace/layout.json b/atheoryofthedistortionperceptiontradeoffinwassersteinspace/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..7bf4fa6d0c8e26bf4433862f451fa50cb9d5be59 --- /dev/null +++ b/atheoryofthedistortionperceptiontradeoffinwassersteinspace/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2aecaea06610e68fc71c1f7afd33898dbaaad695abf7120eb5379bf15f312f1f +size 606710 diff --git a/atopologicalperspectiveoncausalinference/bcb8efce-e668-453d-b3df-ca32c00da1b3_content_list.json b/atopologicalperspectiveoncausalinference/bcb8efce-e668-453d-b3df-ca32c00da1b3_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..2fb0d5a6bf0640ae7bfb223287b1f5a3cea731a4 --- /dev/null +++ b/atopologicalperspectiveoncausalinference/bcb8efce-e668-453d-b3df-ca32c00da1b3_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d216b8b3fd03b6ce6b3d84d976edbb8a2d4b9dbc7728b2cd1b58ac79f530b6f +size 87613 diff --git a/atopologicalperspectiveoncausalinference/bcb8efce-e668-453d-b3df-ca32c00da1b3_model.json b/atopologicalperspectiveoncausalinference/bcb8efce-e668-453d-b3df-ca32c00da1b3_model.json new file mode 100644 index 0000000000000000000000000000000000000000..bef57d03084c1cde594911681cf477c2f33d5eb8 --- /dev/null +++ b/atopologicalperspectiveoncausalinference/bcb8efce-e668-453d-b3df-ca32c00da1b3_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cca720d157b92cadcf59fc6765f1c0bc48a9fff002d4bf591e2a2c87f4c0ebfb +size 105942 diff --git a/atopologicalperspectiveoncausalinference/bcb8efce-e668-453d-b3df-ca32c00da1b3_origin.pdf b/atopologicalperspectiveoncausalinference/bcb8efce-e668-453d-b3df-ca32c00da1b3_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c4968fe219e94f22ab676973db6a2e052228498d --- /dev/null +++ b/atopologicalperspectiveoncausalinference/bcb8efce-e668-453d-b3df-ca32c00da1b3_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:729374575218f86523575089a9b34ebc845134928560f374fa6dce0f50236152 +size 361644 diff --git a/atopologicalperspectiveoncausalinference/full.md b/atopologicalperspectiveoncausalinference/full.md new file mode 100644 index 0000000000000000000000000000000000000000..a437799e96e1c4fab3bc2f7f29f1ee484d92e8b8 --- /dev/null +++ b/atopologicalperspectiveoncausalinference/full.md @@ -0,0 +1,362 @@ +# A Topological Perspective on Causal Inference + +Duligur Ibeling + +Department of Computer Science + +Stanford University + +duligur@stanford.edu + +Thomas Icard + +Department of Philosophy + +Stanford University + +icard@stanford.edu + +# Abstract + +This paper presents a topological learning-theoretic perspective on causal inference by introducing a series of topologies defined on general spaces of structural causal models (SCMs). As an illustration of the framework we prove a topological causal hierarchy theorem, showing that substantive assumption-free causal inference is possible only in a meager set of SCMs. Thanks to a known correspondence between open sets in the weak topology and statistically verifiable hypotheses, our results show that inductive assumptions sufficient to license valid causal inferences are statistically unverifiable in principle. Similar to no-free-lunch theorems for statistical inference, the present results clarify the inevitability of substantial assumptions for causal inference. An additional benefit of our topological approach is that it easily accommodates SCMs with infinitely many variables. We finally suggest that the framework may be helpful for the positive project of exploring and assessing alternative causal-inductive assumptions. + +# 1 Introduction and Motivation + +In the background of any investigation into learning algorithms are no-free-lunch phenomena: roughly, the observation that assumption-free statistical learning is infeasible in general (see, e.g., [33, Ch. 5] for a formal statement). Common wisdom is that learning algorithms and architectures must adequately reflect non-trivial features of the data-generating distribution to gain inductive purchase. + +For many purposes we need to move beyond passive observation, focusing instead on what would happen were we to act upon a given system. Even further, we sometimes desire to explain the behavior of a system, raising questions about what would have occurred had some aspects of a situation been different. Such questions depend not just on the data distribution; they depend on deeper features of underlying data-generating processes or mechanisms. It is thus generally acknowledged that stronger assumptions are required if we want to draw causal conclusions from data [35, 28, 20, 30, 32]. + +Whether implicit or explicit, any approach to causal inference involves a space of candidate causal models, viz. data-generating processes. Indeed, a blunt way of incorporating inductive bias is simply to omit some class of possible causal hypotheses from consideration. Many (im)possibility results in the literature can accordingly be understood as pertaining to all models within a class. For instance, if we can restrict attention to Markovian models that satisfy faithfulness, then we can always identify the structure of a model from experimental data (e.g., [11, 35]). If we can restrict attention to Markovian (continuous) models with linear functions and non-Gaussian noise, then every model can be learned even from purely observational data [34]. As a negative example, in the larger class of (not necessarily Markovian) models, no model can ever be determined from observational data alone [35, 2]. + +At the same time, in many settings it is sensible to aim for results with "nearly universal" force. It is natural to ask, e.g., within the class of all Markovian models, how "typical" are those in which the faithfulness condition is violated? This might tell us, for instance, how typically we could expect failure of a method that depended on these assumptions. A well-known result shows that, fixing + +any particular causal dependence graph, such violations have measure zero for any smooth (e.g., Lebesgue) measure on the parameter space of distributions consistent with that graph [24]. In fact, the standard notion of statistical consistency itself, which underlies many possibility results in causal inference, requires omission of some purportedly "negligible" set of possible data streams [9, 35]. + +There are two standard mathematical approaches to making concepts like "typical" and "negligible" rigorous: measure-theoretic and topological. While the two approaches often agree, they capture slightly different intuitions [25]. One virtue of the measure-theoretic approach is its natural probabilistic interpretation: intuitively, we are exceedingly unlikely to hit upon a set with measure zero. At the same time, the measure-theoretic approach is sometimes criticized in statistical settings for its alleged dependence on a measure, and this has been argued to favor topological approaches (see, e.g., [3] on no-free-lunch theorems). The latter of course in turn demands an appropriate topology. + +In the present work we show how to define a sequence of meaningful topologies on the space of causal models, each corresponding to a progressively coarser level of the so called causal hierarchy ([29, 2]; see Fig. 1 for an abbreviated pictorial summary). We aim to demonstrate that topologizing causal models in this way helps clarify the scope and limits of causal inference under different assumptions, as well as the potential empirical status of those very assumptions, in a highly general setting. + +Our starting point is a canonical topology on the space of Borel probability distributions called the weak topology. The weak topology is grounded in the fundamental notion of weak convergence of probability distributions [4] and is thereby closely related to problems of statistical inference (see, e.g., [8]). Recent work has sharpened this correspondence, showing that open sets in the weak topology correspond exactly to the statistical hypotheses that can be naturally deemed verifiable [14, 16]. We extend the correspondence to higher levels of the causal hierarchy, including the most refined and expansive "top" level consisting of all (well-founded) causal models. Lower levels and natural subspaces (e.g., corresponding to prominent causal assumption classes) emerge as coarsenings and continuous projections of this largest space. As an illustration of the general approach, we prove a topological version of the causal hierarchy theorem from [2]. Rather than showing that collapse happens only in a measure zero set as in [2], our Theorem 3 show that collapse is topologically meager. Conceptually, this highlights a different (but complementary) intuition: not only is collapse exceedingly unlikely in the sense of measure, meagerness implies that collapse could never be statistically verified. Correlatively, this implies that any causal assumption that would generally allow us to infer counterfactual probabilities from experimental (or "interventional") probabilities must itself be statistically unverifiable (Corollary 1). + +To derive such a result we actually show something slightly stronger (see Lem. 2): even with respect to the subspace of models consistent with a fixed temporal order on variables, the causal hierarchy theorem holds. Merely knowing the temporal order of the variables is not enough to render collapse of the hierarchy a statistically verifiable proposition. Furthermore, we show that the witness to collapse can be taken as any of the well-known counterfactual "probabilities of causation" (see, e.g., [27]): probabilities of necessity, sufficiency, necessity and sufficiency, enablement, or disablement. That is, none of these important quantities are fully determined by experimental data except in a meager set. + +In §2 we give background on causal models, and in §3 we present a model-theoretic characterization of the causal hierarchy as a sequence of spaces. Topology is introduced in §4, and the main results about collapse appear in §5. For the technical results, we include proof sketches in the main text to provide the core intuitions, relegating some of the details to an exhaustive technical appendix, which also includes additional supplementary material. + +# 2 Structural Causal Models + +A fundamental building block in the theory of causality is the structural causal model [26, 35, 28] or SCM, which formalizes the notion of a data-generating process. In addition to specifying data-generating distributions, these models also specify the generative mechanisms that produce them. For the purpose of causal inference and learning, SCMs provide a broad, fine-grained hypothesis space. + +The notions in this section have their usual definition following, e.g., [28], but we have recast them in the standard language of Borel probability spaces so as to handle the case of infinitely many variables rigorously. We start with notation, basic assumptions, and some probability theory. + +Notation. The signature (or range) of a variable $V$ is denoted $\chi_V$ . Where $\mathbf{S}$ is a set of variables, let $\chi_{\mathbf{S}} = \times_{S\in \mathbf{S}}\chi_S$ . Given an indexed family of sets $\{S_{\beta}\}_{\beta \in B}$ and elements $s_\beta \in S_\beta$ , let $(s_\beta)_\beta$ denote the tuple whose element at index $\beta$ is $s_\beta$ , for all $\beta$ . For $B' \subset B$ write $\pi_{B'}: \times_{\beta \in B} S_\beta \to \times_{\beta \in B'} S_\beta$ for the projection map sending each $(s_\beta)_{\beta \in B} \mapsto (s_{\beta'})_{\beta' \in B'}$ ; abbreviate $\pi_{\beta'} = \pi_{\{\beta'\}}$ , where $\beta' \in B$ . + +The reader is referred to standard texts [21, 5] for elaboration on the concepts used below. + +Definition 1 (Topology). For discrete spaces (like $\chi_S$ , for a single categorical variable $S$ ) we use the discrete topology and for product spaces (like $\chi_{\mathbf{S}}$ for a set of variables $\mathbf{S}$ ) we use the product topology. Note that the so-called cylinder sets of the form $\pi_{\mathbf{Y}}^{-1}(\{\mathbf{y}\})$ for finite subsets $\mathbf{Y} \subset \mathbf{S}$ and $\mathbf{y} \in \chi_{\mathbf{Y}}$ form a basis for the product topology on $\chi_{\mathbf{S}}$ . This cylinder set is a subset of $\chi_{\mathbf{S}}$ , and contains exactly those valuations agreeing with the value $\pi_Y(\mathbf{y})$ specified in $\mathbf{y}$ for $Y$ , for every $Y \in \mathbf{Y}$ . Following standard statistical notation this cylinder is abbreviated as simply $\mathbf{y}$ . + +Definition 2 (Probability). Where $\vartheta$ is a topological space write $\mathcal{B}(\vartheta)$ for its Borel $\sigma$ -algebra of measurable subsets. Let $\mathfrak{P}(\vartheta)$ be the set of probability measures on $\mathcal{B}(\vartheta)$ . Specifically, elements of $\mathfrak{P}(\vartheta)$ are functions $\mu : \mathcal{B}(\vartheta) \to [0,1]$ assigning a probability to each measurable set such that $\mu(\vartheta) = 1$ and $\mu\left(\bigcup_{i=1}^{\infty}(S_i)\right) = \sum_{i=1}^{\infty}\mu(S_i)$ for each sequence $S_1, S_2, \ldots$ of pairwise disjoint sets from $\mathcal{B}(\vartheta)$ . A map $f: \vartheta_1 \to \vartheta_2$ is said to be measurable if $f^{-1}(S_2) \in \mathcal{B}(\vartheta_1)$ for every $S_2 \in \mathcal{B}(\vartheta_2)$ . + +Fact 1 (Lemma 1.9.4 [5]). A Borel probability measure is determined by its values on a basis. + +# 2.1 SCMs, Observational Distributions + +Let $\mathbf{V}$ be a set of endogenous variables. We assume for simplicity every variable $V\in \mathbf{V}$ is dichotomous with $\chi_V = \{0,1\}$ , although the results here generalize to any larger countable range. Influences among endogenous variables are the main phenomena our formalism aims to capture. A well-founded direct influence relation $\rightarrow$ on $\mathbf{V}$ encapsulates the notion of one endogenous variable possibly influencing another. For each $V\in \mathbf{V}$ , we call $\{V^{\prime}\in \mathbf{V}:V^{\prime}\to V\} = \mathbf{P}\mathbf{a}(V)$ the parents of $\mathbf{V}$ . We assume every set $\mathbf{P}\mathbf{a}(V)$ is finite; this condition is called local finiteness. These two assumptions (well-foundedness and local finiteness) generalize the common recursiveness assumption to the infinitary setting, and have an alternative characterization in terms of "temporal" orderings: + +Fact 2. Say that a total order $\prec$ on $\mathbf{V}$ is $\omega$ -like if every node has finitely many predecessors: for each $V \in \mathbf{V}$ , the set $\{V': V' \prec V\}$ is finite. Then the influence relation $\rightarrow$ is extendible to an $\omega$ -like order iff $\rightarrow$ is well-founded and locally finite. + +In addition to endogenous variables, causal models have exogenous variables $\mathbf{U}$ . Each endogenous $V$ depends on a subset $\mathbf{U}(V) \subset \mathbf{U}$ of "exogenous parents" and uncertainty enters via exogenous noise, that is, a distribution from $\mathfrak{P}(\chi_{\mathbf{U}})$ . A structural function (or mechanism) for $V \in \mathbf{V}$ is a measurable $f_V: \chi_{\mathbf{Pa}(V)} \times \chi_{\mathbf{U}(V)} \to \chi_V$ mapping parental endogenous and exogenous valuations to values. + +Definition 3. A structural causal model is a tuple $\mathcal{M} = \langle \mathbf{U},\mathbf{V},\{f_V\}_{V\in \mathbf{V}},P\rangle$ where $\mathbf{U}$ is a collection of exogenous variables, $\mathbf{V}$ is a collection of endogenous variables, $f_{V}$ is a structural function for each $V\in \mathbf{V}$ , and $P\in \mathfrak{P}(\chi_{\mathbf{U}})$ is a probability measure on (the Borel $\sigma$ -algebra of) $\chi_{\mathbf{U}}$ . + +As is well known, recursiveness implies that each $\mathbf{u} \in \chi_{\mathbf{U}}$ induces a unique $\mathbf{v} \in \chi_{\mathbf{V}}$ that solves the simultaneous system of structural equations $\{V = f_V\}_{V}$ : + +Proposition 1. Any SCM $\mathcal{M}$ with well-founded, locally finite parent relation $\rightarrow$ induces a unique measurable $m^{\mathcal{M}}:\chi_{\mathbf{U}}\to \chi_{\mathbf{V}}$ such that $f_{V}\bigl (\pi_{\mathbf{Pa}(V)}(m^{\mathcal{M}}(\mathbf{u})),\pi_{\mathbf{U}(V)}(\mathbf{u})\bigr) = \pi_{V}\bigl (m^{\mathcal{M}}(\mathbf{u})\bigr)$ for all $\mathbf{u}\in \chi_{\mathbf{U}}$ and $V\in \mathbf{V}$ . + +Measurability then entails that the exogenous noise $P$ induces a distribution on joint valuations of $\mathbf{V}$ , called the observational distribution, which characterizes passive observations of the system. + +Definition 4. The observational distribution $p^{\mathcal{M}} \in \mathfrak{P}(\chi_{\mathbf{V}})$ is defined on open sets by $p^{\mathcal{M}}(\mathbf{y}) = P((m^{\mathcal{M}})^{-1}(\mathbf{y}))$ . Here recall that $\mathbf{y}$ represents a cylinder subset (Definition 1) of $\chi_{\mathbf{V}}$ . + +# 2.2 Interventions + +What makes SCMs distinctively causal is the way they accommodate statements about possible manipulations of a causal setup capturing, e.g., observations resulting from a controlled experimental trial. This is formalized in the following definition. + +Definition 5. An intervention is a choice of a finite subset of variables $\mathbf{W} \subset \mathbf{V}$ and $\mathbf{w} \in \chi_{\mathbf{W}}$ . This intervention is written $\mathbf{W} := \mathbf{w}$ , and we let $A$ be the set of all interventions. Under this intervention, each $W \in \mathbf{W}$ is held fixed to its value $\pi_W(\mathbf{w}) \in \chi_W$ in $\mathbf{w}$ while the mechanism for any $V \in \mathbf{V} \setminus \mathbf{W}$ is left unchanged. Specifically, where $\mathcal{M}$ is as in Definition 3, the manipulated model for $\mathbf{W} := \mathbf{w}$ is the model $\mathcal{M}_{\mathbf{W} := \mathbf{w}} = \langle \mathbf{U}, \mathbf{V}, \{f_V^{\mathbf{W} := \mathbf{w}}\}_{V \in \mathbf{V}}, P \rangle$ where + +$$ +f _ {V} ^ {\mathbf {W} := \mathbf {w}} = \left\{ \begin{array}{l l} f _ {V}, & V \notin \mathbf {W} \\ \text {c o n s t a n t f u n c . m a p p i n g t o} \pi_ {V} (\mathbf {w}), & V \in \mathbf {W}. \end{array} \right. +$$ + +The interventional or experimental distribution $p^{\mathcal{M}_{\mathbf{W}}: = \mathbf{w}} \in \mathfrak{P}(\chi_{\mathbf{V}})$ is just the observational distribution for the manipulated model $\mathcal{M}_{\mathbf{W}:= \mathbf{w}}$ , and it encodes the probabilities for an experiment in which the variables $\mathbf{W}$ are fixed to the values $\mathbf{w}$ . + +Remark 1. Empty interventions $\varnothing := ()$ are just passive observations, i.e., $p^{\mathcal{M}_{\varnothing:=0}} = p^{\mathcal{M}}$ . + +# 2.3 Counterfactuals + +By permitting multiple manipulated settings to share exogenous noise, not only the distribution arising from a single manipulation, but also joint distributions over multiple can be considered. These are often called counterfactuals. The set $\mathfrak{P}(\chi_{A\times \mathbf{V}})$ encompasses the combined joint distributions over $\mathbf{V}$ for any combination of interventions from $A$ . A basis for the space $\chi_{A\times \mathbf{V}}$ are the cylinder sets of the following form, for some sequence $(\mathbf{X}\coloneqq \mathbf{x},\mathbf{Y}),\ldots ,(\mathbf{W}\coloneqq \mathbf{w},\mathbf{Z})$ of pairs, where $\mathbf{Y},\dots,\mathbf{Z}\subset \mathbf{V}$ are finite, and $\mathbf{X}\coloneqq \mathbf{x},\ldots ,\mathbf{W}\coloneqq \mathbf{w}\in A$ are interventions: + +$$ +\pi_ {\{\mathbf {X} := \mathbf {x} \} \times \mathbf {Y}} ^ {- 1} (\{\mathbf {y} \}) \cap \dots \cap \pi_ {\{\mathbf {W} := \mathbf {w} \} \times \mathbf {Z}} ^ {- 1} (\{\mathbf {z} \}). +$$ + +We will abbreviate this open set as $\mathbf{y}_{\mathbf{x}},\ldots ,\mathbf{z}_{\mathbf{w}}$ , writing, e.g. simply $\mathbf{x}$ for the intervention $\mathbf{X} = \mathbf{x}$ + +Definition 6. Given $\mathcal{M}$ , define a counterfactual distribution $p_{\mathrm{cf}}^{\mathcal{M}} \in \mathfrak{P}(\chi_{A \times \mathbf{V}})$ on a basis as follows: + +$$ +p _ {\mathrm {c f}} ^ {\mathcal {M}} \left(\mathbf {y} _ {\mathbf {x}}, \dots , \mathbf {z} _ {\mathbf {w}}\right) = P \left(\left(m ^ {\mathcal {M} _ {\mathbf {X} := \mathbf {x}}}\right) ^ {- 1} (\mathbf {y}) \cap \dots \cap \left(m ^ {\mathcal {M} _ {\mathbf {W} := \mathbf {w}}}\right) ^ {- 1} (\mathbf {z})\right). +$$ + +Here, the letters $\mathbf{y},\dots ,\mathbf{z}$ on the right-hand side abbreviate the respective cylinder sets (Definition 1) $\pi_{\mathbf{Y}}^{-1}(\{\mathbf{y}\}),\ldots ,\pi_{\mathbf{Z}}^{-1}(\{\mathbf{z}\})$ + +Remark 2. Marginalizing $p_{\mathrm{cf}}^{\mathcal{M}}$ to any single intervention $\mathbf{W} \coloneqq \mathbf{w}$ yields $p^{\mathcal{M}\mathbf{W}:= \mathbf{w}}$ . If $\chi_{\mathbf{U}}$ is finite, we obtain a familiar [13] sum formula $p_{\mathrm{cf}}^{\mathcal{M}}(\mathbf{y}_{\mathbf{x}},\dots,\mathbf{z}_{\mathbf{w}}) = \sum_{\{\mathbf{u}|m^{\mathcal{M}}\mathbf{x}:= \mathbf{x}(\mathbf{u})\in \mathbf{y},\dots,m^{\mathcal{M}}\mathbf{W}:= \mathbf{w}(\mathbf{u})\in \mathbf{z}\}}P(\mathbf{u})$ . + +Example 1. As a very simple example (drawn from [28, 2]), just to illustrate the previous definitions and notation, consider a scenario with two binary exogenous variables $\mathbf{U} = \{U_1, U_2\}$ and two binary endogenous variables $\mathbf{V} = \{X, Y\}$ . Let $U_1, U_2$ both be uniformly distributed, and define $f_X: \chi_{U_1} \to \chi_X$ to be the identity, and $f_Y: \chi_X \times \chi_{U_2} \to \chi_Y$ by $f_Y(u, x) = ux + (1 - u)(1 - x)$ . This fully defines an SCM $\mathcal{M}$ with influence $X \to Y$ , and produces an observational distribution $p^{\mathcal{M}}$ such that $p^{\mathcal{M}}(x, y) = 1/4$ for all four settings $X = x, Y = y$ . + +The space $A$ of interventions in this example includes the empty intervention and all combinations of $X := x$ and $Y := y$ , with $x, y \in \{0, 1\}$ . Notably, all interventional distributions here collapse to observational distributions, e.g., $p^{\mathcal{M}}_{X := x}(X, Y) = p^{\mathcal{M}}(X, Y)$ , for both values of $x$ . Thus, "experimental" manipulations of this system reveal little interesting causal structure. The counterfactual distribution $p_{\mathrm{cf}}^{\mathcal{M}}$ , however, does not trivialize. For instance, $p_{\mathrm{cf}}^{\mathcal{M}}((X := 1, Y = 1), (X := 0, Y = 0)) = 1/2$ . This term is known as the probability of necessity and sufficiency [27], which we can abbreviate by $p_{\mathrm{cf}}^{\mathcal{M}}(y_x, y_{x'}')$ . Note that $p_{\mathrm{cf}}^{\mathcal{M}}(y_x, y_{x'}) \neq p_{\mathrm{cf}}^{\mathcal{M}}(y_x) p_{\mathrm{cf}}^{\mathcal{M}}(y_{x'}) = 1/4$ . Similarly, $p_{\mathrm{cf}}^{\mathcal{M}}(y_x', y_{x'}) = 1/2$ . + +# 2.4 SCM classes + +We now define several subclasses of SCMs that we will use throughout the paper. Notably, we do not require their endogenous variable sets $\mathbf{V}$ to be finite. It is infinite in many applications, for instance, in time series models, or generative models defined by probabilistic programs (see, e.g., [18, 36]). Because the proofs call for slightly different methods, we deal with the infinite and finite cases separately. We make one additional assumption in the infinite case. + +Definition 7. $\mu \in \mathfrak{P}(\vartheta)$ is atomless if $\mu (\{t\}) = 0$ for each $t\in \vartheta$ . $\mathcal{M}$ is atomless if $p_{\mathrm{cf}}^{\mathcal{M}}$ is atomless. + +Intuitively, an atomless distribution is one in which weight is always " smeared" out continuously and there are no point masses; infinitely many fair coin flips, for example, generate an atomless distribution as the probability of obtaining any given infinite sequence is zero. + +Definition 8. For the remainder of the paper, fix a countable endogenous variable set $\mathbf{V}$ . Define the following classes of SCMs: + +$\mathfrak{M}_{\prec} = \mathrm{SCMs}$ over $\mathbf{V}$ whose influence relation is extendible to the $\omega$ -like order $\prec$ + +$\mathfrak{M}_X = \mathrm{SCMs}$ over $\mathbf{V}$ in which the variable $X$ has no parents: $\mathbf{P}\mathbf{a}(X) = \varnothing$ + +$$ +\mathfrak {M} = \text {a l l S C M s o v e r} \mathbf {V} = \bigcup_ {\prec} \mathfrak {M} _ {\prec} = \bigcup_ {X} \mathfrak {M} _ {X}. +$$ + +If $\mathbf{V}$ is infinite then all SCMs in the classes above are assumed to be atomless. + +# 3 The Causal Hierarchy + +Implicit in §2, and indeed in much of the literature on causal inference, is a hierarchy of causal expressivity. Following the metaphor offered in [29], it is natural to characterize three levels of the hierarchy as the observational, interventional (experimental), and counterfactual (explanatory). Drawing on recent work [2, 19] we make this characterization explicit. The levels will be defined in descending order of causal expressivity (the reverse of §2). Fig. 1(a) summarizes our definitions. + +Higher levels determine lower levels—counterfactuals determine interventionals, and the observational is just an (empty) interventional. Thus movement "downward" in the causal hierarchy corresponds to a kind of projection. For indexed $\{S_{\beta}\}_{\beta \in B}$ and $B' \subset B$ let $\varsigma_{B'}: \mathfrak{P}(\times_{\beta \in B} S_{\beta}) \to \mathfrak{P}(\times_{\beta \in B'} S_{\beta})$ be the marginalization map taking a joint distribution to its marginal on $B'$ . + +Definition 9. Define three composable causal projections $\{\varpi_i\}_{1\leq i\leq 3}$ with signatures and definitions + +$$ +\varpi_ {3}: \mathfrak {M} \to \mathfrak {P} (\chi_ {A \times \mathbf {V}}), \quad \varpi_ {2}: \mathfrak {P} (\chi_ {A \times \mathbf {V}}) \to \times_ {\alpha \in A} \mathfrak {P} (\chi_ {\mathbf {V}}), \quad \varpi_ {1}: \bigvee_ {\alpha \in A} \mathfrak {P} (\chi_ {\mathbf {V}}) \to \mathfrak {P} (\chi_ {\mathbf {V}}); +$$ + +$$ +\varpi_ {3}: \mathcal {M} \mapsto p _ {\mathrm {c f}} ^ {\mathcal {M}}, \quad \varpi_ {2}: \mu_ {3} \mapsto \big (\varsigma_ {\{\alpha \} \times \mathbf {V}} (\mu_ {3}) \big) _ {\alpha \in A}, \quad \varpi_ {1}: (\mu_ {\alpha}) _ {\alpha \in A} \mapsto \mu_ {\emptyset : = ()} = \pi_ {\emptyset : = ()} \big ((\mu_ {\alpha}) _ {\alpha} \big). +$$ + +The causal hierarchy consists of three sets $\{\mathfrak{S}_i\}_{1\leq i\leq 3}$ defined as images or projections of $\mathfrak{M}$ : + +$$ +\mathfrak {S} _ {3} = \varpi_ {3} (\mathfrak {M}), \quad \mathfrak {S} _ {2} = \varpi_ {2} (\mathfrak {S} _ {3}), \quad \mathfrak {S} _ {1} = \varpi_ {1} (\mathfrak {S} _ {2}). +$$ + +These are the three Levels of the hierarchy. The definitions cohere with those of $\S 2$ (and, e.g., [28, 2]): + +Fact 3. Let $\mathcal{M} \in \mathfrak{M}$ . Then $\mu_3 = \varpi_3(\mathcal{M}) \in \mathfrak{S}_3$ trivially coincides with its counterfactual distribution as defined in §2.3, while $(\mu_{\alpha})_{\alpha} = \varpi_2(\mu_3) \in \mathfrak{S}_2$ coincides with the indexed family of all its interventional distributions (§2.2), i.e., $\pi_{\mathbf{W}:=\mathbf{w}}((\mu_{\alpha})_{\alpha}) = p^{\mathcal{M}_{\mathbf{W}:=\mathbf{w}}} \text{ for each } \mathbf{W} := \mathbf{w} \in A$ . Finally $\mu = \varpi_1((\mu_{\alpha})_{\alpha}) \in \mathfrak{S}_1$ coincides with its observational distribution (§2.1). + +Thus, e.g., $\mathfrak{S}_3$ is the set of counterfactual distributions that are consistent with at least some SCM from $\mathfrak{M}$ . It is a fact that $\mathfrak{S}_3 \subsetneq \mathfrak{P}(\chi_{A \times \mathbf{V}})$ and similarly not every interventional family belongs to $\mathfrak{S}_2$ ; see Appendix B for explicit characterizations. At the observational level, this is simple: + +Fact 4. $\mathfrak{S}_1 = \mathfrak{P}(\chi_{\mathbf{V}})$ in the finite case. In the infinite case, $\mathfrak{S}_1 = \{\mu \in \mathfrak{P}(\chi_{\mathbf{V}}):\mu$ is atomless}. + +We will also use the subsets $\{\mathfrak{S}_i^{\prec}\}_{i}$ and $\{\mathfrak{S}_i^X\}_{i}$ , which are defined analogously but via projection from $\mathfrak{M}_{\prec}$ and $\mathfrak{M}_X$ respectively. + +# 3.1 Problems of Causal Inference + +As elucidated in [29, 2], the causal hierarchy helps characterize many standard problems of causal inference, in as far as these problems typically involve ascending levels of the hierarchy. Some examples include: + +1. Classical identifiability: given observational data about some variables in $\mathbf{V}$ , estimate a causal effect of setting variables $\mathbf{X}$ to values $\mathbf{x}$ [26, 35]. In the notation here, given information about $p^{\mathcal{M}}(\mathbf{V})$ , can we determine $p^{\mathcal{M}}_{\mathbf{X}:=\mathbf{x}}(\mathbf{Y})$ ? + +![](images/b0068425207afdeb5f34474bc277045d3f7bad686b97da2519d683ac82e8a863.jpg) +(a) Causal Hierarchy + +![](images/26cc73472ef3c1e415816041f4dedeea372a0a5d90d931d514df93e00d1ae22e.jpg) +(b) Collapse Set $\mathfrak{C}_2$ +Figure 1: (a) $\mathfrak{S}_3$ can be seen as a coarsening of $\mathfrak{M}$ , abstracting from irrelevant "intensional" details. $\mathfrak{S}_2$ is obtained from $\mathfrak{S}_3$ by marginalization (also a coarsening), while $\mathfrak{S}_1$ is a projection of $\mathfrak{S}_2$ via the "empty" intervention. Each map $\varpi_i$ , $i = 1, 2, 3$ , is continuous for the respective weak topologies (Prop. 4). The projections $\varpi_2^{X \to Y}$ from $\mathfrak{S}_2$ to the 2VE-spaces are likewise continuous (Prop. 4). (b) The shaded region, $\mathfrak{C}_2 \subset \mathfrak{S}_2$ , is the collapse set in which Level 2 facts determine all Level 3 facts: those points in $\mathfrak{S}_2$ whose $\varpi_2$ -preimage in $\mathfrak{S}_3$ is a singleton set. The main result of this paper is that $\mathfrak{C}_2$ is meager in weak topology on $\mathfrak{S}_2$ (Thm. 3). This means $\mathfrak{C}_2$ contains no open subset, which by Thm. 2 implies no part of $\mathfrak{C}_2$ is statistically verifiable, even with infinitely many ideal experiments. + +2. General identifiability: given a mix of observational data and limited experimental data-- that is, information about $p^{\mathcal{M}}(\mathbf{V})$ as well as some experimental distributions of the form $p^{\mathcal{M}_{\mathbf{W}:=\mathbf{w}}(\mathbf{V})}$ --determine $p^{\mathcal{M}_{\mathbf{X}:=\mathbf{x}}(\mathbf{Y})}$ [38, 22]. +3. Structure learning: given observational data, and perhaps experimental data, infer properties of the underlying causal influence relation $\rightarrow$ [35, 30]. +4. Counterfactual estimation: given a combination of observational and experimental data, infer a counterfactual quantity, such as probability of necessity [31], or probability of necessity and sufficiency [27, 37] (see also §3.3 below). +5. Global identifiability: given observational data drawn from $p^{\mathcal{M}}(\mathbf{V})$ infer the full counterfactual distribution $p_{\mathrm{cf}}^{\mathcal{M}}(A \times \mathbf{V})$ [34, 10]. + +This is not an exhaustive list, and these problems are not all independent of one another. They are also all unsolvable in general. Problems 1, 2, and 3 involve ascending to Level 2 given information at Level 1 (and perhaps partial information at Level 2); problems 4 and 5 ask us to ascend to Level 3 given only Level 1 (and perhaps also Level 2) information. The upshot of the causal hierarchy theorem from [2] is that these steps are impossible without assumptions, formalizing the common wisdom, "no causes in, no causes out" [7]. To understand the statement of the causal hierarchy theorem—and our topological version of it—we explain what it means for the hierarchy to collapse. + +# 3.2 Collapse of the Hierarchy + +In the present setting a collapse of the hierarchy can be understood in terms of injectivity of the functions $\varpi_{i}$ . For $i = 1,2$ let $\mathfrak{C}_i\subset \mathfrak{S}_i$ be the injective fibers of $\varpi_{i}$ , i.e., $\mathfrak{C}_i = \{\mu_i\in \mathfrak{S}_i:\mu_{i + 1} = \mu_{i + 1}^{\prime}$ whenever $\varpi_{i}(\mu_{i + 1}) = \varpi_{i}(\mu_{i + 1}^{\prime}) = \mu_{i}\}$ . Every element $\mu \in \mathfrak{C}_i$ is a witness to (global) collapse of the hierarchy: knowing $\mu$ would be sufficient to determine the Level $i + 1$ facts completely. + +A first observation is that $\varpi_{1}$ is never injective. In other words, the distribution $p^{\mathcal{M}}(\mathbf{V})$ never determines all the interventional distributions $p^{\mathcal{M}}\mathbf{x}:= \mathbf{x}(\mathbf{Y})$ . This is essentially a way of stating that correlation never implies causation absent assumptions. (See also [2, Thm. 1].) + +Proposition 2. $\mathfrak{C}_1 = \emptyset$ . That is, Level 2 never collapses to Level 1 without assumptions. + +To overcome this formidable inferential barrier, researchers often assume we are not working in the "full" space $\mathfrak{M}$ of all causal models, but rather some proper subset embodying a range of causal assumptions. This may effectively eliminate counterexamples to collapse (cf. Fig. 1(b)). For problems of type 1 or 2 (from the list above in §3.1) it is common to assume we are only dealing with models whose graph (direct influence relation) $\rightarrow$ satisfies a fixed set of properties. For problems of type 3 it is common to assume that $p^{\mathcal{M}}$ and $\rightarrow$ relate in some way (for instance, through an assumption like faithfulness or minimality [35]). All of these problems become solvable with sufficiently strong assumptions about the form of the functions $\{f_V\}_V$ or the probability space $P$ . + +In some cases, the relevant causal assumptions are justified by appeal to background or expert knowledge. In other cases, however, an assumption will be justified by the fact that it rules out only + +a "small" or "negligible" or "measure zero" part of the full set $\mathfrak{M}$ of possibilities. As emphasized by a number of authors [12, 39, 23], not all "small" subsets are the same, and it seems reasonable to demand further justification for eliminating one over another. We believe that the framework presented here can contribute to this positive project, but our immediate interest is in solidifying and clarifying limiting results about what cannot be done. + +The issue of collapse becomes especially delicate when we turn to $\mathfrak{C}_2$ . When do interventional distributions fully determine counterfactual distributions? In contrast to Prop. 2 we have: + +Proposition 3. $\mathfrak{C}_2\neq \emptyset$ . That is, there exists an SCM in which Level 3 collapses to Level 2. + +Proof sketch. As a very simple example in the finite case, any fully deterministic SCM will result in collapse. This is because, if $(\mu_{\alpha})_{\alpha \in A}$ are all binary-valued then the measure $\mu_3 \in \mathfrak{P}\big(\times_{\alpha \in A} \chi_{\mathbf{V}}\big)$ that produces the marginals $\mu_{\alpha}$ is completely determined: each $\mu_{\alpha}$ specifies an element of $\chi_{\mathbf{V}}$ , so $\mu_3$ must assign unit probability to the tuple that matches $\mu_{\alpha}$ at the $\alpha$ projection. In the infinite case, any example must be non-deterministic by atomlessness, but collapse is still possible; see Example 2 in Appendix B. + +# 3.3 Probabilities of Causation + +A handful of counterfactual quantities over two given variables, collected below, have been particularly prominent in the literature (e.g., [27]). Our main result will show that any of these six quantities (for any two fixed variables) is robust against collapse. Below, fix two distinct variables $Y \neq X \in \mathbf{V}$ and distinct values $x \neq x' \in \chi_X$ , $y \neq y' \in \chi_Y$ . + +Definition 10. The probabilities of causation are the following quantities: + +$$ +\begin{array}{l} P \left(y _ {x}, y _ {x ^ {\prime}} ^ {\prime}\right): \text {p r o b a b i l i t y} \\ P \left(y _ {x} ^ {\prime}, y _ {x ^ {\prime}}\right): \text {c o n v e r s e p r o b . o f n e c e s s i t y a n d s u f f i c i e n c y} \\ P \left(y _ {x ^ {\prime}} ^ {\prime} \mid x, y\right): \text {p r o b .} P \left(y _ {x} \mid x ^ {\prime}, y ^ {\prime}\right): \text {p r o b .} \\ P \left(y _ {x ^ {\prime}} ^ {\prime} \mid y\right): \text {p r o b . o f d i s a b l e m} \quad P \left(y _ {x} \mid y ^ {\prime}\right): \text {p r o b . o f e n a b l e m} \\ \end{array} +$$ + +Consider, for example, the probability of necessity and sufficiency (PNS), which is the joint probability that $Y$ would take on value $y$ if $X$ is set by intervention to $x$ , and $y'$ if $X$ is set to $x'$ . PNS has been thoroughly studied [27, 37, 1], in part due to its widespread relevance: from medical treatment to online advertising, we would like to assess which interventions are likely to be both necessary and sufficient for a given outcome. Using the notation from §2.3, PNS concerns the measure of sets $y_x, y_{x'} = \pi_{(X := x, Y)}^{-1}(\{y\}) \cap \pi_{(X := x', Y)}^{-1}(\{y'\})$ . + +The probabilities of causation are paradigmatically Level 3, and we will be interested in their manifestations at Level 2. In that direction we introduce a small part of $\mathfrak{S}_2$ , just enough to witness the behavior of $Y$ (and $X$ ) under the empty intervention and the two possible interventions on $X$ : + +Definition 11. Let $A_X = \{\varnothing := (), X := 0, X := 1\}$ . Define a small subspace $\mathfrak{S}_2^{X \to Y} \subset \times_{\alpha \in A_X} \mathfrak{P}(\chi_{\{X,Y\}})$ as the image of the map $\varpi_2^{X \to Y} = (\varsigma_{\{X,Y\}} \times \varsigma_{\{X,Y\}} \times \varsigma_{\{X,Y\}}) \circ \pi_{A_X}$ (see Fig. 1(a)). Call $\mathfrak{S}_2^{X \to Y}$ a two-variable effect (2VE) space; fixing $X$ , we have a 2VE-space for each $Y$ . + +It is known in the literature that the probabilities of causation are not identifiable from the data $p(X,Y)$ , $p(Y_x)$ , and $p(Y_{x'})$ (see, e.g., [1] for PNS). As part of our proof of Theorem 3 below, we will strengthen this considerably to show them all to be generically unidentifiable, in a topological sense to be made precise. + +# 4 The Weak Topology + +We now demonstrate how $\mathfrak{S}_1, \mathfrak{S}_2$ and $\mathfrak{S}_3$ can be topologized. In general, given a space $\vartheta$ and the set $\mathfrak{S} = \mathfrak{P}(\vartheta)$ of Borel probability measures on $\vartheta$ , a natural topology on $\mathfrak{S}$ can be defined as follows: + +Definition 12. For a sequence $(\mu_n)_n$ of measures in $\mathfrak{S}$ , write $(\mu_n)_n \Rightarrow \mu$ and say it converges weakly [4, p. 7] to $\mu$ if $\int_{\vartheta} f \, \mathrm{d}\mu_n \to \int_{\vartheta} f \, \mathrm{d}\mu$ for all bounded, continuous $f: \vartheta \to \mathbb{R}$ . Then the weak topology $\tau^{\mathrm{w}}$ on $\mathfrak{S}$ is that with the following closed sets: $E \subset \mathfrak{S}$ is closed in $\tau^{\mathrm{w}}$ iff for any weakly convergent sequence $(\mu_n)_n \Rightarrow \mu$ in which every $\mu_n \in E$ , the limit point $\mu$ is in $E$ . + +There are several alternative characterizations of $\tau^{\mathrm{w}}$ , which hold under very general conditions. For instance, it coincides with the topology induced by the so called Lévy-Prohorov metric [4]. The most useful characterization for our purposes is that it can be generated by subbasic open sets of the form + +$$ +\{\mu : \mu (X) > r \} \tag {1} +$$ + +with $X$ ranging over basic clopens in $\vartheta$ and $r$ over rationals (see, e.g., [16, Lemma A.5]). + +Conceptually, the explication of $\tau^{\mathrm{w}}$ in terms of weak convergence strongly suggests a connection with statistical learning. We now make this connection precise, building on existing work [8, 14, 16]. + +# 4.1 Connection to Learning Theory + +Roughly speaking, we will say a hypothesis $H \subseteq \mathfrak{S}$ is statistically verifiable if there is some error bound $\epsilon$ and a sequence of statistical tests that converge on $H$ with error at most $\epsilon$ , when data are generated from $H$ . More formally, a test is a function $\lambda : \vartheta^n \to \{\text{accept, reject}\}$ , where $\vartheta^n$ is the $n$ -fold product of $\vartheta$ , viz. finite data streams from $\vartheta$ . The interest is in whether a "null" hypothesis can be rejected given data observed thus far. The boundary of a set $A \subseteq \vartheta$ , written $\operatorname{bd}(A)$ , is the difference of its closure and its interior. Intuitively, a learner will not be able to decide whether to accept or reject on the boundary. Consequently it is assumed that $\lambda$ is feasible in the sense that the boundary of its acceptance zone (in the product topology on $\vartheta^n$ ) always has measure 0, i.e., $\mu^n[\operatorname{bd}(\lambda^{-1}(\text{accept}))] = 0$ for every $\mu \in \mathfrak{S}$ , where $\mu^n$ is the $n$ -fold product measure of $\mu$ . + +Say a hypothesis $H \subseteq \mathfrak{S}$ is verifiable [14] if there is $\epsilon > 0$ and a sequence $(\lambda_n)_{n \in \mathbb{N}}$ of feasible tests (of the complement of $H$ in $\mathfrak{S}$ , i.e., the "null hypothesis") such that + +1. $\mu^n [\lambda_n^{-1}(\mathrm{reject})]\leq \epsilon$ for all $n$ , whenever $\mu \notin H$ ; +2. $\lim_{n\to \infty}\mu^n [\lambda_n^{-1}(\mathrm{reject})] = 1$ , whenever $\mu \in H$ + +That is, to be verifiable we only require a sequence of tests that converges in probability to the true hypothesis in the limit of infinite data (requirement 2), while incurring (type 1) error only up to a given bound at finite stages (requirement 1). As an illustrative example, conditional dependence is verifiable [14]. This is a relatively lax notion of verifiability. For instance, the hypothesis need not also be refutable (and thus "decidable"). For our purposes this generality is a virtue: we want to show that certain hypotheses are not statistically verifiable by any method, even in this wide sense. The fundamental link between verifiability and the weak topology is the following, due to [14, 16]: + +Theorem 1. A set $H \subseteq \mathfrak{S}$ is verifiable if and only if it is open in the weak topology. + +# 4.2 Topologizing Causal Models + +We now reinterpret $\tau^{\mathrm{w}}$ at each level of the causal hierarchy: + +Definition 13. The weak causal topology $\tau_{i}^{\mathrm{w}}$ , $1 \leq i \leq 3$ , is the subspace topology on $\mathfrak{S}_i$ , induced by if $i = 3:\tau^{\mathrm{w}}$ on $\mathfrak{P}(\chi_{A \times \mathbf{V}})$ ; if $i = 2$ : product of $\tau^{\mathrm{w}}$ on $\bigvee_{\alpha \in A}\mathfrak{P}(\chi_{\mathbf{V}})$ ; if $i = 1:\tau^{\mathrm{w}}$ on $\mathfrak{P}(\chi_{\mathbf{V}})$ . + +Proposition 4. All projections $\{\varpi_i\}_i, \varpi_2^{X \to Y}$ are continuous in the weak causal topologies. + +A significant observation is that the learning theoretic interpretation, originally intended for $\tau_1^{\mathrm{w}}$ , naturally extends to $\tau_2^{\mathrm{w}}$ . While data streams at Level 1 amount to passive observations of $\mathbf{V}$ , data streams at Level 2 can be seen as sequences of experimental results, i.e., observations of "potential outcomes" $\mathbf{Y}_{\mathbf{x}}$ . To make verifiability as easy as possible we assume a learner can observe a sample from all conceivable experiments at each step. A learner is thus a function $\lambda : \mathcal{E}^n \to \{\text{accept, reject}\}$ , where $\mathcal{E}^n = ((\chi_{\mathbf{V}})^n)_{\alpha}$ is the set of potential experimental observations over $n$ trials (with $\alpha$ indexing the experiments). Construing $\mathcal{E}^n$ as a product space we can again speak of feasibility of $\lambda$ . + +Recall that elements of $\mathfrak{S}_2$ are tuples $(\mu_{\alpha})_{\alpha \in A}$ of measures. Say a hypothesis $H \subseteq \mathfrak{S}_2$ is experimentally verifiable if there is $\epsilon > 0$ and a sequence $(\lambda_n)_{n \in \mathbb{N}}$ of feasible tests such that 1 and 2 above hold, replacing $\mu^n[\lambda_n^{-1}(\mathrm{reject})]$ with $\prod_{\alpha} \mu_{\alpha}^{n}[(\lambda_n^{-1}(\mathrm{reject}))_{\alpha}]$ . That is, when experimental data are drawn from the interventional distributions $(\mu_{\alpha})_{\alpha \in A} \in H$ , we require that the learner eventually converge on $H$ with bounded error at finite stages. We can then show (see Appendix C): + +Theorem 2. A set $H \subseteq \mathfrak{S}_2$ is experimentally verifiable if and only if it is open in $\tau_2^{\mathrm{w}}$ . + +A similar result can be given for $(\mathfrak{S}_3,\tau_3^{\mathrm{w}})$ , although it is less clear what the empirical content of this result would be. Note also that $\tau_{1}^{\mathrm{w}},\tau_{2}^{\mathrm{w}},\tau_{3}^{\mathrm{w}}$ give a sequence of increasingly fine topologies on the set of actual SCMs $\mathfrak{M}$ by simply pulling back the projections. The point is that $\tau_{2}^{\mathrm{w}}$ is the finest that has clear empirical significance, while $\tau_{3}^{\mathrm{w}}$ is the finest in terms of relevance to the causal hierarchy. + +# 5 Collapse is Meager + +Recall that a set $X \subseteq \vartheta$ is nowhere dense if every open set contains an open $Y$ with $X \cap Y = \emptyset$ . A countable union of nowhere dense sets is said to be meager (or of first category). The complement of a meager set is comeager. Intuitively, a meager set is one that can be "approximated" by sets "perforated with holes" [25]. Meagerness is notably preserved under continuous preimages. + +As discussed above, one intuition highlighted by the weak topology $\tau^{\mathrm{w}}$ is that open sets are the kinds of probabilistic propositions that could, in the limit of infinite data, be verified (Thms. 1, 2). Correlatively, meager sets in $\tau^{\mathrm{w}}$ are so negligible as to be unverifiable: as a meager set contains no non-empty open subsets (by the Baire Category Theorem [25]), it is statistically unverifiable. We will now show that the injective collapse set $\mathfrak{C}_2$ from §3.2 is topologically meager. + +The crux is to identify a "good" comeager 2VE-subspace where collapse never occurs (with separation witnessed by probabilities of causation). In this subspace, the constraints circumscribing Level 3 have sufficient slack to make a tweak without thereby disturbing Level 2 (cf. Figure 2). We define the good set as the locus of a set of strict inequalities: + +Definition 14. A family $(\mu_{\alpha})_{\alpha \in A_X} \in \mathfrak{S}_2^{X \to Y}$ is $Y$ -good if we have the following, abbreviating the members of $A_X$ as $(x, x')$ : + +$$ +0 < \mu_ {x} \left(y ^ {\prime}\right) - \mu_ {()} \left(x, y ^ {\prime}\right) < \mu_ {()} \left(x ^ {\prime}\right), \tag {2} +$$ + +$$ +0 < \mu_ {()} \left(x ^ {\prime}, y ^ {\prime}\right) < \mu_ {()} \left(x ^ {\prime}\right). \tag {3} +$$ + +Lemma 1. The subspace of $Y$ -good families is comeager in $\mathfrak{S}_2^{X\to Y}$ . + +Proof sketch. The non-strict versions of (2), (3) hold universally, so the complement of the good set is defined by equalities. This is closed and contains no nonempty open by the weak subbasis (1). $\square$ + +Figure 2 presents the construction in a small, two-variable case, and Lemma 2 below is proven by generalizing it to arbitrary $\mathbf{V}$ . Guaranteeing agreement on every interventional distribution in the general case is subtle (Appendix D): it has been observed that enlarging $\mathbf{V}$ can enable additional inferences (e.g., [32]), though the next result reflects a dependence on further assumptions. + +Lemma 2. Suppose $\prec$ is an order in which $X$ comes first and $(\mu_{\alpha})_{\alpha \in A} \in \mathfrak{S}_2^{\prec}$ is such that $\varpi_2^{X \to Y}((\mu_\alpha)_\alpha)$ is $Y$ -good, and let $\varphi$ be PNS, the converse PNS, the probability of sufficiency, or the probability of enablement (Definition 10). Then for any $\mu_3 \in \mathfrak{S}_3^{\prec}$ such that $\varpi_2(\mu_3) = (\mu_\alpha)_\alpha$ , there exists a $\mu_3' \in \mathfrak{S}_3^{\prec}$ such that $\mu_3$ and $\mu_3'$ disagree on $\varphi$ . + +Note that by reversing the roles of $x$ and $x'$ , we may obtain the same for the probability of necessity and probability of disablement. The main theorem and its important learning-theoretic corollary are now straightforward. + +Theorem 3 (Topological Hierarchy). The set $\mathfrak{C}_2$ of points where all Level 3 facts are identifiable from Level 2 is meager in $(\mathfrak{S}_2, \tau_2^{\mathrm{w}})$ . The preimage $\varpi_2^{-1}(\mathfrak{C}_2) = \mathfrak{C}_3$ is likewise meager in $(\mathfrak{S}_3, \tau_3^{\mathrm{w}})$ . + +Proof. Let $\mathfrak{D}_2^{X,Y} \subset \mathfrak{S}_2^X$ be the preimage under $\varpi_2^{X \to Y}$ of the set of $Y$ -good tuples in $\mathfrak{S}_2^{X \to Y}$ . Lemma 2 implies that $\mathfrak{C}_2 \cap \mathfrak{S}_2^X$ is contained in $\mathfrak{S}_2^X \setminus \mathfrak{D}_2^{X,Y}$ , for any $Y \neq X$ . Meanwhile, since $\varpi_2^{X \to Y}$ is continuous, Lemma 1 implies that $\mathfrak{S}_2^X \setminus \mathfrak{D}_2^{X,Y}$ is meager in $\mathfrak{S}_2^X$ , and thereby also in $\mathfrak{S}_2$ . Thus $\mathfrak{C}_2 = \bigcup_{X \in \mathbf{V}} \mathfrak{C}_2 \cap \mathfrak{S}_2^X$ is a countable union of meager sets, and hence meager. + +Corollary 1. No causal hypothesis licensing arbitrary counterfactual inferences (and specifically those of the probabilities of causation) from observational and experimental data is itself statistically (even experimentally) verifiable. + +
MM'
uP(u)XuYx,uYx',uuP(u)XuYx,u
u01/2x'yyu01/2 - εx'y
u11/2x'y'y'u1εx'y
u21/2 - εx'y'
u3εx'y'
(a) Y-good Model(b) Example Separating Levels 2 and 3
+ +Figure 2: (a): the structural functions and exogenous noise for a model $\mathcal{M}$ with direct influence $X\rightarrow Y$ . This $\mathcal{M}$ meets (2) and (3), so we may apply Lemma 2, constructing the model $\mathcal{M}'$ in (b), where $0 < \varepsilon < 1/2$ . Note that $p_{\mathrm{cf}}^{\mathcal{M}}(y_x,y_{x'}') = 0$ while $p_{\mathrm{cf}}^{\mathcal{M}'}(y_x,y_{x'}') = \varepsilon$ , so that the two models disagree on a Level 3 PNS quantity; on the other hand, it is easy to check agreement on all of Level 2. Similarly, $\mathcal{M}$ and $\mathcal{M}'$ disagree on the converse PNS, probability of sufficiency, and probability of enablement (Definition 10). + +# 6 Conclusion + +We introduced a general framework for topologizing spaces of causal models, including the space of all (discrete, well-founded) causal models. As an illustration of the framework we characterized levels of the causal hierarchy topologically, and proved a topological version of the causal hierarchy theorem from [2]. While the latter shows that collapse of the hierarchy (specifically of Level 3 to Level 2) is exceedingly unlikely in the sense of (Lebesgue) measure, we offer a complementary result: any condition guaranteeing that we could infer arbitrary Level 3 information from purely Level 2 information must be statistically unverifiable, even by experimental means. Both results capture an important sense in which collapse is "negligible" in the space of all possible models. As an added benefit, the topological approach extends seamlessly to the setting of infinitely many variables. + +There are many natural extensions of these results. For instance, we have begun work on a version for continuous endogenous variables. Also of interest are subspaces embodying familiar causal assumptions or other well-studied coarsenings of SCMs (see, e.g., [23] on Bayesian networks, or [17, 15] on linear non-Gaussian models), which often render important inference problems solvable, though sometimes only "generically" so. In the opposite direction, we expect analogous hierarchy theorems to hold for extensions of the SCM concept, e.g., that dropping the well-foundedness or recursiveness requirements [6]. As emphasized by [2], a causal hierarchy theorem should not be construed as a purely limiting result, but rather as further motivation for understanding the whole range of causal-inductive assumptions, how they relate, and what they afford. We submit that the topological constructions presented here can help clarify and systematize this broader landscape. + +# Acknowledgments + +This material is based upon work supported by the National Science Foundation Graduate Research Fellowship Program under Grant No. DGE-16565. We are very grateful to the five anonymous NeurIPS reviewers for insightful and detailed comments and questions that led to significant improvements in the paper. We would also like to thank Jimmy Koppel, Krzysztof Mierzewski, Francesca Zaffora Blando, and especially Kasey Genin for helpful feedback on earlier versions. + +# References + +[1] C. Avin, I. Shpitser, and J. Pearl. Identifiability of path-specific effects. In Proceedings of IJCAI, 2005. +[2] E. Baireinboim, J. D. Correa, D. Ibeling, and T. Icard. On Pearl's hierarchy and the foundations of causal inference. Technical Report R-60, Causal AI Lab, Columbia University, 2020. +[3] G. Belot. Absolutely no free lunches! Theoretical Computer Science, 845:159-180, 2020. +[4] P. Billingsley. Convergence of Probability Measures. Wiley, 2nd edition, 1999. +[5] V. I. Bogachev. Measure Theory. Springer Berlin Heidelberg, 2007. + +[6] S. Bongers, P. Forre, J. Peters, and J. M. Mooij. Foundations of structural causal models with cycles and latent variables, 2021. +[7] N. Cartwright. Nature's Capacities and their Measurements. Clarendon Press, 1989. +[8] A. Dembo and Y. Peres. A topological criterion for hypothesis testing. Annals of Statistics, 22(1):106-117, 1994. +[9] P. Diaconis and D. Freedman. On the consistency of Bayes estimates. Annals of Statistics, 14(1):1-26, 1986. +[10] M. Drton, R. Foygel, and S. Sullivant. Global identifiability of linear structural equation models. Annals of Statistics, 39(2):865-886, 2011. +[11] F. Eberhardt, C. Glymour, and R. Scheines. On the number of experiments sufficient and in the worst case necessary to identify all causal relations among n variables. In Proceedings of UAI, page 178-184, 2005. +[12] D. Freedman. From association to causation via regression. Advances in Applied Mathematics, 18:59-110, 1997. +[13] D. Galles and J. Pearl. An axiomatic characterization of causal counterfactuals. Foundations of Science, 3 (1):151-182, Jan 1998. +[14] K. Genin. The Topology of Statistical Inquiry. PhD thesis, Carnegie Mellon University, 2018. +[15] K. Genin. Statistical undecidability in linear, non-gaussian models in the presence of latent confounders. In Proceedings of NeurIPS, 2021. +[16] K. Genin and K. Kelly. The topology of statistical verifiability. In Proceedings of TARK, pages 236-250, 2017. +[17] K. Genin and C. Mayo-Wilson. Statistical decidability in linear, non-Gaussian models. In Causal Discovery & Causality-Inspired Machine Learning, NeurIPS, 2020. +[18] D. Ibeling and T. Icard. On open-universe causal reasoning. In Proceedings of UAI, 2019. +[19] D. Ibeling and T. Icard. Probabilistic reasoning across the causal hierarchy. In Proceedings of AAAI, 2020. +[20] G. W. Imbens and D. B. Rubin. Causal Inference in Statistics, Social, and Biomedical Sciences. Cambridge University Press, 2015. +[21] J. L. Kelley. General Topology. Springer, 1975. +[22] S. Lee, J. Correa, and E. Bairenboim. General identifiability with arbitrary surrogate experiments. In Proceedings of UAI, 2019. +[23] H. Lin and J. Zhang. On learning causal structures from non-experimental data without any faithfulness assumption. In Proceedings of ALT, pages 554-582, 2020. +[24] C. Meek. Strong completeness and faithfulness in Bayesian networks. In Proceedings of UAI, page 411-418, 1995. +[25] J. C. Oxtoby. Measure and Category. Springer, 1971. +[26] J. Pearl. Causal diagrams for empirical research. Biometrika, 82(4):669-710, 1995. +[27] J. Pearl. Probabilities of causation: Three counterfactual interpretations and their identification. Synthese, 121(1):93-149, 1999. +[28] J. Pearl. Causality. Cambridge University Press, 2009. +[29] J. Pearl and D. Mackenzie. The book of why: The new science of cause and effect. Basic Books, 2018. +[30] J. Peters, D. Janzing, and B. Schölkopf. Elements of Causal Inference: Foundations and Learning Algorithms. MIT Press, 2017. +[31] J. Robins and S. Greenland. The probability of causation under a stochastic model for individual risk. Biometrics, 45(4):1125-1138, 1989. +[32] B. Schölkopf, F. Locatello, S. Bauer, N. R. Ke, N. Kalchbrenner, A. Goyal, and Y. Bengio. Toward causal representation learning. Proceedings of the IEEE, 109(5):612-634, 2021. + +[33] S. Shalev-Shwartz and S. Ben-David. Understanding Machine Learning: From Theory to Algorithms. Cambridge University Press, 2014. +[34] S. Shimizu, P. O. Hoyer, A. Hyvarinen, and A. Kerminen. A linear non-Gaussian acyclic model for causal discovery. Journal of Machine Learning Research, 7(72):2003-2030, 2006. +[35] P. Spirtes, C. Glymour, and R. Scheines. Causation, Prediction, and Search. MIT Press, 2001. +[36] Z. Tavares, J. Koppel, X. Zhang, R. Das, and A. S. Lezama. A language for counterfactual generative models. In Proceedings of ICML, 2021. +[37] J. Tian and J. Pearl. Probabilities of causation: Bounds and identification. Annals of Mathematics and Artificial Intelligence, 28(1):287-313, 2000. +[38] J. Tian and J. Pearl. A general identification condition for causal effects. In Proceedings of AAAI. 2002. +[39] C. Uhler, G. Raskutti, P. Buhlmann, and B. Yu. Geometry of the faithfulness assumption in causal inference. Annals of Statistics, 41(2):436-463, 2013. \ No newline at end of file diff --git a/atopologicalperspectiveoncausalinference/images.zip b/atopologicalperspectiveoncausalinference/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..bb029d9568984768896d2679b3909104a5082629 --- /dev/null +++ b/atopologicalperspectiveoncausalinference/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:143091b1398933e37abe83c44122ce694c7e1c07cd81bbf24b6e40e8f9b43893 +size 131974 diff --git a/atopologicalperspectiveoncausalinference/layout.json b/atopologicalperspectiveoncausalinference/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..9712060cd48cd06b063c0d8b9a2881a476ed797d --- /dev/null +++ b/atopologicalperspectiveoncausalinference/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:45164c5b89e142b3ffa26596a5aad3704a74c0f03d86ed25828bebac05a85108 +size 675978 diff --git a/atrainablespectralspatialsparsecodingmodelforhyperspectralimagerestoration/997c3a8f-abaa-4007-a5cc-15762f84b5f4_content_list.json b/atrainablespectralspatialsparsecodingmodelforhyperspectralimagerestoration/997c3a8f-abaa-4007-a5cc-15762f84b5f4_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..252d80275db499614eb8d475a91e8c10f85652cc --- /dev/null +++ b/atrainablespectralspatialsparsecodingmodelforhyperspectralimagerestoration/997c3a8f-abaa-4007-a5cc-15762f84b5f4_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2de38189bb6eaefcff6f8bbf99827751a98b8efc92acd837f7f2e77e5455f229 +size 84018 diff --git a/atrainablespectralspatialsparsecodingmodelforhyperspectralimagerestoration/997c3a8f-abaa-4007-a5cc-15762f84b5f4_model.json b/atrainablespectralspatialsparsecodingmodelforhyperspectralimagerestoration/997c3a8f-abaa-4007-a5cc-15762f84b5f4_model.json new file mode 100644 index 0000000000000000000000000000000000000000..c3d8b4fb1a2547cf09ddf7a398dc2b6b2273ec50 --- /dev/null +++ b/atrainablespectralspatialsparsecodingmodelforhyperspectralimagerestoration/997c3a8f-abaa-4007-a5cc-15762f84b5f4_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:11a68ecc3876d7efa374c5d9c9edae8fd68d8bff59977724b6d1769fc30c4037 +size 109180 diff --git a/atrainablespectralspatialsparsecodingmodelforhyperspectralimagerestoration/997c3a8f-abaa-4007-a5cc-15762f84b5f4_origin.pdf b/atrainablespectralspatialsparsecodingmodelforhyperspectralimagerestoration/997c3a8f-abaa-4007-a5cc-15762f84b5f4_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..aee6b2f254c8b5673e09a9e0018ce578678b2546 --- /dev/null +++ b/atrainablespectralspatialsparsecodingmodelforhyperspectralimagerestoration/997c3a8f-abaa-4007-a5cc-15762f84b5f4_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f51a656da56c5e20e35ec90d6a2bbda2a40913772a2a9691ea7e387baf33ce45 +size 5943306 diff --git a/atrainablespectralspatialsparsecodingmodelforhyperspectralimagerestoration/full.md b/atrainablespectralspatialsparsecodingmodelforhyperspectralimagerestoration/full.md new file mode 100644 index 0000000000000000000000000000000000000000..df73ba5b22e3502857b2c9e29f1c22eaf90868bc --- /dev/null +++ b/atrainablespectralspatialsparsecodingmodelforhyperspectralimagerestoration/full.md @@ -0,0 +1,348 @@ +# A Trainable Spectral-Spatial Sparse Coding Model for Hyperspectral Image Restoration + +Théo Bodrito*, Alexandre Zouaoui*, Jocelyn Chanussot, and Julien Mairal +Inria, Univ. Grenoble Alpes, CNRS, Grenoble INP, LJK, 38000 Grenoble, France +firstname.lastname@inria.fr + +# Abstract + +Hyperspectral imaging offers new perspectives for diverse applications, ranging from the monitoring of the environment using airborne or satellite remote sensing, precision farming, food safety, planetary exploration, or astrophysics. Unfortunately, the spectral diversity of information comes at the expense of various sources of degradation, and the lack of accurate ground-truth "clean" hyperspectral signals acquired on the spot makes restoration tasks challenging. In particular, training deep neural networks for restoration is difficult, in contrast to traditional RGB imaging problems where deep models tend to shine. In this paper, we advocate instead for a hybrid approach based on sparse coding principles that retains the interpretability of classical techniques encoding domain knowledge with handcrafted image priors, while allowing to train model parameters end-to-end without massive amounts of data. We show on various denoising benchmarks that our method is computationally efficient and significantly outperforms the state of the art. $^{1}$ + +# 1 Introduction + +Hyperspectral imaging (HSI) enables measurements of the electromagnetic spectrum of a scene on multiple bands (typically about a hundred or more), which offers many perspectives over traditional color RGB imaging. For instance, the high-dimensional information present in a single pixel is sometimes sufficient to identify the signature of a particular material, which is of course infeasible in the RGB domain. Not surprisingly, hyperspectral imaging is then of utmost importance and has a huge number of scientific and technological applications such as remote sensing [8, 22, 46], quality evaluation of food products [16, 19, 35], medical imaging [2, 18, 37], agriculture and forestry [1, 36, 40], microscopy imaging in biology [25, 56], or exoplanet detection in astronomy [24]. + +Information contained in hyperspectral signals is much richer than in RGB images, but the price to pay is the need to deal with complex degradations that may arise from multiple sources, including sparse noise with specific patterns (stripes), in addition to photon and thermal noise [29, 51]. As a consequence, HSI denoising is a crucial pre-processing step to enhance the image quality before using data in downstream tasks such as semantic segmentation or spectral unmixing [30]. A second issue is the lack of large-scale collection of ground-truth high-quality signals and the large diversity of sensor types, which makes it particularly challenging to train machine learning models for restoration such as convolutional neural networks. To deal with the scarcity of ground-truth data, most successful approaches typically encode strong prior knowledge about data within the model architecture, which may be low-rank representations of input patches [17, 23, 53, 60, 70], sparse coding [13, 21, 23], or image self-similarities [39, 49, 71], which have proven to be very powerful in the RGB domain [9]. + +In this paper, we propose a fully interpretable machine learning model for hyperspectral images that may be seen as a hybrid approach between deep learning techniques, where parameters can be learned end to end with supervised data, and classical methods that essentially rely on image priors. Since designing an appropriate image prior by hand is very hard, our goal is to benefit from deep learning principles (here, differentiable programming [6]) while encoding domain knowledge and physical rules about hyperspectral data directly into the model architecture, which we believe is a key to develop robust approaches that do not require massive amounts of training data. + +More precisely, we introduce a novel trainable spectral-spatial sparse coding model with two layers, which performs the following operations: (i) The first layer decomposes the spectrum measured at each pixel as a sparse linear combination of a few elements from a learned dictionary, thus performing a form of linear spectral unmixing per pixel, where dictionary elements can be seen as basis elements for spectral responses of materials present in the scene. (ii) The second layer builds upon the output of the first one, which is represented as a two-dimensional feature map, and sparsely encodes patches on a dictionary in order to take into account spatial relationships between pixels within small receptive fields. To further reduce the number of parameters to learn and leverage classical prior knowledge about spectral signals [60], we also assume that the dictionary elements admit a low-rank structure—that is, dictionary elements are near separable in the space and spectrum domains, as detailed later. Even though dictionary learning has been originally introduced for unsupervised learning [42, 47], we adopt an unrolled optimization procedure inspired by the LISTA algorithm [26], which has been very successful in imaging problems for training sparse coding models from supervised data [33, 34, 55, 63]. + +Our motivation for adopting a two-layer model is to provide a shared architecture for different HSI sensors, which often involve a different number of bands with different spectral responses. Our solution consists of learning sensor-specific dictionaries for the first layer, while the dictionary of second layer is shared across modalities. This allows training simultaneously on several HSI signals, the first layer mapping input data to a common space, before processing data by the second layer. + +We experimentally evaluate our HSI model on standard denoising benchmarks, showing a significant improvement over the state of the art (including deep learning models and more traditional baselines), while being computationally very efficient at test time. Perhaps more important than pure quantitative results, we believe that our work also draws interesting conclusions for machine learning. First, by encoding prior knowledge within the model architecture directly, we obtain models achieving excellent results with a relatively small number of parameters to learn, a conclusion also shared by [33, 34] for RGB imaging; nevertheless, the effect is stronger in our work due to the scarcity of training data for HSI denoising and the difficulty to train deep learning models for this task. Second, we also show that interpretable architectures are useful: our model architecture can adapt to different noise levels per band and modify the encoding function at test time in a principled manner, making it well suited for solving blind denoising problems that are crucial for processing hyperspectral signals. + +# 2 Related Work on Hyperspectral Image Denoising + +Learning-free and low-rank approaches. Classical image denoising methods such as BM3D [12] may be applied independently to each spectral band of HSI signals, but such an approach fails to capture relations between channels; Not surprisingly, multi-band techniques such as BM4D [39] have been shown to perform better for HSI, and other variants were subsequently proposed such as GLF [71]. Tensor-based methods such as LLRT [11] are able to exploit the underlying low-rank structure of HSI signals [17, 53, 67] and have shown particularly effective when combined with a non-local image prior as in NGMeet [27]. Finally, other approaches adapt traditional image processing priors such as total variation [65, 59], or wavelet sparsity [48, 52] but they tend to perform worse than GLF, LLRT, or NGMeet, see [31] for a survey on denoising techniques for HSI. + +Sparse coding models. Dictionary learning [47] is an unsupervised learning technique consisting of representing a signal as a linear combination of a few elements from a learned dictionary, which has shown to be very effective for various image restoration tasks [15, 43]. Several approaches have then combined dictionary learning and low-rank regularization. For instance, 3D patches are represented as tensors in [49] and are encoded by using spatial-spectral dictionaries [57]. In [70], 2D patches are extracted from the band-vectorized representation of the 3D HSI data and sparsely encoded on a dictionary, while encouraging low-rank representations with a trace norm penalty on + +the reconstructed image. The low-rank constraint can also be enforced by designing the dictionary as the result of the matrix multiplication between spatial and spectral dictionaries learned by principal component analysis as in [21]. However, these methods typically compute sparse representations with an iterative optimization procedure, which may be computationally demanding at test time. + +Deep learning. Like BM3D above, convolutional neural networks for grayscale image denoising (e.g., DnCNN [68]) may also be applied to each spectral band, which is of course suboptimal. Because deep neural networks have been highly successful for RGB images with often low computational inference cost, there have been many attempts to design deep neural networks dedicated to HSI denoising. For instance, to account for the large number of hyperspectral bands, several approaches based on convolutional neural networks are operating on sliding windows in the spectral domain, [38, 54, 66], which allows training models on signals with different number of spectral bands, but the sliding window significantly increases the inference time. More precisely, attention layers are used in [54], while more traditional CNNs are used in [38], possibly with residual connections [66]. Recently, an approach based on recurrent architecture was proposed in [62] to process signals with an arbitrary number of bands, achieving impressive results for various denoising tasks. + +Hybrid approaches. SMDS-Net [63] adopts a hybrid approach between sparse coding and deep learning models by adapting the RGB image restoration method of [34] to HSI images. The resulting pipeline however lacks interpretability: SMDS-Net first denoises the input image with non-local means [9], then performs subspace projection in the spectral domain using HySime[7], before sparsely encoding 3D patches (cubes) with a trainable version of Tensor-based ISTA [50]. Although this method reduces considerably the number of parameters in comparison to vanilla deep learning models, the spectral sliding windows approach lacks interpretability since the same denoising procedure is applied across different bands, which may not suffer from the same level of noise. In contrast, we propose a much simpler sparse coding model, which is physically consistent with the nature of hyperspectral signals, by introducing a novel differentiable low-rank sparse coding layer. + +# 3 A Trainable Spectral-Spatial Sparse Coding Model (T3SC) + +In this section, we introduce our trainable spectral-spatial sparse coding model dedicated to hyperspectral imaging, and start by presenting some preliminaries on sparse coding. + +# 3.1 Background on Sparse Coding + +Image denoising with dictionary learning. A classical approach introduced by Elad and Aharon [15] for image denoising consists in considering the set of small overlapping image patches (e.g., $8 \times 8$ pixels) from a noisy image, and compute a sparse approximation of these patches onto a learned dictionary. The clean estimates for each patch are then recombined to produce the full image. + +Formally, let us consider a noisy image $\mathbf{y}$ in $\mathbb{R}^{c\times h\times w}$ with $c$ channels and two spatial dimensions. We denote by $\mathbf{y}_1,\mathbf{y}_2,\dots \mathbf{y}_n$ the $n$ overlapping patches from $\mathbf{y}$ of size $c\times s\times s$ , which we represent as vectors in $\mathbb{R}^m$ with $m = cs^2$ . Assuming that a dictionary $\mathbf{D} = [\mathbf{d}_1,\dots ,\mathbf{d}_p]$ in $\mathbb{R}^{m\times p}$ is given—we will discuss later how to obtain a "good" dictionary—each patch $\mathbf{y}_i$ is processed by computing a sparse approximation: + +$$ +\min _ {\boldsymbol {\alpha} _ {i} \in \mathbb {R} ^ {p}} \frac {1}{2} \| \mathbf {y} _ {i} - \mathbf {D} \boldsymbol {\alpha} _ {i} \| ^ {2} + \lambda \| \boldsymbol {\alpha} _ {i} \| _ {1}, \tag {1} +$$ + +where $\|\cdot\|_1$ is the $l_1$ -norm, which is known to induce sparsity in the problem solution [42], and $\alpha_i$ is the sparse code representing the patch $\mathbf{y}_i$ , while $\lambda$ controls the amount of regularization. Note that the $\ell_0$ -penalty, which counts the number of non-zero elements, could also be used, leading to a combinatorial problem whose solution is typically approximated by a greedy algorithm. After solving the $n$ problems (1), each patch $\mathbf{y}_i$ admits a "clean" estimate $\mathbf{D}\alpha_i$ . Because each pixel belongs to several patches, the full denoised image $\hat{\mathbf{x}}$ is obtained by averaging these estimates. + +Finding a good dictionary can be achieved in various manners. In classical dictionary learning algorithms, $\mathbf{D}$ is optimized such that the sum of the loss functions (1) is as small as possible, see [42] for a review. Adapting the dictionary with supervision is also possible [41], as discussed next. + +Differentiable programming for sparse coding. The proximal gradient descent method called ISTA [20] is a classical algorithm for solving the Lasso problem in Eq. (1), which consists of the following iterations + +$$ +\boldsymbol {\alpha} _ {i} ^ {(t + 1)} = S _ {\lambda} \left[ \boldsymbol {\alpha} _ {i} ^ {(t)} + \eta \mathbf {D} ^ {\top} \left(\mathbf {y} _ {i} - \mathbf {D} \boldsymbol {\alpha} _ {i} ^ {(t)}\right) \right], \tag {2} +$$ + +where $\eta > 0$ is a step-size and $S_{\lambda}[u] = \mathrm{sign}(u)\max(|u| - \lambda, 0)$ is the soft-thresholding operator, which is applied pointwise to each entry of an input vector. + +By noting that the above iteration can be seen as a sequence of affine transformations interleaved with pointwise non-linearities $S_{\lambda}$ , it is then tempting to interpret $T$ iterations (2) as a multilayer feed-forward neural network with shared weights between the $T$ layers. Following such an insight, Gregor and LeCun have proposed the LISTA algorithm [26], where the parameters are learned such that the sequence approximates well the solution of the sparse coding problem (1). + +Interestingly, the LISTA algorithm can also be used to train dictionaries for supervised learning tasks. This is the approach chosen in [34, 55] for image restoration, which considers the following iterations: + +$$ +\boldsymbol {\alpha} _ {i} ^ {(t + 1)} = S _ {\lambda} \left[ \boldsymbol {\alpha} _ {i} ^ {(t)} + \mathbf {C} ^ {\top} \left(\mathbf {y} _ {i} - \mathbf {D} \boldsymbol {\alpha} _ {i} ^ {(t)}\right) \right], \tag {3} +$$ + +which differs from (2) with the presence of a matrix $\mathbf{C}$ of the same size as $\mathbf{D}$ . Even if the choice $\mathbf{C} = \eta \mathbf{D}$ (which recovers ISTA) is perfectly reasonable, using a different dictionary $\mathbf{C}$ has empirically shown to provide improvements in results quality [34], probably due to faster convergence of the LISTA iterations. Then, given some fixed parameters $\mathbf{C},\mathbf{D}$ , a clean estimate $\mathbf{W}\alpha_{i}^{(T)}$ for each patch $\mathbf{y}_i$ is obtained by using a dictionary $\mathbf{W}$ , where $T$ is the number of LISTA steps. The reason for allowing a different dictionary $\mathbf{W}$ than $\mathbf{D}$ is to correct the potential bias due to $\ell_1$ -minimization. + +Finally, the denoised image $\hat{\mathbf{x}}$ is reconstructed by averaging the patch estimates: + +$$ +\hat {\mathbf {x}} = \frac {1}{m} \sum_ {i = 1} ^ {n} \mathbf {R} _ {i} \mathbf {W} \boldsymbol {\alpha} _ {i} ^ {(T)}, \tag {4} +$$ + +where $\mathbf{R}_i$ is the linear operator that places the patch $\hat{\mathbf{x}}_i$ at position $i$ in the image, and we assume—by neglecting border effects for simplicity—that each pixel admits the same number $m$ of estimates. + +In contrast to classical restoration techniques based on dictionary learning, the LISTA point of view enables us to learn the model parameters $\mathbf{C}$ , $\mathbf{D}$ , $\mathbf{W}$ in a supervised fashion. Given a training set of pairs of noisy/clean images, we remark that the estimate $\hat{\mathbf{x}}$ is obtained from a noisy image $\mathbf{y}$ by a sequence of operations that are differentiable almost everywhere, as typical neural networks with rectified linear unit activation functions. A typical loss, which we optimize by stochastic gradient descent, is then + +$$ +\min _ {\mathbf {C}, \mathbf {D}, \mathbf {W}, \lambda} \mathbb {E} _ {\mathbf {x}, \mathbf {y}} \left[ \left\| \hat {\mathbf {x}} (\mathbf {y}) - \mathbf {x} \right\| ^ {2} \right], +$$ + +where $(\mathbf{x},\mathbf{y})$ is a pair of clean/noisy images drawn from some training distribution from which we can sample, and $\hat{\mathbf{x}} (\mathbf{y})$ is the clean estimate obtained from (4), given the noisy image $\mathbf{y}$ + +# 3.2 A Trainable Low-Rank Sparse Coding Layer + +We are now in shape to introduce a trainable layer encoding both sparsity and low-rank principles. + +Spatial-Spectral Representation. As shown in [10, 21], HSI patches can be well reconstructed by using only a few basis elements obtained by principal component analysis. The authors further decompose these into a Cartesian product of separate spectral and spatial dictionaries. In this paper, we adopt a slightly different approach, where we consider a single dictionary $\mathbf{D} = [\mathbf{d}_1,\dots ,\mathbf{d}_p]$ in $\mathbb{R}^{m\times p}$ as in the previous section with $m = cs^2$ , but each element may be seen as a matrix of size $c\times s^2$ with low-rank structure. More precisely, we enforce the following representation + +$$ +\forall j \in 1, \dots , p, \mathbf {d} _ {j} = \operatorname {v e c} \left(\mathbf {U} _ {j} \times \mathbf {V} _ {j}\right), \tag {5} +$$ + +where $\mathbf{U}_j$ is in $\mathbb{R}^{s^2\times r}$ , $\mathbf{V}_j$ is in $\mathbb{R}^{r\times c}$ , $r$ is the desired rank of the dictionary elements, and $\mathrm{vec}(.)$ is the operator than flattens a matrix to a vector. The hyperparameter $r$ is typically small with $r = 1, 2$ or 3. When $r = 1$ , the dictionary elements are said to be separable in the spectral and spatial domains, which we found to be a too stringent condition to achieve good reconstruction in practice. + +![](images/f6a753b7129b9037e827741aaf912b2390b09a0a2729d0bff24648e3439b50a7.jpg) +Figure 1: Architecture of T3SC : we propose a two-layer sparse coding model which is end-to-end trainable. The first layer performs a sensor-specific spectral decomposition, while the second layer encodes both spectral and spatial information. + +The low-rank assumption allows us to build model with a reduced number of parameters, while encoding natural assumption about the data directly in the model architecture. Indeed, whereas a classical full-rank dictionary $\mathbf{D}$ admits $cs^2 p$ parameters, the decomposition (5) yields dictionaries with $(s^2 + c)rp$ parameters only. Matrices $\mathbf{C}$ and $\mathbf{W}$ are parametrized in a similar manner. + +Convolutional variant and implementation tricks. Whereas traditional sparse coding reconstructs local signals (patches) independently according to the iterations (3), another variant called convolutional sparse coding (CSC) represents the whole image by a sparse linear combination of dictionary elements placed at every possible location in the image [55]. From a mathematical point of view, the reconstruction loss for computing the codes $\alpha_{i}$ given an input image $\mathbf{y}$ becomes + +$$ +\min _ {\left\{\boldsymbol {\alpha} _ {i} \in \mathbb {R} ^ {p} \right\} _ {i = 1, \dots , n}} \frac {1}{2} \left\| \mathbf {y} - \frac {1}{m} \sum_ {i = 1} ^ {n} \mathbf {R} _ {i} \mathbf {D} \boldsymbol {\alpha} _ {i} \right\| ^ {2} + \lambda \sum_ {i = 1} ^ {n} \| \boldsymbol {\alpha} _ {i} \| _ {1}. \tag {6} +$$ + +An iterative approach for computing these codes can be obtained by a simple modification of (3) consisting of replacing the quantity $\mathbf{D}\alpha_{i}^{(t)}$ by the $i$ -th patch of the reconstructed image $\frac{1}{m}\sum_{i=1}^{n}\mathbf{R}_{i}\mathbf{D}\alpha_{i}^{(t)}$ . All of these operations can be efficiently implemented in standard deep learning frameworks, since the corresponding operations correspond to a transposed convolution with $\mathbf{D}$ , followed by convolution with $\mathbf{C}$ , see [55] for more details. In this paper, we experimented with the CSC variant (6) and SC one (1), both with low-rank dictionaries, which were previously described. We observed that CSC was providing slightly better results and was thus adopted in our experiments. Following [34], another implementation trick we use is to consider a different $\lambda$ parameter per dictionary element, which slightly increases the number of parameters, while allowing to learn with a weighted $\ell_{1}$ -norm in (6). + +# 3.3 The Two-Layer Sparse Coding Model with Sensor-Specific Layer + +One of the main challenge in hyperspectral imaging is to train a model that can generalize to several types of sensors, which typically admit different number of spectral bands. Whereas learning a model that is tuned to a specific sensor is perfectly acceptable in many contexts, it is often useful to learn a model that is able to generalize across different types of HSI signals. To alleviate this issue, several strategies have been adopted such as (i) projecting signals onto a linear subspace of fixed dimension, with no guarantee that representations within this subspace can be comparable between different signals, or (ii) processing input data using a sliding window across the spectral domain. + +In this paper, we address this issue by learning a two-layer model, presented in Figure 1, where the first layer is tuned to a specific sensor, whereas the second layer could be generic. Note that the + +second layer carries most of the model parameters (about $20\times$ more than in the first layer in our experiments). Formally, let us denote by $\alpha$ in $\mathbb{R}^{p\times h\times w}$ the sparse encoding of an input tensor $\mathbf{y}$ in $\mathbb{R}^{c\times h\times w}$ as previously described. A sparse coding layer $\Phi$ naturally yields an encoder and a decoder such that: + +$$ +\Phi^ {e n c}: \mathbf {y} \mapsto \boldsymbol {\alpha}, \quad \text {a n d} \quad \Phi^ {d e c}: \boldsymbol {\alpha} \mapsto \frac {1}{n} \sum_ {i = 1} ^ {n} \mathbf {R} _ {i} \mathbf {W} \boldsymbol {\alpha} _ {i}. \tag {7} +$$ + +Given a noisy image $\mathbf{y}$ , the denoising procedure described in the previous section with one layer can be written as + +$$ +\hat {\mathbf {x}} (\mathbf {y}) = \Phi^ {d e c} \circ \Phi^ {e n c} (\mathbf {y}). +$$ + +Then, a straightforward multilayer extension of the procedure may consist of stacking several sparse coding layers $\Phi_1,\ldots ,\Phi_L$ together to form a multilayer sparse coding denoising model: + +$$ +\hat {\mathbf {x}} (\mathbf {y}) = \Phi_ {1} ^ {d e c} \circ \dots \circ \Phi_ {L} ^ {d e c} \circ \Phi_ {L} ^ {e n c} \circ \dots \circ \Phi_ {1} ^ {e n c} (\mathbf {y}). +$$ + +The model we propose is composed of two layers, as shown in Figure 1. The first layer encodes spectrally the input HSI image, meaning that it operates on $1 \times 1$ patches, whereas the second layer encodes both spectrally and spatially the output of the first layer. + +# 3.4 Noise Adaptive Sparse Coding + +An advantage of using a model based on a sparse coding objective (1) is to give the ability to encode domain knowledge within the model architecture. For instance, the Lasso problem (1) seen from a maximization a posteriori estimator implicitly assumes that the noise is i.i.d. If the noise variance is different on each spectral band, a natural modification to the model is to introduce weights and use a weighted- $\ell_2$ data fitting term (which could be applied as well to the CSC model of (6)): + +$$ +\min _ {\boldsymbol {\alpha} _ {i} \in \mathbb {R} ^ {p}} \frac {1}{2} \sum_ {j = 1} ^ {c} \beta_ {j} \| \mathbf {M} _ {j} (\mathbf {y} _ {i} - \mathbf {D} \boldsymbol {\alpha} _ {i}) \| ^ {2} + \lambda \| \boldsymbol {\alpha} _ {i} \| _ {1}, \tag {8} +$$ + +where $\mathbf{M}_j$ is a linear operator that extracts band $j$ from a given HSI signal. From a probabilistic point of view, if $\sigma_j^2$ denotes the variance of the noise for band $j$ , we may choose the corresponding weight $\beta_{j}$ to be proportional to $1 / \sigma_j^2$ . Yet, estimating accurately $\sigma_j^2$ is not always easy, and we have found it more effective to simply learn a parametric function $\beta_{j} = g(\mathbf{M}_{j}\mathbf{y})$ —here, a very simple CNN with three layers, see supplementary material for details—which is applied independently to each band. It is then easy to modify the LISTA iterations accordingly to take into account these weights, and learn the model parameters jointly with those of the parametric function $g$ . + +# 3.5 Self-Supervised Learning: Blind-Band Denoising with No Ground Truth Data + +Even though acquiring limited ground truth data for a specific sensor is often feasible, it is also interesting to be able to train models with no ground truth at all, e.g., for processing images without physical access to the sensor. In such an unsupervised setting, deep neural networks are typically trained for RGB images by using blind-spot denoising techniques [32], consisting of predicting pixel values given their context. Here, we propose a much simpler approach exploiting the spectral redundancy between channels. More precisely, each time we draw an image for training, we randomly mask one band (ore more), and train the model to reconstruct the missing band from the available ones. Formally, the training objective becomes + +$$ +\min _ {\mathbf {C}, \mathbf {D}, \mathbf {W}, \lambda} \mathbb {E} _ {\mathbf {x}, \mathbf {y}, S} \left[ \sum_ {j \notin S} \| \mathbf {M} _ {j} \left(\hat {\mathbf {x}} _ {S} (\mathbf {y}) - \mathbf {y}\right) \| ^ {2} \right], \tag {9} +$$ + +where $S$ is the set of bands that are visible for computing the sparse codes $\alpha_{i}$ , leading to a reconstructed image that we denote by $\hat{\mathbf{x}}_S(\mathbf{y})$ . Formally, it would mean considering the objective (8), but replacing the sum $\sum_{j=1}^{c}$ by $\sum_{j \in S}$ . This is in spirit similar to blind-spot denoising, except that bands are masked instead of pixels, making the resulting implementation much simpler. + +Table 1: Simplified comparison between learning-free and learning-based approaches. + +
Data req.traininginferenceadapt. to new datacomplex noise
learning-freeno req.no trainingsloweasypoor
learning-basedclean dataslowfastcomplicatedgood perf.
+ +# 4 Experiments + +We now present various experiments to demonstrate the effectiveness of our approach for HSI denoising, but first, we discuss the difficulty of defining the state of the art in this field. We believe indeed that it is not always easy to compare learning-free from approaches based on supervised learning. These two classes of approaches have very different requirements/characteristics, making one class more relevant than the other one in some scenarios, and less in others. Table 1 summarizes their characteristics, displaying advantages and drawbacks of both approaches. + +Benchmarked models. Keeping in mind the previous dichotomy, we choose to compare our method to traditional methods such as bandwise BM3D [12] (implementation based on [44, 45]), BM4D [39], GLF [71], LLRT [11], NGMeet [27]. We also included deep learning models in our benchmark such as HSID-CNN [66], HSI-SDeCNN [38] 3D-ADNet [54], SMDS-Net [63] and QRNN3D [62]. Results of HSID-CNN, HSI-SDeCNN and 3D-ADNet on Washington DC Mall (available in the Appendix) are taken directly from the corresponding papers, as the train/test split is the same. Otherwise, the results were obtained by running the code obtained directly from the authors, except for SMDS-Net, where our implementation turned out to be slightly more effective. Note that the same architecture for our model was used in all our experiments (see Appendix). + +Datasets. We evaluate our approach on two datasets with significantly different properties. + +- ICVL [4] consists of 204 images of size $1392 \times 1300$ with 31 bands. We used 100 images for training and 50 for testing as in [62] but with a different train/test split ensuring that similar images—e.g., picture from the same scene—are not used twice. +- Washington DC Mall is perhaps the most widely used dataset² for HSI denoising and consists of a high-quality image of size $1280 \times 307$ with 191 bands. Following [54], we split the image into two sub-images of size $600 \times 307$ and $480 \times 307$ for training and one sub-image of size $200 \times 200$ for testing. Even though the test image does not overlap with train images, they nevertheless share common characteristics. Interestingly, the amount of training data is very limited here. + +Specific experiments were also conducted with the datasets APEX [28], Pavia3, Urban[58] and CAVE [64], which appear in the supplementary material. + +Normalization. Before denoising, HSI images are normalized to $[0,1]$ . For remote sensing datasets, we pre-compute the $2^{\mathrm{nd}}$ and $98^{\mathrm{th}}$ percentiles for each band, on the whole the training set. Then, normalization is performed on train and test images by clipping each band between those percentiles before applying bandwise min-max normalization, similar to [5, 38]. For the close-range dataset ICVL, we simply apply global min-max normalization as in [63, 62]. + +Noise patterns. We evaluate our model against different types of synthetic noise: + +- i.i.d Gaussian noise with known variance $\sigma^2$ , which is the same on all bands. +- Gaussian noise with unknown band-dependent variance: We consider Gaussian noise with different standard deviation $\sigma_{j}$ for each band, which is uniformly drawn in a fixed interval. These standard deviations change from an image to the other and are unknown at test time. +- Noise with spectrally correlated variance: We consider Gaussian noise with standard deviation $\sigma_{j}$ varying continuously across bands, following a Gaussian curve, see details in the appendix. +- Stripes noise : similar to [62], we applied additive stripes noise to $33\%$ of bands. In those bands, $10 - 15\%$ of columns are affected, meaning a value uniformly sampled in the interval $[-0.25, 0.25]$ is added to them. Moreover, all bands are disturbed by Gaussian noise with noise intensity $\sigma = 25$ . + +Metrics. In order to assess the performances the previous methods, we used five different indexes widely used for HSI restoration, namely (i) Mean Peak Signal-to-Noise Ratio (MPSNR), which is the classical PSNR metric averaged across bands; (ii) Mean Structural Similarity Index Measurement (MSSIM), which is based on the SSIM metric [61]; (iii) Mean Feature Similarity Index Measurement (MFSIM) introduced in [69]; (iv) Mean ERGAS [14], and (v) Mean Spectral Angle Map (MSAM) [3]. We use MPSNR and MSSIM in the main paper and report the other metrics in the appendix. + +Implementation details. We trained our network by minimizing the MSE between the groundtruth and restored images. For ICVL, we follow the training procedure described in [62]: we first center crop training images to size $1024 \times 1024$ , then we extract patches of size $64 \times 64$ at scales 1:1, 1:2, and 1:4, with stride 64, 32 and 32 respectively. The number of extracted patches for ICVL amounts to 52962. For Washington DC Mall, we do not crop training images and the patches are extracted with stride 16, 8 and 8, for a total of 1650 patches. One epoch in Washington DC Mall corresponds to 10 iterations on the training dataset. Basic data augmentation schemes such as $90^{\circ}$ rotations and vertical/horizontal flipping are performed. Code and additional details about optimization, implementation, computational resources, are provided in the supplementary material. As reported in Table 4, augmenting the number unrolled iterations improves the denoising performances at the expense of inference time. Since the Spectral-Spatial SC layer is the most time-consuming, the number of unrolled iterations chosen for the first and second layers are 12 and 5 respectively. + +Quantitative results on synthetic noise. We present in Table 2 the results obtained on the ICVL dataset (results on DCMall are presented in the appendix). Our method uses the vanilla model of Section 3.3 for the experiments with constant $\sigma$ or correlated noise. For the blind denoising experiment with band-dependent $\sigma$ or for the stripe noise experiment, we use the variant of Section 3.4, which is designed to deal with unknown noise level per channel. The method "T3SC-SSL" implements the self-supervised learning approach of Section 3.5, which does not rely on ground-truth data. + +- Our supervised approach achieves state-of-the-art results (or is close to the best performing baseline) on all settings. GLF performs remarkably well given that this baseline is learning-free. +- Our self-supervised method achieves a relatively good performance under i.i.d. Gaussian noise, but does not perform as well under more complex noise. This is a limitation of the approach which is perhaps expected and overcoming this limitation would require designing a different self-supervised learning scheme; this is an interesting problem, which is beyond the scope of this paper. + +A visual result on ICVL is shown in Figure 2 for stripes noise. Inference times are provided in Table 3, showing that our approach is computationally efficient. + +Results on real noise. We also conducted a denoising experiment on the Urban dataset, reporting a visual result in Figure 3. Deep models were pre-trained on the APEX dataset, which has the same number of channels as Urban (even though the sensors are different), with band-dependent noise with $\sigma \in [0 - 55]$ . Please note that for this experiment we did not use Noise Adaptive Sparse Coding3.4 for T3SC, as it is highly dependent on the type of sensor used for training. We show that learning-based models trained on synthetic noise are able to transfer to real data. + +Comments on the additional results presented in the appendix. The appendix also contains (i) results on the DCMall dataset including additional baselines mentioned above; (ii) error bars for parts of our experimental results in order to assess their statistical significance; (iii) an experiment when learning simultaneously on several datasets with different types of sensors showing that the second layer can be generic and effective at the same time; (iv) additional visual results; (v) various ablation studies to illustrate the importance of different components of our method. + +# Broader Impact + +Our paper addresses the problem of denoising the signal, which is a key pre-processing step before using hyperspectral signals in concrete applications. As such, it is necessarily subject to dual use. For instance, HSI may be used for environmental monitoring, forestry, yield estimation in agriculture, natural disaster management planning, astronomy, archaeology, and medicine. Yet, HSI is also used by the petroleum industry for finding new oil fields, and has obvious military applications for surveillance. We believe the potential benefits of HSI for society are large enough to outweigh the + +Table 2: Denoising performance on ICVL with various types of noise patterns. The first four rows correspond to i.i.d. Gaussian noise with fixed $\sigma$ per band. The next three rows corresponds to a noise level that depends on the band, taken uniformly on small interval. This is a blind-noise experiment since at test time, the noise level is unknown. The last two rows correspond to the scenarios with correlated $\sigma$ across bands, and with stripe noise, respectively. See main text for details. + +
σMetricsNoisyBM3DBM4DGLFLLRTNGMeetSMDSQRNN3DT3SCT3SC-SSL
5MPSNR34.4746.1748.8551.2551.8652.7450.9148.8052.6251.42
MSSIM0.76180.98430.99160.99490.99510.99600.99440.99180.99590.9952
25MPSNR21.4437.8639.8943.1643.4344.7442.8344.2045.3844.73
MSSIM0.15480.92690.95100.96950.97460.97960.97000.97820.98250.9805
50MPSNR16.0334.2234.2239.2639.6941.0839.2541.6742.1641.62
MSSIM0.05020.86540.86540.91970.95040.96020.93820.96550.96770.9646
100MPSNR10.8530.4332.4734.7936.3937.5535.6437.1938.9938.50
MSSIM0.01440.75570.81550.79820.91820.93110.88150.91400.94390.9394
[0-15]MPSNR33.8945.8145.3550.5748.5041.6748.2352.0753.3151.26
MSSIM0.63860.97670.97350.99480.98990.90780.99000.99570.99670.9955
[0-55]MPSNR23.3639.0638.4344.2241.1332.9441.7647.1348.6446.82
MSSIM0.26010.92310.90740.98180.95800.75650.96200.98840.99110.9882
[0-95]MPSNR19.0636.1735.5541.4338.4429.4038.9443.9846.3044.75
MSSIM0.16140.87600.85400.96740.93540.66090.93570.97530.98590.9822
Corr.MPSNR28.8542.7342.1347.0545.7638.0645.9848.9049.8948.78
MSSIM0.47400.95990.90700.98810.98240.85360.98350.99110.99230.9911
Strip.MPSNR21.2034.8837.7042.0639.3839.7841.9844.6044.7443.80
MSSIM0.15080.86410.91980.96280.92580.93330.96550.98060.98050.9773
+ +Table 3: Inference time per image on ICVL with $\sigma = 50$ ; SMDS, QRNN3D and T3SC are using a V100 GPU; BM4D, GLF, LLRT and NGMeet are using an Intel(R) Xeon(R) CPU E5-1630 v4 @ 3.70GHz. Note that unlike GLF, NGMeet, and LRRT, learning-based approaches such as QRNN3D and our approach require a training procedure, which may be conducted offline. The cost of such a training step was about 13.5 hours for our method and 19 hours for QRNN3D on a V100 GPU. + +
BM3DBM4DGLFLLRTNGMeetSMDSQRNN3DT3SCT3SC-SSL
Inference time (s)16772382556524384268674.33.65.854.2
+ +![](images/8dcf796335f4e0bf423db6caf906bf839d31d379895730fb618464ab58b7b649.jpg) + +![](images/bcbc5fee1f7f7b9c2c2cef1af5047cebad47e22821ec7d7685c7b5836ad7ef79.jpg) + +![](images/a47908dc296e572b351efefe51c5e9b070baa391256bcd391c3301325d7aabd3.jpg) + +![](images/e78479bfff612a0e66a070cc35d23f12451b3c745d2672ad1a162016f280ae9a.jpg) + +![](images/f1426f42f171a087ccd357f7e424421655c9f01dc21ad728d306b951065b4f25.jpg) +(a) Groundtruth +(e) GLF +Figure 2: Denoising results with Gaussian noise $\sigma = 25$ on ICVL with bands 9, 15, 28. + +![](images/b17e03975601194a8e19d1dd78f25a26218a0f397681519a92984c7694fc31e6.jpg) +(b) Noisy +(f) SMDS-Net + +![](images/dc7342c725d02a5b67af8fa169c2aadb659d2140331ef0d2b5f14b697eaa0bb9.jpg) +(c) LLRT +(g) QRNN3D + +![](images/5c80456e9b304103d7af84f413722023896ebc6edc319d9a324a94ce4e00a6ef.jpg) +(d) NGMeet +(h) T3SC + +Table 4: Impact of the number of unrolled iterations per layer on denoising performances and inference time. This experiment was carried out on ICVL with $\sigma = 50$ . + +
Unrolled iterations per layer12512
MPSNR40.1641.4842.1542.45
Inference time (s)0.381.445.2714.91
+ +![](images/c53cede93bd3f8fe1ef076a70221f0f9d371b143b320cf70d5d5aae3dea0f10f.jpg) + +![](images/f1f1529e3685893515700d21853a54dc7f6331118cfe86ca6d2c16535a290ff8.jpg) + +![](images/e8047dbb965092c73973892907013972d457495474269c963d44341405721c52.jpg) + +![](images/8120d315950c5dd43a1478412fbd5ba6fd6d83f8b5a1a8d21f5ce6e651b3f45f.jpg) + +![](images/f104945e469d6299c15677b8c417f753891edfc88b60eed7a29d9aa768d125b2.jpg) +(a) Input +(e) GLF +Figure 3: Visual result on a real HSI denoising experiment on Urban dataset with bands 1, 108, 208. + +![](images/625af92dea547a43070379f4c34868e54ad37a76704486a79c11f9adbab406ab.jpg) +(b) BM4D +(f) SMDS-Net + +![](images/47f1bf46b111867bee106f30bbd346ce4ae4e50e4aea50273d07d618af7e7c86.jpg) +(c) LLRT +(g) QRNN3D + +![](images/3a5e4fc8d75cd818edf86e5fff979905169702e38f6732ccf248137c2749631b.jpg) +(d) NGMeet +(h) T3SC + +potential harm. Nevertheless, we are planning to implement appropriate dissemination strategies to mitigate the risk of misuse for this work (notably with restrictive software licenses), while targeting a gold standard regarding the scientific reproducibility of our results. + +# Acknowledgments and Funding + +This project was supported by the ERC grant number 714381 (SOLARIS project) and by ANR 3IA MIAI@Grenoble Alpes (ANR-19-P3IA-0003). This work was granted access to the HPC resources of IDRIS under the allocation 2021-[AD011012382] made by GENCI. + +# References + +[1] T. Adão, J. Hruska, L. Pádua, J. Bessa, E. Peres, R. Morais, and J. J. Sousa. Hyperspectral imaging: A review on UAV-Based sensors, data processing and applications for agriculture and forestry. Remote Sensing, 9(11), 2017. +[2] H. Akbari, L. Halig, D. M. Schuster, B. Fei, A. Osunkoya, V. Master, P. Nieh, and G. Chen. Hyperspectral imaging and quantitative analysis for prostate cancer detection. Journal of Biomedical Optics, 17(7):1-11, 2012. +[3] L. Alparone, L. Wald, J. Chanussot, C. Thomas, P. Gamba, and L. M. Bruce. Comparison of pansharpening algorithms: Outcome of the 2006 grs-s data-fusion contest. IEEE Transactions on Geoscience and Remote Sensing, 45(10):3012-3021, 2007. +[4] B. Arad and O. Ben-Shahar. Sparse recovery of hyperspectral signal from natural RGB images. In Proc. European Conference on Computer Vision (ECCV), 2016. +[5] N. Audebert, B. Saux, and S. Lefèvre. Deep learning for classification of hyperspectral data: A comparative review. IEEE Geoscience and Remote Sensing Magazine, 7(2):159-173, 2019. + +[6] A. G. Baydin, B. A. Pearlmutter, A. A. Radul, and J. M. Siskind. Automatic differentiation in machine learning: a survey. Journal of Machine Learning Research (JMLR), 18:1-43, 2018. +[7] J. M. Bioucas-Dias and J. M. P. Nascimento. Hyperspectral subspace identification. IEEE Transactions on Geoscience and Remote Sensing, 46(8):2435-2445, 2008. +[8] J. M. Bioucas-Dias, A. Plaza, G. Camps-Valls, P. Scheunders, N. Nasrabadi, and J. Chanussot. Hyperspectral remote sensing data analysis and future challenges. IEEE Geoscience and Remote Sensing Magazine, 1(2):6-36, 2013. +[9] A. Buades, B. Coll, and J.-M. Morel. A non-local algorithm for image denoising. In Proc. Conference on Computer Vision and Pattern Recognition (CVPR), 2005. +[10] A. Chakrabarti and T. Zickler. Statistics of real-world hyperspectral images. In Proc. Conference on Computer Vision and Pattern Recognition (CVPR), 2011. +[11] Y. Chang, L. Yan, and S. Zhong. Hyper-laplacian regularized unidirectional low-rank tensor recovery for multispectral image denoising. In Proc. Conference on Computer Vision and Pattern Recognition (CVPR), 2017. +[12] K. Dabov, A. Foi, V. Katkovnik, and K. Egiazarian. Image Denoising by Sparse 3-D Transform-Domain Collaborative Filtering. IEEE Transactions on Image Processing, 16(8):2080-2095, 2007. +[13] C. F. Dantas, J. E. Cohen, and R. Gribonval. Hyperspectral image denoising using dictionary learning. In 2019 10th Workshop on Hyperspectral Imaging and Signal Processing: Evolution in Remote Sensing (WHISPERS), 2019. +[14] Q. Du, N. H. Younan, R. King, and V. P. Shah. On the performance evaluation of pan-sharpening techniques. IEEE Geoscience and Remote Sensing Letters, 4(4):518-522, 2007. +[15] M. Elad and M. Aharon. Image denoising via sparse and redundant representations over learned dictionaries. IEEE Transactions on Image Processing, 15(12):3736-3745, 2006. +[16] G. Elmasry, M. Kamruzzaman, D.-W. Sun, and Paul Allen. Principles and applications of hyperspectral imaging in quality evaluation of agro-food products: A review. Critical Reviews in Food Science and Nutrition, 52(11):999-1023, 2012. +[17] H. Fan, C. Li, Y. Guo, G. Kuang, and J. Ma. Spatial-Spectral total variation regularized low-rank tensor decomposition for hyperspectral image denoising. IEEE Transactions on Geoscience and Remote Sensing, 56(10):6196-6213, 2018. +[18] B. Fei. Chapter 3.6 - Hyperspectral imaging in medical applications. In J. M. Amigo, editor, Hyperspectral Imaging, volume 32 of Data Handling in Science and Technology, pages 523-565. Elsevier, 2020. +[19] Y.-Z. Feng and Da-Wen Sun. Application of hyperspectral imaging in food safety inspection and control: A review. Critical Reviews in Food Science and Nutrition, 52(11):1039-1058, 2012. +[20] M. Figueiredo and R. Nowak. An EM algorithm for wavelet-based image restoration. IEEE Transactions on Image Processing, 12(8):906-916, 2003. +[21] Y. Fu, A. Lam, I. Sato, and Y. Sato. Adaptive spatial-spectral dictionary learning for hyperspectral image denoising. In Proc. International Conference on Computer Vision (ICCV), 2015. +[22] A. F. Goetz. Three decades of hyperspectral remote sensing of the Earth: A personal view. Remote Sensing of Environment, 113:S5-S16, 2009. +[23] X. Gong, W. Chen, and J. Chen. A low-rank tensor dictionary learning method for hyperspectral image denoising. IEEE Transactions on Signal Processing, 68:1168-1180, 2020. +[24] C. A. G. Gonzalez, O. Absil, and M. van Droogenbroeck. Supervised detection of exoplanets in high-contrast imaging sequences. *Astronomy & Astrophysics*, 613:A71, May 2018. +[25] A. A. Gowen, Y. Feng, E. Gaston, and V. Valdramidis. Recent applications of hyperspectral imaging in microbiology. Talanta, 137:43-54, 2015. +[26] K. Gregor and Y. LeCun. Learning fast approximations of sparse coding. In Proc. International Conference on Machine Learning (ICML), 2010. +[27] W. He, Q. Yao, C. Li, N. Yokoya, and Q. Zhao. Non-local meets global: An integrated paradigm for hyperspectral denoising. In Proc. Conference on Computer Vision and Pattern Recognition (CVPR), 2019. +[28] K. I. Itten, F. Dell'Endice, A. Hueni, M. Kneubühler, D. Schläpfer, D. Odermatt, F. Seidel, S. Huber, J. Schopfer, T. Kellenberger, et al. Apex-the hyperspectral ESA airborne prism experiment. Sensors, 8(10):6235-6259, 2008. + +[29] J. Kerekes and J. Baum. Hyperspectral imaging system modeling. Lincoln Laboratory Journal, 14(1):117-130, 2003. +[30] N. Keshava and J. F. Mustard. Spectral unmixing. IEEE signal processing magazine, 19(1):44-57, 2002. +[31] Z. Kong, X. Yang, and L. He. A comprehensive comparison of multi-dimensional image denoising methods, 2020. +[32] S. Laine, T. Karras, J. Lehtinen, and T. Aila. High-quality self-supervised deep image denoising. In Adv. Neural Information Processing Systems (NeurIPS), 2019. +[33] B. Lecouat, J. Ponce, and J. Mairal. Designing and learning trainable priors with non-cooperative games. In Adv. Neural Information Processing Systems (NeurIPS), 2020. +[34] B. Lecouat, J. Ponce, and J. Mairal. Fully trainable and interpretable non-local sparse models for image restoration. In Proc. European Conference on Computer Vision (ECCV), 2020. +[35] Y. Liu, H. Pu, and D.-W. Sun. Hyperspectral imaging technique for evaluating food quality and safety during various processes: A review of recent applications. Trends in Food Science & Technology, 69:25-35, 2017. +[36] B. Lu, P. D. Dao, J. Liu, Y. He, and J. Shang. Recent advances of hyperspectral imaging technology and applications in agriculture. Remote Sensing, 12(16), 2020. +[37] G. Lu and B. Fei. Medical hyperspectral imaging: A review. Journal of Biomedical Optics, 19(1):1-24, 2014. +[38] A. Maffei, J. M. Haut, M. E. Paoletti, J. Plaza, L. Bruzone, and A. Plaza. A single model CNN for hyperspectral image denoising. IEEE Transactions on Geoscience and Remote Sensing, 58(4):2516-2529, 2020. +[39] M. Maggioni, V. Katkovnik, K. Egiazarian, and A. Foi. Nonlocal Transform-Domain Filter for Volumetric Data Denoising and Reconstruction. IEEE Transactions on Image Processing, 22(1):119-133, 2013. +[40] S. Mahesh, D. Jayas, J. Paliwal, and N. White. Hyperspectral imaging to classify and monitor quality of agricultural materials. Journal of Stored Products Research, 61:17-26, 2015. +[41] J. Mairal, F. Bach, and J. Ponce. Task-driven dictionary learning. IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI), 34(4):791-804, 2012. +[42] J. Mairal, F. Bach, J. Ponce, et al. Sparse modeling for image and vision processing. Foundations and Trends in Computer Graphics and Vision, 8(2-3):85-283, 2014. +[43] J. Mairal, M. Elad, and G. Sapiro. Sparse representation for color image restoration. IEEE Transactions on image processing, 17(1):53-69, 2007. +[44] Y. Mäkinen, L. Azzari, and A. Foi. Exact transform-domain noise variance for collaborative filtering of stationary correlated noise. In IEEE International Conference on Image Processing (ICIP), 2019. +[45] Y. Makinen, L. Azzari, and A. Foi. Collaborative filtering of correlated noise: Exact transform-domain variance for improved shrinkage and patch matching. IEEE Transactions on Image Processing, 29:8339-8354, 2020. +[46] D. G. Manolakis, R. B. Lockwood, and T. W. Cooley. Hyperspectral Imaging Remote Sensing: Physics, Sensors, and Algorithms. Cambridge University Press, Cambridge, 2016. +[47] B. A. Olshausen and D. J. Field. Emergence of simple-cell receptive field properties by learning a sparse code for natural images. Nature, 381(6583):607-609, 1996. +[48] H. Othman and S.-E. Qian. Noise reduction of hyperspectral imagery using hybrid spatial-spectral derivative-domain wavelet shrinkage. IEEE Transactions on Geoscience and Remote Sensing, 44(2):397-408, 2006. +[49] Y. Peng, D. Meng, Z. Xu, C. Gao, Y. Yang, and B. Zhang. Decomposable nonlocal tensor dictionary learning for multispectral image denoising. In Proc. Conference on Computer Vision and Pattern Recognition (CVPR), 2014. +[50] N. Qi, Y. Shi, X. Sun, and B. Yin. TenSR: Multi-dimensional tensor sparse representation. In IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2016. +[51] B. Rasti, P. Scheunders, P. Ghamisi, G. Licciardi, and J. Chanussot. Noise Reduction in Hyperspectral Imagery: Overview and Application. Remote Sensing, 10(3):482, Mar. 2018. +[52] B. Rasti, J. R. Sveinsson, M. O. Ulfarsson, and J. A. Benediktsson. Hyperspectral image denoising using first order spectral roughness penalty in wavelet domain. IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing, 7(6):2458-2467, 2014. + +[53] B. Rasti, M. O. Ulfarsson, and P. Ghamisi. Automatic hyperspectral image restoration using sparse and low-rank modeling. IEEE Geoscience and Remote Sensing Letters, 14(12):2335-2339, 2017. +[54] Q. Shi, X. Tang, T. Yang, R. Liu, and L. Zhang. Hyperspectral image denoising using a 3-D attention denoising network. IEEE Transactions on Geoscience and Remote Sensing, 2021. +[55] D. Simon and M. Elad. Rethinking the CSC model for natural images. In Adv. Neural Information Processing Systems (NeurIPS), 2019. +[56] V. Studer, J. Bobin, M. Chahid, H. S. Mousavi, E. Candes, and M. Dahan. Compressive fluorescence microscopy for biological and hyperspectral imaging. Proceedings of the National Academy of Sciences, 109(26):E1679-E1687, 2012. +[57] L. Tucker. Some mathematical notes on three-mode factor analysis. Psychometrika, 31(3):279-311, 1966. +[58] G. R. L. (U.S.). Hypercube sample data set: Hydice sensor imagery urban. +[59] M. Wang, Q. Wang, J. Chanussot, and D. Hong. $\mathrm{L}_0\text{-}\mathrm{l}_1$ hybrid total variation regularization and its applications on hyperspectral image mixed noise removal and compressed sensing. IEEE Transactions on Geoscience and Remote Sensing, 2021. +[60] M. Wang, Q. Wang, J. Chanussot, and D. Li. Hyperspectral image mixed noise removal based on multidirectional low-rank modeling and spatial-spectral total variation. IEEE Transactions on Geoscience and Remote Sensing, 59(1):488-507, 2021. +[61] Z. Wang, A. Bovik, H. Sheikh, and E. Simoncelli. Image quality assessment: from error visibility to structural similarity. IEEE Transactions on Image Processing, 13(4):600-612, 2004. +[62] K. Wei, Y. Fu, and H. Huang. 3-D quasi-recurrent neural network for hyperspectral image denoising. IEEE Transactions on Neural Networks and Learning Systems, 2020. +[63] F. Xiong, J. Zhou, J. Lu, and Y. Qian. SMDS-Net: Model Guided Spectral-Spatial Network for Hyperspectral Image Denoising. arXiv:2012.01829, 2020. +[64] F. Yasuma, T. Mitsunaga, D. Iso, and S. Nayar. Generalized Assorted Pixel Camera: Post-Capture Control of Resolution, Dynamic Range and Spectrum. Technical report, Nov 2008. +[65] Q. Yuan, L. Zhang, and H. Shen. Hyperspectral image denoising with a Spatial-Spectral view fusion strategy. IEEE Transactions on Geoscience and Remote Sensing, 52(5):2314-2325, 2014. +[66] Q. Yuan, Q. Zhang, J. Li, H. Shen, and L. Zhang. Hyperspectral Image Denoising Employing a Spatial-Spectral Deep Residual Convolutional Neural Network. IEEE Transactions on Geoscience and Remote Sensing, 57(2):1205-1218, Feb. 2019. +[67] H. Zhang, W. He, L. Zhang, H. Shen, and Q. Yuan. Hyperspectral image restoration using low-rank matrix recovery. IEEE Transactions on Geoscience and Remote Sensing, 52(8):4729-4743, 2014. +[68] K. Zhang, W. Zuo, Y. Chen, D. Meng, and L. Zhang. Beyond a Gaussian denoiser: Residual learning of deep CNN for image denoising. IEEE Transactions on Image Processing, 26(7):3142-3155, 2017. +[69] L. Zhang, L. Zhang, X. Mou, and D. Zhang. Fsim: A feature similarity index for image quality assessment. IEEE Transactions on Image Processing, 20(8):2378-2386, 2011. +[70] Y.-Q. Zhao and J. Yang. Hyperspectral image denoising via sparse representation and low-rank constraint. IEEE Transactions on Geoscience and Remote Sensing, 53(1):296-308, 2015. +[71] L. Zhuang and J. M. Bioucas-Dias. Hyperspectral image denoising based on global and non-local low-rank factorizations. In IEEE International Conference on Image Processing (ICIP), 2017. \ No newline at end of file diff --git a/atrainablespectralspatialsparsecodingmodelforhyperspectralimagerestoration/images.zip b/atrainablespectralspatialsparsecodingmodelforhyperspectralimagerestoration/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..d9405e949fcc2baa4c14cbafc432dff2bc494cd8 --- /dev/null +++ b/atrainablespectralspatialsparsecodingmodelforhyperspectralimagerestoration/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1891c36d9f22af0ee33b19a491ecc21a2ecde69b9c736048781cde93cb23cc3a +size 561302 diff --git a/atrainablespectralspatialsparsecodingmodelforhyperspectralimagerestoration/layout.json b/atrainablespectralspatialsparsecodingmodelforhyperspectralimagerestoration/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..58f6b527e09c305d7859281496db5d44d4ba1898 --- /dev/null +++ b/atrainablespectralspatialsparsecodingmodelforhyperspectralimagerestoration/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7fba1191b2a2f65b410bc0218ecd3215bb6cd8572572fe868c850834fabc5647 +size 475771 diff --git a/aunifiedapproachtofaironlinelearningviablackwellapproachability/a1f0587c-201f-4218-b477-36746c1f3405_content_list.json b/aunifiedapproachtofaironlinelearningviablackwellapproachability/a1f0587c-201f-4218-b477-36746c1f3405_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..08c8116a0dd5339431c34a3ec5e3937fd4efe538 --- /dev/null +++ b/aunifiedapproachtofaironlinelearningviablackwellapproachability/a1f0587c-201f-4218-b477-36746c1f3405_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15db0461d9d703ba72e06a772c9b018080b5f7da0562c93ab3cd01c961e49997 +size 96560 diff --git a/aunifiedapproachtofaironlinelearningviablackwellapproachability/a1f0587c-201f-4218-b477-36746c1f3405_model.json b/aunifiedapproachtofaironlinelearningviablackwellapproachability/a1f0587c-201f-4218-b477-36746c1f3405_model.json new file mode 100644 index 0000000000000000000000000000000000000000..83e8744225846d9dd265b698c3985dd47f01ea65 --- /dev/null +++ b/aunifiedapproachtofaironlinelearningviablackwellapproachability/a1f0587c-201f-4218-b477-36746c1f3405_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:59fa3ce0bd2c6189f3da680ab443fedc3f425903689ff2da1eb048200828f03d +size 116109 diff --git a/aunifiedapproachtofaironlinelearningviablackwellapproachability/a1f0587c-201f-4218-b477-36746c1f3405_origin.pdf b/aunifiedapproachtofaironlinelearningviablackwellapproachability/a1f0587c-201f-4218-b477-36746c1f3405_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7cce2cc58fc89fdbc4c43448674406618c381d09 --- /dev/null +++ b/aunifiedapproachtofaironlinelearningviablackwellapproachability/a1f0587c-201f-4218-b477-36746c1f3405_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:06cbdaaf89f1b3a032e023a98bc281e8f301bcbb9278d29ac2d6caa4fb8877ff +size 368943 diff --git a/aunifiedapproachtofaironlinelearningviablackwellapproachability/full.md b/aunifiedapproachtofaironlinelearningviablackwellapproachability/full.md new file mode 100644 index 0000000000000000000000000000000000000000..2f42b27d19e5a9ca69a51ba10a4bbaf3e4086744 --- /dev/null +++ b/aunifiedapproachtofaironlinelearningviablackwellapproachability/full.md @@ -0,0 +1,440 @@ +# A Unified Approach to Fair Online Learning via Blackwell Approachability + +Evgenii Chzhen Christophe Giraud Gilles Stoltz + +Université Paris-Saclay, CNRS, Laboratoire de mathématiques d'Orsay, 91405, Orsay, France {evgenii.chzhen, christophe.giraud, gilles.stoltz} @universite-paris-saclay.fr + +# Abstract + +We provide a setting and a general approach to fair online learning with stochastic sensitive and non-sensitive contexts. The setting is a repeated game between the Player and Nature, where at each stage both pick actions based on the contexts. Inspired by the notion of unawareness, we assume that the Player can only access the non-sensitive context before making a decision, while we discuss both cases of Nature accessing the sensitive contexts and Nature unaware of the sensitive contexts. Adapting Blackwell's approachability theory to handle the case of an unknown contexts' distribution, we provide a general necessary and sufficient condition for learning objectives to be compatible with some fairness constraints. This condition is instantiated on (group-wise) no-regret and (group-wise) calibration objectives, and on demographic parity as an additional constraint. When the objective is not compatible with the constraint, the provided framework permits to characterise the optimal trade-off between the two. + +# 1 Introduction + +Classically, the goal of the decision maker in sequential environment is purely performance driven — she wants to obtain as high reward as if she has had a complete information about the environment. In contrast, algorithmic fairness shifts the attention from the performance-driven behavior by taking into account additional ethical considerations. The latter is often formalized via the notion of fairness constraint [10, 26, 6] on the decision maker's strategies. The goal of this work is to bring to light Blackwell's approachability theory as a suitable theoretical formalism for fair online learning under group fairness constraints. The appealing feature of this theory is two-fold: first, it gives explicit criteria when learning is possible; second, if this criteria is met, it comes with an explicit strategy. + +It is well known that Blackwell's approachability theory may be used to characterize online learning problems that are tractable and to design strategies to solve them—for instance, for no-regret learning or calibration. Extensive references to such uses may be found in Cesa-Bianchi and Lugosi [5], Perchet [23] and Abernethy et al. [1]. Actually, as noted by the latter two references, no-regret learning, calibration, and approachability imply each other in some sense. The main first achievement of this article is to extend this use to online learning under fairness constraints. This idea, though natural and intuitive, requires some extensions to Blackwell's approachability theory, like ignoring the target set and having to estimate it. + +Related works in fair online learning. Several frameworks have been proposed to tackle various problems of fairness arising in online learning. Blum et al. [4] consider the problem of online prediction with experts and define fairness via (approximate) equality of average payoffs. Hébert-Johnson et al. [16], Gupta et al. [14] consider the problem of group-wise calibration. (In passing, we may note that Gupta et al. [14] consider some techniques with a flavor of approachability.) Bechavod et al. [2] consider the problem of online binary classification with partial feedback and + +equal opportunity constraint [15]. We treat the above works as sources of inspiration; they all differ in the specific (sensitive and non-sensitive) information that the Player may or may not access before or after taking an action. We apply the general formalism of approachability theory to give new insights into online learning under fairness constraints, and approach this goal in a unified (and geometric) way. In particular, the generality of this formalism allows to derive (im)possibility results nearly effortlessly. But we also go beyond such a mere compatibility/incompatibility check between the learning objectives and fairness constraints, and note that approachability theory also gives a clear strategy for the study of trade-offs between incompatible learning objectives and fairness constraints, which often arise in batch setup [6]. + +Outline. We describe our approachability setting in Section 2 and provide some learning objectives (no-regret and calibration) and fairness constraints (group-wise controls, demographic parity, equalized average payoffs) that fit our framework. A slight extension of the classical result of Blackwell [3] is required and discussed in Section 3. We then support the generality of our framework by deriving (im)possibility results for some objective-constraint pairs in Section 4. We also illustrate in Section 5 how this formalism can be used to derive optimal trade-offs (Pareto frontiers) between performance and fairness for incompatible objective-constraint pairs; as an example, we deal with group-wise calibration (studied by [16, 14]) under demographic parity constraint. For the sake of exposition, we deal in Sections 2-5 with stochastic sensitive contexts whose distribution is known; Section 6 explains how to overcome this and develops a theory of approachability relying on ignoring but estimating the target set. + +Notation. The Euclidean norm is denoted by $\| \cdot \|$ , while the $\ell_1$ norm is denoted by $\| \cdot \| _1$ . Given a convex closed set $\mathcal{C}\subset \mathbb{R}^d$ , we denote by $\mathrm{Proj}_{\mathcal{C}}(\cdot)$ the projection operator onto $\mathcal{C}$ in Euclidean norm. + +# 2 Fair online learning cast as an approachability problem + +In this section, we propose a setting for fair online learning based on approachability—a theory introduced by Blackwell [3] (see also the more modern expositions by Perchet [25] or Mertens et al. [22]). More precisely, we consider the following repeated game between a Player and Nature, with stochastic contexts. The existence of these contexts is a (minor) variation on the classical statement of the approachability problem. + +The Player and Nature have respective finite action sets $\mathcal{A}$ and $\mathcal{B}$ . The sets of sensitive and non-sensitive contexts are respectively denoted by $S$ and $\mathcal{X}$ . The set $\mathcal{X}$ is a general Borel set, while $S$ is a finite set with cardinality denoted by $|\mathcal{S}|$ . Typical choices are $S = \{0,1\}$ and $\mathcal{X} = \mathbb{R}^m$ for some $m \in \mathbb{N}$ . A joint distribution $\mathbf{Q}$ on $\mathcal{X} \times S$ is fixed and is unknown to the Player. Finally, a (bounded) Borel-measurable vector-valued payoff function $m: \mathcal{A} \times \mathcal{B} \times \mathcal{X} \times S \to \mathbb{R}^d$ , as well as a closed target set $\mathcal{C} \subseteq \mathbb{R}^d$ , are given and known by the Player. + +At each round $t \geq 1$ the pair of non-sensitive and sensitive contexts $(x_{t}, s_{t}) \sim \mathbf{Q}$ is generated independently from the past. The Player observes only the non-sensitive context $x_{t}$ ; while Nature also observes $x_{t}$ , it may or may not observe the sensitive context $s_{t}$ . Then, Nature and the Player simultaneously pick (possibly in a randomized fashion) $b_{t} \in \mathcal{B}$ and $a_{t} \in \mathcal{A}$ , respectively. The Player finally accesses the obtained reward $m(a_{t}, b_{t}, x_{t}, s_{t})$ and the sensitive context $s_{t}$ , while Nature has a more complete monitoring and may observe $a_{t}$ and $s_{t}$ . We introduce an observation operation $G$ to indicate whether Nature observes $x_{t}$ only—i.e., $G(x_{t}, s_{t}) = x_{t}$ , the case of Nature's unawareness—or whether Nature observes both contexts—i.e., $G(x_{t}, s_{t}) = (x_{t}, s_{t})$ , the case of Nature's awareness. + +We consider the short-hand notation $\pmb{m}_t \coloneqq \pmb{m}(a_t, b_t, x_t, s_t)$ , + +$$ +\overline {{\boldsymbol {m}}} _ {T} := \frac {1}{T} \sum_ {t = 1} ^ {T} \boldsymbol {m} (a _ {t}, b _ {t}, x _ {t}, s _ {t}), \qquad \text {a n d} \qquad \overline {{\boldsymbol {c}}} _ {T} = \operatorname {P r o j} _ {\mathcal {C}} (\overline {{\boldsymbol {m}}} _ {T}) = \underset {\boldsymbol {v} \in \mathcal {C}} {\arg \min } \| \overline {{\boldsymbol {m}}} _ {T} - \boldsymbol {v} \| +$$ + +for the instantaneous and average payoffs of the player, as well as the Euclidean projection of the latter onto the closed set $\mathcal{C}$ , respectively. The distance of $\overline{\boldsymbol{m}}_T$ to $\mathcal{C}$ thus equals $d_T \coloneqq \| \overline{\boldsymbol{m}}_T - \overline{\boldsymbol{c}}_T \|$ . The game protocol is summarized on the next page. + +We recall that the Player does not know the context distribution $\mathbf{Q}$ . + +Definition 1. A target set $\mathcal{C}$ is called $\mathbf{m}$ -approachable by the Player under the distribution $\mathbf{Q}$ if there exists a strategy of the Player such that, for all strategies of the Nature, $\overline{\mathbf{m}}_T \to \mathcal{C}$ a.s. + +# PROTOCOL 2.1 + +Parameters: Observation operator $G$ for Nature; distribution $\mathbf{Q}$ on $\mathcal{X} \times \mathcal{S}$ + +For $t = 1,2,\ldots$ + +1. Contexts $(x_{t}, s_{t})$ are sampled according to $\mathbf{Q}$ , independently from the past; +2. Simultaneously, +- Nature observes $G(x_{t}, s_{t})$ and picks $b_{t} \in \mathcal{B}$ ; +- the Player observes $x_{t}$ and picks an action $a_{t} \in \mathcal{A}$ ; + +3. The Player observes the reward $\pmb{m}(a_t, b_t, x_t, s_t)$ and the sensitive context $s_t$ , while Nature observes $(a_t, b_t, x_t, s_t)$ . + +Aim: The Player wants to ensure that $\overline{\mathbf{m}}_T\to \mathcal{C}$ a.s., i.e., $d_{T} = \| \overline{\mathbf{m}}_{T} - \overline{\mathbf{c}}_{T}\| \to 0$ a.s. + +Remark 1 (Awareness for the Player). We are mostly interested in a Player unaware of the sensitive contexts $s_t$ (Gajane and Pechenizkiy [13]). However, the setting above also covers the case of a Player aware of these contexts: simply consider the lifted non-sensitive contexts $x_t' = (x_t, s_t)$ . + +We now describe payoff functions and target sets corresponding to online learning objectives or online fairness constraints. They may be combined together. For instance, vanilla calibration corresponds below to the $m_{\mathrm{cal}}$ -approachability of a set $\mathcal{C}_{\mathrm{cal}}$ , demographic parity, to the $m_{\mathrm{DP}}$ -approachability of a set $\mathcal{C}_{\mathrm{DP}}$ , so that vanilla calibration under a demographic parity constraint translates into the $(m_{\mathrm{cal}}, m_{\mathrm{DP}})$ -approachability of the product set $\mathcal{C}_{\mathrm{cal}} \times \mathcal{C}_{\mathrm{DP}}$ . We therefore consider each objective and each constraint as some elementary brick, to be combined with one or several other bricks. We recall that $S$ is a finite set and will indicate the cases where we only consider $S = \{0, 1\}$ . + +We discuss two objectives: no-regret and approximate calibration, as well as three fairness constraints: group-wise (per-group) control, demographic parity, and equal average payoffs. + +# 2.1 Statement of the objectives + +For the sake of a more compact exposition, we define the objectives in two forms: global objectives (the vanilla form of objectives) and group-wise objectives. We denote $\gamma_s = \mathbb{P}(s_t = s)$ , so that $(\gamma_s)_{s \in S}$ corresponds to the marginal of $\mathbf{Q}$ on $S$ . + +Objective 1: (Vanilla and group-wise) no-regret. The definition is based on some payoff function $r$ , possibly taking contexts into account: at each round $t$ , the Player obtains the payoff $r(a_{t}, b_{t}, x_{t}, s_{t})$ . The aim is to get, on average, almost as much payoff as the best constant action, all things equal. The vanilla (average) regret equals + +$$ +R _ {T} = \min _ {a \in \mathcal {A}} \frac {1}{T} \sum_ {t = 1} ^ {T} \left(r \left(a _ {t}, b _ {t}, x _ {t}, s _ {t}\right) - r \left(a, b _ {t}, x _ {t}, s _ {t}\right)\right), +$$ + +while the group-wise (average) regret equals + +$$ +R _ {\mathrm {g r}, T} = \min _ {s \in \mathcal {S}} \min _ {a _ {s} ^ {\prime} \in \mathcal {A}} \frac {1}{T} \sum_ {t = 1} ^ {T} \big (r (a _ {t}, b _ {t}, x _ {t}, s _ {t}) - r (a _ {s} ^ {\prime}, b _ {t}, x _ {t}, s _ {t}) \big) \mathbb {I} \{s _ {t} = s \}. +$$ + +The aim is that $\lim \inf R_T\geqslant 0$ a.s. (no-regret) and $\lim \inf R_{\mathrm{gr},T}\geqslant 0$ a.s. (group-wise no-regret), respectively. We could replace the $1 / T$ factor by a $1 / (\gamma_sT)$ factor in the definition of $R_{\mathrm{gr},T}$ , as we will do for the $C_T$ calibration criterion, but given the wish of a non-negative limit, this is irrelevant. + +Denote by $N = |\mathcal{A}|$ the cardinality of $\mathcal{A}$ . No-regret corresponds to the $m_{\mathrm{reg}}$ -approachability of $\left([0, +\infty)\right)^N$ , with the global payoff function $m_{\mathrm{reg}}(a,b,x,s) = \left(r(a,b,x,s) - r(a',b,x,s)\right)_{a' \in \mathcal{A}}$ . + +We also duplicate $m_{\mathrm{reg}}$ into the group-wise payoff function + +$$ +\boldsymbol {m} _ {\text {g r - r e g}} (a, b, x, s) = \left(\boldsymbol {m} _ {\text {r e g}} (a, b, x, s) \mathbb {I} \{s ^ {\prime} = s \}\right) _ {s ^ {\prime} \in \mathcal {S}}. +$$ + +Group-wise no-regret then corresponds to the $m_{\mathrm{gr - reg}}$ -approachability of $\mathcal{C}_{\mathrm{gr - reg}} = ([0, + \infty))^{N|S|$ + +Objective 2: Approximate (vanilla or group-wise) calibration. Online calibration was first solved by Foster and Vohra [12] and Foster [11]; see the monograph by Cesa-Bianchi and Lugosi [5, Section 4.8] for references to other solutions and extensions. For simplicity, we focus on binary outcomes $b_{t} \in \{0,1\}$ and ask the Player to provide at each round forecasts $a_{t}$ in $[0,1]$ , and even in a discretization of $[0,1]$ based on a fixed number $N \geqslant 2$ of points: + +$$ +\mathcal {A} = \left\{a ^ {(k)} := (k - 1 / 2) / N, k \in \{1, \dots , N \} \right\}. +$$ + +Each $x \in [0,1]$ can be approximated by some $a^{(k)} \in \mathcal{A}$ with $|x - a^{(k)}| \leqslant 1/(2N)$ . At each round, the Player picks $k_{t} \in \{1, \ldots, N\}$ and forecasts $a_{t} = a^{(k_{t})}$ . The action set $\mathcal{A}$ can thus be identified with $\{1, \ldots, N\}$ . + +This problem is actually called $1 / N$ -calibration or approximate calibration. The global (vanilla) form of the criterion reads + +$$ +C _ {T} = \sum_ {k = 1} ^ {N} \left| \frac {1}{T} \sum_ {t = 1} ^ {T} \left(a ^ {(k)} - b _ {t}\right) \mathbb {I} \left\{k _ {t} = k \right\} \right|, +$$ + +while the approximate group-wise calibration criterion is defined as + +$$ +C _ {\mathrm {g r}, T} = \sum_ {s \in \mathcal {S}} \sum_ {k = 1} ^ {N} \left| \frac {1}{\gamma_ {s} T} \sum_ {t = 1} ^ {T} \left(a ^ {(k)} - b _ {t}\right) \mathbb {I} \left\{k _ {t} = k \right\} \mathbb {I} \left\{s _ {t} = s \right\} \right|. +$$ + +The aim is that $\lim \sup C_T\leqslant 1 / N$ a.s. or $\lim \sup C_{\mathfrak{gr},T}\leqslant 1 / N$ , respectively. Note that unlike vanilla calibration, its group-wise version requires to be calibrated on each sensitive attribute $s\in S$ . In particular, the classical $1 / T$ factor is replaced by $1 / (\gamma_sT)$ , the expected number of appearances of $s_t = s$ for $t = 1,\ldots ,T$ . + +Mannor and Stoltz [18] and Abernethy et al. [1] rewrote the problem of approximate calibration as an approachability problem as follows: introduce the global payoff function + +$$ +\boldsymbol {m} _ {\operatorname {c a l}} (k, b) = \left(\left(a ^ {(1)} - b\right) \mathbb {I} \{k = 1 \}, \dots , \left(a ^ {(N)} - b\right) \mathbb {I} \{k = N \}\right), +$$ + +and duplicate it into the group-wise payoff function as follows: + +$$ +\boldsymbol {m} _ {\text {g r - c a l}} (k, b, s) = \left(\boldsymbol {m} _ {\text {c a l}} (k, b) \mathbb {I} \{s = s ^ {\prime} \} / \gamma_ {s ^ {\prime}}\right) _ {s ^ {\prime} \in \mathcal {S}}. +$$ + +The calibration criteria $C_T$ and $C_{\mathrm{gr},T}$ can now be rewritten as the $\ell^1$ -norms of the average payoff vectors $\overline{\boldsymbol{m}}_{\mathrm{cal},T}$ and $\overline{\boldsymbol{m}}_{\mathrm{gr - cal},T}$ . Approximate vanilla calibration thus corresponds to the $m_{\mathrm{cal}}$ -approachability of $\mathcal{C}_{\mathrm{cal}} = \left\{\boldsymbol{v} \in \mathbb{R}^{N} : \| \boldsymbol{v} \|_{1} \leqslant 1 / N\right\}$ , while approximate group-wise calibration corresponds to the $m_{\mathrm{gr - cal}}$ -approachability of $\mathcal{C}_{\mathrm{gr - cal}} = \left\{\boldsymbol{v} \in \mathbb{R}^{N|S|} : \| \boldsymbol{v} \|_{1} \leqslant 1 / N\right\}$ . + +Note that non-sensitive contexts play no role in the calibration objectives, but the Player can (and must) leverage these non-sensitive contexts to possibly infer sensitive contexts when handling group-wise calibration. + +# 2.2 Statement of the fairness constraints + +Fairness constraint 1: Group-wise objectives. We already considered possibly group-wise objectives above and Section 4 will show that handling them is already a challenge in our setting where the Player is unaware of the sensitive contexts. + +Fairness constraint 2: Demographic parity. We will consider it only in the setting of approximate calibration and further restrict our attention to the case of two groups: $S = \{0,1\}$ . The demographic parity criterion measures the difference between the average forecasts issued for the two groups: + +$$ +D _ {T} = \left| \frac {1}{\gamma_ {0} T} \sum_ {t = 1} ^ {T} a _ {t} \mathbb {I} \{s _ {t} = 0 \} - \frac {1}{\gamma_ {1} T} \sum_ {t = 1} ^ {T} a _ {t} \mathbb {I} \{s _ {t} = 1 \} \right|. +$$ + +Given the discretization used, the wish is that $\lim \sup D_T\leqslant 1 / N$ . Abiding by a demographic parity constraint is equivalent to $m_{\mathrm{DP}}$ -approaching $\mathcal{C}_{\mathrm{DP}} = \left\{(u,v)\in \mathbb{R}^2:|u - v|\leqslant 1 / N\right\}$ , where + +$$ +\boldsymbol {m} _ {\mathrm {D P}} (k, s) = \left(a ^ {(k)} \mathbb {I} \{s = 0 \} / \gamma_ {0}, a ^ {(k)} \mathbb {I} \{s = 1 \} / \gamma_ {1}\right). +$$ + +Fairness constraint 3: Equalized average payoffs. This criterion is to be combined with a no-regret criterion; in particular, a base payoff function $r$ is considered. We restrict our attention to the case of two groups, $S = \{0,1\}$ , and measure the difference of average payoffs: + +$$ +P _ {T} = \left| \frac {1}{\gamma_ {0} T} \sum_ {t = 1} ^ {T} r \left(a _ {t}, b _ {t}, x _ {t}, s _ {t}\right) \mathbb {I} \left\{s _ {t} = 0 \right\} - \frac {1}{\gamma_ {1} T} \sum_ {t = 1} ^ {T} r \left(a _ {t}, b _ {t}, x _ {t}, s _ {t}\right) \mathbb {I} \left\{s _ {t} = 1 \right\} \right|. +$$ + +Ensuring $\lim \sup P_T\leqslant \varepsilon$ corresponds to $m_{\mathrm{eq - pay}}$ approaching $\mathcal{C}_{\mathrm{eq - pay}} = \{(u,v)\in \mathbb{R}^2:|u - v|\leqslant \varepsilon \}$ where + +$$ +\boldsymbol {m} _ {\text {e q - p a y}} (a, b, x, s) = \left(r (a, b, x, 0) \mathbb {I} \{s = 0 \} / \gamma_ {0}, r (a, b, x, 1) \mathbb {I} \{s = 1 \} / \gamma_ {1}\right). +$$ + +Remark 2. Note that in this general form, the equality of average payoffs encompasses the demographic parity constraint. Indeed, the latter is obtained by setting $r(a,b,x,s) = a$ and $\varepsilon = 1 / N$ . + +# 2.3 Summary table + +The table below gives a summary of different criteria and associated pairs of payoff function and target set. We remark that some of the payoff functions depend on the marginals $(\gamma_s)_{s \in S}$ . Meanwhile, Protocol 2.1 assumes the perfect knowledge of the former. In Section 6 we will show how to bypass this issue, transferring all the unknown quantities into the target set and estimating it. + +
CriterionVector payoff functionClosed convex target set
Calibrationm_cal(k,b) = ((a(k') - b) I{k=k'})_{k'∈A}C_cal = {v∈R^N: ||v||_1 ≤ 1/N}
Group-calibrationm_gr-cal(k,b,s) = (m_cal(k,b) I{s=s'}/γs')_{s'∈S}C_gr-cal = {v∈R^N|S|: ||v||_1 ≤ 1/N}
No-regretm_reg(a,b,x,s) = (r(a,b,x,s) - r(a',b,x,s))_{a'∈A}C_reg = ([0,+∞))^N
Group-no-regretm_gr-reg(a,b,x,s) = (m_reg(a,b,x,s) I{s=s'})_{s'∈S}C_gr-reg = ([0,+∞))^{N|S|}
Demographic paritym_DP(k,s) = (a(k) I{s=0}/γ0, a(k) I{s=1}/γ1)C_DP = {(u,v)∈R^2: |u-v| ≤ 1/N}
Equalized payoffsm_eq-pay(a,b,x,s) = (r(a,b,x,s') I{s=s'/γs')_{s'∈{0,1}})C_eq-pay = {(u,v)∈R^2: |u-v| ≤ ε}
+ +# 3 Approachability theory adapted + +We provide a rather straightforward extension of the approachability theory to deal with Protocol 2.1, namely, with the existence of stochastic contexts, drawn according to an unknown distribution $\mathbf{Q}$ . We want to characterize closed convex sets that are approachable. + +Pure vs. mixed actions. To conclude the description of the setting, we provide more details on the randomized draws of the (pure) actions $a_{t+1}$ and $b_{t+1}$ of the Player and Nature at round $t+1$ . We denote by $h_t$ the information available to Player at the end of round $t$ , and by $H_t$ the full history of the first $t$ rounds: $h_t = (m_{t'}, x_{t'}, s_{t'})_{t' \leqslant t}$ and $H_t = (a_{t'}, b_{t'}, x_{t'}, s_{t'})_{t' \leqslant t}$ . At the beginning of round $t+1$ , the Player thus picks in a $h_t$ -measurable way a measurable family $(\pmb{p}_{t+1}^x)_{x \in \mathcal{X}}$ of probability distributions over $\mathcal{A}$ (i.e., a collection of distributions such that $x \in \mathcal{X} \mapsto \pmb{p}_{t+1}^x$ is Borel-measurable), and then draws $a_{t+1}$ independently at random according to the mixed action $\pmb{p}_{t+1}^{x_t+1}$ . Similarly, Nature picks in a $H_t$ -measurable way a measurable family $(\pmb{q}_{t+1}^{G(x,s)})_{(x,s) \in \mathcal{X} \times \mathcal{S}}$ of probability distributions over $\mathcal{B}$ , and uses $q_{t+1}^{G(x_{t+1}, s_{t+1})}$ to draw $b_{t+1}$ . + +Approachability strategy. We adapt the original strategy by Blackwell [3] by assuming the existence of and substituting a sequence of estimates $\hat{\mathbf{Q}}_t$ that are $h_t$ -adapted in place of the unknown distribution $\mathbf{Q}$ . We will assume that this sequence is convergent in the total variation distance in the sense of Assumption 1 below. To state the strategy, we extend linearly $m$ : for all probability distributions $\pmb{p}$ over $\mathcal{A}$ and $\pmb{q}$ over $\mathcal{B}$ , for all $(x,s)\in \mathcal{X}\times \mathcal{S}$ , + +$$ +\boldsymbol {m} (\boldsymbol {p}, \boldsymbol {q}, x, s) = \sum_ {a \in \mathcal {A}} \sum_ {b \in \mathcal {B}} \boldsymbol {p} (a) \boldsymbol {q} (b) \boldsymbol {m} (a, b, x, s). +$$ + +Now, the Player uses an arbitrary measurable family of distributions $(\pmb{p}_1^x)_{x\in \mathcal{X}}$ for the first round, gets the estimate $\hat{\mathbf{Q}}_1$ , and then uses, for rounds $t + 1$ , where $t\geqslant 1$ : + +$$ +\left(\boldsymbol {p} _ {t + 1} ^ {x}\right) _ {x \in \mathcal {X}} \in \underset {\left(\boldsymbol {p} ^ {x}\right) _ {x \in \mathcal {X}} \left(\boldsymbol {q} ^ {G (x, s)}\right) _ {(x, s) \in \mathcal {X} \times \mathcal {S}} \left. \right.} {\arg \min } \underset {\left(\boldsymbol {q} ^ {G (x, s)}\right) _ {(x, s) \in \mathcal {X} \times \mathcal {S}}} {\max } \left\langle \overline {{\boldsymbol {m}}} _ {t} - \overline {{\boldsymbol {c}}} _ {t}, \int_ {\mathcal {X} \times \mathcal {S}} \boldsymbol {m} \left(\boldsymbol {p} ^ {x}, \boldsymbol {q} ^ {G (x, s)}, x, s\right) \mathrm {d} \hat {\boldsymbol {Q}} _ {t} (x, s) \right\rangle , \tag {1} +$$ + +where the minimum and maximum are over all measurable families of probability distributions over $\mathcal{A}$ and $\mathcal{B}$ , respectively. The Player then gets access to $h_{t + 1}$ and may compute the estimate $\hat{\mathbf{Q}}_{t + 1}$ to be used at the next round. + +Necessary and sufficient condition for approachability. We were able to work out such a condition under the assumption that $\mathbf{Q}$ can be estimated well enough, e.g., faster than at a $1 / \ln^3 (T)$ rate in total variation distance. We recall that the total variation distance between two probability distributions $\mathbf{Q}_1$ and $\mathbf{Q}_2$ on $\mathcal{X} \times \mathcal{S}$ equals (see, e.g., Devroye [8]): + +$$ +\mathrm {T V} (\mathbf {Q} _ {1}, \mathbf {Q} _ {2}) = \sup _ {E \subseteq \mathcal {X} \times \mathcal {S}} | \mathbf {Q} _ {1} (E) - \mathbf {Q} _ {2} (E) | = \frac {1}{2} \int_ {\mathcal {X} \times \mathcal {S}} | g _ {1} (x, s) - g _ {2} (x, s) | \mathrm {d} \mu (x, s), +$$ + +where the supremum is over all Borel sets $E$ of $\mathcal{X} \times S$ , and where $g_{1}$ and $g_{2}$ denote densities of $\mathbf{Q}_{1}$ and $\mathbf{Q}_{2}$ with respect to a common dominating probability distribution $\mu$ . + +Assumption 1 (fast enough sequential estimation of $\mathbf{Q}$ ). The sequence of $(h_t)$ -adapted estimators $(\hat{\mathbf{Q}}_t)$ used is such that $\sum_{t=1}^{+\infty} \frac{1}{t} \sqrt{\mathbb{E}[\mathrm{TV}^2(\hat{\mathbf{Q}}_t, \mathbf{Q})]} < +\infty$ . + +The above assumption implies both $\frac{1}{T}\sum_{t=1}^{T-1}\sqrt{\mathbb{E}\left[\mathrm{TV}^2(\hat{\mathbf{Q}}_t,\mathbf{Q})\right]}$ and $\sum_{t\geqslant T+1}\frac{1}{t}\sqrt{\mathbb{E}\left[\mathrm{TV}^2(\hat{\mathbf{Q}}_t,\mathbf{Q})\right]}$ converge to zero (with $T$ ; see Appendix A for details). Assumption 1 is trivially satisfied in the case when $\mathbf{Q}$ is known, as it is sufficient to take $\hat{\mathbf{Q}}_t = \mathbf{Q}$ . When both $\mathcal{X}$ and $\mathcal{S}$ are finite sets, we may use the empirical frequencies as estimators $\hat{\mathbf{Q}}_t$ ; they satisfy $\mathbb{E}[\mathrm{TV}^2(\hat{\mathbf{Q}}_t,\mathbf{Q})] = O(1/t)$ ; see, e.g., [7, Lemma 3]. The general case of an uncountable $\mathcal{X}$ , e.g., $\mathcal{X} = \mathbb{R}^m$ requires results for density estimation in the $L^1$ or $L^2$ norms; such results rely typically on moving averages or kernel estimates and may be found, for instance, in the monographs by Devroye and Györfi [9] and Devroye [8] (see also Tsybakov [28]). Under mild conditions, the estimation takes place at a polynomial rate in total variation distance (e.g., a $T^{-1/5}$ rate in dimension $m = 1$ ). Note that the needed rate of decrease for $\mathbb{E}\left[\mathrm{TV}^2(\hat{\mathbf{Q}}_t,\mathbf{Q})\right]$ in Assumption 1 is extremely slow: a $1/\ln^3(T)$ rate would suffice. + +Assumption 2 (boundedness). We assume that $\| \pmb{m}\|_{\infty,2} \coloneqq \max_{a,b \in \mathcal{A} \times \mathcal{B}} \sup_{(x,s) \in \mathcal{X} \times \mathcal{S}} \| \pmb{m}(a,b,x,s)\| < +\infty$ . + +We may now state our main result; the distance of $\overline{m}_T$ to $\mathcal{C}$ was denoted by $d_T$ in Protocol 2.1. + +Theorem 1. Assume that $\mathcal{C}$ is a closed convex set and that Assumptions 1 (fast enough sequential estimation of $\mathbf{Q}$ ) and 2 (bounded reward function) are satisfied, then $\mathcal{C}$ is approachable if and only if + +$$ +\forall \left(\boldsymbol {q} ^ {G (x, s)}\right) _ {(x, s) \in \mathcal {X} \times \{0, 1 \}} \exists \left(\boldsymbol {p} ^ {x}\right) _ {x \in \mathcal {X}} \quad \text {s . t .} \quad \int_ {\mathcal {X} \times \mathcal {S}} \boldsymbol {m} \left(\boldsymbol {p} ^ {x}, \boldsymbol {q} ^ {G (x, s)}, x, s\right) \mathrm {d} \mathbf {Q} (x, s) \in \mathcal {C}. \tag {2} +$$ + +In this case, the strategy of Eq. (1) achieves the following rates for $L^2$ and almost-sure convergences: + +$$ +\mathbb {E} \left[ d _ {T} ^ {2} \right] \leqslant \sqrt {\frac {K}{T}} + 4 \| \boldsymbol {m} \| _ {\infty , 2} \overbrace {\frac {1}{T} \sum_ {t = 1} ^ {T - 1} \sqrt {\mathbb {E} \left[ \mathrm {T V} ^ {2} \left(\hat {\mathbf {Q}} _ {t} , \mathbf {Q}\right) \right]}} ^ {: := \overline {{\Delta}} _ {T}} \quad a n d +$$ + +$$ +\mathbb {P} \left(\sup _ {t \geqslant T} d _ {t} \geqslant \varepsilon\right) \leqslant \frac {3 K}{T \varepsilon^ {2}} + \frac {1 6 \| \boldsymbol {m} \| _ {\infty , 2}}{\varepsilon^ {2}} \left(\sqrt {\frac {K}{T - 1}} + 2 \left(\sup _ {t \geqslant T} \overline {{\Delta}} _ {t}\right) \left(\overline {{\Delta}} _ {T} + \sum_ {t \geqslant T} \frac {1}{t} \sqrt {\mathbb {E} \left[ \mathrm {T V} ^ {2} \left(\hat {\mathbf {Q}} _ {t} , \mathbf {Q}\right) \right]}\right)\right) +$$ + +where $K < +\infty$ denotes the maximal distance to $\mathcal{C}$ of an element of the compact set $\pmb{m}(\mathcal{A},\mathcal{B},\mathcal{X},\mathcal{S})$ . + +The proof lies in Appendix A. The necessity part of the theorem actually relies on no assumption other than $\mathcal{C}$ being closed; it consists of showing that Nature has a stationary strategy such that there exists $\alpha > 0$ with $d_T \geqslant \alpha$ in the limit, i.e., the average payoff vectors $\overline{m}_T$ remain $\alpha$ -away from $\mathcal{C}$ in the limit. This exactly indicates that the underlying fair online learning problem is not tractable: the underlying objectives and underlying fairness constraints cannot be simultaneously satisfied. + +# 4 Working out some objective-constraint pairs: (im)possibility results + +In this section we apply Theorem 1 to deal with some examples of objective-constraint pairs described in Sections 2.1 and 2.2. Some of them have been considered before in the literature (sometimes in the batch setup) using various tools [4, 16, 21, 14], as discussed in Section 1. + +We keep the original criteria and obtain possibility or impossibility results. This is a first step, meanwhile, Section 5 will explain how to go further and obtain a trade-off, if needed, between the objective and the fairness constraint. + +Additional notation. We recall that $\gamma_s = \mathbb{P}(s_t = s)$ and denote by $\mathbf{Q}^s$ the conditional distribution of $x_{t}$ given $s_t = s$ , so that $\mathrm{d}\mathbf{Q}(x,s) = \gamma_s\mathrm{d}\mathbf{Q}^s (x)$ . We denote by $\mathrm{supp}(\mathbf{Q}^s)\subseteq \mathcal{X}$ the support of $\mathbf{Q}^s$ . + +Example 1: Vanilla calibration under a demographic parity constraint—achievable. Consider the following payoff function and target set, obtained by simultaneously considering the objective of vanilla calibration and the constraint of demographic parity: $m = (m_{\mathrm{cal}}, m_{\mathrm{DP}})$ and $\mathcal{C} = \mathcal{C}_{\mathrm{cal}} \times \mathcal{C}_{\mathrm{DP}}$ . + +Defining $\psi(u_1, u_2) \coloneqq |u_1 - u_2|$ , the approachability condition (2) then reads as follows (where we introduce short-hand notation C and DP): + +$$ +\forall \left(\boldsymbol {q} ^ {G (x, s)}\right) _ {(x, s) \in \mathcal {X} \times \{0, 1 \}} \exists \left(\boldsymbol {p} ^ {x}\right) _ {x \in \mathcal {X}} \quad \text {s . t .} \left\{ \begin{array}{l} C := \left\| \int_ {\mathcal {X} \times \{0, 1 \}} \boldsymbol {m} _ {\operatorname {c a l}} \left(\boldsymbol {p} ^ {x}, \boldsymbol {q} ^ {G (x, s)}\right) \mathrm {d} \boldsymbol {Q} (x, s) \right\| _ {1} \leqslant \frac {1}{N}; \\ D P := \psi \left(\int_ {\mathcal {X} \times \{0, 1 \}} \boldsymbol {m} _ {\mathrm {D P}} \left(\boldsymbol {p} ^ {x}, s\right) \mathrm {d} \boldsymbol {Q} (x, s)\right) \leqslant \frac {1}{N}. \end{array} \right. \tag {3} +$$ + +Recalling the notation $\mathbf{Q}^0$ and $\mathbf{Q}^1$ for the conditional distributions, we observe that + +$$ +\mathrm {D P} = \left| \int_ {\mathcal {X}} \sum_ {k = 1} ^ {N} \boldsymbol {p} ^ {x} (k) a ^ {(k)} \mathrm {d Q} ^ {0} (x) - \int_ {\mathcal {X}} \sum_ {k = 1} ^ {N} \boldsymbol {p} ^ {x} (k) a ^ {(k)} \mathrm {d Q} ^ {1} (x) \right|. +$$ + +We now show that the condition in Eq. (3) is satisfied. For any $(\pmb{q}^{G(x,s)})$ , we define the family $(\pmb{p}^x)$ as the constant family $\left(\operatorname{dirac}(Q_{\mathcal{A}})\right)$ , where $\operatorname{dirac}(Q_{\mathcal{A}})$ denotes the Dirac mass supported on $Q_{\mathcal{A}}$ , the closest point of $\mathcal{A}$ to $Q := \int_{\mathcal{X} \times \{0,1\}} \pmb{q}^{G(x,s)}(1) \, \mathrm{d}\mathbf{Q}(x,s)$ . We have $\mathrm{DP} = 0$ as $\pmb{p}^x$ does not depend on $x$ . Substituting the expression for $\pmb{m}_{\mathrm{cal}}$ into the definition of $\mathbb{C}$ , we observe that for such a choice of $(\pmb{p}^x)_{x \in \mathcal{X}}$ , we have + +$$ +\mathsf{c} = \left|\int_{\mathcal{X}\times \{0,1\}}\bigl(Q_{\mathcal{A}} - \boldsymbol{q}^{G(x,s)}(1)\bigr)\mathrm{d}\mathbf{Q}(x,s)\right| \leqslant \frac{1}{2N} +\left|\underbrace{\int_{\mathcal{X}\times\{0,1\}}\bigl(Q - \boldsymbol{q}^{G(x,s)}(1)\bigr)\mathrm{d}\mathbf{Q}(x,s)}_{= 0}\right|, +$$ + +where the inequality holds by taking the effect of discretization in $\mathcal{A}$ into account and by the very definition of $Q$ . The condition of Eq. (3) is thus satisfied. Therefore, under Assumption 1 (the existence of fast enough sequential estimators of $\mathbf{Q}$ ) and thanks to Theorem 1, the vanilla calibration and the demographic parity can be achieved simultaneously no matter the monitoring of the Nature. + +Example 2: Group-wise no-regret-mixed picture. Let the target set be $\mathcal{C}_{\mathrm{gr - reg}} = ([0, + \infty))^{N|\mathcal{S}|}$ and the payoff function be $m_{\mathrm{gr - reg}}$ , i.e., we consider the case of group-wise no-regret under no additional constraint. The approachability condition in Eq. (2) demands that + +$$ +\forall \left(\boldsymbol {q} ^ {G (x, s)}\right) \exists \left(\boldsymbol {p} ^ {x}\right) \quad \text {s . t .} \quad \int_ {\mathcal {X} \times \mathcal {S}} \boldsymbol {m} _ {\operatorname {g r - r e g}} \left(\boldsymbol {p} ^ {x}, \boldsymbol {q} ^ {G (x, s)}\right) \mathrm {d} \boldsymbol {Q} (x, s) \in \left([ 0, + \infty)\right) ^ {N | S |}, \quad \text {i . e . ,} \tag {4} +$$ + +$$ +\forall (a ^ {\prime}, s), \quad \int_ {\operatorname {s u p p} (\mathbf {Q} ^ {s})} \sum_ {a \in \mathcal {A}} \boldsymbol {p} ^ {x} (a) \left(\sum_ {b \in \mathcal {B}} \boldsymbol {q} ^ {G (x, s)} (b) \left(r (a, b, x, s) - r (a ^ {\prime}, b, x, s)\right)\right) \mathrm {d} \mathbf {Q} ^ {s} (x) \geqslant 0. +$$ + +No-regret seems a harmless challenge, and it is so when the sensitive context is directly observed by the Player, which we do not assume. (In this case, the Player may simply run several no-regret algorithms in parallel, one per sensitive group $s$ .) In our context, the direct observation is emulated in some sense when the non-sensitive context $x$ reveals the sensitive context $s$ ; this is the case, for instance, when the supports of the distributions $\mathbf{Q}^s$ are pairwise disjoint. Note, however, that these distributions $\mathbf{Q}^s$ are unknown to the Player and need to be learned. The second part of Proposition 1 + +shows that in this case, the group-wise no-regret may be controlled. We get a similar control in the case of irrelevant sensitive contexts, i.e., not affecting the payoffs and not used by Nature; see the first part of Proposition 1, which corresponds to the case of vanilla no-regret minimization. In both cases, the group-wise no-regret can be controlled under Assumption 1, thanks to Theorem 1. However, as we show by means of counter-examples, these are the only cases that may be favorably dealt with. + +Proposition 1. The condition of Eq. (4) holds when + +- the sensitive context is irrelevant, i.e., the payoff function is such that $r(a,b,x,s) = r(a,b,x)$ and Nature's monitoring is $G(x,s) = x$ ; +- for all $s \neq s'$ , it holds that $\operatorname{supp}(\mathbf{Q}^s) \cap \operatorname{supp}(\mathbf{Q}^{s'}) = \emptyset$ , no matter Nature's monitoring $G$ . Otherwise, the condition of Eq. (4) may not hold. + +Proof. We mimic the classical proof of no-regret by approachability for the positive results. For the first positive result: for any $(\pmb{q}^x)$ , we define $a^x \in \arg \max_{a \in \mathcal{A}} \sum_{b \in \mathcal{B}} \pmb{q}^x(b) r(a, b, x)$ and let $(\pmb{p}^x) = (\operatorname{dirac}(a^x))$ . For the second positive result: fix any $(\pmb{q}^{G(x, s)})$ ; we define $(\pmb{p}^x)_{x \in \mathcal{X}}$ point-wise as follows. For all $s \in S$ , all $x \in \operatorname{supp}(\mathbf{Q}^s)$ , we set $\pmb{p}^x = \operatorname{dirac}(a^x)$ , where we validly define $a^x \in \arg \max_{a \in \mathcal{A}} \sum_{b \in \mathcal{B}} \pmb{q}^{G(x, s)}(b) r(a, b, x, s)$ on the union of the supports of $(\mathbf{Q}^s)_{s \in S}$ , since they are pair-wise disjoint; we define the $a^x$ arbitrarily elsewhere. + +Two counter-examples detailed in Appendix B back up the final part of the proposition: we show that Eq. (4) does not hold. In the first counter-example, the monitoring is $G(x,s) = x$ , the payoff function depends on $s$ , and the supports of $(\mathbf{Q}^s)_{s\in S}$ have non-negligible intersection. In the second example, the monitoring is $G(x,s) = (x,s)$ , the payoff function does not depend on $s$ , and the supports of $(\mathbf{Q}^s)_{s\in S}$ have non-negligible intersection. + +Example 3: (Vanilla) no-regret under the equalized average payoffs constraint. For the sake of space we deal with this example in Appendix B, obtaining similar conclusions as that of Blum et al. [4]. + +# 5 Group-wise calibration under a demographic parity constraint: trade-off + +In this section, we consider the problem of group-wise calibration under the demographic parity constraint; in particular, $S = \{0,1\}$ . As we will see, except for special cases, the corresponding two error criteria cannot be simultaneously smaller than the desired $1 / N$ in the limit. However, a (possibly optimal) trade-off may be set between the calibration error $\varepsilon$ and the violation level $\delta$ of demographic parity. To that end, we introduce neighborhoods of the original target sets $C_{\mathrm{gr - cal}}$ and $C_{\mathrm{DP}}$ : + +$$ +\mathcal {C} _ {\text {g r - c a l}} ^ {\varepsilon} = \left\{\boldsymbol {v} \in \mathbb {R} ^ {2 N}: \| \boldsymbol {v} \| _ {1} \leqslant \varepsilon \right\} \quad \text {a n d} \quad \mathcal {C} _ {\mathrm {D P}} ^ {\delta} = \left\{(u, v) \in \mathbb {R} ^ {2}: | u - v | \leqslant \delta \right\}. +$$ + +A pair $(\varepsilon, \delta) \in \mathbb{R}_+ \times \mathbb{R}_+$ is said achievable when $\mathcal{C}_{\mathrm{gr - cal}}^{\varepsilon} \times \mathcal{C}_{\mathrm{DP}}^{\delta}$ is approachable with $\boldsymbol{m} = (\boldsymbol{m}_{\mathrm{gr - cal}}, \boldsymbol{m}_{\mathrm{DP}})$ . Theorem 1 provides a characterization of this approachability as well as an associated strategy; in particular, when $(\varepsilon, \delta)$ is achievable, this strategy ensures that the calibration error $C_T$ and the violation $D_T$ of demographic parity satisfy: $\lim \sup C_T \leqslant \varepsilon$ a.s. and $\lim \sup D_T \leqslant \delta$ a.s. + +The goal of this section is to identify all achievable pairs $(\varepsilon, \delta)$ . We will do so by determining, for $\delta \geqslant 0$ of interest, the smallest $\varepsilon \geqslant 0$ such that $(\varepsilon, \delta)$ is achievable1; we denote it by $\varepsilon^{\star}(\delta)$ . The line $(\delta, \varepsilon^{\star}(\delta))$ is a Pareto frontier. + +Re-parametrization of the problem. Under Assumption 1 (the existence of fast enough sequential estimators of $\mathbf{Q}$ ) and thanks to Theorem 1, the $(m_{\mathrm{gr - cal}}, m_{\mathrm{DP}})$ -approachability of $\mathcal{C}_{\mathrm{gr - cal}}^{\varepsilon} \times \mathcal{C}_{\mathrm{DP}}^{\delta}$ holds if and only if the condition of Eq. (2) is satisfied. The latter can be stated as follows: + +$$ +\forall \left(\boldsymbol {q} ^ {G (x, s)}\right) _ {(x, s) \in \mathcal {X} \times \{0, 1 \}} \exists \left(\boldsymbol {p} ^ {x}\right) _ {x \in \mathcal {X}} \quad \text {s . t .} \quad \left\{ \begin{array}{l} \left\| \int_ {\mathcal {X} \times \{0, 1 \}} \boldsymbol {m} _ {\mathrm {g r - c a l}} \left(\boldsymbol {p} ^ {x}, \boldsymbol {q} ^ {G (x, s)}\right) \mathrm {d} \boldsymbol {Q} (x, s) \right\| _ {1} \leqslant \varepsilon ; \\ \psi \left(\int_ {\mathcal {X} \times \{0, 1 \}} \boldsymbol {m} _ {\mathrm {D P}} \left(\boldsymbol {p} ^ {x}, s\right) \mathrm {d} \boldsymbol {Q} (x, s)\right) \leqslant \delta , \end{array} \right. \tag {5} +$$ + +where we recall that $\psi(u_1, u_2) = |u_1 - u_2|$ . Now, one can show (see comments after Lemma 3 of Appendix C) that the $\psi(\ldots)$ term above is always smaller than $\mathrm{TV}(\mathbf{Q}^0, \mathbf{Q}^1)$ . Thus, we can re-parameterize the problem and focus only on $\delta_{\tau} = \tau \cdot \mathrm{TV}(\mathbf{Q}^0, \mathbf{Q}^1)$ , where $\tau \in [0,1]$ . + +Computation of the Pareto frontier. The condition of Eq. (5) indicates that + +$$ +\begin{array}{l} \varepsilon^ {\star} \left(\delta_ {\tau}\right) = \max _ {\left(\boldsymbol {q} ^ {G (x, s)}\right)} \min _ {\left(\boldsymbol {p} ^ {x}\right)} \left\| \int_ {\mathcal {X} \times \{0, 1 \}} \boldsymbol {m} _ {\text {g r - c a l}} \left(\boldsymbol {p} ^ {x}, \boldsymbol {q} ^ {G (x, s)}, s\right) \mathrm {d} \boldsymbol {Q} (x, s) \right\| _ {1} \tag {6} \\ \text {s . t .} \quad \psi \left(\int_ {\mathcal {X} \times \{0, 1 \}} \boldsymbol {m} _ {\mathrm {D P}} (\boldsymbol {p} ^ {x}, s) \mathrm {d} \mathbf {Q} (x, s)\right) \leqslant \tau \cdot \operatorname {T V} \left(\mathbf {Q} ^ {0}, \mathbf {Q} ^ {1}\right). \\ \end{array} +$$ + +Propositions 2 and 3 below compute the values (up to the $1 / N$ discretization error) of $\varepsilon^{\star}(\delta_{\tau})$ in two scenarios, depending on whether Nature observes the sensitive contexts $s_t$ . + +Proposition 2 (Nature awareness: $G(x,s) = (x,s)$ ). Under Assumption 1 and with the monitoring $G(x,s) = (x,s)$ for Nature, the Pareto frontier $\left( \varepsilon^{\star}(\delta_{\tau}), \delta_{\tau} \right)_{\tau \in [0,1]}$ of achievable pairs satisfies + +$$ +\delta_ {\tau} = \tau \cdot \operatorname {T V} \left(\mathbf {Q} ^ {0}, \mathbf {Q} ^ {1}\right) \quad a n d \quad 1 - \tau \cdot \operatorname {T V} \left(\mathbf {Q} ^ {0}, \mathbf {Q} ^ {1}\right) \leqslant \varepsilon^ {\star} (\delta_ {\tau}) \leqslant 1 - \tau \cdot \operatorname {T V} \left(\mathbf {Q} ^ {0}, \mathbf {Q} ^ {1}\right) + \frac {1}{N}. +$$ + +Proposition 3 (Nature unawareness: $G(x,s) = x$ ). Under Assumption 1 and with the monitoring $G(x,s) = x$ for Nature, the Pareto frontier $\left(\varepsilon^{\star}(\delta_{\tau}), \delta_{\tau}\right)_{\tau \in [0,1]}$ of achievable pairs satisfies: + +$$ +\delta_ {\tau} = \tau \cdot \operatorname {T V} \left(\mathbf {Q} ^ {0}, \mathbf {Q} ^ {1}\right) \quad a n d \quad (1 - \tau) \cdot \operatorname {T V} \left(\mathbf {Q} ^ {0}, \mathbf {Q} ^ {1}\right) \leqslant \varepsilon^ {\star} (\delta_ {\tau}) \leqslant (1 - \tau) \cdot \operatorname {T V} \left(\mathbf {Q} ^ {0}, \mathbf {Q} ^ {1}\right) + \frac {1}{N}. +$$ + +The parameter $\tau \in [0,1]$ is set by the user. + +We observe that in the case when the true label $b_{t}$ provided by the Nature can be directly influenced by the sensitive attribute $s_{t}$ , Proposition 2 shows that approximate group-wise calibration with $\varepsilon = 1 / N$ is never possible, unless $\mathrm{TV}(\mathbf{Q}^0,\mathbf{Q}^1) = 1$ (and $\tau = 1$ is picked). The latter case corresponds to the situation when the supports of $\mathbf{Q}^0$ and $\mathbf{Q}^1$ are disjoint, hence allowing the Player to infer the sensitive context $s$ from the non-sensitive one $x$ , essentially reducing (up to unknown $\mathbf{Q}$ ) the problem to the previously studied setup of Player's awareness [16]. + +When the true label $b_{t}$ provided by the Nature is not directly influenced by the sensitive attribute $s_{t}$ (it is influenced by $s_{t}$ only via $x_{t}$ ), Proposition 3 indicates that calibration is always possible by setting $\tau = 1$ , no matter the value of $\mathrm{TV}(\mathbf{Q}^0, \mathbf{Q}^1)$ . Interestingly, this proposition also shows that if $\mathrm{TV}(\mathbf{Q}^0, \mathbf{Q}^1) = 0$ , i.e., the $x_{t}$ and the $s_{t}$ are independent, then the Player is able to achieve calibration and satisfy the demographic parity constraint simultaneously. + +# 6 Approachability of an unknown target set + +A limitation of the calibration problems under demographic parity constraint discussed in Section 4 (Example 1) and Section 5 is that the unknown probabilities $\gamma_0$ and $\gamma_{1}$ enter the payoff functions $m_{\mathrm{gr - cal}}$ and $m_{\mathrm{DP}}$ . We already pointed out this issue in Section 2.3. Even worse, the trade-off claimed in Propositions 2 and 3 relies on the knowledge of the unknown $\mathrm{TV}(\mathbf{Q}^0,\mathbf{Q}^1)$ , to set the values of the achievable pair $(\delta ,\varepsilon)$ targeted; that is, the target set is unknown. To bypass the first limitation we transfer the unknown $(\gamma_0,\gamma_1)$ to the target set, which makes the payoff function fully known to the Player. We will then be left with the problem of approaching an unknown target set only. For instance, in the context of Section 5, we can define + +$$ +\widetilde {\boldsymbol {m}} _ {\operatorname {g r - c a l}} (k, y, s) = \left(\boldsymbol {m} _ {\operatorname {c a l}} (k, y) \mathbb {I} \{s = s ^ {\prime} \}\right) _ {s ^ {\prime} = 0, 1} \text {a n d} \widetilde {\boldsymbol {m}} _ {\mathrm {D P}} (k, s) = \left(a ^ {(k)} \mathbb {I} \{s = 0 \}, a ^ {(k)} \mathbb {I} \{s = 1 \}\right), +$$ + +and set $\widetilde{m} := (\widetilde{m}_{\mathrm{gr - cal}}, \widetilde{m}_{\mathrm{DP}})$ . Taking into account the definition of $m_{\mathrm{cal}}$ , we note that $\widetilde{m}$ does not depend on $(\gamma_0, \gamma_1)$ . Furthermore, by considering the closed convex target sets + +$$ +\widetilde {\mathcal {C}} _ {\mathrm {g r - c a l}} ^ {\varepsilon} = \left\{\left(\boldsymbol {v} _ {0}, \boldsymbol {v} _ {1}\right) \in \mathbb {R} ^ {2 N}: \frac {\| \boldsymbol {v} _ {0} \| _ {1}}{\gamma_ {0}} + \frac {\| \boldsymbol {v} _ {1} \| _ {1}}{\gamma_ {1}} \leqslant \varepsilon \right\}, \quad \widetilde {\mathcal {C}} _ {\mathrm {D P}} ^ {\delta} = \left\{\left(u, v\right) \in \mathbb {R} ^ {2}: \left| \frac {u}{\gamma_ {0}} - \frac {v}{\gamma_ {1}} \right| \leqslant \delta \right\}, +$$ + +we remark that the $(\widetilde{m}_{\mathrm{gr - cal}},\widetilde{m}_{\mathrm{DP}})$ -approachability of $\widetilde{\mathcal{C}}_{\mathrm{gr - cal}}^{\varepsilon}\times \widetilde{\mathcal{C}}_{\mathrm{DP}}^{\delta}$ is equivalent to the $(m_{\mathrm{gr - cal}},m_{\mathrm{DP}})$ - approachability of $\mathcal{C}_{\mathrm{gr - cal}}^{\varepsilon}\times \mathcal{C}_{\mathrm{DP}}^{\delta}$ . The unknown quantities appear only in the target set $\widetilde{\mathcal{C}}_{\mathrm{gr - cal}}^{\varepsilon}\times \widetilde{\mathcal{C}}_{\mathrm{DP}}^{\delta}$ (and $\delta$ and $\varepsilon$ count as unknown quantities given the trade-off exhibited), while the payoff $\widetilde{m}$ is known beforehand. Thus, it is sufficient to consider the setup of Protocol 2.1 with an unknown target set $\mathcal{C}$ . + +Approachability strategy for an unknown target set $\mathcal{C}$ . We still assume that the Player is able to build an $h_t$ -adapted sequence of estimates $\hat{\mathbf{Q}}_t$ . Additionally, we assume that for $T_r \coloneqq 2^r$ , with $r \geqslant 0$ , the Player can construct an $h_{T_r}$ -adapted estimate $\hat{\mathcal{C}}_r$ of $\mathcal{C}$ . We discuss this assumption at the end of this section. We define $d(\hat{\mathcal{C}}_r, \mathcal{C}) = \sup_{x \in \hat{\mathcal{C}}_r} d(x, \mathcal{C})$ . + +Assumption 3. There exist $B < +\infty$ and a summable non-increasing sequence $(\beta_r)_{r \geqslant 0}$ such that for all $r \geqslant 0$ , the sets $\hat{\mathcal{C}}_r$ are convex closed, with $\| \pmb{v} - \mathrm{Proj}_{\hat{\mathcal{C}}_r}(\pmb{v}) \| \leqslant B$ for all $\pmb{v} \in \pmb{m}(\mathcal{A}, \mathcal{B}, \mathcal{X}, \{0,1\})$ . + +$$ +\mathbb {P} \left(\mathcal {C} \subset \hat {\mathcal {C}} _ {r}\right) \geqslant 1 - 1 / \left(2 T _ {r}\right), \quad a n d \quad \max \left\{\mathbb {E} \left[ d \left(\hat {\mathcal {C}} _ {r}, \mathcal {C}\right) ^ {2} \right], \mathbb {E} \left[ d \left(\mathcal {C}, \hat {\mathcal {C}} _ {r}\right) ^ {2} \right] \right\} \leqslant \beta_ {r} ^ {2}. +$$ + +For all $r \geqslant 0$ and all $t \in \{T_r, \dots, T_{r+1} - 1\}$ , define $\hat{\pmb{c}}_t \coloneqq \mathrm{Proj}_{\hat{\mathcal{C}}_r}(\overline{\pmb{m}}_t)$ . The idea of the approachability strategy is to use $\hat{\pmb{c}}_t$ in place of $\overline{\pmb{c}}_t$ in Eq. (1) and update the estimate $\hat{\mathcal{C}}_r$ of the target $\mathcal{C}$ only at the end of rounds $t = T_r$ . More precisely, the strategy of the Player is: + +$$ +\left(\boldsymbol {p} _ {t + 1} ^ {x}\right) _ {x \in \mathcal {X}} \in \underset {\left(\boldsymbol {p} ^ {x}\right)} {\arg \min } \underset {\left(\boldsymbol {q} ^ {G (x, s)}\right)} {\max } \left\langle \overline {{\boldsymbol {m}}} _ {t} - \hat {\boldsymbol {c}} _ {t}, \int \boldsymbol {m} \left(\boldsymbol {p} ^ {x}, \boldsymbol {q} ^ {G (x, s)}, x, s\right) \mathrm {d} \hat {\boldsymbol {Q}} _ {t} (x, s) \right\rangle . \tag {7} +$$ + +Theorem 2. Under Assumption 3 and the assumptions of Theorem 1, a convex closed set $\mathcal{C}$ , unknown to the Player, is $\pmb{m}$ -approachable if and only if Blackwell's condition in Eq. (2) is satisfied. In this case, the strategy of Eq. (7) is an approachability strategy. + +Appendix D.2 provides a proof of Theorem 2. But before we do so, we discuss in Appendix D.1 why and how the target set $\mathcal{C}$ may be estimated by sets $\hat{\mathcal{C}}_r$ satisfying Assumption 3. The construction is idiosyncratic and strongly depends on the problem and exact setting considered (in particular, whether the set of non-sensitive contexts $\mathcal{X}$ is finite or not). We provide an illustration for the target set $\mathcal{C} = \widetilde{\mathcal{C}}_{\mathrm{gr - cal}}^{\varepsilon} \times \widetilde{\mathcal{C}}_{\mathrm{DP}}^{\delta}$ of Section 5, in the case of a finite set $\mathcal{X}$ . + +# 7 Limitations of the current work and topics for future work + +The anonymous reviewers of this article pointed out some limitations to or possible extensions of the current work, which we list now. + +We only considered, for the sake of readability, the case of demographic parity with two groups. While the criterion of demographic parity easily extends to more groups, the extension of the trade-offs stated in Section 5 is less clear. It would probably involve the total variation distances $\mathrm{TV}(\mathbf{Q}^s,\mathbf{Q}^{s'})$ between each pair $\mathbf{Q}^s$ and $\mathbf{Q}^{s'}$ of marginal distributions, where $s,s'\in S$ , or the distances $\mathrm{TV}(\mathbf{Q}^s,\mathbf{Q})$ . + +The complexity of the generic approachability strategy of Section 3 is at least linear in the number of groups (if an approximate solution is used, and even polynomial in this number for an exact solution), see Mannor and Stoltz [18, Sections 3.3 and 3.4]. The convergence rates achieved in Theorem 1 involve total variation distances that would also probably depend in at least a linear fashion on the number of groups, unless some special structure is assumed. Both facts may be an issue for large numbers of groups. More generally, we only provide in this article a generic strategy, that is, a first approach to tackle a given fair online learning problem, but specific strategies may be more efficient and get better regret bounds, in particular for large numbers of groups. (For instance, for group-wise calibration, Gupta et al. [14] base a specific and computationally more efficient strategy on an exponential surrogate loss: this strategy enjoys a sample complexity only logarithmic in the number of groups.) The design of such specific strategies remains largely open. + +As mentioned in the introduction, Bechavod et al. [2] consider the objective of online binary classification and an equal-opportunity fairness constraint, under some partial monitoring known as "apple tasting". In this article we considered a bandit monitoring for the Player: she observes the reward obtained at each round. Partial monitoring, which was introduced by Rustichini [27], consists of only receiving feedback which is a (possibly) random function of the actions played by the Player and Nature. A theory of approachability under partial monitoring was initiated by Perchet [24], who stated a necessary and sufficient condition (see also Mannor et al. [19]); Mannor et al. [20] then exhibited a computationally more efficient strategy, with improved convergence rates, and Kwon and Perchet [17] finally obtained the optimal convergence rates. A question to investigate is therefore the extension of the results of this article from a bandit monitoring to a partial monitoring. + +# Acknowledgments and Disclosure of Funding + +Evgenii Chzhen was fully funded by grant ANR-11-LABX-0056-LMH (Labex LMH, part of Programme d'investissements d'avir). Christophe Giraud received partial support by grant ANR-19-CHIA-0021-01 ("BiSCottE", Agence Nationale de la Recherche). Gilles Stoltz has no direct funding to acknowledge. + +Additional revenues for authors are: Evgenii Chzhen—none; Christophe Giraud—none; Gilles Stoltz—part time employment as an affiliate professor with HEC Paris. + +# References + +[1] J. Abernethy, P. Bartlett, and E. Hazan. Blackwell approachability and no-regret learning are equivalent. In Proceedings of the 24th Annual Conference on Learning Theory, volume PMLR 19, pages 27-46, 2011. +[2] Y. Bechavod, K. Ligett, A. Roth, B. Waggoner, and S. Wu. Equal opportunity in online classification with partial feedback. In Advances in Neural Information Processing Systems, volume 32, 2019. +[3] D. Blackwell. An analog of the minimax theorem for vector payoffs. Pacific Journal of Mathematics, 6(1):1-8, 1956. +[4] A. Blum, S. Gunasekar, T. Lykouris, and N. Srebro. On preserving non-discrimination when combining expert advice. In Advances in Neural Information Processing Systems, volume 31, 2018. +[5] N. Cesa-Bianchi and G. Lugosi. Prediction, Learning, and Games. Cambridge University Press, 2006. +[6] A. Chouldechova. Fair prediction with disparate impact: A study of bias in recidivism prediction instruments. *Big Data*, 5(2):153–163, 2017. +[7] L. Devroye. The equivalence of weak, strong and complete convergence in $L_{1}$ for kernel density estimates. The Annals of Statistics, 11(3):896-904, 1983. +[8] L. Devroye. A Course in Density Estimation. Birkhäuser, 1987. +[9] L. Devroye and L. Györfi. Nonparametric Density Estimation: The $L^1$ View. Wiley, 1985. +[10] C. Dwork, M. Hardt, T. Pitassi, O. Reingold, and R. Zemel. Fairness through awareness. In Proceedings of the 3rd Innovations in Theoretical Computer Science Conference, pages 214-226, 2012. +[11] D. Foster. A proof of calibration via Blackwell's approachability theorem. Games and Economic Behavior, 29:73-78, 1999. +[12] D. Foster and R. Vohra. Asymptotic calibration. Biometrika, 85:379-390, 1998. +[13] P. Gajane and M. Pechenizkiy. On formalizing fairness in prediction with machine learning, 2017. Preprint, arXiv:1710.03184. +[14] V. Gupta, C. Jung, G. Noarov, M. Pai, and A. Roth. Online multivalid learning: Means, moments, and prediction intervals, 2021. Preprint, arXiv:2101.01739. +[15] M. Hardt, E. Price, and N. Srebro. Equality of opportunity in supervised learning. In Advances in Neural Information Processing Systems, volume 29, 2016. +[16] U. Hébert-Johnson, M. Kim, O. Reingold, and G. Rothblum. Multicalibration: Calibration for the (computationally-identifiable) masses. In Proceedings of the 35th International Conference on Machine Learning, volume PMLR 80, pages 1939–1948, 2018. +[17] J. Kwon and V. Perchet. Online learning and Blackwell approachability with partial monitoring: Optimal convergence rates. In Proceedings of the 20th International Conference on Artificial Intelligence and Statistics, volume PMLR 54, pages 604-613, 2017. + +[18] S. Mannor and G. Stoltz. A geometric proof of calibration. Mathematics of Operations Research, 35(4):721-727, 2010. +[19] S. Mannor, V. Perchet, and G. Stoltz. A primal condition for approachability with partial monitoring. Journal of Dynamics and Games, 1(3):447-469, 2013. +[20] S. Mannor, V. Perchet, and G. Stoltz. Set-valued approachability and online learning with partial monitoring. Journal of Machine Learning Research, 15(1):3247-3295, 2014. +[21] N. Martinez, M. Bertran, and G. Sapiro. Minimax Pareto fairness: A multi objective perspective. In Proceedings of the 37th International Conference on Machine Learning, volume PMLR 119, pages 6755-6764, 2020. +[22] J.-F. Mertens, S. Sorin, and Z. Shmuel. Repeated Games. Cambridge University Press, 2015. +[23] V. Perchet. Approachability, calibration and regret in games with partial observations. PhD thesis, Université Pierre et Marie Curie - Paris VI, 2010. +[24] V. Perchet. Approachability of convex sets in games with partial monitoring. Journal of Optimization Theory and Applications, 149(3):665-677, 2011. +[25] V. Perchet. Approachability, regret and calibration: Implications and equivalences. Journal of Dynamics & Games, 1(2):181-254, 2014. +[26] G. Pleiss, M. Raghavan, F. Wu, J. Kleinberg, and K. Weinberger. On fairness and calibration. In Advances in Neural Information Processing Systems, volume 30, pages 5680-5689, 2017. +[27] A. Rustichini. Minimizing regret: The general case. Games and Economic Behavior, 29(1): 224-243, 1999. +[28] A. Tsybakov. Introduction to Nonparametric Estimation. Springer, 2008. + +# Checklist + +1. For all authors... + +(a) Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope? [Yes] +(b) Did you describe the limitations of your work? [Yes] +(c) Did you discuss any potential negative societal impacts of your work? [N/A] Fairness results exhibited should only have positive impacts +(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] + +2. If you are including theoretical results... + +(a) Did you state the full set of assumptions of all theoretical results? [Yes] +(b) Did you include complete proofs of all theoretical results? [Yes] + +3. If you ran experiments... + +(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [N/A] +(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [N/A] +(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [N/A] +(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [N/A] + +4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... + +(a) If your work uses existing assets, did you cite the creators? [N/A] +(b) Did you mention the license of the assets? [N/A] +(c) Did you include any new assets either in the supplemental material or as a URL? [N/A] +(d) Did you discuss whether and how consent was obtained from people whose data you're using/curating? [N/A] +(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] + +5. If you used crowdsourcing or conducted research with human subjects... + +(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] +(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] +(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] \ No newline at end of file diff --git a/aunifiedapproachtofaironlinelearningviablackwellapproachability/images.zip b/aunifiedapproachtofaironlinelearningviablackwellapproachability/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..486a396893d185fcb8cc03e5a968e7c9b436eb89 --- /dev/null +++ b/aunifiedapproachtofaironlinelearningviablackwellapproachability/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f1f2116a26e8ca921fdb45c5e60902d6fe79c55f6605491768b76c674848661 +size 381615 diff --git a/aunifiedapproachtofaironlinelearningviablackwellapproachability/layout.json b/aunifiedapproachtofaironlinelearningviablackwellapproachability/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..280168f62a9f4c9d076cc15ecdf7d608fc12c30a --- /dev/null +++ b/aunifiedapproachtofaironlinelearningviablackwellapproachability/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1919c6a48d97d5599a7b13bd54ea25b823b29f7c239e8e52b7046f7b66a5570b +size 687582 diff --git a/aunifiedframeworkforbanditmultipletesting/bdd50246-6936-4feb-b7fd-a3cb3c23e5c3_content_list.json b/aunifiedframeworkforbanditmultipletesting/bdd50246-6936-4feb-b7fd-a3cb3c23e5c3_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..c3d22b31c45c1a61195c67daff57a770c17aa5f6 --- /dev/null +++ b/aunifiedframeworkforbanditmultipletesting/bdd50246-6936-4feb-b7fd-a3cb3c23e5c3_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:18eb6b2827679124ffe4e05d24a55963ea7a165c1f7bc55525f54b9e18369e18 +size 90499 diff --git a/aunifiedframeworkforbanditmultipletesting/bdd50246-6936-4feb-b7fd-a3cb3c23e5c3_model.json b/aunifiedframeworkforbanditmultipletesting/bdd50246-6936-4feb-b7fd-a3cb3c23e5c3_model.json new file mode 100644 index 0000000000000000000000000000000000000000..8d9f0e538a02953c2040c9c7f2bf891069d2383d --- /dev/null +++ b/aunifiedframeworkforbanditmultipletesting/bdd50246-6936-4feb-b7fd-a3cb3c23e5c3_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c42743885c0210f49b2012d323dec8b7d5aa205d1cf6f9baafeb63f0e9bad5bf +size 109449 diff --git a/aunifiedframeworkforbanditmultipletesting/bdd50246-6936-4feb-b7fd-a3cb3c23e5c3_origin.pdf b/aunifiedframeworkforbanditmultipletesting/bdd50246-6936-4feb-b7fd-a3cb3c23e5c3_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4c89b1c04df609c717fe5ca34f1da23ffeec77f1 --- /dev/null +++ b/aunifiedframeworkforbanditmultipletesting/bdd50246-6936-4feb-b7fd-a3cb3c23e5c3_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5fc519620565d52166b76c6d5cf1fbc5127f5a1c3e324594787141d3e31ebb2c +size 561618 diff --git a/aunifiedframeworkforbanditmultipletesting/full.md b/aunifiedframeworkforbanditmultipletesting/full.md new file mode 100644 index 0000000000000000000000000000000000000000..ca28a43db71fc3492a1b74196136b50c122edcfa --- /dev/null +++ b/aunifiedframeworkforbanditmultipletesting/full.md @@ -0,0 +1,342 @@ +# A unified framework for bandit multiple testing + +# Ziyu Xu + +Department of Statistics and Data Science + +Carnegie Mellon University, USA + +xzy@cmu.edu + +# Ruodu Wang + +Department of Statistics and Actuarial Science + +University of Waterloo, Canada + +wang@uwaterloo.ca + +# Aaditya Ramdas + +Department of Statistics and Data Science + +Machine Learning Department + +Carnegie Mellon University, USA + +aramdas@cmu.edu + +# Abstract + +In bandit multiple hypothesis testing, each arm corresponds to a different null hypothesis that we wish to test, and the goal is to design adaptive algorithms that correctly identify large set of interesting arms (true discoveries), while only mistakenly identifying a few uninteresting ones (false discoveries). One common metric in non-bandit multiple testing is the false discovery rate (FDR). We propose a unified, modular framework for bandit FDR control that emphasizes the decoupling of exploration and summarization of evidence. We utilize the powerful martingale-based concept of "e-processes" to ensure FDR control for arbitrary composite nulls, exploration rules and stopping times in generic problem settings. In particular, valid FDR control holds even if the reward distributions of the arms could be dependent, multiple arms may be queried simultaneously, and multiple (cooperating or competing) agents may be querying arms, covering combinatorial semi-bandit type settings as well. Prior work has considered in great detail the setting where each arm's reward distribution is independent and sub-Gaussian, and a single arm is queried at each step. Our framework recovers matching sample complexity guarantees in this special case, and performs comparably or better in practice. For other settings, sample complexities will depend on the finer details of the problem (composite nulls being tested, exploration algorithm, data dependence structure, stopping rule) and we do not explore these; our contribution is to show that the FDR guarantee is clean and entirely agnostic to these details. + +# 1 Introduction to bandit multiple hypothesis testing + +Scientific experimentation is often a sequential process. To test a single null hypothesis — with "null" capturing the setting of no scientific interest, and the alternative being scientifically interesting — scientists typically collect an increasing amount of experimental data in order to gather sufficient evidence such that they can potentially reject the null hypothesis (i.e. make a scientific discovery) with a high degree of statistical confidence. As long as the collected evidence remains thin, they do not reject the null hypothesis and do not proclaim a discovery. Since executing each additional unit of data (stemming from an experiment or trial) has an associated cost (in the form of time, money, resources), the scientist would like to stop as soon as possible. This becomes increasingly prevalent when the scientist is testing multiple hypotheses at the same time, and investing resources into testing one means divesting it from another. + +For example, consider the case of a scientist at a pharmaceutical company who wants to discover which of several drug candidates under consideration are truly effective (i.e. testing a hypothesis of whether each candidate has greater than baseline effect) through an adaptive sequential assignment of drug candidates to participants. Performing follow up studies on each discovery is expensive, so the scientist does not want to make many "false discoveries" i.e. drugs that did not have an actual effect, but were proclaimed to have one by the scientist. To achieve these goals, one could imagine + +the scientist collecting more data for candidates whose efficacy is unclear but appear promising (e.g. drugs with nontrivial but inconclusive evidence), and stop sampling candidates that have relatively clear results already (e.g. drugs that have a clear and large effect, or seemingly no effect). + +Past work. This problem combines the challenges of multiple hypothesis testing with multi-arm bandits (MABs). In a "doubly-sequential" version of the problem studied by Yang et al. [46], one encounters a sequence of MAB problems over time. Each MAB was used to test a single special placebo arm against several treatment arms, and if at least one treatment dominated the placebo, then they aimed to return the best treatment. Thus each MAB was itself a single adaptive sequential hypothesis test, and the authors aimed not to make too many false discoveries over the sequence of MAB instances. + +This paper instead considers the formulation of Jamieson and Jain [19], henceforth called JJ, but our techniques apply equally well to the above setup. To avoid confusions, note that our setup is very different from the active classification work of the same authors [17]. To recap, JJ consider a single MAB instance without a placebo arm (or rather, leaving it implicit), and try to identify as many treatments that work better than chance as possible, without too many false identifications. To clarify, we associate each arm with one (potentially composite) null hypothesis — for example, the hypothesis that corresponding drug has no (significant) effect. A single observed reward when pulling an arm corresponds to a statistic that summarizes the results of one experiment with the corresponding drug, and the average reward across many experiments could correspond to an estimate of the average treatment effect, which would be (at most) zero for null arms and positive for non-nulls. Thus, a strategy for quickly finding the arms with positive means corresponds to a strategy for allocating trial patients to drug candidates that allows the scientists to rapidly find the effective drugs. + +However, the above corresponds to only the simplest problem setting. In more complex settings, it may be possible to pull multiple arms in each round, and observe correlated rewards. Further, the arms may have some combinatorial structure that allows only certain subsets of arms to be pulled. There could be multiple agents (eg: hospitals) pulling the same set of arms and seeing independent rewards (eg: different patients) or dependent rewards (eg: patient overlap or interference). Further, if some set of experiments by one scientist yielded suggestive but inconclusive evidence, another may want to follow up, but not start from scratch, instead picking up from where the first left off. Last, the MAB may be stopped for a variety of reasons that may or may not be in the control of the scientist (eg: a faster usage of funding than expected, or additional funding is secured). We dive in the details of these scenarios in Appendix D.3. + +Our contribution. We introduce a modular meta-algorithm for bandit multiple testing with provable FDR control that utilizes "e-values" — or, more appropriately, their sequential analog, "e-processes" — a recently introduced alternative to p-values (or p-processes) by Ramdas et al. [32] for various testing problems, that are inherently related to martingales, gambling and betting [33, 14, 15, 44]. This work is the first to carefully study e-processes in general MAB settings, building on prior work that studied a special case [44]. We also are the first to extend the bandit multiple testing problem to the combinatorial bandit setting — JJ had previously only analyzed the problem in the single-arm, independent reward setting. Utilizing e-processes provide our meta-algorithm with several benefits. (a) For composite nulls, it is typically easier to construct e-processes than p-processes; the same holds when data from a single source is dependent. When combining evidence from disparate (independent or dependent) sources, it is also more straightforward to combine e-values than p-values (see Appendix D.3). (b) The same multiple testing step applies in all bandit multiple testing problems, regardless of all the various details of the problem setup mentioned in the previous paragraph. Consequently, FDR control in our meta-algorithm is agnostic to much of problem setup and can be proved in a vast array of settings. This is not true when working for p-values. In particular, the techniques for proving FDR control in JJ are highly reliant on the specific bandit setup in their paper. (c) The exploration step can be — but does not have to be — decoupled from the multiple testing (combining evidence) step. This results in a modular procedure that can be easily ported to new problem settings to yield transparent guarantees on FDR control. + +By virtue of being a meta-algorithm, we do not (and cannot) provide "generic" sample complexity guarantees: these will depend on all of the finer problem details mentioned above, on the exploration algorithm employed, on which e-processes are constructed. Our emphasis is on the flexibility with which FDR control can be guaranteed in a vast variety of problem setups. Further research can pick up one problem at a time and design sensible exploration strategies and stopping rules, developing sampling complexity bounds for each, and these bounds will be inherited by the meta-algorithm. + +However, we do formulate some generic exploration algorithms in Appendix C based on best arm identification algorithms [1, 22, 11, 18, 23, 10, 20]. + +When instantiated to the particular problem setup studied by JJ (independent, sub-Gaussian rewards, one arm in each round, etc.), we get a slightly different algorithm from them — the exploration strategy can be inherited to stay the same, but the multiple testing part differs. JJ use p-processes for each arm to determine whether that arm should be added to the rejection set, and correct for testing multiple hypotheses by using the BH procedure [6] to ensure that the false discovery rate (FDR), i.e. the proportion of rejections that are false discoveries in expectation, is controlled at some fixed level $\delta$ . Adaptive sampling induces a peculiar form of dependence amongst the p-values, for which the BH procedure provides error control at an inflated level; in other words, one has to use BH at a more stringent level of approximately $\delta / \log(16 / \delta)$ to ensure that the FDR is less than $\delta$ . On the other hand, we use the e-BH procedure [44], an analogous procedure for e-values, which can ensure the FDR is less than $\delta$ without any inflation, regardless of the dependence structure between the e-values of each arm. Our algorithm has improved sample efficiency in simulations and the same sample complexity in theory. + +Formal problem setup. We define the bandit as having $k$ arms, and $\nu_{i}$ as the (unknown) reward distribution for arm $i \in [k] = \{1,\dots,k\}$ . Every arm $i$ is associated with a null hypothesis, which is represented by a known, prespecified set of distributions $\mathcal{P}_i$ . If $|\mathcal{P}_i| = 1$ , it is a 'point null hypothesis', and otherwise it is a 'composite null hypothesis'. Examples of the latter include "all [0,1]-bounded distributions with mean $\leq 0.5$ " or "all 1-sub-Gaussian distributions with mean $\leq 0$ " or "all distributions that are symmetric around 0" or "all distributions with median $\leq 0$ ". While we assume by default that all rewards from an arm are i.i.d., we also formulate tests for hypotheses on reward distributions that may violate this assumption in Appendix G. If $\nu_{i} \in \mathcal{P}_{i}$ , then we say that the $i$ -th null hypothesis is true and we call $i$ a null arm; else, we say $i$ -th null hypothesis is false and we call it a non-null arm. Thus, the set of arms are partitioned into two disjoint sets: nulls $\mathcal{H}_0 \subseteq [k]$ and non-nulls $\mathcal{H}_1 := [k] \setminus \mathcal{H}_0$ . + +Let $\mathcal{K} \subseteq 2^{[k]}$ denote the subsets of arms that can be jointly queried in each round. At each time $t$ , the algorithm chooses a subset of arms $\mathcal{I}_t \in \mathcal{K}$ to sample jointly from. The special choice of $\mathcal{K} = \{\{1\}, \{2\}, \dots, \{k\}\}$ recovers the standard bandit setup, but otherwise this setting is known as combinatorial bandits with semi-bandit feedback [12]. We also consider the special case of full-bandit feedback (the algorithm sees all rewards at each time step) in Appendix D.1. We denote the reward sampled at time $t$ from arm $i \in \mathcal{I}_t$ as $X_{i,t}$ . Let $T_i(t)$ denote the number of times arm $i$ has been sampled by time $t$ , and $t_i(j)$ be the time of the $j$ th sample from arm $i$ . + +We now define a canonical "filtration" for our bandit problem. A filtration $(\mathcal{F}_t)_{t\geq 0}$ is a series of nested sigma-algebras that encapsulates what information is known at time $t$ . (We drop the subscript and just write $(\mathcal{F}_t)$ for brevity, and drop the parentheses when just referring to a single sigma-algebra at time $t$ .) Define the canonical filtration as follows for $t\in \mathbb{N}$ : $\mathcal{F}_t\coloneqq \sigma (U\cup \{(i,s,X_{i,j})\colon s\leq t,i\in \mathcal{I}_s\})$ and we let $\mathcal{F}_0\coloneqq \sigma (U)$ where $U$ is uniformly distributed on [0,1] and its bits capture all private randomness used by the bandit algorithm that are independent of all observed rewards. Let $(\lambda_t)$ be a sequence of random variables indexed by $t\in \mathbb{N}$ . $(\lambda_t)$ is said to be predictable w.r.t. $(\mathcal{F}_t)$ if $\lambda_t$ is measurable w.r.t. $\mathcal{F}_{t - 1}$ i.e. $\lambda_t$ is fully specified given the information in $\mathcal{F}_{t - 1}$ . An $\mathbb{N}$ -valued random variable $\tau$ is a stopping time (or stopping rule) w.r.t. to $(\mathcal{F}_t)$ if $\{\tau = t\} \in \mathcal{F}_t$ — in other words, at each time $t$ , we know whether or not to stop collecting data. Let $\mathcal{T}$ denote the set of all possible stopping times/rules w.r.t. $(\mathcal{F}_t)$ , potentially infinite. Technically, the algorithm must not just specify a strategy to select $\mathcal{I}_t$ , but also specify when sampling will stop. This is denoted by the stopping rule or stopping time $\tau^{*}\in \mathcal{T}$ . + +Once the algorithm halts at some time $\tau$ , it produces a rejection set $S_{\tau} \subseteq [k]$ . We consider two metrics w.r.t. $S$ : the FDR as discussed prior, and true positive rate (TPR), which is the proportion of non-nulls that are discovered in expectation. These two metrics are defined as follows: + +$$ +\operatorname {F D R} (\mathcal {S} _ {\tau}) := \mathbb {E} \left[ \frac {| \mathcal {H} _ {0} \cap \mathcal {S} _ {\tau} |}{| \mathcal {S} _ {\tau} | \vee 1} \right], \qquad \operatorname {T P R} (\mathcal {S} _ {\tau}) := \mathbb {E} \left[ \frac {| \mathcal {H} _ {1} \cap \mathcal {S} _ {\tau} |}{| \mathcal {H} _ {1} |} \right]. +$$ + +We consider algorithms that always satisfy $\mathrm{FDR}(S_{\tau}) \leq \delta$ for any number and configuration of nulls $\mathcal{H}_0$ and any choice of null and non-null distributions. In fact, our algorithm will produce a sequence of candidate rejection sets $(S_t)$ that satisfies $\sup_{\tau \in \mathcal{T}} \mathrm{FDR}(S_{\tau}) \leq \delta$ . This is a much stronger guarantee than the typical setting considered in the multiple testing literature. On the other hand, TPR is a measurement of the power of the algorithm i.e. how many of the non-null hypotheses does the algorithm discover. Our implicit goal in the multiple testing problem is to maximize the number of true discoveries while not making too many mistakes i.e. keep the FDR controlled. + +In hypothesis testing, the set of null distributions $\mathcal{P}_i$ for each arm $i$ is known, because the user defines the null hypothesis they are interested in testing. When the null hypothesis is false, the non-null distribution can be arbitrary. Consequently, we can prove results about FDR, but we cannot prove guarantees about TPR without several further assumptions on the non-null distributions, dependence across arms, etc. For a particular setting where we make such a set of assumptions, we demonstrate in Section 4 that we can prove TPR guarantees for algorithms within our framework. Hence, our FDR controlling framework is not vacuous as it includes powerful algorithms i.e. algorithms which make many true discoveries. However, our focus is primarily to show that the FDR control of our framework is robust to a wide range of conditions. + +Finally, note that in bandit multiple testing, one does not care about regret. The problem is more akin to pure exploration, where we aim to find a $S$ with $\mathrm{FDR}(S_{\tau^{*}}) \leq \delta$ and large TPR as quickly as possible. + +Now that we have specified the problem we are interested in, we can introduce our main technical tools for ensuring FDR control at stopping times: e-processes and p-processes. + +# 2 Technical preliminaries + +# 2.1 E-processes versus p-processes + +An e-variable, $E$ , is a nonnegative random variable where $\mathbb{E}[E] \leq 1$ when the null hypothesis is true. In contrast, the more commonly used p-variable, $P$ , is defined to have support on $(0,1)$ and satisfy $\mathbb{P}(P \leq \alpha) \leq \alpha$ for all $\alpha \in (0,1)$ when the null hypothesis is true. To clearly delineate when we are discussing solely the properties of a random variable, we also use the terms "e-value" $e$ and "p-value" $p$ to refer to the realized values of a e-variable $E$ and a p-variable $P$ (their instantiations on a particular set of data). E-variables and p-variables are connected through Markov's inequality, which implies that $1 / E$ is a p-variable (but $1 / P$ is not in general an e-variable). Rejecting a null hypothesis is usually based on observing a small p-value or a large e-value. For example, to control the false positive rate at 0.05 for a single hypothesis test, we reject the null when $p \leq 0.05$ or when $e \geq 20$ . + +Since bandit algorithms operate over time, we define sequential versions of p-variables and e-variables. A p-process, denoted $(P_{t})_{t\geq 1}$ , is a sequence of random variables such that $\sup_{\tau \in \mathcal{T}}\mathbb{P}(P_{\tau}\leq \alpha)\leq \alpha$ for any $\alpha \in (0,1)$ . In contrast, an e-process $(E_{t})_{t\geq 1}$ must satisfy $\sup_{\tau \in \mathcal{T}}\mathbb{E}[E_{\tau}]\leq 1$ (let $E_{\infty}\coloneqq \operatorname *{limsup}_{t\in \mathbb{N}}E_t$ and $P_{\infty}\coloneqq \operatorname *{liminf}_{t\in \mathbb{N}}P_t$ ). These sequentially valid forms of p-variables and e-variables are crucial since we allow the bandit algorithm to stop and output a rejection set in a data-dependent manner. Thus, we must ensure the respective properties of p-variables and e-variables hold over all stopping times. + +These concepts are intimately tied to sequential testing and sequential estimation using confidence sequences [31], but most importantly, nonnegative (super)martingales play a central role in the construction of efficient e-processes. To summarize, (a) for point nulls, all admissible e-processes are simply nonnegative martingales, and the safety property follows from the optional stopping theorem, (b) for composite nulls, admissible e-processes are either nonnegative martingales, or nonnegative supermartingales, or the infimum (over the distributions in the null) of nonnegative martingales. Associated connections to betting [45] are also important for the development of sample efficient algorithms and we discuss how we use betting ideas in Appendix F. We also discuss some useful equivalence properties of p-processes in Appendix A.1, while Appendix A.2 introduces supermartingales for the unfamiliar reader. + +Why use e-processes over p-processes? Wang and Ramdas [44] describe a multitude of advantages outside of the bandit setting; these advantages also apply to the bandit setting but we do not redescribe them here for brevity. However, we will describe multiple ways in which using e-variables instead of p-variables as a measure of evidence in the bandit setting allows for both better flexibility and sample complexity of the algorithm. While this question has been the focus of a recent line of work for hypothesis tests in general [33, 41, 14, 44], we will explore how the properties of e-variables allow us to consider novel bandit setups and algorithms. In particular, e-variables allow us to be robust to arbitrary dependencies between statistics computed for each arm without additional correction. Further, we explore how e-processes can be merged under different conditions in Appendix D.3 to facilitate incorporation of existing evidence and cooperation between multiple agents and present concrete ways to construct e-processes in Appendices B.3 and F. + +Since any non-trivial bandit algorithm will base its sampling choice on the rewards attained so far for every arm, average rewards of each arm are biased and dependent on each other in complex ways even if the algorithm is stopped at a fixed time [27, 35, 36, 37]. Even under a non-adaptive uniform sampling rule, an adaptive stopping rule can induce complex dependencies between reward statistics of each + +arm. When using both adaptive sampling and stopping, the dependence effects are only compounded. Nevertheless, e-variable based algorithms enable us to prove FDR guarantees without assumptions on the sampling method. In contrast, procedures involving p-variables, such as the ones used in JJ, require the test level of $\alpha$ to be corrected by a factor of at least $\log (1 / \alpha)$ when rewards are independent across arms, and a factor of $\log k$ otherwise. We expand on this in Section 2.2. + +# 2.2 Multiple testing procedures with FDR control + +We now introduce two multiple testing procedures that output a rejection set with provable FDR control. We will first describe the guarantees provided by the BH procedure [6], a classic multiple testing procedure that operates on p-variables. Then, we will describe e-BH, the e-variable analog of BH. Our key message in this section is that classical BH will have looser or tighter control of the FDR based upon the dependence structure of the p-variables it is operating on. On the other hand, e-BH provides a consistent guarantee on the FDR even when the e-variables are arbitrarily dependent. Both procedures take an input parameter $\alpha \in (0,1)$ that controls the degree of FDR guarantee (i.e. test level). + +Benjamini-Hochberg (BH) requires corrections for dependence and self-consistency. A set $S$ of p-values is called $p$ -self-consistent [9] at level $\alpha$ iff: + +$$ +\max _ {i \in \mathcal {S}} p _ {i} \leq \frac {| \mathcal {S} | \alpha}{k}. \tag {1} +$$ + +The BH procedure with input $p_1, \ldots, p_k$ outputs the largest p-self-consistent set w.r.t. the input, which we denote $\mathrm{BH}[\alpha](p_1, \ldots, p_k)$ . We must also define a condition on the joint distribution of $P_1, \ldots, P_k$ , which is called positive regression dependence on subset (PRDS). A formal definition is provided in Benjamini and Yekutieli [7], and it is sufficient for our purposes to think of this condition as positive dependence between $P_1, \ldots, P_k$ , with independence being a special case. Now, we describe the FDR control of the BH procedure. + +Fact 1 (BH FDR control. Benjamini and Hochberg [6], Benjamini and Yekutieli [7]). Let $S = \mathrm{BH}[\alpha](p_1, \ldots, p_k)$ . If $P_1, \ldots, P_k$ are PRDS, then $\mathrm{FDR}(S) \leq \alpha$ . Otherwise, under arbitrary dependence amongst $P_1, \ldots, P_k$ , the BH procedure ensures $\mathrm{FDR}(S) \leq \alpha \ell_k$ , where $\ell_k \equiv \sum_{i=1}^k 1 / k \approx \log k$ . + +Thus, in the case of arbitrary dependence, the FDR control of BH is larger by a factor of $\ell_k\approx \log k$ . A larger FDR guarantee is provided for arbitrary p-self-consistent sets. + +Fact 2 (P-self-consistent FDR control. Su [38], Blanchard and Roquain [9], Wang and Ramdas [44]). If $S$ is $p$ -self-consistent at level $\alpha$ and $P_{1},\ldots,P_{k}$ satisfy PRDS, then $\mathrm{FDR}(S)\leq \alpha (1 + \log (1 / \alpha))$ . Otherwise, when there is arbitrary dependence among $P_{1},\ldots,P_{k}$ , $\mathrm{FDR}(S)\leq \alpha \ell_{k}$ (consequence of Proposition 2.7 from Blanchard and Roquain [9] and Proposition 5.2 from Wang and Ramdas [44]). + +These two facts do not imply each other; the BH procedure outputs the largest self-consistent set and has a stronger or equivalent error guarantee under either type of dependence. While it may seem like we should always use BH and the guarantee from Fact 1 to form a rejection set, we elaborate in Section 3.1 on how we can use Fact 2 to provide FDR control for BH when the p-variables are not necessarily PRDS, and in settings where we may not directly use BH. + +e-BH needs no correction for dependence or self-consistency. The e-BH procedure created by Wang and Ramdas [44] uses e-variables instead of p-variables and proceeds similarly to the BH procedure. In this case, let $e_1, \ldots, e_k$ be the realized e-values for a set of e-variables $E_1, \ldots, E_k$ . Define $e_{[i]}$ to be the $i$ th largest e-value for $i \in [k]$ . A set $S$ is e-self-consistent at level $\alpha$ iff $S$ satisfies the following: + +$$ +\min _ {i \in S} e _ {i} \geq \frac {k}{\alpha | S |}. \tag {2} +$$ + +The e-BH procedure outputs the largest e-self-consistent set, which we denote by $\mathrm{eBH}[\alpha](e_1,\dots,e_k)$ . For e-variables, the same guarantee applies for all e-self-consistent sets and under all dependence structures. + +Fact 3 (E-variable self-consistency FDR control. Wang and Ramdas [44]). If $S$ is e-self-consistent at level $\alpha$ , then $\mathrm{FDR}(S) \leq \alpha$ regardless of the dependence structure. + +All FDR bounds discussed in Facts 1 to 3 are optimal, in the sense that there exist e-variable/p-variable distributions with an FDR that is arbitrarily close or equivalent to the stated bound. Consequently, e-variables are more advantageous, since their FDR control does not change under different types of + +dependence as opposed to the factor of $1 + \log (1 / \alpha)$ or $\log k$ p-variables pay on the FDR for different settings. + +In the case where p-variables can only be constructed as $P = 1 / E$ , where $E$ is an e-variable, the rejection sets output by BH and e-BH are identical. However, the e-self-consistency guarantee in Fact 3 provides identical or tighter FDR control than the BH procedure guarantee in Fact 1 or p-self-consistency guarantee in Fact 2. Thus, e-variables and e-BH offer a degree of robustness against arbitrary dependence, since any algorithm using e-BH does not have to adjust $\alpha$ to guarantee the same level of $\mathrm{FDR}(S) \leq \delta$ for a fixed $\delta$ under different dependence structures. We now provide a meta-algorithm that utilizes p-self-consistency and e-self-consistency to guarantee FDR control in the bandit setting. + +# 3 Decoupling exploration and evidence: a unified framework + +We propose a framework for bandit algorithms that separates each algorithm into an exploration component and an evidence component; Algorithm 1 specifies a meta-algorithm combining the two. + +Algorithm 1: A meta-algorithm for bandit multiple testing that decouples exploration and evidence. The evidence component can track p-processes or e-processes for each arm and use BH or e-BH. + +Input: Exploration component $(\mathcal{A}_t)$ , stopping rule $\tau^*$ , Let $(p_{1,t}),\dots,(p_{k,t})$ and $(e_{1,t}),\dots,(e_{k,t})$ denote the realized values of p-processes and e-processes, respectively. Let the desired level of FDR control be $\delta \in (0,1)$ . Let $\delta'$ be the correction of $\delta$ for BH based upon the dependencies of $X_{1,t},\dots,X_{k,t}$ . Set $D_0 = \emptyset$ . + +for $t$ in 1... do + +$$ +\mathcal {I} _ {t} := \mathcal {A} _ {t} (D _ {t - 1}) \subseteq [ k ] +$$ + +Obtain rewards for each $i\in \mathcal{I}_t$ , and update data $D_{t}\coloneqq D_{t - 1}\cup \{(i,t,X_{i,t}):i\in \mathcal{I}_t\}$ + +Update e-process or p-process for each queried arm (summarizing evidence against each null). + +$\mathcal{S}_t \coloneqq \left\{ \begin{array}{ll} \mathrm{BH}[\delta'] (p_{1,t}, \dots, p_{k,t}) \text{ or arbitrary p-self-consistent set} & \text{if using p-variables} \\ \mathrm{eBH}[\delta'] (e_{1,t}, \dots, e_{k,t}) \text{ or arbitrary e-self-consistent set} & \text{if using e-variables} \end{array} \right.$ + +if $\tau^{*} = t$ then stop and return $S_{t}$ + +end + +Exploration component. This is a sequence of functions $(\mathcal{A}_t)$ , where $\mathcal{A}_t: \mathcal{F}_{t-1} \mapsto \mathcal{K}$ specifies the queried arms $\mathcal{I}_t := \mathcal{A}_t(D_{t-1})$ , and $D_t := \{(i,j,X_{i,j}): j \leq t, i \in \mathcal{I}_j\}$ is the observed data. $\mathcal{A}_t$ is "non-adaptive" if it does not depend on the data, but only on some external randomness $U$ . Regardless of how the exploration component $(\mathcal{A}_t)$ is constructed, our framework guarantees that $\mathrm{FDR}(S) \leq \delta$ for a fixed $\delta$ . Similarly, $\tau^*$ is adaptive if it depends on the data, and is not determined purely by $U$ . + +Evidence component. The FDR control provided by Algorithm 1 is solely due to the formulation of the candidate rejection set, $S_{t} \subseteq [k]$ , at each time $t \in \mathbb{N}$ in the evidence component. This construction is completely separate from $(A_{t})$ . Critically, $(S_{t})$ satisfies $\mathrm{FDR}(S_{\tau}) \leq \delta$ for any stopping time $\tau \in \mathcal{T}$ . This is accomplished by applying BH or e-BH to p-processes or e-processes, respectively. At stopping time $\tau$ , $P_{i,\tau}$ is a p-variable when $(P_{i,t})$ is a p-process, and similarly $E_{i,\tau}$ is an e-variable when $(E_{i,t})$ is an e-process. Thus, $S_{\tau}$ is the result of applying BH to p-variables or e-BH to e-variables. + +Consequently, the aforementioned framework allows us to guarantee $\sup_{\tau \in \mathcal{T}}\mathrm{FDR}(S_{\tau})\leq \delta$ in a way that is agnostic to the exploration component. For completeness, we do discuss some generic exploration strategies in Appendix C. In the next section, we will formalize these guarantees and discuss the benefits afforded by using e-variables and e-BH in this framework instead of p-variables and BH. + +# 3.1 FDR control under different dependence structures + +In the general combinatorial bandit setting, different dependence structures affect the choice of $\delta'$ that ensures FDR control at $\delta$ in the p-variable and BH case. Table 1 summarizes the guarantees and choices of $\delta'$ for each type of dependence. Prior work on hypothesis testing in the bandit setting by JJ has only considered the non-combinatorial bandit case where $X_{1,t},\ldots,X_{k,t}$ are independent. Critically, JJ employ BH and p-variables in their algorithm, and the FDR guarantee of BH changes based on the dependencies between reward distributions. On the other hand, choosing $\alpha = \delta$ for e-BH is sufficient to guarantee FDR control at level $\delta$ for any type of dependence between e-variables, but only sufficient for BH in the non-adaptive, PRDS $X_{1,t},\ldots,X_{k,t}$ setting. We show that there is a wide range of dependence structures that require different degrees of correction for BH. Specifically, we will set an appropriate choice of $\delta'$ in each of these situations such that Algorithm 1 with p-variables can ensure FDR control level $\delta$ . We include proofs of all results in this section in Appendix B.1. + +Table 1: FDR control for BH, and the $\delta^\prime$ to ensure $\delta$ control of FDR in Algorithm 1 under different dependence structures and adaptivity of $(\mathcal{A}_t)$ . Adaptivity and arbitrary dependence both require extra correction for BH, but any $e$ -self-consistent procedure provides $\mathrm{FDR}(\mathcal{S}) \leq \alpha$ in all settings in the table. + +
Dependence of X1,t,...,Xk,t
Adaptivity of (At) and τ*independentarbitrarily dependent
non-adaptiveFDR(S) ≤ αδ' = δFDR(S) ≤ αlogkδ' = δ/logk (Prop. 2)
adaptiveFDR(S) ≤ α((1 + log(1/α)) ∧ logk)δ' = cδ ∨ (δ / logk) (Prop. 1)
Any e-self-consistent procedure ensures FDR(S) ≤ α in all settings and sets α = δ.
+ +Adaptive $(\mathcal{A}_t)$ and independent $X_{1,t},\ldots ,X_{k,t}$ . JJ consider this case in the non-combinatorial bandit setting, but their insights and techniques also can be extended to the combinatorial setting. We give a sketch of their proof here, and produce the full proof in Appendix B.1. In the language of self-consistency (not explicitly used in JJ), JJ make the key insight that running BH on the $p$ -variables for each arm produces a rejection set that is actually $p$ -self-consistent with a different set of independent $p$ -variables. Define $P_1^*,\dots,P_k^*$ , where $P_i^* = \inf_{t\in \mathbb{N}}P_{i,t}$ for each $i\in [k]$ i.e. each arm's $p$ -variable in the infinite sample limit. Since $(P_{i,t})$ is a $p$ -process for each arm $i\in [k]$ , the corresponding $P_i^*$ is a $p$ -variable (Proposition 6 in Appendix A.1). Further, $P_1^*,\dots,P_k^*$ are independent because $X_{1,t},\dots,X_{k,t}$ are independent. By definition of $P_1^*,\dots,P_k^*,p_i^*\leq p_{i,t}$ for any $i\in [k]$ and any $t\in \mathbb{N}$ . Thus, $\mathcal{S}_{\tau^{*}}$ is $p$ -self-consistent w.r.t. $p_1^*,\dots,p_k^*$ , and has its FDR bounded by $\alpha (1 + \log (1 / \alpha))$ due to Fact 2. At the same time, the arbitrary dependence guarantee from Fact 1 still applies. Combining these facts, we achieve the following guarantee: + +Proposition 1. When $(\mathcal{A}_t)$ is adaptive and $X_{1,t},\ldots ,X_{k,t}$ are independent, Algorithm 1 with $p$ -processes and an arbitrary $p$ -self-consistent set guarantees $\sup_{\tau \in \mathcal{T}}\mathrm{FDR}(\mathcal{S}_{\tau})\leq \delta$ if $\delta^{\prime}\leq c_{\delta}\lor \delta /\ell_{k}$ where for any $\delta \in (0,1)$ , define $c_{\delta}\leq \delta$ as the solution to $c_{\delta}(1 + \log (1 / c_{\delta})) = \delta$ + +Note that Proposition 1 is valid for any p-self-consistent set since p-self-consistency is the only property required of the output set to prove the result. JJ prove a similar bound to Proposition 1. However, they used a larger FDR bound for p-self-consistent sets with worse constants (which was subsequently improved by Su [38] as presented earlier), and they only considered the non-combinatorial case. Proposition 1 uses an optimal bound on p-self-consistent sets from Fact 2, and is valid in our combinatorial bandit setup. + +Adaptive $(\mathcal{A}_t)$ and arbitrarily dependent $X_{1,t},\ldots,X_{k,t}$ . In the general combinatorial bandit setting, where the algorithm chooses a subset of arms or "superarm" at each time to jointly sample from, we will have multiple samples from multiple arms in the same time step, and $X_{1,t},\ldots,X_{k,t}$ can be arbitrarily dependent. Consequently, the p-variables corresponding to each arm can also be arbitrarily dependent. For example, a superarm could consist of all arms, and the sampling rule could be to just sample this superarm that encompasses all arms. Then, the p-variable distribution would directly depend on the reward distribution of the arms. Thus, we can provide the following guarantee by Fact 1 when using p-variables as a result of Fact 3. + +Proposition 2. When $(\mathcal{A}_t)$ is adaptive and $X_{1,t},\ldots ,X_{k,t}$ are dependent, Algorithm 1 with $p$ -variables and BH guarantees $\sup_{\tau \in \mathcal{T}}\mathrm{FDR}(S_\tau)\leq \delta$ if $\delta^{\prime}\leq \delta /\ell_{k}$ + +Finally, consider a setting structured setting where we cannot output the rejection set of BH. Such a constraint often occurs in directed acyclic graph (DAG) settings where there is a hierarchy among hypotheses that restricts which rejection sets are allowed [30, 25]. Instead, we would like to output the largest self-consistent set that respects the structural constraints. By Fact 2, we get the following FDR control. + +Proposition 3. If $(\mathcal{A}_t)$ is adaptive and $X_{1,t},\ldots ,X_{k,t}$ are dependent, Algorithm 1 with $p$ -variables that outputs an arbitrary $p$ -self-consistent $\mathcal{S}_t$ guarantees $\sup_{\tau \in \mathcal{T}}\mathrm{FDR}(\mathcal{S}_{\tau})\leq \delta$ if $\delta^{\prime}\leq c_{\delta} / \ell_{k}$ + +We explore the structured setting with greater depth in Appendix D.2. Unlike p-variables, e-variables do not need correction in any of the aforementioned settings. + +Proposition 4. When $(\mathcal{A}_t)$ is adaptive and $X_{1,t},\ldots ,X_{k,t}$ are dependent, Algorithm 1 with $e$ -variables, which runs $e$ -BH at level $\delta$ or outputs a $e$ -self-consistent set at level $\delta$ , guarantees $\sup_{\tau \in \mathcal{T}}\mathrm{FDR}(\mathcal{S}_{\tau})\leq \delta$ + +Thus, running e-BH (or any e-self-consistent procedure) at level $\delta$ is valid for any choice of $(\mathcal{A}_t)$ and type of dependence. Now, we give an example where $X_{1,t},\ldots ,X_{k,t}$ might be arbitrarily dependent. + +# 3.2 Illustrative examples to demonstrate flexibility of the framework + +Below, we briefly describe a set of nontrivial illustrative examples to showcase the flexibility of our framework. In most of the cases below, a p-process approach would have to correct for dependence and/or self-consistency in different case-specific ways, rendering it more conservative and requiring careful arguments to justify FDR control. However, working with our unified framework is easy, handling both self-consistency and dependence issues in the same breath and without any changes to the algorithm or analysis. The data scientist can focus on designing powerful e-processes for each arm separately and let the modular framework correct for the multiplicity aspect. + +Example: sampling nodes on a graph. A scenario where $X_{1,t}, \ldots, X_{k,t}$ may naturally have dependence is when each arm corresponds to a node on a graph. The superarms in this situation could be defined w.r.t. to a graph constraint e.g. "two nodes connected by an edge" or "a node and its neighbors". Graph bandits has been studied in the regret setting [26] and have many real world applications [39]. We could imagine a scenario where low power sensors in a sensor network can only communicate locally. A centralized algorithm is tasked with querying the sensors to find those with high activity. A sensor may only provide activity information about itself and nearby sensors, and this data can be arbitrarily dependent across the sensors. Figure 1 illustrates a superarm in this situation. + +In such a setting, if Proposition 2 is used to guarantee $\mathrm{FDR}(S) \leq \delta$ with p-variables, it pays a log $k$ correction, while Proposition 4 can guarantee e-variables need no correction. We simulate this setting in Appendix E.2, and show these differences empirically. We also discuss some other examples in the appendix that we will summarize here. + +- Multiple agents (Appendix D.3): Consider the setting where multiple agents are operating on the same bandit, and we want to aggregate the evidence for rejection across agents. For e-processes, we present an algorithm for merging e-values that maintains FDR control. +- Structured rejection sets (Appendix D.2): We illustrate the difference between self-consistency guarantees for p-variables and e-variables when a DAG hierarchy is imposed upon the hypotheses. +- Multi-arm hypotheses (Appendix D.4) A hypothesis may concern the reward distributions of multiple arms e.g. are the means of two different arms equivalent? We provide FDR guarantees even when hypotheses and arms are not matched one-to-one. +- Streaming data setting (Appendix D.1) Our methods also naturally extend to the streaming setting when the algorithm views the rewards of every at each time step. + +![](images/91c122621f8def5d204c1b9e6574054334ef25a8703a1a1257dc6ace768ddcda.jpg) +Figure 1: A superarm consists of a node and all its neighbors. The dotted line captures $\mathcal{I}_t$ , the superarm around node 1. + +Now that we have shown FDR is controlled using e-variables in a way that is robust to the underlying dependence structure, we analyze the sample complexity of achieving a high TPR using e-variables when the rewards are independent and sub-Gaussian. + +# 4 E-process sample complexity guarantees for sub-Gaussian arms + +We provide sample complexity guarantees for the sub-Gaussian setting that has been the focus of existing methodology by JJ in bandit multiple testing. We explicitly define e-processes and an exploration component $(\mathcal{A}_t)$ that will have sample complexity bounds matching those of the algorithm in JJ, which uses p-variables. Specifically, we will consider the standard bandit setting where $|\mathcal{L}_t| = 1$ and $\nu_{i}$ is 1-sub-Gaussian for each $i\in [k]$ . Denote the means of each arm $i\in [k]$ as $\mu_{i} = \mathbb{E}[X_{i,t}]$ for all $t\in \mathbb{N}$ . The goal is to find many arms where $\mu_{i} > \mu_{0}$ , where we set $\mu_0 = 0$ to be the mean of a reward distribution under the null hypothesis. Thus, we define $\mathcal{H}_0 = \{i\in [k]:\mu_i\leq \mu_0\}$ and $\mathcal{H}_1 = \{i\in [k]:\mu_i > \mu_0\}$ . Our framework ensures that $\mathrm{FDR}(\mathcal{S})\leq \delta$ , and we also want to achieve $\mathrm{TPR}(\mathcal{S})\geq 1 - \delta$ with small sample complexity. Proofs of the results from this section are in Appendices B.2 and B.3. As an aside, we also discuss what hypotheses we can test when the reward distribution is not necessarily independent across $t\in \mathbb{N}$ , but the conditional distribution of the rewards still satisfy certain sub-Gaussian guarantees in Appendix G. + +Our e-process of choice is the discrete mixture e-process from Howard et al. [16]: + +Proposition 5. $E_{i,t}^{\mathrm{DM}}$ is an e-process when $\nu_{i}$ is 1-sub-Gaussian and $i\in \mathcal{H}_0$ + +Denote $\Delta_{i}\equiv \mu_{i} - \mu_{0}$ for $i\in \mathcal{H}_1$ and $\Delta \equiv \min_{i\in \mathcal{H}_1}\Delta_i$ . When $i\in \mathcal{H}_0$ , let $\Delta_{i}\equiv \min_{j\in \mathcal{H}_{1}}\mu_{i} - \mu_{0} = \Delta +(\mu_{i}-$ $\mu_0)$ .First, we recall a time-uniform bound on the sample mean $\widehat{\mu}_t$ + +$$ +E _ {i, t} ^ {\mathrm {D M}} (\mu_ {0}) := \sum_ {\ell = 0} ^ {\infty} w _ {\ell} \exp \left(\sum_ {j = 1} ^ {T _ {i} (t)} \lambda_ {\ell} \left(X _ {i, t _ {i} (j)} - \mu_ {0}\right) - \lambda_ {\ell} ^ {2} / 2\right), \tag {3a} +$$ + +$$ +\text {w h e r e} \lambda_ {\ell} := \frac {1}{e ^ {\ell + 5 / 2}} \text {a n d} w _ {\ell} := \frac {2 (e - 1)}{e (\ell + 2) ^ {2}} \text {f o r} \ell \in \mathbb {N} _ {0}. \tag {3b} +$$ + +Fact 4 (JJ, Kaufmann et al. [23], + +Howard et al. [16]). Let $X_{1}, X_{2}, \ldots$ be i.i.d. draws from a 1-sub-Gaussian distribution with mean $\mu$ . Consider the boundaries defined in (4). Let $\varphi$ be one of these boundaries. Then, $\mathbb{P}(\exists t \in \mathbb{N}: |\widehat{\mu}_t - \mu| > \varphi(t, \delta)) \leq \delta$ for any $\delta \in (0,1)$ if $\varphi \in \{\varphi^0, \varphi^{\mathrm{IS}}\}$ and any $\delta \in (0,0.1]$ if $\varphi = \varphi^{\mathrm{JJ}}$ . + +We will use $\varphi$ to refer to an arbitrary boundary from Fact 4. All of the $\varphi$ are time-uniform boundaries that yield confidence sequences for the mean. Note that $\varphi^0$ is generally larger than the other boundaries, so we use $\varphi^0$ as the default boundary in our + +$$ +\varphi^ {0} (t, \delta) := \sqrt {\frac {4 \log \left(\log_ {2} (2 t) / \delta\right)}{t}}, \tag {4a} +$$ + +$$ +\varphi^ {\mathrm {J J}} (t, \delta) := \sqrt {\frac {2 \log (1 / \delta) + 6 \log \log (1 / \delta) + 3 \log (\log (e t / 2))}{t}}, \tag {4b} +$$ + +$$ +\varphi^ {\mathrm {I S}} (t, \delta) := \sqrt {\frac {2 . 8 9 \log \log (2 . 0 4 1 t) + 2 . 0 6 5 \log \left(\frac {4 . 9 8 3}{\delta}\right)}{t}}. \tag {4c} +$$ + +proofs, and we explore how different choices of $\varphi$ affect empirical performance in Appendix E.1. Now, we can define the algorithm from JJ in (5), which consists of an exploration policy based on an upper confidence bound (UCB) of the mean reward (specified by a singleton set $\mathcal{I}_t = \{\bar{I}_t\}$ ) and a p-variable derived from Fact 4. + +In (5a), we denote the sample mean at time $t$ of each arm $i \in [k]$ by $\widehat{\mu}_{i,t}$ . Let $f \lesssim g$ denote $f$ asymptotically dominates $g$ i.e. there exist $c > 0$ that is independent of the problem parameters such that $f \leq cg$ . JJ prove the following sample complexity guarantee for their algorithm. + +Fact 5 (From JJ). Let $(\mathcal{A}_t)$ output $\mathcal{I}_t = \{I_t\}$ , and let $I_{t}$ and $P_{i,t}$ be specified by Alg. 5 with $\varphi = \varphi^0$ . Then, Algorithm 1 will always guarantee $\sup_{\tau \in \mathcal{T}}\mathrm{FDR}(\mathcal{S}_{\tau})\leq \delta$ . With at least $1 - \delta$ probability, there will exist $T\lesssim \left(\sum_{i = 1}^{k}\Delta_{i}^{-2}\log \log \Delta_{i}^{-2} + \Delta_{i}^{-2}\log (k / \delta)\right)\wedge k\Delta^{-2}\log (\log (\Delta^{-2}) / \delta)$ such that $\mathrm{TPR}(\mathcal{S}_t)\geq 1 - \delta$ for all $t\geq T$ . + +We show that we can match the sample complexity bounds of Fact 5 with e-variables. + +$$ +I _ {t} = \arg \max _ {i \in [ k ] \backslash S _ {t - 1}} \widehat {\mu} _ {i, t - 1} + \varphi (T _ {i} (t - 1), \delta), \tag {5a} +$$ + +Theorem 1. Let $\nu_{i}$ be 1-sub-Gaussian for $i\in [k]$ . Set $(\mathcal{A}_t)$ so $\mathcal{A}_t$ outputs $\{I_t\}$ from (5a) + +$$ +P _ {i, t} \equiv \inf \left\{\rho \in [ 0, 1 ]: \left| \widehat {\mu} _ {i, t} - \mu_ {0} \right| > \varphi (t, \rho) \right\}. \tag {5b} +$$ + +for all $t \in \mathbb{N}$ and $E_{i,t}$ to $E_{i,t}^{\mathrm{DM}}$ . Algorithm 1 ensures $\sup_{\tau \in \mathcal{T}} \mathrm{FDR}(S_{\tau}) \leq \delta$ and, with at least $1 - \delta$ probability, there exists $T \lesssim \left( \sum_{i=1}^{k} \Delta_{i}^{-2} \log \log \Delta_{i}^{-2} + \Delta_{i}^{-2} \log (k / \delta) \right) \wedge k \Delta^{-2} \log (\log (\Delta^{-2}) / \delta)$ such that $\mathrm{TPR}(S_t) \geq 1 - \delta$ for all $t \geq T$ . + +In addition to matching theoretical guarantees, we show in the following section that e-variables and e-BH perform empirically as well or better than p-variables and BH through numerical simulations. + +# 5 Numerical simulations + +We perform simulations for the sub-Gaussian setting discussed in Section 4 to demonstrate that our version of Algorithm 1 using e-variables is empirically as efficient as the algorithm of JJ, which uses p-variables (code available here). However, unlike JJ, our algorithm does not use a corrected level $\delta^{\prime}$ based upon the dependence assumptions among $X_{1,t},\ldots,X_{k,t}$ to guarantee FDR is controlled at level $\delta$ . We explore additional simulations of combinatorial semi-bandit settings with dependent $X_{1,t},\ldots,X_{k,t}$ in Appendix E that show the benefit of using e-variables over p-variables in our framework. + +Simulation setup Let $\nu_{i} = \mathcal{N}(\mu_{i},1)$ where $\mu_{i} = \mu_{0} = 0$ if $i\in \mathcal{H}_0$ and $\mu_{i} = 1 / 2$ if $i\in \mathcal{H}_1$ . We consider 3 setups, where we set the number of non-null hypotheses to be $|\mathcal{H}_1| = 2,\log k$ , and $\sqrt{k}$ , to see the effect of different magnitudes of non-null hypotheses on the sample complexity of each method. We set $\delta = 0.05$ and compare 4 different methods. We compare the same two different exploration components for both e-variables and p-variables. The first exploration component we consider is simply uniform sampling across each arm (Uni). The second is the UCB sampling strategy described in (5a). When using BH, our formulation for p-variables is (5b), which is the same as JJ. Like JJ, we set $\varphi = \varphi^{\mathrm{JJ}}$ in our simulations. When using e-BH, we set our e-variables to $E_{i,t}^{\mathrm{PM - H}}\coloneqq \prod_{j = 1}^{T_i(t)}\exp (\lambda_{i,t_i(j)}(X_{i,t_i(j)} - \mu_0) - \lambda_{i,t_i(j)}^2 /2)$ + +with $\lambda_{i,t} = \sqrt{\frac{2\log(2 / \alpha)}{T_i(t)\log(T_i(t) + 1)}}$ , which is the default choice of $\lambda_{i,t}$ suggested in Waudby-Smith and Ramdas [45]. We show that this is a valid e-process in Appendix F and maintains FDR control. + +Results We plot the relative performance of each method to e-BH with UCB sampling in Figure 2. For uniform sampling, e-BH and e-variables seem to outperform BH and p-variables, although by a decreasing margin for more arms, especially in the case where $|\mathcal{H}_1| = \lfloor \sqrt{k} \rfloor$ . For the UCB sampling algorithm, we see that e-variables and p-variables have relatively similar performance, with the gap narrowing as the number of arms increase as well. Thus, e-variables and e-BH empirically perform on par or better than p-variables with regards to sample complexity. This shows that using e-variables does not require any sacrifice in performance in simple cases where p-variables also work well. Further, e-variables do not require the same log $k$ correction that p-variables need for situations where $X_{1,t}, \ldots, X_{k,t}$ are arbitrarily dependent to guarantee FDR control at the same level. Thus, e-variables are preferable to p-variables as they are more flexible w.r.t. assumptions. + +![](images/bc10d78eaba21e7bb446eb8740391536160180e6223ee8668fc406f38b47cfe9.jpg) + +![](images/3e0b6c717acb7bbeb85f6606dae327cbc8c79ddffbc91fb6d7e5d1e5ddb3f567.jpg) +(a) $|\mathcal{H}_1| = 2$ + +![](images/2c9a3ce859e36465b995d529581d5e7f106ce394de8a17feae0d13a33c475781.jpg) +(b) $|\mathcal{H}_1| = |\log k|$ +Figure 2: Relative comparison of time $t$ to obtain a rejection set, $S_{t}$ , that has a $\mathrm{TPR}(\bar{S}_t) \geq 1 - \delta$ and $\mathrm{FDR}(S_t) \leq \delta$ where $\delta = 0.05$ . This plot compares e-BH vs. BH for both uniform (Uni) and UCB sampling over different numbers of arms (choices of $k$ ) and densities of non-null hypotheses (sizes of $\mathcal{H}_1$ ). Time is reported as a ratio to the time taken by UCB e-BH method. Note that the methods using e-variables perform on par or better than methods using p-variables for both sampling strategies. + +![](images/f55dae3b4bf299cb060e8419ed41fc9120507987d03d0797c1c1f522b7621260.jpg) +(c) $|\mathcal{H}_1| = |\sqrt{k} |$ + +# 6 Conclusion, limitations and broader impact + +In this paper, we developed a unified framework for bandit multiple hypothesis testing. We demonstrated that applying the e-BH procedure to stopped e-processes guarantees FDR control without assumptions on the dependency between $X_{1,t},\ldots,X_{k,t}$ , exploration strategy, stopping time of the algorithm, ability to query multiple arms, etc. In contrast, existing algorithms using BH and p-variables have FDR guarantees that vary with the problem setting and dependence structure among the p-variables. We argued that control of the FDR with p-variables can blow up by a factor of $\log k$ , and any p-self-consistent algorithm must decrease its threshold for discovery correspondingly to maintain FDR control at the desired level. We provide more detailed explanations of these observations in Appendix D.2. In addition to demonstrating the generality of our meta-algorithm, we showed that in the standard sub-Gaussian reward setting, the instantiated algorithm matches the sample complexity bounds of the p-variable algorithm by JJ for achieving high TPR, and has better practical performance than JJ's algorithm, despite the fact that we improve JJ's guarantees by invoking the self-consistency results of Su [38]. + +The appendices have additional examples of problem settings and simulations that show the utility of e-processes and our general framework. In fact, we can address an even more general setting where the null hypotheses do not have a one-to-one correspondence with the arms; in other words, despite the queries being at the arm-level, the hypotheses being tested could combine arms (for example, comparing different arms). We also discuss the multi-agent setting where there could be multiple agents that operate the same bandit. We avoided these scenarios in the main paper for simplicity of exposition, since there were enough generalizations to describe in the simpler setup already. + +The main limitation of the work is that it does not develop instance optimal sampling algorithms for multiple testing problem in the described settings with more complicated dependence structures; we believe this is a difficult open problem, requiring specialized techniques in each example. We do not foresee any negative societal impact of this work; it is aimed at reducing costs and improving reproducibility in scientific experimentation by controlling false discoveries in adaptive testing. + +Acknowledgments RW acknowledges funding from NSERC RGPIN-2018-03823 and RGPAS-2018-522590. AR acknowledges funding from NSF DMS 1916320 and ARL IoBT REIGN. Research reported in this paper was sponsored in part by the DEVCOM Army Research Laboratory under Cooperative Agreement W911NF-17-2-0196 (ARL IoBTCRA). The views and conclusions contained in this document are those of the authors and should not be interpreted as representing the official policies, either expressed or implied, of the Army Research Laboratory or the U.S. Government. The U.S. Government is authorized to reproduce and distribute reprints for Government purposes notwithstanding any copyright notation herein. + +# References + +[1] J.-Y. Audibert and S. Bubeck. Best arm identification in multi-armed bandits. In Conference on Learning Theory, 2010. +[2] J. Bartroff. Multiple Hypothesis Tests Controlling Generalized Error Rates for Sequential Data. Statistica Sinica, 2017. ISSN 10170405. +[3] J. Bartroff and J. Song. Sequential tests of multiple hypotheses controlling type I and II familywise error rates. Journal of Statistical Planning and Inference, 153:100-114, 2014. ISSN 0378-3758. +[4] J. Bartroff and J. Song. A Rejection Principle for Sequential Tests of Multiple Hypotheses Controlling Familywise Error Rates. Scandinavian Journal of Statistics, 31(1):3-19, 2016. ISSN 0303-6898. +[5] J. Bartroff and J. Song. Sequential Tests of Multiple Hypotheses Controlling False Discovery and Nondiscovery Rates. Sequential analysis, 39(1):65-91, 2020. ISSN 0747-4946. +[6] Y. Benjamini and Y. Hochberg. Controlling the False Discovery Rate: A Practical and Powerful Approach to Multiple Testing. Journal of the Royal Statistical Society. Series B (Methodological), 57(1):289-300, 1995. ISSN 0035-9246. +[7] Y. Benjamini and D. Yekutieli. The control of the false discovery rate in multiple testing under dependency. The Annals of Statistics, 29(4):1165-1188, 2001. ISSN 0090-5364, 2168-8966. +[8] A. Birnbaum. Combining Independent Tests of Significance. Journal of the American Statistical Association, 49(267):559-574, 1954. ISSN 0162-1459. +[9] G. Blanchard and E. Roquain. Two simple sufficient conditions for FDR control. *Electronic Journal of Statistics*, 2:963–992, 2008. ISSN 1935-7524, 1935-7524. +[10] L. Chen, A. Gupta, J. Li, M. Qiao, and R. Wang. Nearly Optimal Sampling Algorithms for Combinatorial Pure Exploration. In Conference on Learning Theory, 2017. +[11] S. Chen, T. Lin, I. King, M. R. Lyu, and W. Chen. Combinatorial pure exploration of multi-armed bandits. Neural Information Processing Systems, 2014. +[12] W. Chen, Y. Wang, Y. Yuan, and Q. Wang. Combinatorial multi-armed bandit and its extension to probabilistically triggered arms. Journal of Machine Learning Research, 17(50):1–33, 2016. +[13] R. Durrett. Probability: Theory and Examples. Cambridge University Press, 5a edition, 2017. +[14] P. Grünwald, R. de Heide, and W. Koolen. Safe Testing. arXiv:1906.07801, 2020. +[15] S. R. Howard, A. Ramdas, J. McAuliffe, and J. Sekhon. Time-uniform chernoff bounds via nonnegative supermartingales. Probability Surveys, 17:257-317, 2020. +[16] S. R. Howard, A. Ramdas, J. McAuliffe, and J. Sekhon. Time-uniform, nonparametric, nonasymptotic confidence sequences. The Annals of Statistics, 49(2):1055-1080, 2021. +[17] L. Jain and K. G. Jamieson. A new perspective on pool-based active classification and false-discovery control. In Neural Information Processing Systems, 2019. +[18] K. Jamieson, M. Malloy, R. Nowak, and S. Bubeck. Lil' UCB: An Optimal Exploration Algorithm for Multi-Armed Bandits. In Conference on Learning Theory, 2014. +[19] K. G. Jamieson and L. Jain. A bandit approach to sequential experimental design with false discovery control. In Neural Information Processing Systems, volume 31, 2018. +[20] M. Jourdan, M. Mutny, J. Kirschner, and A. Krause. Efficient Pure Exploration for Combinatorial Bandits with Semi-Bandit Feedback. In Algorithmic Learning Theory, 2021. + +[21] K.-S. Jun, F. Orabona, S. Wright, and R. Willett. Online learning for changing environments using coin betting. *Electronic Journal of Statistics*, 11(2):5282-5310, 2017. ISSN 1935-7524, 1935-7524. +[22] S. Kalyanakrishnan, A. Tewari, P. Auer, and P. Stone. PAC subset selection in stochastic multiarmed bandits. In International Conference on Machine Learning, 2012. +[23] E. Kaufmann, O. Cappé, and A. Garivier. On the complexity of best-arm identification in multiarmed bandit models. The Journal of Machine Learning Research, 17(1):1-42, 2016. ISSN 1532-4435. +[24] J. L. Kelly. A new interpretation of information rate. The Bell System Technical Journal, 35(4): 917-926, 1956. +[25] L. Lei, A. Ramdas, and W. Fithian. A general interactive framework for false discovery rate control under structural constraints. Biometrika, 2020. ISSN 0006-3444. +[26] S. Mannor and O. Shamir. From bandits to experts: On the value of side-observations. In Neural Information Processing Systems, 2011. +[27] X. Nie, X. Tian, J. Taylor, and J. Zou. Why adaptively collected data have negative bias and how to correct for it. In International Conference on Artificial Intelligence and Statistics, 2018. +[28] F. Orabona and D. Pál. Coin betting and parameter-free online learning. In Neural Information Processing Systems, 2016. +[29] F. Orabona and T. Tommasi. Training Deep Networks without Learning Rates Through Coin Betting. In Neural Information Processing Systems, 2017. +[30] A. Ramdas, J. Chen, M. J. Wainwright, and M. I. Jordan. A sequential algorithm for false discovery rate control on directed acyclic graphs. Biometrika, 106:69-86, 2019. ISSN 0006-3444. +[31] A. Ramdas, J. Ruf, M. Larsson, and W. Koolen. Admissible anytime-valid sequential inference must rely on nonnegative martingales. arXiv:2009.03167, 2020. +[32] A. Ramdas, J. Ruf, M. Larsson, and W. M. Koolen. Testing exchangeability: Fork-convexity, supermartingales and e-processes. International Journal of Approximate Reasoning, 2021. ISSN 0888-613X. +[33] G. Shafer. Testing by betting: A strategy for statistical and scientific communication. Journal of the Royal Statistical Society: Series A (Statistics in Society), 184(2):407-431, 2021. ISSN 1467-985X. +[34] G. Shafer and V. Vovk. Game-Theoretic Foundations for Probability and Finance. John Wiley & Sons, Ltd, first edition, 2019. ISBN 978-1-118-54803-5. +[35] J. Shin, A. Ramdas, and A. Rinaldo. Are sample means in multi-armed bandits positively or negatively biased? Neural Information Processing Systems, 2019. +[36] J. Shin, A. Ramdas, and A. Rinaldo. On conditional versus marginal bias in multi-armed bandits. In International Conference on Machine Learning, 2020. +[37] J. Shin, A. Ramdas, and A. Rinaldo. On the bias, risk and consistency of sample means in multi-armed bandits. SIAM Journal on the Mathematics of Data Science, 2021. +[38] W. J. Su. The FDR-Linking Theorem. arXiv:1812.08965, 2018. +[39] M. Valko. Bandits on Graphs and Structures. HdR Thesis, Ecole normale supérieure de Paris-Saclay, Paris-Saclay, France, 2016. +[40] V. Vovk. Testing randomness online. Statistical Science, 2021. +[41] V. Vovk and R. Wang. E-values: Calibration, combination, and applications. Annals of Statistics, 2021. +[42] V. Vovk, I. Petej, I. Nouretdinov, E. Ahlberg, L. Carlsson, and A. Gammerman. Retrain or not retrain: Conformal test martingales for change-point detection. In Symposium on Conformal and Probabilistic Prediction and Applications, 2021. +[43] V. Vovk, B. Wang, and R. Wang. Admissible ways of merging p-values under arbitrary dependence. The Annals of Statistics (forthcoming), 2021. +[44] R. Wang and A. Ramdas. False discovery rate control with e-values. arXiv:2009.02824, 2020. + +[45] I. Waudby-Smith and A. Ramdas. Estimating means of bounded random variables by betting. arXiv:2010.09686, 2021. +[46] F. Yang, A. Ramdas, K. Jamieson, and M. J. Wainwright. A framework for multi-A(rmed)/B(andit) testing with online FDR control. Neural Information Processing Systems, 2017. \ No newline at end of file diff --git a/aunifiedframeworkforbanditmultipletesting/images.zip b/aunifiedframeworkforbanditmultipletesting/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..2874b2c457f01b8ea51dc625e9fffac312d5f849 --- /dev/null +++ b/aunifiedframeworkforbanditmultipletesting/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e376950b8058870a8d76ff3740fb8826892085b06630697b3fb4f2e59fe8db04 +size 144022 diff --git a/aunifiedframeworkforbanditmultipletesting/layout.json b/aunifiedframeworkforbanditmultipletesting/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..76502161095dee7b0523bd786e90975a77067afc --- /dev/null +++ b/aunifiedframeworkforbanditmultipletesting/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5a1e3abaa09870d94be8a4d4d968d01419ea734c6736dad82717275e970b5338 +size 613797 diff --git a/aunifiedviewofcganswithandwithoutclassifiers/6eb58224-4c58-472f-a8e8-bb0eb9821793_content_list.json b/aunifiedviewofcganswithandwithoutclassifiers/6eb58224-4c58-472f-a8e8-bb0eb9821793_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..961e5de3e50bd11746d4341272c3e55535172817 --- /dev/null +++ b/aunifiedviewofcganswithandwithoutclassifiers/6eb58224-4c58-472f-a8e8-bb0eb9821793_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0285bba447b2f7a09cb2486e87068204c79a2283308008a85e558e0e78bb976d +size 87181 diff --git a/aunifiedviewofcganswithandwithoutclassifiers/6eb58224-4c58-472f-a8e8-bb0eb9821793_model.json b/aunifiedviewofcganswithandwithoutclassifiers/6eb58224-4c58-472f-a8e8-bb0eb9821793_model.json new file mode 100644 index 0000000000000000000000000000000000000000..1f0ac216c1cb07f2543380c89b40133dab674666 --- /dev/null +++ b/aunifiedviewofcganswithandwithoutclassifiers/6eb58224-4c58-472f-a8e8-bb0eb9821793_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:788f78227e69748072ef373d3e400ab347fe25f9cdabc1dd285f1029154948e4 +size 109908 diff --git a/aunifiedviewofcganswithandwithoutclassifiers/6eb58224-4c58-472f-a8e8-bb0eb9821793_origin.pdf b/aunifiedviewofcganswithandwithoutclassifiers/6eb58224-4c58-472f-a8e8-bb0eb9821793_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e0285e6733ddd365561c1c3ccf387ad41cbdd39f --- /dev/null +++ b/aunifiedviewofcganswithandwithoutclassifiers/6eb58224-4c58-472f-a8e8-bb0eb9821793_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:782c3a134f245b2dd9541f0865a76f21467000b3497c08254c4f2f3f8325c037 +size 476634 diff --git a/aunifiedviewofcganswithandwithoutclassifiers/full.md b/aunifiedviewofcganswithandwithoutclassifiers/full.md new file mode 100644 index 0000000000000000000000000000000000000000..7e9de9d40dbeb88c34c05318a419916730c1db5e --- /dev/null +++ b/aunifiedviewofcganswithandwithoutclassifiers/full.md @@ -0,0 +1,448 @@ +# A Unified View of cGANs with and without Classifiers + +Si-An Chen + +National Taiwan University d09922007@csie.ntu.edu.tw + +Chun-Liang Li + +Google Cloud AI chunliang@google.com + +Hsuan-Tien Lin + +National Taiwan University +htlin@csie.ntu.edu.tw + +# Abstract + +Conditional Generative Adversarial Networks (cGANs) are implicit generative models which allow to sample from class-conditional distributions. Existing cGANs are based on a wide range of different discriminator designs and training objectives. One popular design in earlier works is to include a classifier during training with the assumption that good classifiers can help eliminate samples generated with wrong classes. Nevertheless, including classifiers in cGANs often comes with a side effect of only generating easy-to-classify samples. Recently, some representative cGANs avoid the shortcoming and reach state-of-the-art performance without having classifiers. Somehow it remains unanswered whether the classifiers can be resurrected to design better cGANs. In this work, we demonstrate that classifiers can be properly leveraged to improve cGANs. We start by using the decomposition of the joint probability distribution to connect the goals of cGANs and classification as a unified framework. The framework, along with a classic energy model to parameterize distributions, justifies the use of classifiers for cGANs in a principled manner. It explains several popular cGAN variants, such as ACGAN, ProjGAN, and ContraGAN, as special cases with different levels of approximations, which provides a unified view and brings new insights to understanding cGANs. Experimental results demonstrate that the design inspired by the proposed framework outperforms state-of-the-art cGANs on multiple benchmark datasets, especially on the most challenging ImageNet. The code is available at https://github.com/sian-chen/PyTorch-ECGAN. + +# 1 Introduction + +Generative Adversarial Networks [GANs; 10] is a family of generative models that are trained from the duel of a generator and a discriminator. The generator aims to generate data from a target distribution, where the fidelity of the generated data is "screened" by the discriminator. Recent studies on the objectives [2, 37, 29, 25, 36, 26, 38], backbone architectures [41, 50], and regularization techniques [13, 35, 51] for GANs have achieved impressive progress on image generation, making GANs the state-of-the-art approach to generate high fidelity and diverse images [3]. Conditional GANs (cGANs) extend GANs to generate data from class-conditional distributions [33, 39, 34, 16]. The capability of conditional generation extends the application horizon of GANs to conditional image generation based on labels [39] or texts [43], speech enhancement [32], and image style transformation [18, 53]. + +One representative cGAN is Auxiliary Classifier GAN [ACGAN; 39], which decomposes the conditional discriminator to a classifier and an unconditional discriminator. The generator of ACGAN is expected to generate images that convince the unconditional discriminator while being classified to + +the right class. The classifier plays a pivotal role in laying down the law of conditional generation for ACGAN, making it the very first cGAN that can learn to generate 1000 classes of ImageNet images [6]. That is, ACGAN used to be a leading cGAN design. While the classifier in ACGAN indeed improves the quality of conditional generation, deeper studies revealed that the classifier biases the generator to generate easier-to-classify images [45], which in term decreases the capability to match the target distribution. + +Unlike ACGAN, most state-of-the-art cGANs are designed without a classifier. One representative cGAN without a classifier is Projection GAN [ProjGAN; 34], which learns an embedding for each class to form a projection-based conditional discriminator. ProjGAN not only generates higher-quality images than ACGAN, but also accurately generates images in target classes without relying on an explicit classifier. In fact, it was found that ProjGAN usually cannot be further improved by adding a classification loss [34]. The finding, along with the success of ProjGAN and other cGANs without classifiers [15, 4], seem to suggest that including a classifier is not helpful for improving cGANs. + +In this work, we challenge the belief that classifiers are not helpful for cGANs, with the conjecture that leveraging the classifiers appropriately can benefit conditional generation. We propose a framework that pins down the roles of the classifier and the conditional discriminator by first decomposing the joint target distribution with Bayes rule. We then model the conditional discriminator as an energy function, which is an unnormalized log probability. Under the energy function, we derive the corresponding optimization term for the classifier and the conditional discriminator with the help of Fenchel duality to form the unified framework. The framework reveals that a jointly generative model can be trained via two routes, from the aspect of the classifier and the conditional discriminator, respectively. We name our framework Energy-based Conditional Generative Adversarial Networks (ECGAN), which not only justifies the use of classifiers for cGANs in a principled manner, but also explains several popular cGAN variants, such as ACGAN [39], ProjGAN [34], and ContraGAN [16] as special cases with different approximations. After properly combining the objectives from the two routes of the framework, we empirically find that ECGAN outperforms other cGAN variants across different backbone architectures on benchmark datasets, including the most challenging ImageNet. + +We summarize the contributions of this paper as: + +- We justify the principled use of classifiers for cGANs by decomposing the joint distribution. +- We propose a cGAN framework, Energy-based Conditional Generative Adversarial Networks (ECGAN), which explains several popular cGAN variants in a unified view. +- We experimentally demonstrate that ECGAN consistently outperforms other state-of-the-art cGANs across different backbone architectures on benchmark datasets. + +The paper is organized as follows. Section 2 derives the unified framework that establishes the role of the classifiers for cGANs. The framework is used to explain ACGAN [39], ProjGAN [34], and ContraGAN [16] in Section 3. Then, we demonstrate the effectiveness of our framework by experiments in Section 4. We discuss related work in Section 5 before concluding in Section 6. + +# 2 Method + +Given a $K$ -class dataset $(x,y) \sim p_d$ , where $y \in \{1 \dots K\}$ is the class of $x$ and $p_d$ is the underlying data distribution. Our goal is to train a generator $G$ to generate a sample $G(z,y)$ following $p_d(x|y)$ where $z$ is sampled from a known distribution such as $\mathcal{N}(0,1)$ . To solve the problem, a typical cGAN framework can be formulated by extending an unconditional GAN as: + +$$ +\max _ {D} \min _ {G} \sum_ {y} \mathbb {E} _ {p _ {d} (x \mid y)} D (x, y) - \mathbb {E} _ {p (z)} D (G (z, y), y) \tag {1} +$$ + +where $G$ is the generator and $D$ is a discriminator that outputs higher values for real data. The choice of $D$ leads to different types of GANs [10, 2, 29, 8]. + +At first glance, there is no classifier in Eq. (1). However, because of the success of leveraging label information via classification, it is hypothesized that a better classifier can improve conditional generation [39]. Motivated by this, in this section, we show how we bridge classifiers to cGANs by Bayes rule and Fenchel duality. + +# 2.1 Bridge Classifiers to Discriminators with Joint Distribution + +A classifier, when viewed from a probabilistic perspective, is a function that approximates $p_d(y|x)$ , the probability that $x$ belongs to class $y$ . On the other hand, a conditional discriminator, telling whether $x$ is real data in class $y$ , can be viewed as a function approximate $p_d(x|y)$ . To connect $p_d(y|x)$ and $p_d(x|y)$ , an important observation is through the joint probability: + +$$ +\begin{array}{l} \log p (x, y) = \log p (x | y) + \log p (y) (2) \\ = \log p (y | x) + \log p (x). (3) \\ \end{array} +$$ + +The observation illustrates that we can approximate $\log p(x,y)$ in two directions: one containing $p(x|y)$ for conditional discriminators and one containing $p(y|x)$ for classifiers. The finding reveals that by sharing the parameterization, updating the parameters in one direction may optimize the other implicitly. Therefore, we link the classifier to the conditional discriminator by training both objectives jointly. + +# 2.2 Learning Joint Distribution via Optimizing Conditional Discriminators + +Since $p(y)$ is usually known a priori (e.g., uniform) or able to easily estimated (e.g., empirical counting), we focus on learning $p(x|y)$ in Eq.(2). Specifically, since $\log p(x,y) \in \mathbb{R}$ , we parameterize it via $f_{\theta}(x)$ , such as a neural network with $K$ real value outputs, where $\exp(f_{\theta}(x)[y]) \propto p(x,y)$ . Similar parameterization is also used in exponential family [48] and energy based model [23]. Therefore, the log-likelihood $\log p(x|y)$ can be modeled as: + +$$ +\log p _ {\theta} (x \mid y) = \log \left(\frac {\exp \left(f _ {\theta} (x) [ y ]\right)}{Z _ {y} (\theta)}\right) = f _ {\theta} (x) [ y ] - \log Z _ {y} (\theta), \tag {4} +$$ + +where $Z_{y}(\theta) = \int_{x^{\prime}}\exp \left(f_{\theta}(x^{\prime})[y]\right)dx^{\prime}$ + +Optimizing Eq. (4) is challenging because of the intractable partition function $Z_{y}(\theta)$ . Here we introduce the Fenchel duality [48] of the partition function $Z_{y}(\theta)$ : + +$$ +\log Z _ {y} (\theta) = \max _ {q _ {y}} \left[ \underset {q _ {y} (x)} {\mathbb {E}} [ f _ {\theta} (x) [ y ] ] + H (q _ {y}) \right] +$$ + +where $q_{y}$ is a distribution of $x$ conditioned on $y$ and $H(q_{y}) = -\mathbb{E}_{xf \sim q_{y}(x)}[\log q_{y}(x)]$ is the entropy of $q_{y}$ . The derivation is provided in Appendix A. By the Fenchel duality, we obtain our maximum likelihood estimation in Eq. (4) as: + +$$ +\left. \max _ {\theta} \left[ \mathbb {E} _ {p _ {d} (x, y)} [ f _ {\theta} (x) [ y ] ] - \max _ {q _ {y}} \left[ \mathbb {E} _ {q _ {y} (x)} [ f _ {\theta} (x) [ y ] ] + H (q _ {y}) \right] \right]. \right. \tag {5} +$$ + +To approximate the solution of $q_{y}$ , in additional to density models, we can train an auxiliary generator $q_{\phi}$ as in cGANs to estimate $\mathbb{E}_{q_y(x)}$ via sampling. That is, we can sample $x$ from $q_{\phi}$ by $x = q_{\phi}(z,y)$ where $z \sim \mathcal{N}(0,1)$ . The objective (5) then becomes: + +$$ +\max _ {\theta} \min _ {\phi} \sum_ {y} \mathbb {E} _ {p _ {d} (x \mid y)} [ f _ {\theta} (x) [ y ] ] - \mathbb {E} _ {p (z)} [ f _ {\theta} (q _ {\phi} (z, y)) [ y ] ] - H (q _ {\phi} (\cdot , y)), \tag {6} +$$ + +which is almost in the form of Eq (1) except the entropy $H(q_{\phi}(\cdot ,y))$ . We leave the discussion about the entropy estimation in Section 2.4. Currently, the loss function to optimize the objective without the entropy can be formulated as: + +$$ +\mathcal {L} _ {d _ {1}} (x, z, y; \theta) = - f _ {\theta} (x) [ y ] + f _ {\theta} \left(q _ {\phi} (z)\right) [ y ] +$$ + +$$ +\mathcal {L} _ {g _ {1}} (z, y; \phi) = - f _ {\theta} \left(q _ {\phi} (z, y)\right) [ y ] +$$ + +# 2.3 Learning Joint Distributions via Optimizing Unconditional Discriminators & Classifiers + +Following Eq. (3), we can approximate $\log p(x,y)$ by approximating $\log p(y|x)$ and $\log p(x)$ . With our energy function $f_{\theta},p_{\theta}(y|x)$ can be formulated as: + +$$ +p _ {\theta} (y | x) = \frac {p _ {\theta} (x , y)}{p _ {\theta} (x)} = \frac {\exp (f _ {\theta} (x) [ y ])}{\sum_ {y ^ {\prime}} \exp (f _ {\theta} (x) [ y ^ {\prime} ])}, +$$ + +which is equivalent to the $y$ 'th output of $\mathsf{SOFTMAX}(f_{\theta}(x))$ . Therefore, we can maximize the log-likelihood of $p_{\theta}(y|x)$ by considering $f_{\theta}$ as a softmax classifier minimizing the cross-entropy loss: + +$$ +\mathcal {L} _ {\mathrm {c l f}} (x, y; \theta) = - \log (\text {S O F T M A X} (f _ {\theta} (x)) [ y ]) +$$ + +On the other hand, to maximize the log-likelihood of $p(x)$ , we introduce a reparameterization $h_{\theta}(x) = \log \sum_y \exp(f_{\theta}(x)[y])$ : + +$$ +\begin{array}{l} \log p _ {\theta} (x) = \log \left(\sum_ {y} p _ {\theta} (x, y)\right) = \log \left(\sum_ {y} \frac {\exp (f _ {\theta} (x) [ y ])}{\int_ {x ^ {\prime}} \sum_ {y ^ {\prime}} \exp (f _ {\theta} (x ^ {\prime}) [ y ^ {\prime} ]) d x ^ {\prime}}\right) \\ = \log \left(\frac {\exp (\log (\sum_ {y} \exp (f _ {\theta} (x) [ y ])))}{\int_ {x ^ {\prime}} \exp (\log (\sum_ {y ^ {\prime}} \exp (f _ {\theta} (x ^ {\prime}) [ y ^ {\prime} ]))) d x ^ {\prime}}\right) = \log \left(\frac {\exp (h _ {\theta} (x))}{\int_ {x ^ {\prime}} \exp (h _ {\theta} (x ^ {\prime})) d x ^ {\prime}}\right) \\ = h _ {\theta} (x) - \log \left(Z ^ {\prime} (\theta)\right), \tag {7} \\ \end{array} +$$ + +where $Z^{\prime}(\theta) = \int_{x}\exp (h_{\theta}(x))dx$ . Similar to Eq. (5), we can rewrite $\log Z^{\prime}(\theta)$ by its Fenchel duality: + +$$ +\log Z ^ {\prime} (\theta) = \max _ {q} \left[ \mathbb {E} _ {q (x)} [ h _ {\theta} (x) ] + H (q) \right] \tag {8} +$$ + +where $q$ is a distribution of $x$ and $H(q)$ is the entropy of $q$ . + +Combining Eq. (7) and Eq. (8) and reusing the generator in Section 2.2, we obtain the optimization problem: + +$$ +\max _ {\theta} \min _ {\phi} \mathbb {E} _ {p _ {d} (x, y)} [ h _ {\theta} (x) ] - \mathbb {E} _ {p (z)} [ h _ {\theta} (q _ {\phi} (z, y)) ] - H (q _ {\phi}) \tag {9} +$$ + +Similar to Eq. (6), the objective of the unconditional discriminator is equivalent to typical GANs augmented with an entropy term. The loss function without considering the entropy can be formulated as: + +$$ +\begin{array}{l} \mathcal {L} _ {d _ {2}} (x, z, y; \theta) = - h _ {\theta} (x) + h _ {\theta} \left(q _ {\phi} (z)\right) \\ \mathcal {L} _ {g _ {2}} (z, y; \phi) = - h _ {\theta} \left(q _ {\phi} (z, y)\right) \\ \end{array} +$$ + +# 2.4 Entropy Approximation in cGANs + +In Section 2.2 and Section 2.3, we propose two approaches to train cGANs with and without classification. Unsolved problems in Eq. (6) and Eq. (9) are the entropy terms $H(q_{\phi}(\cdot ,y))$ and $H(q_{\phi})$ . In previous work, various estimators have been proposed to estimate entropy or its gradient [46, 42, 21, 27]. One can freely choose any approach to estimate the entropy in the proposed framework. In this work, we consider two entropy estimators, and we will show how they connect with existing cGANs. + +The first approach is the naive constant approximation. Since entropy is always non-negative, we naturally have the constant zero as a lower bound. Therefore, we can maximize the objective by replacing the entropy term with its lower bound, which is zero in this case. This approach is simple but we will show its effectiveness in Section 4 and how it links our framework to ProjGAN and ContraGAN in Section 3. + +The second approach is estimating a variational lower bound. Informally, given a batch of data $\{(x_1,y_1),\ldots ,(x_m,y_m)\}$ , an encoder function $l$ , and a class embedding function $e(y)$ , the negative 2C loss used in ContraGAN [16], + +$$ +\mathcal {L} _ {C} \left(x _ {i}, y _ {i}; t\right) = \log \left(\frac {d \left(l \left(x _ {i}\right) , e \left(y _ {i}\right)\right) + \sum_ {k = 1} ^ {m} \llbracket y _ {k} = y _ {i} \rrbracket d \left(l \left(x _ {i}\right) , l \left(x _ {k}\right)\right)}{d \left(l \left(x _ {i}\right) , e \left(y _ {i}\right)\right) + \sum_ {k = 1} ^ {m} \llbracket k \neq i \rrbracket d \left(l \left(x _ {i}\right) , (l x _ {k})\right)}\right), \tag {10} +$$ + +is an empirical estimate of a proper lower bound of $H(X)$ [40], where $d(a, b) = \exp(a^\top b / t)$ is a distance function with a temperature $t$ . We provide the proof in Appendix B. + +The 2C loss heavily relies on the embeddings $l(x)$ and $e(y)$ . Although we only need to estimate the entropy of generated data in Eq. (6) and Eq. (9), we still rely on true data to learn the embeddings in + +![](images/023483099121ed0cbd5474c95b802b884e1b45ebf0c0226d004bc808cd0b1f70.jpg) +Figure 1: The discriminator's design of ECGAN. $D_{1}$ can be any network backbone such as DCGAN, ResGAN, BigGAN. $D_{2}$ is a linear layer with $K$ outputs, where $K$ is the number of classes. + +Softmax CE Loss: $\mathcal{L}_{\mathrm{clf}}$ + +Cond. Adv. Loss: $\mathcal{L}_{d_1},\mathcal{L}_{g_1}$ + +Uncond. Adv. Loss: $\mathcal{L}_{d_2},\mathcal{L}_{g_2}$ + +Contrastive Loss: $\mathcal{L}_C^{\mathrm{real}}$ , $\mathcal{L}_C^{\mathrm{fake}}$ + +practice. Therefore, the loss function of Eq. (6) can be written as: + +$$ +\mathcal {L} _ {D _ {1}} (x, z, y; \theta) = \mathcal {L} _ {d _ {1}} (x, z, y; \theta) + \lambda_ {c} \mathcal {L} _ {C} ^ {\text {r e a l}} +$$ + +$$ +\mathcal {L} _ {G _ {1}} (z, y; \phi) = \mathcal {L} _ {g _ {1}} (x, y; \phi) + \lambda_ {c} \mathcal {L} _ {C} ^ {\mathrm {f a k e}}, +$$ + +where $\lambda_{c}$ is a hyperparameter controlling the weight of the contrastive loss, and $\mathcal{L}_C^{\mathrm{real}}$ , $\mathcal{L}_C^{\mathrm{fake}}$ are the contrastive loss calculated on a batch of real data and generated data respectively. + +Similarly, the loss function of Eq. (9) becomes: + +$$ +\mathcal {L} _ {D _ {2}} (x, z, y; \theta) = \mathcal {L} _ {d _ {2}} (x, z, y; \theta) + \lambda_ {c} \mathcal {L} _ {C} ^ {\text {r e a l}} +$$ + +$$ +\mathcal {L} _ {G _ {2}} (z, y; \phi) = \mathcal {L} _ {g _ {2}} (x, y; \phi) + \lambda_ {c} \mathcal {L} _ {C} ^ {\mathrm {f a k e}}, +$$ + +The introduction of 2C loss allows us to accommodate ContraGAN into our framework. + +# 2.5 Energy-based Conditional Generative Adversarial Network + +Previous work has shown that multitask training benefits representation learning [30] and training discriminative and generative models jointly outperforms their purely generative or purely discriminative counterparts [11, 28]. Therefore, we propose a framework named Energy-based Conditional Generative Adversarial Network (ECGAN), which combines the two approaches in Section 2.2 and Section 2.3 to learn the joint distribution better. The loss function can be summarized as: + +$$ +\mathcal {L} _ {D} (x, z, y; \theta) = \mathcal {L} _ {d _ {1}} (x, z, y; \theta) + \alpha \mathcal {L} _ {d _ {2}} (x, z, y; \theta) + \lambda_ {c} \mathcal {L} _ {C} ^ {\text {r e a l}} + \lambda_ {\text {e l f}} \mathcal {L} _ {\text {e l f}} (x, y; \theta) \tag {11} +$$ + +$$ +\mathcal {L} _ {G} (z, y; \phi) = \mathcal {L} _ {g _ {1}} (z, y; \phi) + \alpha \mathcal {L} _ {g _ {2}} (z, y; \phi) + \lambda_ {c} \mathcal {L} _ {C} ^ {\text {f a k e}} \tag {12} +$$ + +where $\alpha$ is a weight parameter for the unconditional GAN loss. The discriminator's design is illustrated in Fig 1. + +Here we discuss the intuition of the mechanisms behind each component in Eq. (11). $\mathcal{L}_{d_1}$ is a loss function for conditional discriminator. It updates the $y$ -th output when given a data pair $(x,y)$ . $\mathcal{L}_{d_2}$ guides to an unconditional discriminator. It updates all outputs according to whether $x$ is real. $\mathcal{L}_{\mathrm{clf}}$ learns a classifier. It increases the $y$ -th output and decreases the other outputs for data belonging to class $y$ . Finally, $\mathcal{L}_C^{real}$ and $\mathcal{L}_C^{fake}$ play the roles to improve the latent embeddings by pulling the embeddings of data with the same class closer. + +Previously, we derive the loss functions $\mathcal{L}_{d_1}$ and $\mathcal{L}_{d_2}$ as the loss in Wasserstein GAN [2]. In practice, we use the hinge loss as proposed in Geometric GAN [26] for better stability and convergence. We use the following combination of $\mathcal{L}_{d_1}$ and $\mathcal{L}_{d_2}$ : + +$$ +\operatorname {H i n g e} \left(f _ {\theta} \left(x _ {\text {r e a l}}, y\right) + \alpha \cdot h _ {\theta} \left(x _ {\text {r e a l}}\right), f _ {\theta} \left(x _ {\text {f a k e}}, y\right) + \alpha \cdot h _ {\theta} \left(x _ {\text {f a k e}}\right)\right). \tag {13} +$$ + +For more discussion of the implementation of hinge loss, please check Appendix C. The overall training procedure of ECGAN is presented in Appendix E. + +# 3 Accommodation to Existing cGANs + +In this section, we show that our framework covers several representative cGAN algorithms, including ACGAN [39], ProjGAN [35], and ContraGAN [16]. Through the ECGAN framework, we obtain a unified view of cGANs, which allows us to fairly compare and understand the pros and cons of existing cGANs. We name the ECGAN counterparts ECGAN-0, ECGAN-C, and ECGAN-E, corresponding to ProjGAN, ACGAN, and ContraGAN, respectively. We summarize the settings in Table 1 and illustrate the discriminator designs in Appendix F. + +
Existing cGANECGAN Counterpartαλcfλc
ProjGANECGAN-0000
ACGANECGAN-C0>00
ContraGANECGAN-E00>0
+ +Table 1: A summary of cGANs and their closest ECGAN counterpart. + +# 3.1 ProjGAN + +ProjGAN [34] is the most representative cGAN design that is commonly used in state-of-the-art research [3, 50]. Let the output of the penultimate layer in the discriminator be $g(x)$ . The output of ProjGAN's discriminator is: + +$$ +D (x, y) = w _ {u} ^ {T} g (x) + b _ {u} + w _ {y} ^ {T} g (x) = \left(w _ {u} + w _ {y}\right) ^ {T} g (x) + b _ {u} \tag {14} +$$ + +where $w_{u}, b_{u}$ are the parameters for the unconditional linear layer, and $w_{y}$ is the class embedding of $y$ . On the other hand, the output of a discriminator in ECGAN is: + +$$ +D (x, y) = f (x) [ y ] = \left(\mathbf {W} ^ {T} g (x) + \mathbf {b}\right) [ y ] = w _ {y} ^ {T} g (x) + b _ {y} \tag {15} +$$ + +where $\mathbf{W}$ , $\mathbf{b}$ are the parameters of the linear output layer in $f_{\theta}$ . As shown in Eq. (14) and Eq. (15), the architectures of ProjGAN and ECGAN are almost equivalent. In addition, the loss function of ProjGAN can be formulated as: + +$$ +\mathcal {L} _ {G} = - D (G (z), y) +$$ + +$$ +\mathcal {L} _ {D} = - D (x, y) + D (G (z), y), +$$ + +which is a special case of ECGAN while $\alpha = \lambda_c = \lambda_{\mathrm{clf}} = 0$ . We name this case ECGAN-0, which is the simplest version of ECGAN. Compared with ProjGAN, ECGAN-0 has additional bias terms for the output of each class. + +# 3.2 ACGAN + +ACGAN [39] is the most well-known cGAN algorithm that leverages a classifier to achieve conditional generation. Given a $K$ -class dataset, the discriminator of ACGAN is parameterized by a network with $K + 1$ outputs. The first output, denoted as $D(x)$ , is an unconditional discriminator distinguishing between real and fake images. The remaining $K$ outputs, denoted as $C(x)$ , is a classifier that predicts logits for every class. The loss function of ACGAN can be formulated as: + +$$ +\mathcal {L} _ {G} = - D (G (z)) + \lambda_ {g} \mathcal {L} _ {\operatorname {c l f}} (G (z), y; C) +$$ + +$$ +\mathcal {L} _ {D} = - D (x) + D (G (z)) + \lambda_ {d} (\mathcal {L} _ {\mathrm {c l f}} (x, y; C) + \mathcal {L} _ {\mathrm {c l f}} (G (z), y; C)) +$$ + +where $G$ is the generator, $\lambda_{g}$ and $\lambda_{d}$ are hyperparameters to control the weight of cross-entropy loss. + +The formulation of ACGAN is similar to our ECGAN when $\alpha = \lambda_c = 0$ and $\lambda_{\mathrm{clf}} > 0$ . We call the special case as ECGAN-C, with a suffix 'C' for classification loss. ECGAN-C uses a conditional discriminator which plays the role of a classifier at the same time. Hence the generator in ECGAN-C learns from the conditional discriminator rather than the cross-entropy loss which is biased for generative objectives. + +
Dataset# training# test# classesResolution# training data per class
CIFAR-1050,00010,0001032 × 325,000
Tiny ImageNet100,00010,00020064 × 64500
ImageNet1,281,16750,0001,000128 × 1281,281
+ +Table 2: Datasets for evaluation. + +# 3.3 ContraGAN + +ContraGAN [16] proposed 2C loss, which we mentioned in Eq. (10), to capture the data-to-data relationship and data-to-label relationship. The 2C loss is applied in both discriminator and generator to achieve conditional generation. That is: + +$$ +\mathcal {L} _ {G} = - D (G (z), y) + \lambda_ {c} \mathcal {L} _ {C} ^ {\mathrm {f a k e}} +$$ + +$$ +\mathcal {L} _ {D} = - D (x, y) + D (G (z), y) + \lambda_ {c} \mathcal {L} _ {C} ^ {\mathrm {r e a l}} +$$ + +The loss functions are similar to ones in ECGAN with $\alpha = \lambda_{\mathrm{clf}} = 0$ and $\lambda_c > 0$ . We call it ECGAN-E, where 'E' means entropy estimation. The main difference between ContraGAN and ECGAN-E is the output layer of their discriminators. While ContraGAN uses a single-output network, ECGAN uses a $K$ -output network $f_{\theta}$ which has higher capacity. + +We keep Eq. (11) and Eq. (12) as simple as possible to reduce the burden of hyperparameter tuning. Under the simple equations of the current framework, ECGAN-C and ECGAN-E are the closest counterparts to ACGAN and ContraGAN. The subtle difference (in addition to the underlying network architecture) is that ACGAN uses $\mathcal{L}_{d_2}$ instead of $\mathcal{L}_{d_1}$ (ECGAN-C); ContraGAN uses $\mathcal{L}_{d_2},\mathcal{L}_{g_2}$ instead of $\mathcal{L}_{d_1},\mathcal{L}_{g_1}$ (ECGAN-E). One future direction is to introduce more hyperparameters in Eq. (11) and Eq. (12) to get closer counterparts. + +# 4 Experiment + +We conduct our experiments on CIFAR-10 [20] and Tiny ImageNet [22] for analysis, and ImageNet [6] for large-scale empirical study. Table 2 shows the statistics of the datasets. All datasets are publicly available for research use. They were not constructed for human-related study. We do not specifically take any personal information from the datasets in our experiments. + +In our experiment, we use two common metrics, Frechet Inception Distance [FID; 14] and Inception Score [IS; 44], to evaluate our generation quality and diversity. Besides, we use Intra-FID, which is the average of FID for each class, to evaluate the performance of conditional generation. + +# 4.1 Experimental Setup + +We use StudioGAN [16] to conduct our experiments. StudioGAN is a PyTorch-based project distributed under the MIT license that provides implementation and benchmark of several popular GAN architectures and techniques. To provide reliable evaluation, we conduct experiments on CIFAR-10 and Tiny ImageNet with 4 different random seeds and report the means and standard deviations for each metric. We evaluate the model with the lowest FID for each trial. The default backbone architecture is BigGAN [3]. We fix the learning rate for generators and discriminators to 0.0001 and 0.0004, respectively, and tune $\lambda_{\mathrm{clf}}$ in $\{1,0.1,0.05,0.01\}$ . We follow the setting $\lambda_c = 1$ in [16] when using 2C loss, and set $\alpha = 1$ when applying unconditional GAN loss. The experiments take 1-2 days on single GPU (Nvidia Tesla V100) machines for CIFAR-10, Tiny ImageNet, and take 6 days on 8-GPU machines for ImageNet. More details are described in Appendix D. + +# 4.2 Ablation Study + +We start our empirical studies by investigating the effectiveness of each component in ECGAN. We use symbols 'U' to represent unconditional GAN loss, 'C' to represent classification loss, and 'E' + +
DatasetECGAN VariantFID (↓)IS (↑)Intra-FID (↓)
CIFAR-10ECGAN-08.049 ± 0.0929.759 ± 0.06141.708 ± 0.278
ECGAN-U7.915 ± 0.0959.967 ± 0.07841.430 ± 0.326
ECGAN-C7.996 ± 0.1209.870 ± 0.15741.715 ± 0.307
ECGAN-UC7.942 ± 0.04110.002 ± 0.12041.425 ± 0.221
ECGAN-UCE8.039 ± 0.1619.898 ± 0.06441.371 ± 0.278
Tiny ImageNetECGAN-024.077 ± 1.66016.173 ± 0.671214.811 ± 3.627
ECGAN-U20.876 ± 1.65115.318 ± 1.148215.117 ± 7.034
ECGAN-C24.853 ± 3.90216.554 ± 1.500212.661 ± 8.135
ECGAN-UC18.919 ± 0.77418.442 ± 1.036203.373 ± 5.101
ECGAN-UCE24.728 ± 0.97417.935 ± 0.619209.547 ± 1.968
+ +Table 3: Ablation study of ECGAN on CIFAR-10 and Tiny ImageNet. ECGAN-0 means the vanilla version of ECGAN where $\alpha = \lambda_{\mathrm{clf}} = \lambda_c = 0$ . The label U stands for unconditional gain loss ( $\alpha > 0$ ). C means classification loss ( $\lambda_{\mathrm{clf}} > 0$ ). E means entropy estimation loss via contrastive learning ( $\lambda_c > 0$ ). + +to represent entropy estimation loss, which is 2C loss in our implementation. The concatenation of the symbols indicates the combination of losses. For example, ECGAN-UC means ECGAN with both unconditional GAN loss and classification loss ( $\alpha > 0$ and $\lambda_{\mathrm{clf}} > 0$ ). Table 3 shows the results of ECGAN from the simplest ECGAN-0 to the most complicated ECGAN-UCE. On CIFAR-10, ECGAN-0 already achieves decent results. Adding unconditional loss, classification loss, or contrastive loss provides slightly better or on-par performance. On the harder Tiny Imagenet, the benefit of unconditional loss and classification loss becomes more significant. While ECGAN-U already shows advantages to ECGAN-0, adding classification loss to ECGAN-U further improves all metrics considerably. We also observe that directly adding classification loss is not sufficient to improve cGAN, which is consistent to the finding in [34]. The fact reveals that the unconditional GAN loss is a crucial component to bridge classifiers and discriminators in cGANs. We also find that adding contrastive loss does not improve ECGAN-UC. An explanation is that the entropy estimation lower bound provided by the contrastive loss is too loose to benefit the training. Furthermore, the additional parameters introduced by 2C loss make the optimization problem more complicated. As a result, we use the combination ECGAN-UC as the default option of ECGAN in the following experiments. + +# 4.3 Comparison with Existing cGANs + +We compare ECGAN to several representative cGANs including ACGAN [39], ProjGAN [34], and ContraGAN [16], with three representative backbone architectures: DCGAN [41], ResNet [13], and BigGAN [3]. Table 4 compares the results of each combinations of cGAN algorithms and backbone architectures. The results show that ECGAN-UC outperforms other cGANs significantly with all backbone architectures on both CIFAR-10 and Tiny ImageNet. We also noticed that ContraGAN, though achieves decent image quality and diversity, learns a conditional generator that interchanges some classes while generating, hence has low Intra-FID. Overall, the experiment indicates that ECGAN-UC can be a preferred choice for cGAN in general situations. + +# 4.4 Comparisons between Existing cGANs and their ECGAN Counterpart + +Table 5 compares ProjGAN, ContraGAN, ACGAN to their ECGAN counterparts. As we described in Section 3, each of these representative cGANs can be viewed as special cases under our ECGAN framework. As mentioned in Section 3, ECGAN-0 has additional bias terms in the output layer compared to ProjGAN. The results in Table 5 show that the subtle difference still brings significant improvement to the generation quality, especially on the harder Tiny ImageNet. + +Compared to ContraGAN, ECGAN-E has the same loss but different design in the discriminator's output layer. While the discriminator of ContraGAN has only single output, ECGAN-E has multiple outputs for every class. The difference makes ECGAN-E solve the label mismatching problem of ContraGAN mentioned in Section 4.3 and benefits generation on CIFAR-10, but does not work well on Tiny ImageNet. It is probably because of the scarcity of training data in each class in Tiny ImageNet. Only 50 data are available for updating the parameters corresponding to each class. + +
DatasetBackbonemethodFID (↓)IS (↑)Intra-FID (↓)
CIFAR-10DCGANACGAN32.507 ± 2.1747.621 ± 0.088129.603 ± 1.212
ProjGAN21.918 ± 1.5808.095 ± 0.18568.164 ± 2.055
ContraGAN28.310 ± 1.7617.637 ± 0.125153.730 ± 9.965
ECGAN-UC18.035 ± 0.7888.487 ± 0.13159.343 ± 1.557
ResGANACGAN10.073 ± 0.2749.512 ± 0.05048.464 ± 0.716
ProjGAN10.195 ± 0.2039.268 ± 0.13946.598 ± 0.070
ContraGAN10.551 ± 0.9769.087 ± 0.228138.944 ± 12.582
ECGAN-UC9.244 ± 0.0629.651 ± 0.09843.876 ± 0.384
BigGANACGAN8.615 ± 0.1469.742 ± 0.04145.243 ± 0.129
ProjGAN8.145 ± 0.1569.840 ± 0.08042.110 ± 0.405
ContraGAN8.617 ± 0.6719.679 ± 0.210114.602 ± 13.261
ECGAN-UC7.942 ± 0.04110.002 ± 0.12041.425 ± 0.221
Tiny ImageNetBigGANACGAN29.528 ± 4.61212.964 ± 0.770315.408 ± 1.171
ProjGAN28.451 ± 2.24212.213 ± 0.624242.332 ± 11.447
ContraGAN24.915 ± 1.22213.445 ± 0.371257.657 ± 3.246
ECGAN-UC18.780 ± 1.29117.475 ± 1.052204.830 ± 5.648
+ +Table 4: Comparison between cGAN variants with different backbone architectures on CIFAR-10 and Tiny ImageNet + +
DatasetmethodFID (↓)IS (↑)Intra-FID (↓)
CIFAR-10ProjGAN8.145 ± 0.1569.840 ± 0.08042.110 ± 0.405
ECGAN-08.049 ± 0.0929.759 ± 0.06141.708 ± 0.278
ContraGAN8.617 ± 0.6719.679 ± 0.210114.602 ± 13.261
ECGAN-E8.038 ± 0.1029.876 ± 0.03641.155 ± 0.277
ACGAN8.615 ± 0.1469.742 ± 0.04145.243 ± 0.129
ECGAN-C8.102 ± 0.0399.980 ± 0.09341.109 ± 0.273
Tiny ImageNetProjGAN28.451 ± 2.24212.213 ± 0.624242.332 ± 11.447
ECGAN-024.077 ± 1.66016.173 ± 0.671214.811 ± 3.627
ContraGAN24.915 ± 1.22213.445 ± 0.371257.657 ± 3.246
ECGAN-E38.270 ± 1.17412.576 ± 0.405239.184 ± 2.628
ACGAN29.528 ± 4.61212.964 ± 0.770315.408 ± 1.171
ECGAN-C24.853 ± 3.90216.554 ± 1.500212.661 ± 8.135
+ +Table 5: Compare between representative cGANs and their ECGAN counterparts. + +Last, we compare ECGAN-C to ACGAN. Both of them optimize a GAN loss and a classification loss. However, ECGAN-C combines the discriminator and the classifier, so the generator can directly optimize cGAN loss rather than the classification loss. As a result, ECGAN-C demonstrates better performance on both CIFAR-10 and Tiny ImageNet. In sum, the comparisons show that through the unified view provided by ECGAN, we can improve the existing methods with minimal modifications. + +# 4.5 Evaluation on ImageNet + +We compare our ECGAN-UC and ECGAN-UCE with BigGAN [3] and ContraGAN [16] on ImageNet. We follow all configurations of BigGAN with batch size 256 in StudioGAN. The numbers in Table 6 are reported after 200,000 training steps if not specified. The results show that ECGAN-UCE outperforms other cGANs dramatically. The comparison between ECGAN-UC and ECGAN-UCE indicates that the 2C loss brings more significant improvement in the ECGAN framework than in ContraGAN. The proposed ECGAN-UCE achieves 8.49 FID and 80.69 inception score. To the best of our knowledge, this is a state-of-the-art result of GANs with batch size 256 on ImageNet. Selected generated images are shown in Appendix G. + +# 5 Related Work + +The development of cGANs started from feeding label embeddings to the inputs of GANs or the feature vector at some middle layer [33, 7]. To improve the generation quality, ACGAN [39] proposes to leverage classifiers and successfully generates high-resolution images. The use of classifiers + +
MethodFID(↓)IS(↑)
BigGAN*24.6828.63
ContraGAN*25.1625.25
ECGAN-UC30.0526.47
ECGAN-UCE12.1656.33
ECGAN-UCE (400k step)8.4980.69
+ +Table 6: Evaluation on ImageNet ${128} \times {128}$ . (*: Reported by StudioGAN.) + +in GANs is studied in Triple GAN [24] for semi-supervised learning and Triangle GAN [9] for cross-domain distribution matching. However, Shu [45] and Miyato and Koyama [34] pointed out that the auxiliary classifier in ACGAN misleads the generator to generate images that are easier to be classified. Thus, whether classifiers can help conditional generation still remains questionable. + +In this work, we connect cGANs with and without classifiers via an energy model parameterization from the joint probability perspective. [12] use similar ideas but focus on sampling from the trained classifier via Markov Chain Monte Carlo [MCMC; 1]. Our work is also similar to a concurrent work [11], which improves [12] by introducing Fenchel duality to replace computationally-intensive MCMC. They use a variational approach [19] to formulate the objective for tractable entropy estimation. In contrast, we study the GAN perspective and the entropy estimation via contrastive learning. Therefore, the proposed ECGAN can be treated as complements works compared with [12, 11] by studying a GAN perspective. We note that the studied cGAN approaches also result in better generation quality than its variational alternative [11]. + +Last, [5] study the connection between exponential family and unconditional GANs. Different from [5], we study the conditional GANs with the focus to provide a unified view of common cGANs and an insight into the role of classifiers in cGANs. + +# 6 Conclusion + +In this work, we present a general framework Energy-based Conditional Generative Networks (ECGAN) to train cGANs with classifiers. With the framework, we can explain representative cGANs, including ACGAN, ProjGAN, and ContraGAN, in a unified view. The experiments demonstrate that ECGAN outperforms state-of-the-art cGANs on benchmark datasets, especially on the most challenging ImageNet. Further investigation can be conducted to find a better entropy approximation or improve cGANs by advanced techniques for classifiers. We hope this work can pave the way to more advanced cGAN algorithms in the future. + +# 7 Limitations and Potential Negative Impacts + +There are two main limitations in the current study. One is the investigation on ImageNet. Ideally, more experiments and analysis on ImageNet can further strengthen the contribution. But training with such a large dataset is barely affordable for our computational resource, and we can only resort to the conclusive findings in the current results. The other limitation is whether the metrics such as FID truly reflect generation quality, but this limitation is considered an open problem to the community anyway. + +As with any work on generative models, there is a potential risk of the proposed model being misused to create malicious content, much like how misused technology can be used to forge bills. In this sense, more anti-forgery methods will be needed to mitigate the misuse in the future. + +# Acknowledgement + +We thank the anonymous reviewers for valuable suggestions. This work is partially supported by the Ministry of Science and Technology of Taiwan via the grants MOST 107-2628-E-002-008-MY3 and 110-2628-E-002-013. We also thank the National Center for High-performance Computing (NCHC) of National Applied Research Laboratories (NARLabs) in Taiwan for providing computational resources. + +# References + +[1] Christophe Andrieu, Nando De Freitas, Arnaud Doucet, and Michael I Jordan. An introduction to mcmc for machine learning. Machine learning, 50(1):5-43, 2003. 10 +[2] Martín Arjovsky, Soumith Chintala, and Léon Bottou. Wasserstein GAN. CoRR, abs/1701.07875, 2017. 1, 2, 5, 15 +[3] Andrew Brock, Jeff Donahue, and Karen Simonyan. Large scale GAN training for high fidelity natural image synthesis. In ICLR, 2019. 1, 6, 7, 8, 9 +[4] Grigorios G. Chrysos, Jean Kossaifi, and Stefanos Zafeiriou. Rocgan: Robust conditional GAN. Int. J. Comput. Vis., 128(10):2665-2683, 2020. 2 +[5] Bo Dai, Zhen Liu, Hanjun Dai, Niao He, Arthur Gretton, Le Song, and Dale Schuurmans. Exponential family estimation via adversarial dynamics embedding. In NeurIPS, 2019. 10 +[6] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, 2009. 2, 7 +[7] Emily L. Denton, Soumith Chintala, Arthur Szlam, and Rob Fergus. Deep generative image models using a laplacian pyramid of adversarial networks. In NeurIPS, 2015. 9 +[8] William Fedus, Mihaela Rosca, Balaji Lakshminarayanan, Andrew M. Dai, Shakir Mohamed, and Ian J. Goodfellow. Many paths to equilibrium: Gans do not need to decrease a divergence at every step. In ICLR, 2018. 2 +[9] Zhe Gan, Liquin Chen, Weiyao Wang, Yunchen Pu, Yizhe Zhang, Hao Liu, Chunyuan Li, and Lawrence Carin. Triangle generative adversarial networks. In NeurIPS, 2017. 10 +[10] Ian J Goodfellow, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. Generative adversarial networks. CoRR, abs/1406.2661, 2014. 1, 2 +[11] Will Grathwohl, Jacob Kelly, Milad Hashemi, Mohammad Norouzi, Kevin Swersky, and David Duvenaud. No MCMC for me: Amortized sampling for fast and stable training of energy-based models. CoRR, abs/2010.04230, 2020. 5, 10 +[12] Will Grathwohl, Kuan-Chieh Wang, Jorn-Henrik Jacobsen, David Duvenaud, Mohammad Norouzi, and Kevin Swersky. Your classifier is secretly an energy based model and you should treat it like one. In ICLR, 2020. 10 +[13] Ishaan Gulrajani, Faruk Ahmed, Martín Arjovsky, Vincent Dumoulin, and Aaron C. Courville. Improved training of wasserstein gans. In NeurIPS, 2017. 1, 8 +[14] 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. In NeurIPS, 2017. 7 +[15] Mingqi Hu, Deyu Zhou, and Yulan He. Variational conditional GAN for fine-grained controllable image generation. In ACML, 2019. 2 +[16] Minguk Kang and Jaesik Park. Contragan: Contrastive learning for conditional image generation. In NeurIPS, 2020. 1, 2, 4, 6, 7, 8, 9, 15, 16 +[17] Tero Karras, Timo Aila, Samuli Laine, and Jaakko Lehtinen. Progressive growing of gans for improved quality, stability, and variation. In ICLR, 2018. 16 +[18] Taeksoo Kim, Moonsu Cha, Hyunsoo Kim, Jung Kwon Lee, and Jiwon Kim. Learning to discover cross-domain relations with generative adversarial networks. In ICML, 2017. 1 +[19] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In ICLR, 2015. 10, 16 +[20] Alex Krizhevsky et al. Learning multiple layers of features from tiny images. 2009. 7 + +[21] Rithesh Kumar, Anirudh Goyal, Aaron C. Courville, and Yoshua Bengio. Maximum entropy generators for energy-based models. CoRR, abs/1901.08508, 2019. 4 +[22] Ya Le and Xuan Yang. Tiny imagenet visual recognition challenge. CS 231N, 7:7, 2015. 7 +[23] Yann LeCun, Sumit Chopra, Raia Hadsell, M Ranzato, and F Huang. A tutorial on energy-based learning. 2006. 3 +[24] Chongxuan Li, Taufik Xu, Jun Zhu, and Bo Zhang. Triple generative adversarial nets. In NeurIPS, 2017. 10 +[25] Chun-Liang Li, Wei-Cheng Chang, Yu Cheng, Yiming Yang, and Barnabás Póczos. MMD GAN: towards deeper understanding of moment matching network. In NeurIPS, 2017. 1 +[26] Jae Hyun Lim and Jong Chul Ye. Geometric GAN. CoRR, abs/1705.02894, 2017. 1, 5, 15, 16 +[27] Jae Hyun Lim, Aaron C. Courville, Christopher J. Pal, and Chin-Wei Huang. AR-DAE: towards unbiased neural entropy gradient estimation. In ICML, 2020. 4 +[28] Hao Liu and Pieter Abbeel. Hybrid discriminative-generative training via contrastive learning. CoRR, abs/2007.09070, 2020. 5 +[29] Xudong Mao, Qing Li, Haoran Xie, Raymond Y. K. Lau, Zhen Wang, and Stephen Paul Smolley. Least squares generative adversarial networks. In ICCV, 2017. 1, 2 +[30] Andreas Maurer, Massimiliano Pontil, and Bernardino Romera-Paredes. The benefit of multitask representation learning. JMLR, 17:81:1-81:32, 2016. 5 +[31] Lars M. Mescheder, Andreas Geiger, and Sebastian Nowozin. Which training methods for gans do actually converge? In ICML, 2018. 16 +[32] Daniel Michelsanti and Zheng-Hua Tan. Conditional generative adversarial networks for speech enhancement and noise-robust speaker verification. In Interspeech, 2017. 1 +[33] Mehdi Mirza and Simon Osindero. Conditional generative adversarial nets. CoRR, abs/1411.1784, 2014. 1, 9 +[34] Takeru Miyato and Masanori Koyama. cgans with projection discriminator. In ICLR, 2018. 1, 2, 6, 8, 10 +[35] Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. In ICLR, 2018. 1, 6, 16 +[36] Youssef Mroueh and Tom Sercu. Fisher gan. In NeurIPS, 2017. 1 +[37] Youssef Mroueh, Tom Sercu, and Vaibhava Goel. Mcgan: Mean and covariance feature matching gan. In ICML, 2017. 1 +[38] Youssef Mroueh, Chun-Liang Li, Tom Sercu, Anant Raj, and Yu Cheng. Sobolev gan. In ICLR, 2018. 1 +[39] Augustus Odena, Christopher Olah, and Jonathon Shlens. Conditional image synthesis with auxiliary classifier gans. In Doina Precup and Yee Whye Teh, editors, ICML, 2017. 1, 2, 6, 8, 9 +[40] Ben Poole, Sherjil Ozair, Aäron van den Oord, Alex Alemi, and George Tucker. On variational bounds of mutual information. In Kamalika Chaudhuri and Ruslan Salakhutdinov, editors, ICML, 2019. 4, 15 +[41] Alec Radford, Luke Metz, and Soumith Chintala. Unsupervised representation learning with deep convolutional generative adversarial networks. In ICLR, 2016. 1, 8 +[42] Rajesh Ranganath, Dustin Tran, and David M. Blei. Hierarchical variational models. In ICML, 2016. 4 +[43] Scott E. Reed, Zeynep Akata, Xinchen Yan, Lajanugen Logeswaran, Bernt Schiele, and Honglak Lee. Generative adversarial text to image synthesis. In ICML, 2016. 1 + +[44] Tim Salimans, Ian J. Goodfellow, Wojciech Zaremba, Vicki Cheung, Alec Radford, and Xi Chen. Improved techniques for training gans. In NeurIPS, 2016. 7 +[45] Rui Shu. Ac-gan learns a biased distribution. 2017. 2, 10 +[46] Shashank Singh and Barnabás Póczos. Analysis of k-nearest neighbor distances with application to entropy estimation. CoRR, abs/1603.08578, 2016. 4 +[47] Aäron van den Oord, Yazhe Li, and Oriol Vinyals. Representation learning with contrastive predictive coding. CoRR, abs/1807.03748, 2018. 15 +[48] Martin J. Wainwright and Michael I. Jordan. Graphical models, exponential families, and variational inference. Found. Trends Mach. Learn., 1(1-2):1-305, 2008. 3 +[49] Yasin Yazici, Chuan-Sheng Foo, Stefan Winkler, Kim-Hui Yap, Georgios Piliouras, and Vijay Chandrasekhar. The unusual effectiveness of averaging in GAN training. In ICLR, 2019. 16 +[50] Han Zhang, Ian J. Goodfellow, Dimitris N. Metaxas, and Augustus Odena. Self-attention generative adversarial networks. In ICML, 2019. 1, 6, 16 +[51] Han Zhang, Zizhao Zhang, Augustus Odena, and Honglak Lee. Consistency regularization for generative adversarial networks. In ICLR, 2020. 1 +[52] Shengyu Zhao, Zhijian Liu, Ji Lin, Jun-Yan Zhu, and Song Han. Differentiable augmentation for data-efficient GAN training. In NeurIPS, 2020. 16 +[53] Jun-Yan Zhu, Taesung Park, Phillip Isola, and Alexei A. Efros. Unpaired image-to-image translation using cycle-consistent adversarial networks. In ICCV, 2017. 1 + +# Checklist + +1. For all authors... + +(a) Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope? [Yes] Section 1 +(b) Did you describe the limitations of your work? [Yes] Section 7 +(c) Did you discuss any potential negative societal impacts of your work? [Yes] Section 7 +(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] + +2. If you are including theoretical results... + +(a) Did you state the full set of assumptions of all theoretical results? [N/A] +(b) Did you include complete proofs of all theoretical results? [N/A] + +3. If you ran experiments... + +(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] Supplemental material +(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] Section 4, Section 4.1, Appendix D +(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] Table 3, Table 4, Table 5 +(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] Section 4.1 + +4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... + +(a) If your work uses existing assets, did you cite the creators? [Yes] Section 4, Section 4.1 +(b) Did you mention the license of the assets? [Yes] Section 4, Section 4.1 +(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] Supplemental material +(d) Did you discuss whether and how consent was obtained from people whose data you're using/curating? [Yes] Section 4, Section 4.1. All assets are distributed under the MIT license. +(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [Yes] Section 4 + +5. If you used crowdsourcing or conducted research with human subjects... + +(a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A] +(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A] +(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A] \ No newline at end of file diff --git a/aunifiedviewofcganswithandwithoutclassifiers/images.zip b/aunifiedviewofcganswithandwithoutclassifiers/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..43e937abdeebbfcdeda998c88fc12d49dd2136d2 --- /dev/null +++ b/aunifiedviewofcganswithandwithoutclassifiers/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:862d66cb3c72369c30a27cf3048d5e5dec56dc2dbe21aeb87e0fef5c6b20b830 +size 606047 diff --git a/aunifiedviewofcganswithandwithoutclassifiers/layout.json b/aunifiedviewofcganswithandwithoutclassifiers/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..3adc8d79a06c679233cb915a01f7178f330b6f41 --- /dev/null +++ b/aunifiedviewofcganswithandwithoutclassifiers/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe59141f693531efcea212ea8280395d5d9aa929d00032e505644eae9ebc20e2 +size 480618 diff --git a/auniversallawofrobustnessviaisoperimetry/1c5adec8-2901-48e8-88ee-f4db9cf645bc_content_list.json b/auniversallawofrobustnessviaisoperimetry/1c5adec8-2901-48e8-88ee-f4db9cf645bc_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..8c424c314ab84ccc2b247ea87145d70e18a83a48 --- /dev/null +++ b/auniversallawofrobustnessviaisoperimetry/1c5adec8-2901-48e8-88ee-f4db9cf645bc_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7a4cb62ffba40dc01c4183b1705ee6337d5e3a0f31a7980ffac868960c56a03 +size 80721 diff --git a/auniversallawofrobustnessviaisoperimetry/1c5adec8-2901-48e8-88ee-f4db9cf645bc_model.json b/auniversallawofrobustnessviaisoperimetry/1c5adec8-2901-48e8-88ee-f4db9cf645bc_model.json new file mode 100644 index 0000000000000000000000000000000000000000..d663301f196a41bb64c0ea095f487e99201e51c1 --- /dev/null +++ b/auniversallawofrobustnessviaisoperimetry/1c5adec8-2901-48e8-88ee-f4db9cf645bc_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4fbc8b603b55154596877f83027bc33fecbb5003c2cd7eb6db7bcd2296304a68 +size 97232 diff --git a/auniversallawofrobustnessviaisoperimetry/1c5adec8-2901-48e8-88ee-f4db9cf645bc_origin.pdf b/auniversallawofrobustnessviaisoperimetry/1c5adec8-2901-48e8-88ee-f4db9cf645bc_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4d804d894f83462f7923e2e08b5473a56b0b6892 --- /dev/null +++ b/auniversallawofrobustnessviaisoperimetry/1c5adec8-2901-48e8-88ee-f4db9cf645bc_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bd3c6743f4a991f4d22d53148d9cd436bb617d5864cc1c616c945bec0629bfe2 +size 307470 diff --git a/auniversallawofrobustnessviaisoperimetry/full.md b/auniversallawofrobustnessviaisoperimetry/full.md new file mode 100644 index 0000000000000000000000000000000000000000..fbe9e5d654479d2150367b93019d5e0807bbf399 --- /dev/null +++ b/auniversallawofrobustnessviaisoperimetry/full.md @@ -0,0 +1,369 @@ +# A Universal Law of Robustness via Isoperimetry + +Sebastien Bubeck + +Microsoft Research + +sebubeck@microsoft.com + +Mark Sellke + +Stanford University + +msellke@stanford.edu + +# Abstract + +Classically, data interpolation with a parametrized model class is possible as long as the number of parameters is larger than the number of equations to be satisfied. A puzzling phenomenon in deep learning is that models are trained with many more parameters than what this classical theory would suggest. We propose a theoretical explanation for this phenomenon. We prove that for a broad class of data distributions and model classes, overparametrization is necessary if one wants to interpolate the data smoothly. Namely we show that smooth interpolation requires $d$ times more parameters than mere interpolation, where $d$ is the ambient data dimension. We prove this universal law of robustness for any smoothly parametrized function class with polynomial size weights, and any covariate distribution verifying isoperimetry (or a mixture thereof). In the case of two-layer neural networks and Gaussian covariates, this law was conjectured in prior work by Bubeck, Li and Nagaraj. We also give an interpretation of our result as an improved generalization bound for model classes consisting of smooth functions. + +# 1 Introduction + +Solving $n$ equations generically requires only $n$ unknowns1. However, the revolutionary deep learning methodology revolves around highly overparametrized models, with many more than $n$ parameters to learn from $n$ training data points. We propose an explanation for this enigmatic phenomenon, showing in great generality that finding a smooth function to fit $d$ -dimensional data requires at least $nd$ parameters. In other words, overparametrization by a factor of $d$ is necessary for smooth interpolation, suggesting that perhaps the large size of the models used in deep learning is a necessity rather than a weakness of the framework. Another way to phrase the result is as a tradeoff between the size of a model (as measured by the number of parameters) and its "robustness" (as measured by its Lipschitz constant): either one has a small model (with $n$ parameters) which must then be non-robust, or one has a robust model (constant Lipschitz) but then it must be very large (with $nd$ parameters). Such a tradeoff was conjectured for the specific case of two-layer neural networks and Gaussian data in [BLN21]. Our result shows that in fact it is a universal phenomenon, which applies to essentially any parametrized function class (including in particular deep neural networks) as well as a much broader class of data distributions. As in [BLN21] we obtain an entire tradeoff curve between size and robustness: our universal law of robustness states that, for any function class smoothly parametrized by $p$ parameters, and for any $d$ -dimensional dataset satisfying mild regularity conditions, any function in this class that fits the data below the noise level must have its (Euclidean) Lipschitz constant larger than $\sqrt{\frac{nd}{p}}$ . + +Theorem 1 (Informal version of Theorem 3). Let $\mathcal{F}$ be a class of functions from $\mathbb{R}^d\to \mathbb{R}$ and let $(x_{i},y_{i})_{i = 1}^{n}$ be i.i.d. input-output pairs in $\mathbb{R}^d\times [-1,1]$ . Assume that: + +1. $\mathcal{F}$ admits a Lipschitz parametrization by $p$ real parameters, each of size at most poly $(n,d)$ . + +2. The distribution $\mu$ of the covariates $x_{i}$ satisfies isoperimetry (or is a mixture theorem). +3. The expected conditional variance of the output (i.e., the "noise level") is strictly positive, denoted $\sigma^2 \coloneqq \mathbb{E}^\mu [\text{Var}[y|x]] > 0$ . + +Then, with high probability over the sampling of the data, one has simultaneously for all $f \in \mathcal{F}$ : + +$$ +\frac {1}{n} \sum_ {i = 1} ^ {n} (f (x _ {i}) - y _ {i}) ^ {2} \leq \sigma^ {2} - \epsilon \Rightarrow \operatorname {L i p} (f) \geq \widetilde {\Omega} \left(\epsilon \sqrt {\frac {n d}{p}}\right). +$$ + +Remark 1.1. For the distributions $\mu$ we have in mind, for instance uniform on the unit sphere, there exists with high probability some $O(1)$ -Lipschitz function $f: \mathbb{R}^d \to \mathbb{R}$ satisfying $f(x_i) = y_i$ for all $i$ . Indeed, with probability $1 - e^{-\Omega(d)}$ we have $||x_i - x_j|| \geq 1$ for all $1 \leq i \neq j \leq n$ so long as $n \leq poly(d)$ . In this case we may apply the Kirschbraun extension theorem to find a suitable $f$ regardless of the labels $y_i$ . More explicitly we may fix a smooth bump function $g: \mathbb{R}^{+} \to \mathbb{R}$ with $g(0) = 1$ and $g(x) = 0$ for $x \geq 1$ , and then interpolate using the sum of radial basis functions + +$$ +f (x) = \sum_ {i = 1} ^ {n} g (| | x - x _ {i} | |) y _ {i}. +$$ + +In fact this construction requires only $p = n(d + 1)$ parameters to specify the values $(x_i, y_i)_{i \in [n]}$ and thus determine the function $f$ . Hence $p = n(d + 1)$ parameters suffice for robust interpolation, i.e. Theorem 3 is essentially best possible for $L = O(1)$ . A similar construction shows the same conclusion for any $p \in [\widetilde{\Omega}(n), nd]$ , essentially tracing the entire tradeoff curve. This is because one can first project onto a fixed subspace of dimension $\tilde{d} = p / n$ , and the projected inputs $x_i$ now have pairwise distances at least $\Omega\left(\sqrt{\tilde{d} / d}\right)$ with high probability. The analogous construction on the projected points now requires only $p = \tilde{dn}$ parameters and has Lipschitz constant $L = O\left(\sqrt{d / \tilde{d}}\right) = O\left(\sqrt{\frac{nd}{p}}\right)$ . + +# 1.1 Speculative implication for real data + +To put Theorem 1 in context, we compare to the empirical results presented in $\mathrm{[MMS^{+}18]}$ . In the latter work, they consider the MNIST dataset which consists of $n = 6\times 10^4$ images in dimension $28^{2} = 784$ . They trained robustly different architectures, and reported in Figure 4 the size of the architecture versus the obtained robust test accuracy (third plot from the left). One can see a sharp transition from roughly $10\%$ accuracy to roughly $90\%$ accuracy at around $2\times 10^{5}$ parameters (capacity scale 4 in their notation). Moreover the robust accuracy keeps climbing up with more parameters, to roughly $95\%$ accuracy at roughly $3\times 10^{6}$ parameters. + +How can we compare these numbers to the law of robustness? There are a number of difficulties that we discuss below, and we emphasize that this discussion is highly speculative in nature, though we find that, with a few leaps of faith, our universal law of robustness sheds light on the potential parameter regimes of interest for robust deep learning. + +The first difficulty is to evaluate the "correct" dimension of the problem. Certainly the number of pixels per image gives an upper bound, however one expects that the data lies on something like a lower dimensional sub-manifold. Optimistically, we hope that Theorem 1 will continue to apply for an appropriate effective dimension which may be rather smaller than the literal number of pixels. This hope is partially justified by the fact that isoperimetry holds in many less-than-picturesque situations, some of which are stated in the next subsection. + +The next difficulty is to estimate/interpret the noise value $\sigma^2$ . From a theoretical point of view, this noise assumption is necessary for otherwise there could exist a smooth classifier with perfect accuracy in $\mathcal{F}$ , defeating the point of any lower bound on the size of $\mathcal{F}$ . We tentatively would like to think of $\sigma^2$ as capturing the contribution of the "difficult" part of the learning problem, that is $\sigma^2$ could be thought of as the non-robust generalization error of reasonably good models, so a couple + +of $\%$ of error in the case of MNIST. With that interpretation, one gets "below the noise level" in MNIST with a training error of a couple of $\%$ . We believe that versions of the law of robustness might hold without noise; these would need to go beyond representational power and consider the dynamics of learning algorithms. + +Finally another subtlety to interpret the empirical results of $\mathrm{[MMS^{+}18]}$ is that there is a mismatch between what they measure and our quantities of interest. Namely the law of robustness talks about two things: the training error, and the worst-case robustness (i.e., the Lipschitz constant). On the other hand $\mathrm{[MMS^{+}18]}$ measures the robust generalization error. Understanding the interplay between those three quantities is a fantastic open problem. Here we take the perspective that a small robust generalization error should imply a small training error and a small Lipschitz constant. Another important mismatch is that we stated our universal law of robustness for Lipschitzness in $\ell_{2}$ , while the experiments in $\mathrm{[MMS^{+}18]}$ are for robustness in $\ell_{\infty}$ . We believe that a variant of the law of robustness remains true for $\ell_{\infty}$ , a belief again partially justified by how broad isoperimetry is (see next subsection). + +With all the caveats described above, we can now look at the numbers as follows: in the $\mathrm{[MMS^{+}18]}$ experiments, smooth models with accuracy below the noise level are attained with a number of parameters somewhere in the range $2\times 10^{5} - 3\times 10^{6}$ parameters (possibly even larger depending on the interpretation of the noise level), while the law of robustness would predict any such model must have at least nd parameters, and this latter quantity should be somewhere in the range $10^{6} - 10^{7}$ (corresponding to an effective dimension between 15 and 150). While far from perfect, the law of robustness prediction is far more accurate than the classical rule of thumb # parameters $\simeq$ # equations (which here would predict a number of parameters of the order $10^{4}$ ). + +Perhaps more interestingly, one could apply a similar reasoning to the ImageNet dataset, which consists of $1.4 \times 10^{7}$ images of size roughly $2 \times 10^{5}$ . Estimating that the effective dimension is a couple of order of magnitudes smaller than this size, the law of robustness predicts that to obtain good robust models on ImageNet one would need at least $10^{10} - 10^{11}$ parameters. This number is larger than the size of current neural networks trained robustly for this task, which sports between $10^{8} - 10^{9}$ parameters. Thus, we arrive at the tantalizing possibility that robust models for ImageNet do not exist yet simply because we are a couple orders of magnitude off in the current scale of neural networks trained for this task. + +# 1.2 Related work + +Theorem 1 is a direct follow-up to the conjectured law of robustness in [BLN21] for (arbitrarily weighted) two-layer neural networks with Gaussian data. Our result does not actually prove their conjecture, because we assume here polynomially bounded weights. While this assumption is reasonable from a practical perspective, it remains mathematically interesting to prove the full conjecture for the two-layer case. We prove however in Section A that the polynomial weights assumption is necessary as soon as one considers three-layer neural networks. Let us also mention the $\left[\mathrm{GCL}^{+}19\right.$ , Theorem 6.1] which showed a lower bound $\Omega(nd)$ on the VC dimension of any function class which can robustly interpolate arbitrary labels on all well-separated input sets $(x_{1},\ldots ,x_{n})$ . We also note that a relation between high-dimensional phenomenon such as concentration and adversarial examples has been hypothesized before, such as in $\left[\mathrm{GMF}^{+}18\right]$ . + +In addition to $\mathrm{[MMS^{+}18]}$ , several recent works have experimentally studied the relationship between a neural network scale and its achieved robustness, see e.g., $\mathrm{[NBA^{+}18,XY20,GQU^{+}20]}$ . It has been consistently reported that larger networks help tremendously for robustness, beyond what is typically seen for classical non-robust accuracy. We view our universal law of robustness as putting this empirical observation on a more solid footing: scale is actually necessary to achieve robustness. + +The law of robustness setting is closely related to the interpolation setting: in the former case one considers models optimizing "beyond the noise level", while in the latter case one studies models with perfect fit on the training data. The study of generalization in this in- + +terpolation regime has been a central focus of learning theory in the last few years (see e.g., [BHMM19, MM19, BLLT20, $\mathrm{NKB}^{+}20$ ]), as it seemingly contradicts classical theory about regularization. More broadly though, generalization remains a mysterious phenomenon in deep learning, and the exact interplay between the law of robustness' setting (interpolation regime/worst-case robustness) and (robust) generalization error is a fantastic open problem. Interestingly, we note that one could potentially avoid the conclusion of the law of robustness (that is, that large models are necessary for robustness), with early stopping methods that could stop the optimization once the noise level is reached. In fact, this theoretically motivated suggestion has already been empirically tested and confirmed in the recent work [RWK20], showing again a close tie between the conclusions one can draw from the law of robustness and actual practical settings. + +Classical lower bounds on the gradient of a function include Poincaré type inequalities, but they are of a qualitatively different nature compared to the law of robustness lower bound. We recall that a measure $\mu$ on $\mathbb{R}^d$ satisfies a Poincaré inequality if for any function $f$ , one has $\mathbb{E}^\mu [||\nabla f||^2 ]\geq C\cdot \mathrm{Var}(f)$ (for some constant $C > 0$ ). In our context, such a lower bound for an interpolating function $f$ has essentially no consequence since the variance $f$ could be exponentially small. In fact this is tight, as one easily use similar constructions to those in [BLN21] to show that one can interpolate with an exponentially small expected norm squared of the gradient (in particular it is crucial in the law of robustness to consider the Lipschitz constant, i.e., the supremum of the norm of the gradient). On the other hand, our isoperimetry assumption is related to a certain strengthening of the Poincaré inequality known as log-Sobolev inequality (see e.g., [Led01]). If the covariate measure satisfies only a Poincaré inequality, then we could prove a weaker law of robustness of the form $\mathrm{Lip}\gtrsim \frac{n\sqrt{d}}{p}$ (using for example the concentration result obtained in [BL97]). For the case of two-layer neural networks there is another natural notion of smoothness (different from $\ell_p$ norms of the gradient) that can be considered, known as the Barron norm. In [BELM20] it is shown that for such a notion of smoothness there is no tradeoff à la the law of robustness, namely one can simultaneously be optimal both in terms of Barron norm and in terms of the network size. More generally, it is an interesting challenge to understand for which notions of smoothness there is a tradeoff with size. + +# 1.3 Isoperimetry + +Concentration of measure and isoperimetry are perhaps the most ubiquitous features of high-dimensional geometry. In short, they assert in many cases that Lipschitz functions on high-dimensional space concentrate tightly around their mean. Our result assumes that the distribution $\mu$ of the covariates $x_{i}$ satisfies such an inequality in the following sense. + +Definition 1.1. A probability measure $\mu$ on $\mathbb{R}^d$ satisfies c-isoperimetry if for any bounded $L$ -Lipschitz $f: \mathbb{R}^d \to \mathbb{R}$ , and any $t \geq 0$ , + +$$ +\mathbb {P} [ | f (x) - \mathbb {E} [ f ] | \geq t ] \leq 2 e ^ {- \frac {d t ^ {2}}{2 c L ^ {2}}}. \tag {1.1} +$$ + +In general, if a scalar random variable $X$ satisfies $\mathbb{P}[|X| \geq t] \leq 2e^{-t^2 / C}$ then we say $X$ is $C$ -subgaussian. Hence isoperimetry states that the output of any Lipschitz function is $O(1)$ -subgaussian under suitable rescaling. Distributions satisfying $O(1)$ -isoperimetry include high dimensional Gaussians $\mu = \mathcal{N}\left(0, \frac{I_d}{d}\right)$ and uniform distributions on spheres and hypercubes (normalized to have diameter 1). Isoperimetry also holds for mild perturbations of these idealized scenarios, including2: + +- The sum of a Gaussian and an independent random vector of small norm [CCNW21]. +- Strongly log-concave measures in any normed space [BL00, Proposition 3.1]. +- Manifolds with positive Ricci curvature [Gro86, Theorem 2.2]. + +Due to the last condition above, we believe our results are realistic even under the manifold hypothesis that high-dimensional data tends to lie on a lower-dimensional submanifold. This viewpoint on learning has been studied for decades, see e.g. [HS89, KL93, RS00, TDSL00, NM10, FMN16]. + +We also note that our formal theorem (Theorem 3) actually applies to distributions that can be written as a mixture of distributions satisfying isoperimetry. Let us also point out that from a technical perspective, our proof is not tied to the Euclidean norm and applies essentially whenever Definition 1.1 holds. The main difficulty in extending the law of robustness to e.g. the earth-mover distance seems to be identifying realistic cases which satisfy isoperimetry. + +Our proofs will repeatedly use the following simple fact: + +Proposition 1.2. [Ver18, Proposition 2.6.1],[vH14, Exercise 3.1] If $X_{1},\ldots ,X_{n}$ are independent, $C$ -subgaussian, with mean 0, then $\frac{1}{\sqrt{n}}\sum_{i = 1}^{n}X_{i}$ is 18C-subgaussian. + +# 2 A finite approach to the law of robustness + +For the function class of two-layer neural networks, [BLN21] investigated several approaches to prove the law of robustness. At a high level, the proof strategies there relied on various ways to measure how "large" the set of two-layer neural networks can be (specifically, they tried a geometric approach based on relating to multi-index models, a statistical approach based on the Rademacher complexity, and an algebraic approach for the case of polynomial activations). + +In this work we take here a different route: we shift the focus from the function class $\mathcal{F}$ to an individual function $f\in \mathcal{F}$ . Namely, our proof starts by asking the following question: for a fixed function $f$ , what is the probability that it would give a good approximate fit on the (random) data? For simplicity, consider for a moment the case where we require $f$ to actually interpolate the data (i.e., perfect fit), and say that $y_{i}$ are random $\pm 1$ labels. The key insight is that isoperimetry implies that either the 0-level set of $f$ or the 1-level set of $f$ must have probability smaller than $\exp \left(-\frac{d}{\mathrm{Lip}(f)^2}\right)$ . + +Thus, the probability that $f$ fits all the $n$ points is at most $\exp \left(-\frac{nd}{\operatorname{Lip}(f)^2}\right)$ so long as both labels $y_i \in \{-1, 1\}$ actually appear a constant fraction of the time. In particular, using an union bound3, for a finite function class $\mathcal{F}$ of size $N$ with $L$ -Lipschitz functions, the probability that there exists a function $f \in \mathcal{F}$ fitting the data is at most + +$$ +N \exp \left(- \frac {n d}{L ^ {2}}\right) = \exp \left(\log (N) - \frac {n d}{L ^ {2}}\right). +$$ + +Thus we see that, if $L \ll \sqrt{\frac{nd}{\log(N)}}$ , then the probability of finding a fitting function in $\mathcal{F}$ is very small. This basically concludes the proof, since via a standard discretization argument, for a smoothly parametrized family with $p$ (bounded) parameters one expects $\log(N) = \tilde{O}(p)$ . + +We now give the formal proof, which applies in particular to approximate fit rather than exact fit in the argument above. The only difference is that we will identify a well-chosen subgaussian random variable in the problem. We start with the finite function class case: + +Theorem 2. Let $(x_{i},y_{i})$ be i.i.d. input-output pairs in $\mathbb{R}^d\times [-1,1]$ such that: + +1. The distribution $\mu$ of the covariates $x_{i}$ can be written as $\mu = \sum_{\ell = 1}^{k}\alpha_{\ell}\mu_{\ell}$ , where each $\mu_{\ell}$ satisfies c-isoperimetry and $\alpha_{\ell}\geq 0,\sum_{\ell = 1}^{k}\alpha_{\ell} = 1$ +2. The expected conditional variance of the output is strictly positive, denoted $\sigma^2 \coloneqq \mathbb{E}^\mu[\text{Var}[y|x]] > 0$ . + +Then one has: + +$$ +\begin{array}{l} \mathbb {P} \left(\exists f \in \mathcal {F}: \frac {1}{n} \sum_ {i = 1} ^ {n} \left(y _ {i} - f \left(x _ {i}\right)\right) ^ {2} \leq \sigma^ {2} - \epsilon\right) \\ \leq 4 k \exp \left(- \frac {n \epsilon^ {2}}{8 ^ {3} k}\right) + 2 \exp \left(\log (| \mathcal {F} |) - \frac {\epsilon^ {2} n d}{9 ^ {4} c L ^ {2}}\right). \\ \end{array} +$$ + +We start with a lemma showing that, to optimize beyond the noise level one must necessarily correlate with the noise part of the labels. In what follows we denote $g(x) = \mathbb{E}[y|x]$ for the target function, and $z_{i} = y_{i} - g(x_{i})$ for the noise part of the observed labels (namely $y_{i}$ is the sum of the target function $g(x_{i})$ and the noise term $z_{i}$ ). + +Lemma 2.1. One has + +$$ +\mathbb {P} \left(\exists f \in \mathcal {F}: \frac {1}{n} \sum_ {i = 1} ^ {n} (y _ {i} - f (x _ {i})) ^ {2} \leq \sigma^ {2} - \epsilon\right) \leq 2 \exp \left(- \frac {n \epsilon^ {2}}{8 ^ {3}}\right) + \mathbb {P} \left(\exists f \in \mathcal {F}: \frac {1}{n} \sum_ {i = 1} ^ {n} f (x _ {i}) z _ {i} \geq \frac {\epsilon}{4}\right). +$$ + +Proof. The sequence $(z_i^2)$ is i.i.d., with mean $\sigma^2$ , and such that $|z_i|^2 \leq 4$ . Thus Hoeffding's inequality yields: + +$$ +\mathbb {P} \left(\frac {1}{n} \sum_ {i = 1} ^ {n} z _ {i} ^ {2} \leq \sigma^ {2} - \frac {\epsilon}{6}\right) \leq \exp \left(- \frac {n \epsilon^ {2}}{8 ^ {3}}\right). \tag {2.1} +$$ + +On the other hand the sequence $(z_{i}g(x_{i}))$ is i.i.d., with mean 0 (since $\mathbb{E}[z_i|x_i] = 0$ ), and such that $|z_{i}g(x_{i})|\leq 2$ . Thus Hoeffding's inequality yields: + +$$ +\mathbb {P} \left(\frac {1}{n} \sum_ {i = 1} ^ {n} z _ {i} g \left(x _ {i}\right) \leq - \frac {\epsilon}{6}\right) \leq \exp \left(- \frac {n \epsilon^ {2}}{8 ^ {3}}\right). \tag {2.2} +$$ + +Let us write $Z = \frac{1}{\sqrt{n}}(z_1, \ldots, z_n)$ , $G = \frac{1}{\sqrt{n}}(g(x_1), \ldots, g(x_n))$ , and $F = \frac{1}{\sqrt{n}}(f(x_1), \ldots, f(x_n))$ . We claim that if $\| Z \|^2 \geq \sigma^2 - \frac{\epsilon}{6}$ and $\langle Z, G \rangle \geq -\frac{\epsilon}{6}$ , then for any $f \in \mathcal{F}$ one has + +$$ +\left\| G + Z - F \right\| ^ {2} \leq \sigma^ {2} - \epsilon \Rightarrow \langle F, Z \rangle \geq \frac {\epsilon}{4}. +$$ + +This claim together with (2.1) and (2.2) conclude the proof. On the other hand the claim itself directly follows from: + +$$ +\sigma^ {2} - \epsilon \geq \| G + Z - F \| ^ {2} = \| Z + G - F \| ^ {2} = \| Z \| ^ {2} + 2 \langle Z, G - F \rangle + \| G - F \| ^ {2} \geq \sigma^ {2} - \frac {\epsilon}{2} - 2 \langle Z, F \rangle . +$$ + +![](images/f0dc88b3593f6670525b9e8a5cffc575f758324b52316d6b38539f3a23cf162f.jpg) + +We can now proceed to the proof of Theorem 2: + +Proof. First note that without loss of generality we can assume that the range of any function in $\mathcal{F}$ is included in $[-1, 1]$ (indeed clipping the values improves both the fit to any $y \in [-1, 1]$ and the Lipschitz constant). We also assume wlog that all functions in $\mathcal{F}$ are $L$ -Lipschitz. + +For clarity let us start with the case $k = 1$ . By the isoperimetry assumption we have that $\sqrt{\frac{d}{c}}\frac{f(x_i) - \mathbb{E}[f]}{L}$ is 1-subgaussian. Since $|z_{i}| \leq 2$ , we also have that $\sqrt{\frac{d}{c}}\frac{(f(x_i) - \mathbb{E}[f])z_i}{L}$ is 4-subgaussian. Moreover, the latter random variable has zero-mean since $\mathbb{E}[z|x] = 0$ . Thus by Proposition 1.2 we have: + +$$ +\mathbb {P} \left(\sqrt {\frac {d}{c n L ^ {2}}} \sum_ {i = 1} ^ {n} (f (x _ {i}) - \mathbb {E} [ f ]) z _ {i} \geq t\right) \leq 2 \exp \left(- (t / 9) ^ {2}\right). +$$ + +We rewrite the above as: + +$$ +\mathbb {P} \left(\frac {1}{n} \sum_ {i = 1} ^ {n} \left(f \left(x _ {i}\right) - \mathbb {E} [ f ]\right) z _ {i} \geq \frac {\epsilon}{8}\right) \leq 2 \exp \left(- \frac {\epsilon^ {2} n d}{9 ^ {4} c L ^ {2}}\right). \tag {2.3} +$$ + +Since we assumed that the range of the functions is in $[-1, 1]$ we have $\mathbb{E}[f] \in [-1, 1]$ and hence: + +$$ +\mathbb {P} \left(\exists f \in \mathcal {F}: \frac {1}{n} \sum_ {i = 1} ^ {n} \mathbb {E} [ f ] z _ {i} \geq \frac {\epsilon}{8}\right) \leq \mathbb {P} \left(\left| \frac {1}{n} \sum_ {i = 1} ^ {n} z _ {i} \right| \geq \frac {\epsilon}{8}\right). \tag {2.4} +$$ + +(This step is the analog of requiring the labels $y_{i}$ to be well-balanced in the example of perfect interpolation.) By Hoeffding's inequality, the above quantity is smaller than $2\exp (-n\epsilon^{2} / 8^{3})$ (recall that $|z_{i}|\leq 2$ ). Thus we obtain with an union bound: + +$$ +\begin{array}{l} \mathbb {P} \left(\exists f \in \mathcal {F}: \frac {1}{n} \sum_ {i = 1} ^ {n} f (x _ {i}) z _ {i} \geq \frac {\epsilon}{4}\right) \leq | \mathcal {F} | \cdot \mathbb {P} \left(\frac {1}{n} \sum_ {i = 1} ^ {n} (f (x _ {i}) - \mathbb {E} [ f ]) z _ {i} \geq \frac {\epsilon}{8}\right) + \mathbb {P} \left(\left| \frac {1}{n} \sum_ {i = 1} ^ {n} z _ {i} \right| \geq \frac {\epsilon}{8}\right) \\ \leq 2 | \mathcal {F} | \cdot \exp \left(- \frac {\epsilon^ {2} n d}{9 ^ {4} c L ^ {2}}\right) + 2 \exp \left(- \frac {n \epsilon^ {2}}{8 ^ {3}}\right). \\ \end{array} +$$ + +Together with Lemma 2.1 this concludes the proof for $k = 1$ . + +We now turn to the case $k > 1$ . We first sample the mixture component $\ell_i \in [k]$ for each data point $i \in [n]$ , and we now reason conditioned on these mixture components. Let $S_{\ell} \subset [n]$ be the set of data points sampled from mixture component $\ell \in [k]$ , that is $x_i, i \in S_{\ell}$ , is i.i.d. from $\mu_{\ell}$ . We now have that $\sqrt{\frac{d}{c}} \frac{f(x_i) - \mathbb{E}^{\mu_{\ell_i}}[f]}{L}$ is 1-subgaussian (notice that the only difference is that now we need to center by $\mathbb{E}^{\mu_{\ell_i}}[f]$ , which depends on the mixture component). In particular using the same reasoning as for (2.4) we obtain (crucially note that Proposition 1.2 does not require the random variables to be identically distributed): + +$$ +\mathbb {P} \left(\frac {1}{n} \sum_ {i = 1} ^ {n} \left(f \left(x _ {i}\right) - \mathbb {E} ^ {\mu_ {\ell_ {i}}} [ f ]\right) z _ {i} \geq \frac {\epsilon}{8}\right) \leq 2 \exp \left(- \frac {\epsilon^ {2} n d}{9 ^ {4} c L ^ {2}}\right). \tag {2.5} +$$ + +Next we want to appropriately modify (2.4). To do so note that: + +$$ +\max _ {m _ {1}, \dots , m _ {k} \in [ - 1, 1 ]} \sum_ {i = 1} ^ {n} m _ {\ell_ {i}} z _ {i} = \sum_ {\ell = 1} ^ {k} \left| \sum_ {i \in S _ {\ell}} z _ {i} \right|, +$$ + +so that we can rewrite (2.4) as: + +$$ +\mathbb {P} \left(\exists f \in \mathcal {F}: \frac {1}{n} \sum_ {i = 1} ^ {n} \mathbb {E} ^ {\mu_ {\ell_ {i}}} [ f ] z _ {i} \geq \frac {\epsilon}{8}\right) \leq \mathbb {P} \left(\frac {1}{n} \sum_ {\ell = 1} ^ {k} \left| \sum_ {i \in S _ {\ell}} z _ {i} \right| \geq \frac {\epsilon}{8}\right). +$$ + +Now note that $\sum_{\ell = 1}^{k}\sqrt{|S_{\ell}|}\leq \sqrt{nk}$ and thus we have: + +$$ +\mathbb {P} \left(\frac {1}{n} \sum_ {\ell = 1} ^ {k} \left| \sum_ {i \in S _ {\ell}} z _ {i} \right| \geq \frac {\epsilon}{8}\right) \leq \mathbb {P} \left(\sum_ {\ell = 1} ^ {k} \left| \sum_ {i \in S _ {\ell}} z _ {i} \right| \geq \frac {\epsilon}{8} \sqrt {\frac {n}{k}} \sum_ {\ell = 1} ^ {k} \sqrt {| S _ {\ell} |}\right) \leq \sum_ {\ell = 1} ^ {k} \mathbb {P} \left(\left| \sum_ {i \in S _ {\ell}} z _ {i} \right| \geq \frac {\epsilon}{8} \sqrt {\frac {n}{k}} \sqrt {| S _ {\ell} |}\right). +$$ + +Finally by Hoeffding's inequality, we have for any $\ell \in [k]$ , $\mathbb{P}\left(\left|\sum_{i\in S_\ell}z_i\right|\geq t\sqrt{|S_\ell|}\right)\leq 2\exp \left(-\frac{t^2}{8}\right)$ , and thus the last display is bounded from above by $2k\exp \left(-\frac{n\epsilon^2}{8^3k}\right)$ . The proof can now be concluded as in the case $k = 1$ . + +Finally we can now state and prove the formal version of the informal Theorem 1 from the introduction. + +Theorem 3. Let $\mathcal{F}$ be a class of functions from $\mathbb{R}^d\to \mathbb{R}$ and let $(x_{i},y_{i})_{i = 1}^{n}$ be i.i.d. input-output pairs in $\mathbb{R}^d\times [-1,1]$ . Fix $\epsilon ,\delta \in (0,1)$ . Assume that: + +1. The function class can be written as $\mathcal{F} = \{f_{\boldsymbol{w}}, \boldsymbol{w} \in \mathcal{W}\}$ with $\mathcal{W} \subset \mathbb{R}^p$ , $\mathrm{diam}(\mathcal{W}) \leq W$ and for any $\boldsymbol{w}_1, \boldsymbol{w}_2 \in \mathcal{W}$ , + +$$ +\left| \left| f _ {\boldsymbol {w} _ {1}} - f _ {\boldsymbol {w} _ {2}} \right| \right| _ {\infty} \leq J \left| \left| \boldsymbol {w} _ {1} - \boldsymbol {w} _ {2} \right| \right|. +$$ + +2. The distribution $\mu$ of the covariates $x_{i}$ can be written as $\mu = \sum_{\ell = 1}^{k}\alpha_{\ell}\mu_{\ell}$ , where each $\mu_{\ell}$ satisfies c-isoperimetry, $\alpha_{\ell}\geq 0,\sum_{\ell = 1}^{k}\alpha_{\ell} = 1$ , and $k$ is such that $9^{4}k\log (8k / \delta)\leq n\epsilon^{2}$ . + +3. The expected conditional variance of the output is strictly positive, denoted $\sigma^2 \coloneqq \mathbb{E}^\mu [\text{Var}[y|x]] > 0$ . + +Then, with probability at least $1 - \delta$ with respect to the sampling of the data, one has simultaneously for all $f\in \mathcal{F}$ .. + +$$ +\frac {1}{n} \sum_ {i = 1} ^ {n} (f (x _ {i}) - y _ {i}) ^ {2} \leq \sigma^ {2} - \epsilon \Rightarrow \mathrm {L i p} (f) \geq \frac {\epsilon}{2 ^ {9} \sqrt {c}} \sqrt {\frac {n d}{p \log (6 0 W J \epsilon^ {- 1}) + \log (4 / \delta)}}. +$$ + +Proof. Define $\mathcal{W}_L \subseteq \mathcal{W}$ by $\mathcal{W}_L = \{\pmb{w} \in \mathcal{W} : \mathrm{Lip}(f_{\pmb{w}}) \leq L\}$ . Denote $\mathcal{W}_{L,\epsilon}$ for an $\frac{\epsilon}{6J}$ -net of $\mathcal{W}_L$ . We have in particular $|\mathcal{W}_{\epsilon}| \leq (60WJ\epsilon^{-1})^p$ . We apply Theorem 2 to $\mathcal{F}_{L,\epsilon} = \{f_{\pmb{w}}, \pmb{w} \in \mathcal{W}_{L,\epsilon}\}$ : + +$$ +\begin{array}{l} \mathbb {P} \left(\exists f \in \mathcal {F} _ {L, \epsilon}: \frac {1}{n} \sum_ {i = 1} ^ {n} \left(y _ {i} - f \left(x _ {i}\right)\right) ^ {2} \leq \sigma^ {2} - \frac {\epsilon}{2} \text {a n d} \operatorname {L i p} (f) \leq 2 L\right) \\ \leq 4 k \exp \left(- \frac {n \epsilon^ {2}}{9 ^ {4} k}\right) + 2 \exp \left(p \log (6 0 W J \epsilon^ {- 1}) - \frac {\epsilon^ {2} n d}{8 ^ {6} c L ^ {2}}\right). \\ \end{array} +$$ + +Observe that if $\| f - g \|_{\infty} \leq \frac{\epsilon}{6}$ and $\| y \|_{\infty}, \| f \|_{\infty}, \| g \|_{\infty} \leq 1$ , then $\frac{1}{n} \sum_{i=1}^{n} (y_i - f(x_i))^2 \leq \frac{\epsilon}{2} + \frac{1}{n} \sum_{i=1}^{n} (y_i - g(x_i))^2$ . (We may again assume without loss of generality that all functions in $\mathcal{F}$ map to $[-1,1]$ .) Thus we obtain for any $L > 0$ : + +$$ +\begin{array}{l} \mathbb {P} \left(\exists f \in \mathcal {F}: \frac {1}{n} \sum_ {i = 1} ^ {n} \left(y _ {i} - f \left(x _ {i}\right)\right) ^ {2} \leq \sigma^ {2} - \epsilon \text {a n d} \operatorname {L i p} (f) \leq L\right) \\ \leq 4 k \exp \left(- \frac {n \epsilon^ {2}}{9 ^ {4} k}\right) + 2 \exp \left(p \log (6 0 W J \epsilon^ {- 1}) - \frac {\epsilon^ {2} n d}{8 ^ {6} c L ^ {2}}\right). \\ \end{array} +$$ + +The first assumption ensures that for any $\boldsymbol{w} \in \mathcal{W}_L$ , there is $\boldsymbol{w}' \in \mathcal{W}_{L,\epsilon}$ with $\| f_{\boldsymbol{w}} - f_{\boldsymbol{w}'} \|_{\infty} \leq \frac{\epsilon}{6}$ . The second assumption shows the probability just above is at most $\delta$ when $L = \frac{\epsilon}{2^9\sqrt{c}} \sqrt{\frac{nd}{p \log(60WJ\epsilon^{-1}) + \log(4 / \delta)}}$ . This concludes the proof. + +# 3 Deep neural networks + +We now specialize the law of robustness (Theorem 3) to multi-layer neural networks. We consider a rather general class of depth $D$ neural networks described as follows. First, we require that the neurons are partitioned into layers $\mathcal{L}_1,\ldots ,\mathcal{L}_D$ , and that all connections are from $\mathcal{L}_i\rightarrow \mathcal{L}_j$ for some $i < j$ . This includes the basic feed-forward case in which only connections $\mathcal{L}_i\to \mathcal{L}_{i + 1}$ are used as well as more general skip connections. We specify (in the natural way) a neural network by matrices $W_{j}$ of shape $|\mathcal{L}_j|\times \sum_{i < j}|\mathcal{L}_i|$ for each $1\leq j\leq D$ , as well as 1-Lipschitz non-linearities $\sigma_{j,\ell}$ and scalar biases $b_{j,\ell}$ for each $(j,\ell)$ satisfying $\ell \in |\mathcal{L}_j|$ . We use fixed non-linearities $\sigma_{j,\ell}$ as well as a fixed architecture, in the sense that each matrix entry $W_{j}[k,\ell ]$ is either always 0 or else it is variable (and similarly for the bias terms). + +To match the notation of Theorem 3, we identify the parametrization in terms of the matrices $(W_{j})$ and bias terms $(b_{j,\ell})$ to a single $p$ -dimensional vector $\boldsymbol{w}$ as follows. A variable matrix entry $W_{j}[k,\ell]$ is set to $w_{a(j,k,\ell)}$ for some fixed index $a(j,k,\ell)\in [p]$ , and a variable bias term $b_{j,\ell}$ is set to $w_{a(j,\ell)}$ for some $a(j,\ell)\in [p]$ . Thus we now have a parametrization $\boldsymbol{w}\in \mathbb{R}^p\mapsto f_\boldsymbol{w}$ where $f_{\boldsymbol{w}}$ is the neural network represented by the parameter vector $\boldsymbol{w}$ . Importantly, note that our formulation allows for weight sharing (in the sense that a shared weight is counted only as a single parameter). For example, this is important to obtain an accurate count of the number of parameters in convolutional architectures. + +In order to apply Theorem 3 to this class of functions we need to estimate the Lipschitz constant of the parametrization $\pmb{w} \mapsto f_{\pmb{w}}$ . To do this we introduce three more quantities. First, we shall assume that all the parameters are bounded in magnitude by $W$ , that is we consider the set of neural networks parametrized by $\pmb{w} \in [-W, W]^p$ . Next, for the architecture under consideration, denote $Q$ for the maximum number of matrix entries/bias terms that are tied to a single parameter $w_{a}$ for some $a \in [p]$ . Finally we define + +$$ +B (\boldsymbol {w}) = \prod_ {j \in [ D ]} \max (\| W _ {j} \| _ {o p}, 1). +$$ + +Observe that $B(\pmb{w})$ is an upper bound on the Lipschitz constant of the network itself, i.e., the map $x \mapsto f_{\pmb{w}}(x)$ . It turns out that a uniform control on it also controls the Lipschitz constant of the parametrization $\pmb{w} \mapsto f_{\pmb{w}}$ . Namely we have the following lemma: + +Lemma 3.1. Let $x \in \mathbb{R}^d$ such that $\| x \| \leq R$ , and $\pmb{w}_1, \pmb{w}_2 \in \mathbb{R}^p$ such that $B(\pmb{w}_1), B(\pmb{w}_2) \leq \overline{B}$ . Then one has + +$$ +\left| f _ {\boldsymbol {w} _ {1}} (x) - f _ {\boldsymbol {w} _ {2}} (x) \right| \leq \bar {B} ^ {2} Q R \sqrt {p} \| \boldsymbol {w} _ {1} - \boldsymbol {w} _ {2} \|. +$$ + +Moreover for any $\pmb{w} \in [-W, W]^p$ with $W \geq 1$ , one has + +$$ +B (\boldsymbol {w}) \leq (W \sqrt {p Q}) ^ {D}. +$$ + +Proof. Fix an input $x$ and define $g_{x}$ by $g_{x}(\boldsymbol{w}) = f_{\boldsymbol{w}}(x)$ . A standard gradient calculation for multi-layer neural networks directly shows that $\| \nabla g_{x}(\boldsymbol{w}) \|_{\infty} \leq B(\boldsymbol{w}) Q R$ so that $\| \nabla g_{x}(\boldsymbol{w}) \| \leq B(\boldsymbol{w}) Q R \sqrt{p}$ . Since the matrix operator norm is convex (and nonnegative) it follows that $B(\boldsymbol{w}) \leq B(\boldsymbol{w}_{1}) B(\boldsymbol{w}_{2}) \leq \overline{B}^{2}$ on the entire segment $[\boldsymbol{w}_{1}, \boldsymbol{w}_{2}]$ by multiplying over layers. Thus $\| \nabla g_{x}(\boldsymbol{w}) \| \leq \overline{B}^{2} Q R \sqrt{p}$ on that segment, which concludes the proof of the first claimed inequality. The second claimed inequality follows directly from $\| W_{j} \|_{op} \leq \| W_{j} \|_{2} \leq W \sqrt{pQ}$ . + +Lemma 3.1 shows that when applying Theorem 3 to our class of neural networks one can always take $J = R(WQp)^{D}$ (assuming that the covariate measure $\mu$ is supported on the ball of radius $R$ ). Thus in this case the law of robustness (under the assumptions of Theorem 3) directly states that with high probability, any neural network in our class that fits the training data well below the noise level must also have: + +$$ +\operatorname {L i p} (f) \geq \tilde {\Omega} \left(\sqrt {\frac {n d}{D p}}\right), \tag {3.1} +$$ + +where $\tilde{\Omega}$ hides logarithmic factors in $W, p, R, Q$ , and the probability of error $\delta$ . Thus we see that the law of robustness, namely that the number of parameters should be at least $nd$ for a smooth model with low training error, remains intact for constant depth neural networks. If taken at face value, the lower bound (3.1) suggests that it is better in practice to distribute the parameters towards depth rather than width, since the lower bound is decreasing with $D$ . On the other hand, we note that (3.1) can be strengthened to: + +$$ +\operatorname {L i p} (f) \geq \tilde {\Omega} \left(\sqrt {\frac {n d}{p \log (\bar {B})}}\right), \tag {3.2} +$$ + +for the class of neural networks such that $B(\boldsymbol{w}) \leq \overline{B}$ . In other words the dependency on the depth all but disappears by simply assuming that the quantity $B(\boldsymbol{w})$ (a natural upper bound on the Lipschitz constant of the network) is polynomially controlled. Interestingly many works have suggested to keep $B(\boldsymbol{w})$ under control, either for regularization purpose (for example [BFT17] relates $B(\boldsymbol{w})$ to the Rademacher complexity of multi-layer neural networks) or to simply control gradient explosion during training, see e.g., [ASB16, CBG+17, MHRB17, MKKY18, JCC+19, YM17]. Moreover, in addition to being well-motivated in practice, the assumption that $\overline{B}$ is polynomially controlled seems also somewhat unavoidable in theory, since $B(\boldsymbol{w})$ is an upper bound on the Lipschitz constant $\mathrm{Lip}(f_{\boldsymbol{w}})$ . Thus a theoretical construction showing that the lower bound in (3.1) is tight (at some large depth $D$ ) would necessarily need to have an exponential gap between $\mathrm{Lip}(f_{\boldsymbol{w}})$ and $B(\boldsymbol{w})$ . We are not aware of any such example, and it would be interesting to fully elucidate the role of depth in the law of robustness (particularly if it could give recommendation on how to best distribute parameters in a neural network). + +# 4 Generalization Perspective + +The law of robustness can be phrased in a slightly stronger way, as a generalization bound for classes of Lipschitz functions based on data-dependent Rademacher complexity. In particular, this perspective applies to any Lipschitz loss function, whereas our analysis in the main text was specific to the squared loss. We define the data-dependent Rademacher complexity $\mathrm{Rad}_{n,\mu}(\mathcal{F})$ by + +$$ +\operatorname {R a d} _ {n, \mu} (\mathcal {F}) = \frac {1}{n} \mathbb {E} ^ {\sigma_ {i}, x _ {i}} \left[ \sup _ {f \in \mathcal {F}} \left| \sum_ {i = 1} ^ {n} \sigma_ {i} f \left(x _ {i}\right) \right| \right] \tag {4.1} +$$ + +where the values $(\sigma_{i})_{i\in [n]}$ are i.i.d. symmetric Rademacher variables in $\{-1,1\}$ while the values $(x_{i})_{i\in [n]}$ are i.i.d. samples from $\mu$ + +Lemma 4.1. Suppose $\mu = \sum_{i=1}^{k} \alpha_i \mu_i$ is a mixture of c-isoperimetric distributions. For finite $\mathcal{F}$ consisting of $L$ -Lipschitz $f$ with $|f(x)| \leq 1$ for all $(f, x) \in \mathcal{F} \times \mathbb{R}^d$ , we have + +$$ +\operatorname {R a d} _ {n, \mu} (\mathcal {F}) \leq O \left(\max \left(\sqrt {\frac {k}{n}}, L \sqrt {\frac {c \log (| \mathcal {F} |)}{n d}}\right)\right). \tag {4.2} +$$ + +The proof is identical to that of Theorem 2. Note that $\mathrm{Rad}_{n,\mu}(\mathcal{F})$ simply measures the ability of functions in $\mathcal{F}$ to correlate with random noise. Using standard machinery it implies the following generalization bound: + +Corollary 4.2. For any loss function $\ell(t, y)$ which is bounded and 1-Lipschitz in its first argument and any $\delta \in [0,1]$ , in the setting of Lemma 4.1 we have with probability at least $1 - \delta$ the uniform convergence bound: + +$$ +\sup _ {f \in \mathcal {F}} \left| \mathbb {E} ^ {(x, y) \sim \mu} [ \ell (f (x), y) ] - \frac {1}{n} \sum_ {i = 1} ^ {n} \ell (f (x _ {i}), y _ {i}) \right| \leq O \left(\max \left(\sqrt {\frac {k}{n}}, L \sqrt {\frac {c \log (| \mathcal {F} |)}{n d}}, \sqrt {\frac {\log (1 / \delta)}{n}}\right)\right). +$$ + +Proof. Using McDiarmid's concentration inequality it is enough to bound the left hand side in expectation over $(x_{i},y_{i})$ . Using the symmetrization trick, one reduces this task to upper bound + +$$ +\mathbb {E} ^ {x _ {i}, y _ {i}, \sigma_ {i}} \sup _ {f \in \mathcal {F}} \frac {1}{n} \sum_ {i = 1} ^ {n} \sigma_ {i} \ell (f (x _ {i}), y _ {i}). +$$ + +Fixing the pairs $(x_{i},y_{i})$ and using the contraction lemma (see e.g., [SSBD14, Theorem 26.9]) the above quantity is upper bounded by $\mathrm{Rad}_{n,\mu}(\mathcal{F})$ which concludes the proof. + +Of course, one can again use an $\epsilon$ -net to obtain an analogous result for continuously parametrized function classes. The law of robustness, now for a general loss function, follows as a corollary (the argument is similar to [Proposition 1, [BELM20]]). Let us point out that many papers have studied the Rademacher complexity of function classes such as neural networks (see e.g. [BFT17], or [YKB19] in the context of adversarial examples). The new feature of our result is that isoperimetry of the covariates yields improved generalization guarantees. + +# Funding Acknowledgement + +Funding in direct support of this work: NSF grant CCF-2006489, NSF graduate research fellowship, Stanford graduate fellowship. Additional revenues related to this work: internship employment by the second author at Microsoft Research. + +# References + +[ASB16] Martin Arjovsky, Amar Shah, and Yoshua Bengio. Unitary evolution recurrent neural networks. In International Conference on Machine Learning, pages 1120-1128. PMLR, 2016. +[BELM20] Sebastien Bubeck, Ronen Eldan, Yin Tat Lee, and Dan Mikulincer. Network size and size of the weights in memorization with two-layers neural networks. In Advances in Neural Information Processing Systems, volume 33, pages 4977-4986, 2020. +[BFT17] Peter L Bartlett, Dylan J Foster, and Matus J Telgarsky. Spectrally-normalized margin bounds for neural networks. In I. Guyon, U. V. Luxburg, S. Bengio, H. Wallach, R. Fergus, S. Vishwanathan, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017. + +[BHMM19] 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. +[BL97] Sergey Bobkov and Michel Ledoux. Poincaré's inequalities and Talagrand's concentration phenomenon for the exponential distribution. Probability Theory and Related Fields, 107(3):383-400, 1997. +[BL00] Sergey G Bobkov and Michel Ledoux. From Brunn-Minkowski to Brascamp-Lieb and to logarithmic Sobolev inequalities. Geometric & Functional Analysis GAFA, 10(5):1028-1052, 2000. +[BLLT20] 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. +[BLN21] Sébastien Bubeck, Yuanzhi Li, and Dheeraj M Nagaraj. A law of robustness for two-layer neural networks. In Conference on Learning Theory, pages 804-820. PMLR, 2021. +$\left[\mathrm{CBG}^{+}17\right]$ Moustapha Cisse, Piotr Bojanowski, Edouard Grave, Yann Dauphin, and Nicolas Usunier. Parseval networks: Improving robustness to adversarial examples. In International Conference on Machine Learning, pages 854-863. PMLR, 2017. +[CCNW21] Hong-Bin Chen, Sinho Chewi, and Jonathan Niles-Weed. Dimension-free log-sobolev inequalities for mixture distributions. Journal of Functional Analysis, 281(11):109236, 2021. +[FMN16] Charles Fefferman, Sanjoy Mitter, and Hariharan Narayanan. Testing the manifold hypothesis. Journal of the American Mathematical Society, 29(4):983–1049, 2016. +[GCL+19] Ruiqi Gao, Tianle Cai, Haochuan Li, Cho-Jui Hsieh, Liwei Wang, and Jason D Lee. Convergence of adversarial training in overparametrized neural networks. Advances in Neural Information Processing Systems, 32:13029-13040, 2019. +$\left[\mathrm{GMF}^{+}18\right]$ Justin Gilmer, Luke Metz, Fartash Faghri, Samuel S Schoenholz, Maithra Raghu, Martin Wattenberg, and Ian Goodfellow. Adversarial spheres. arXiv preprint arXiv:1801.02774, 2018. +$\left[\mathrm{GQU}^{+}20\right]$ Sven Gowal, Chongli Qin, Jonathan Uesato, Timothy Mann, and Pushmeet Kohli. Uncovering the limits of adversarial training against norm-bounded adversarial examples. arXiv preprint arXiv:2010.03593, 2020. +[Gro86] Mikhael Gromov. Isoperimetric inequalities in riemannian manifolds. In Asymptotic Theory of Finite Dimensional Spaces, volume 1200, pages 114-129. Springer Berlin, 1986. +[HS89]Trevor Hastie and Werner Stuetzle. Principal curves. Journal of the American Statistical Association, 84(406):502-516, 1989. +$\left[\mathrm{JCC}^{+}19\right]$ Haoming Jiang, Zhehui Chen, Minshuo Chen, Feng Liu, Dingding Wang, and Tuo Zhao. On computation and generalization of gans with spectrum control. Proc. of International Conference on Learning Representation (ICLR), 2019. +[KL93] Nanda Kambhatla and Todd K Leen. Fast nonlinear dimension reduction. In IEEE International Conference on Neural Networks, pages 1213-1218. IEEE, 1993. +[Led99] Michel Ledoux. Concentration of measure and logarithmic Sobolev inequalities. In *Seminaire de probabilités XXXIII*, pages 120–216. Springer, 1999. +[Led01] M. Ledoux. The concentration of measure phenomenon. In Mathematical Surveys and Monographs, volume 89. American Mathematical Society, Providence, RI, 2001. + +[MHRB17] Zakaria Mhammedi, Andrew Hellicar, Ashfaqur Rahman, and James Bailey. Efficient orthogonal parametrisation of recurrent neural networks using householder reflections. In International Conference on Machine Learning, pages 2401-2409. PMLR, 2017. +[MKKY18] Takeru Miyato, Toshiki Kataoka, Masanori Koyama, and Yuichi Yoshida. Spectral normalization for generative adversarial networks. Proc. of International Conference on Learning Representation (ICLR), 2018. +[MM19] Song Mei and Andrea Montanari. The generalization error of random features regression: Precise asymptotics and the double descent curve. Communications on Pure and Applied Mathematics, 2019. +$\left[\mathbf{MMS}^{+}18\right]$ Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. Proc. of International Conference on Learning Representation (ICLR), 2018. +$\left[\mathrm{NBA}^{+}18\right]$ Roman Novak, Yasaman Bahri, Daniel A Abolafia, Jeffrey Pennington, and Jascha Sohl-Dickstein. Sensitivity and generalization in neural networks: an empirical study. arXiv preprint arXiv:1802.08760, 2018. +$\left[\mathrm{NKB}^{+}20\right]$ 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. +[NM10] Hariharan Narayanan and Sanjoy Mitter. Sample complexity of testing the manifold hypothesis. In Proceedings of the 23rd International Conference on Neural Information Processing Systems-Volume 2, pages 1786-1794, 2010. +[RS00] Sam T Roweis and Lawrence K Saul. Nonlinear dimensionality reduction by locally linear embedding. Science, 290(5500):2323-2326, 2000. +[RWK20] Leslie Rice, Eric Wong, and Zico Kolter. Overfitting in adversarially robust deep learning. In Proceedings of the 37th International Conference on Machine Learning, volume 119 of Proceedings of Machine Learning Research, pages 8093-8104. PMLR, 2020. +[SSBD14] Shai Shalev-Shwartz and Shai Ben-David. Understanding machine learning: From theory to algorithms. Cambridge university press, 2014. +[TDSL00] Joshua B Tenenbaum, Vin De Silva, and John C Langford. A global geometric framework for nonlinear dimensionality reduction. science, 290(5500):2319-2323, 2000. +[Ver18] Roman Vershynin. High-dimensional probability: An introduction with applications in data science, volume 47. Cambridge university press, 2018. +[vH14] Ramon van Handel. Probability in high dimension. Technical report, Princeton University, 2014. +[XY20] Cihang Xie and Alan Yuille. Intriguing properties of adversarial training at scale. In International Conference on Learning Representations, 2020. +[YKB19] Dong Yin, Ramchandran Kannan, and Peter Bartlett. Rademacher complexity for adversarially robust generalization. In International conference on machine learning, pages 7085-7094. PMLR, 2019. +[YM17] Yuichi Yoshida and Takeru Miyato. Spectral norm regularization for improving the generalizability of deep learning. arXiv preprint arXiv:1705.10941, 2017. +[YSJ19] Chulhee Yun, Suvrit Sra, and Ali Jababaie. Small relu networks are powerful memorizers: a tight analysis of memorization capacity. In Advances in Neural Information Processing Systems, pages 15532-15543, 2019. \ No newline at end of file diff --git a/auniversallawofrobustnessviaisoperimetry/images.zip b/auniversallawofrobustnessviaisoperimetry/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e832829d25c7a1025144c3d78bb718982bb66741 --- /dev/null +++ b/auniversallawofrobustnessviaisoperimetry/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9004bcb0e1335409687c4cad022ab6eccfa00b7234aa29fbbb48a1b77fa0ee53 +size 290562 diff --git a/auniversallawofrobustnessviaisoperimetry/layout.json b/auniversallawofrobustnessviaisoperimetry/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..582efdd9429ce1029a6d2ba7d1a16bbeb070fff0 --- /dev/null +++ b/auniversallawofrobustnessviaisoperimetry/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd8d1a60da514025d889aed67541ada773e1c26f07aa1851e0272eb8f73baa3f +size 569086 diff --git a/auniversalprobabilisticspikecountmodelrevealsongoingmodulationofneuralvariability/84cb1587-804c-41a8-b7c6-eb4f26f12b18_content_list.json b/auniversalprobabilisticspikecountmodelrevealsongoingmodulationofneuralvariability/84cb1587-804c-41a8-b7c6-eb4f26f12b18_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..21574b670710b33a9db836d872162a1ab3c1e0e1 --- /dev/null +++ b/auniversalprobabilisticspikecountmodelrevealsongoingmodulationofneuralvariability/84cb1587-804c-41a8-b7c6-eb4f26f12b18_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a6497f91629852b58eb8341d44eddf12858d2e8633df7aef418b3b35e85ded66 +size 79144 diff --git a/auniversalprobabilisticspikecountmodelrevealsongoingmodulationofneuralvariability/84cb1587-804c-41a8-b7c6-eb4f26f12b18_model.json b/auniversalprobabilisticspikecountmodelrevealsongoingmodulationofneuralvariability/84cb1587-804c-41a8-b7c6-eb4f26f12b18_model.json new file mode 100644 index 0000000000000000000000000000000000000000..2a7f82bfa75ece918774b49b44a0695bd925f254 --- /dev/null +++ b/auniversalprobabilisticspikecountmodelrevealsongoingmodulationofneuralvariability/84cb1587-804c-41a8-b7c6-eb4f26f12b18_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:164b80daff0d08af6d01c3e641fc5aee167e5a650adcfb8a8539c8b58bb3e7cd +size 103555 diff --git a/auniversalprobabilisticspikecountmodelrevealsongoingmodulationofneuralvariability/84cb1587-804c-41a8-b7c6-eb4f26f12b18_origin.pdf b/auniversalprobabilisticspikecountmodelrevealsongoingmodulationofneuralvariability/84cb1587-804c-41a8-b7c6-eb4f26f12b18_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..95e51be8816fdc817278e320bcfe3857b157aa2b --- /dev/null +++ b/auniversalprobabilisticspikecountmodelrevealsongoingmodulationofneuralvariability/84cb1587-804c-41a8-b7c6-eb4f26f12b18_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:128a1b9745cd1e02bb8d9a29e546ea4e7a889bd9a14b3958b8102935efeccc67 +size 4720680 diff --git a/auniversalprobabilisticspikecountmodelrevealsongoingmodulationofneuralvariability/full.md b/auniversalprobabilisticspikecountmodelrevealsongoingmodulationofneuralvariability/full.md new file mode 100644 index 0000000000000000000000000000000000000000..9aedfaaa5e76e71e2184ac1a1e895534d134aa80 --- /dev/null +++ b/auniversalprobabilisticspikecountmodelrevealsongoingmodulationofneuralvariability/full.md @@ -0,0 +1,313 @@ +# A universal probabilistic spike count model reveals ongoing modulation of neural variability + +David Liu + +Department of Engineering + +University of Cambridge + +d1543@cam.ac.uk + +Máté Lengyel + +Department of Engineering Department of Cognitive Science + +University of Cambridge Central European University + +m.lengyel@eng.cam.ac.uk + +# Abstract + +Neural responses are variable: even under identical experimental conditions, single neuron and population responses typically differ from trial to trial and across time. Recent work has demonstrated that this variability has predictable structure, can be modulated by sensory input and behaviour, and bears critical signatures of the underlying network dynamics and computations. However, current methods for characterising neural variability are primarily geared towards sensory coding in the laboratory: they require trials with repeatable experimental stimuli and behavioural covariates. In addition, they make strong assumptions about the parametric form of variability, rely on assumption-free but data-inefficient histogram-based approaches, or are altogether ill-suited for capturing variability modulation by covariates. Here we present a universal probabilistic spike count model that eliminates these shortcomings. Our method builds on sparse Gaussian processes and can model arbitrary spike count distributions (SCDs) with flexible dependence on observed as well as latent covariates, using scalable variational inference to jointly infer the covariate-to-SCD mappings and latent trajectories in a data efficient way. Without requiring repeatable trials, it can flexibly capture covariate-dependent joint SCDs, and provide interpretable latent causes underlying the statistical dependencies between neurons. We apply the model to recordings from a canonical non-sensory neural population: head direction cells in the mouse. We find that variability in these cells defies a simple parametric relationship with mean spike count as assumed in standard models, its modulation by external covariates can be comparably strong to that of the mean firing rate, and slow low-dimensional latent factors explain away neural correlations. Our approach paves the way to understanding the mechanisms and computations underlying neural variability under naturalistic conditions, beyond the realm of sensory coding with repeatable stimuli. + +# 1 Introduction + +Classical analyses of neural coding are based on mean spike counts or neural firing rates. Indeed, some of the most paradigmatic examples of the neural code were discovered by regressing neural firing rates to particular sensory stimuli [1, 2] or behavioural covariates [3, 4, 5, 6] to characterize their tuning properties. However, neural spiking is generally not regular. Recordings from many cortical areas show significantly different activity patterns within and across identical trials [7], despite fixing experimentally controlled variables. This irregularity is also seen in continual neural recordings without trial structure [8]. The resulting variability has classically been characterised as 'Poisson', with a Fano factor (variance to mean ratio) of one [9], but experimental data also often exhibits significantly more [10, 8, 11, 12] and sometimes less [13, 14] variability, respectively referred to as over- or underdispersion. Moreover, experimental studies have revealed that neural variability generally depends on stimulus input and behaviour [15, 16, 17, 18], and exhibits structured shared + +variability ('noise correlations') across neurons even after conditioning on such covariates. Such correlations can have important consequences for decoding information from neural population activity [19, 20, 21] and reveal key properties of the underlying circuit dynamics [22]. Moreover, theories of neural representations of uncertainty have assigned computational significance to variability as a signature of Bayesian inference [23, 24, 25, 26]. Thus, just as classical tuning curves for firing rates have been crucial for understanding some of the fundamental properties of the neural code, a principled statistical characterisation of neural variability, and its dependence on stimulus and behavioral covariates, is a key step towards understanding the dynamics of neural circuits and the computations they subserve. + +The traditional approach to characterising neural variability has been pioneered in sensory areas, and relies on repeatable trial structure with a sufficiently large number of trials using identical stimulus and behavioral correlates [27, 15, 28]. Variability in this case can be quantified by simple summary statistics of spike counts across trials of the same condition. However, this approach does not readily generalise to more naturalistic conditions where covariates cannot be precisely controlled and repeated in an experiment. This more general setting requires statistical methods that take into account temporal variation of covariates for predicting neural count activity. Generalised Linear Models are a popular choice [29], but they only model the dependence of firing rates on covariates – with changes in variability directly coupled to changes in the rate inherent to Poisson spiking. More complex methods for inferring neural tuning [30, 31] and latent structure [32, 33, 34, 35] similarly use restrictive parametric families for spike count distributions, and thus also cannot model changes in variability that are not 'just' a consequence of changes in mean counts or firing rates. Conversely, statistical models capable of capturing arbitrary single neuron count statistics, such as histogram-based approaches or copulas [36], do not incorporate dependencies on covariates. + +Here we unify these separate approaches, resulting in a single framework for jointly inferring neural tuning, single neuron count statistics, neural correlations, and latent structure. Our semi-parametric approach leads to the universal count model (UCM) for counts ranging from 0 to $K$ , in the sense that we can model arbitrary distributions over the joint count space of size $(K + 1)^N$ of $N$ neurons. The trade-off between computational overhead and model expressivity is controlled by hyperparameters, with expressivity upper bounded by the true universal model. Our approach extends the idea of a universal binary count model [37] to a finite range of integer counts, while allowing flexible dependence on observed and latent covariates to model non-stationary neural activity and correlations. The flexibility reduces biases from restrictive assumptions in any of the model components. Scalability is maintained by leveraging sparse Gaussian processes [38] with mini-batching [39, 40] to handle the size of modern neural recordings. + +We first define the UCM, and then describe how to interpret as well as evaluate model fits. As our model is able to capture arbitrary single neuron statistics, we build on the Kolmogorov-Smirnov test to construct more absolute goodness-of-fit measures. After validating our method on synthetic data that cannot be captured by currently used methods, we apply the model to electrophysiological recordings from two distinct brain regions in mice that show significant tuning to the head direction of the animal [41, 42]. We find that (1) neural activity tends to be less dispersed than common Poisson-like models at higher firing rates, and more dispersed at low rates; (2) mean and variance of counts defy a simple parametric relationship imposed by parametric count distribution families; (3) variability modulation by behaviour can be comparable or even exceed that of the mean count or firing rate; (4) a two-dimensional latent trajectory varying on timescales of $\sim 1$ s is sufficient to explain away neural correlations but not the non-Poisson nature of single neuron variability. Finally, we discuss related work, limitations and proposed extensions of our model. + +# 2 Universal count model + +Notation Spike count activity of $N$ neurons recorded into $T$ time bins is formally represented as an $N$ -dimensional time series of non-negative integers. Due to biological constraints, the possible spike counts have some finite upper bound $K$ , taken as the highest observed count. We denote probabilities of a spike count distribution (SCD) by a vector $\pi$ of length $K + 1$ , and use $\Pi$ to denote the collection of vectors $\pi_{nt}$ for neurons $n$ and time steps $t$ . Additionally, we denote the count activity by a matrix $Y \in [0, K]^{N \times T}$ with elements $y_{nt}$ . Input covariates are observed $X \in \mathbb{R}^{T \times D_x}$ (e.g. animal speed) or latent $Z \in \mathbb{R}^{T \times D_z}$ (to capture e.g. attention), with range depending on topology [43]. We denote their elements $x_{td}$ and $z_{tq}$ with observed and latent dimension $d$ and $q$ , respectively. + +![](images/b28cad0e1cc3be5e4d798bac286d2b51b77164a30107ada72e258366f0de2389.jpg) +Figure 1: Schematic of the UCM and the workflow. Left: graphical model corresponding to Equation 1, with shaded circles as observed, open circles as latent, and squares as deterministic variables. Filled dots represent fixed quantities. Middle: example inference of model posterior Equation 3, with inferred latent trajectories (green, top) and covariate-dependent SCDs (blue, bottom) that depend on both observed $x$ and latent $z$ covariates. Note we only show the posterior over a single SCD evaluated on a $(x,z)$ grid, whereas the full posterior defines SCDs over all neurons. Right: obtaining interpretable spike count statistics from the SCDs (see subsection 2.3). Examples show firing rate and Fano factor tuning curves over observed $x$ and latent $z$ covariates, either jointly (heatmaps) or marginalized (grey curves). The depth of modulation in marginalized tuning curves is used to extract a tuning index (TI) for the chosen subsets of covariates, see Equation 6. + +# 2.1 Generative model + +The big picture is to model counts $Y$ with dependence on $X$ . For each neuron, our model consists of $C$ Gaussian process (GP) priors, a basis expansion $\phi : \mathbb{R}^C \to \mathbb{R}^{\tilde{C}}$ , and a linear-softmax mapping + +$$ +z _ {t q} \sim p (Z; \theta^ {\mathrm {p r}}), \quad h _ {c n} (\cdot) \sim \mathcal {G P} (0, k _ {c n} (\cdot , \cdot ; \theta_ {c n} ^ {\mathrm {G P}})) +$$ + +$$ +f _ {c n t} = h _ {c n} \left(\boldsymbol {x} _ {t}, \boldsymbol {z} _ {t}\right) \tag {1} +$$ + +$$ +\boldsymbol {\pi} _ {n t} = \operatorname {s o f t m a x} \left(W _ {n} \phi \left(\boldsymbol {f} _ {n t}\right) + \boldsymbol {b} _ {n}\right) +$$ + +$$ +y _ {n t} \sim \operatorname {D i s c r e t e} (\pi_ {n t}) +$$ + +where $W \in \mathbb{R}^{(K + 1) \times \tilde{C}}$ , $\pmb{b} \in \mathbb{R}^{K + 1}$ , and the GP covariance functions $k_{cn}$ have hyperparameters $\theta_{cn}^{\mathrm{GP}}$ . The use of non-parametric GP mappings with point estimates for $W$ and $\pmb{b}$ leads to a semi-parametric model with parameters $\theta$ , see details in Appendix E. The overall generative model $P_{\theta}(Y|X)$ is depicted schematically in Figure 1. Note the model specifies a prior $p(\Pi | X)$ over joint SCDs, conceptually similar to Dirichlet priors [37] but allowing non-parametric dependence on $X$ . With latent input $Z$ , our model can flexibly describe multivariate dependencies in joint SCDs as conditional independence across neurons no longer holds when marginalizing over $Z$ [44]. In addition, $p(Z)$ models temporal correlations in the latent states. We use Markovian priors (details in subsection E.2) + +$$ +p _ {\theta} (Z) = p _ {\theta} \left(\boldsymbol {z} _ {1}\right) \prod_ {t = 2} ^ {T} p _ {\theta} \left(\boldsymbol {z} _ {t} \mid \boldsymbol {z} _ {t - 1}\right) \tag {2} +$$ + +with $\theta^{\mathrm{pr}}$ absorbed into model parameters $\theta$ for compactness. This allows the model to flexibly capture both neural and temporal correlations in $Y$ . To attain scalability, we use sparse GPs [38]. + +Depending on $C$ and basis functions $\phi(\cdot)$ , we obtain an approximation to the true universal prior on joint SCDs, with 'universal' referring to the ability to capture any joint SCD over all neurons. Arbitrary single neuron statistics can be captured when $C = K$ with $\phi(\boldsymbol{f}) = \boldsymbol{f}$ , but fitting is computationally expensive when $N \times C \gg 1$ . For capturing all correlations, the model also requires a sufficiently large latent space. One controls the trade-off between model expressiveness and computational overhead through $C$ and $\phi$ . Larger expansions $\phi$ allow one to model count distributions more expressively with small $C$ , e.g. the element-wise linear-exponential $\phi(\boldsymbol{f}) = (f_1, e^{f_1}, \ldots, f_C, e^{f_C})$ covers a range of distributions including the truncated Poisson with only $C = 1$ (see subsection A.3). + +# 2.2 Stochastic variational inference and learning + +For the joint model distribution $p_{\theta}(Y,\Pi,Z|X) = P(Y|\Pi)p_{\theta}(\Pi|X,Z)p_{\theta}(Z)$ , with count distributions $P(Y|\Pi)$ , we approximate the posterior by $q_{\theta,\chi,\varphi}(\Pi,Z|X)$ that factorizes in the form + +$$ +q _ {\theta , \chi} (\Pi | X, Z) q _ {\varphi} (Z) = \left(\prod_ {n} ^ {N} q _ {\theta , \chi} (\Pi_ {n} | X, Z)\right) \left(\prod_ {t} ^ {T} q _ {\varphi} \left(\boldsymbol {z} _ {t}\right)\right) \tag {3} +$$ + +with $\varphi$ and $\chi$ the variational parameters for latent states and the sparse Gaussian process posterior (Appendix E), respectively. Note that we use a factorized normal $q(Z)$ for Euclidean $Z$ , and a wrapped normal for circular $Z$ based on the framework of reparameterized Lie groups [45, 43]. The posterior over count probabilities $q_{\theta ,\chi}(\Pi |X,Z)$ is defined as mapping the sparse Gaussian process posterior $q_{\theta ,\chi}(F|X,Z)$ through $\Pi (F)$ (Equation 1), a deterministic mapping. This is analytically intractable, so in practice it is represented by Monte Carlo samples. Using stochastic variational inference [46], we minimize an upper bound on the negative log marginal likelihood + +$$ +\mathcal {F} _ {\theta , \chi , \varphi} (Y | X) = - \mathbb {E} _ {Z \sim q _ {\varphi} (Z)} \mathbb {E} _ {\Pi \sim q _ {\theta , \chi} (\Pi | X, Z)} \left[ \log \frac {P (Y | \Pi) p _ {\theta} (\Pi | X , Z) p _ {\theta} (Z)}{q _ {\theta , \chi} (\Pi | X , Z) q _ {\varphi} (Z)} \right] \tag {4} +$$ + +known as the variational free energy. This objective leads to tractable terms (subsection E.1), allowing us to infer the approximate posterior as well as a lower bound of the log marginal likelihood [47, 40]. We use Adam [48] for optimization, see details of implementation and model fitting in Appendix E. + +# 2.3 Obtaining interpretable spike count statistics from the model + +Characterizing spike count distributions From the posterior $q(\Pi |X)^1$ , we can compute samples of the posterior of any statistic of spike counts as a function of covariates. Single neuron statistics in particular can be characterized by tuning curves for both mean firing rates and Fano factors (FF) + +$$ +\rho (X) = \frac {1}{\Delta} \mathbb {E} _ {q (\Pi | X)} \mathbb {E} _ {P (Y | \Pi)} [ Y ] \quad \operatorname {F F} (X) = \mathbb {E} _ {q (\Pi | X)} \left[ \frac {\operatorname {V a r} _ {P (Y | \Pi)} [ Y ]}{\mathbb {E} _ {P (Y | \Pi)} [ Y ]} \right] \tag {5} +$$ + +with time bin length $\Delta$ . The model also quantifies private neuron variability that cannot be explained away by regressing to shared input (both observed and latent) through $P_{n}(y_{tn}|\boldsymbol{x}_{t})$ . + +To quantify the sensitivity of a some aspect of neuron activity to a set of covariates $\boldsymbol{x}_{*}$ , we define a tuning index (TI) with respect to a count statistic $T_{y}(\boldsymbol{x}_{*})$ + +$$ +\mathrm {T I} = \frac {\max _ {\boldsymbol {x} _ {*}} T _ {y} \left(\boldsymbol {x} _ {*}\right) - \min _ {\boldsymbol {x} _ {*}} T _ {y} \left(\boldsymbol {x} _ {*}\right)}{\max _ {\boldsymbol {x} _ {*}} T _ {y} \left(\boldsymbol {x} _ {*}\right) + \min _ {\boldsymbol {x} _ {*}} T _ {y} \left(\boldsymbol {x} _ {*}\right)} \tag {6} +$$ + +with $T_{y}(\pmb{x}_{*})$ evaluated under the mean posterior SCD marginalized over all other covariate dimensions complementary to $\pmb{x}_{*}$ . These marginalized distributions are computed using observed input $\pmb{x}_{t}$ (subsection D.5). Resulting marginalized tuning curves for TIs are depicted conceptually in Figure 1. + +Generalized $Z$ -scores and noise correlations The deviation of activity from the predicted statistics is commonly quantified through $Z$ -scores [8, 49, 17], which are computed as $(y - \langle y \rangle) / \sqrt{\langle y \rangle}$ with $\langle y \rangle$ being the mean count in some time bin. If neural activity follows a Poisson distribution, the distribution of $Z$ -scores asymptotically tends to a unit normal when average counts $\langle y \rangle \gg 1$ (Appendix B). To generalize the normality of the $Z$ -score for arbitrary counts and SCDs, we use + +$$ +\xi = \Phi^ {- 1} (u) \quad \text {w i t h} \quad u (y) = \int_ {0} ^ {y + \epsilon} p (\tilde {y}) \mathrm {d} \tilde {y} = \sum_ {k = 0} ^ {y - 1} P (k) + \epsilon P (y), \quad \epsilon \sim \mathcal {U} (0, 1) \tag {7} +$$ + +with $\Phi (\cdot)$ the unit Gaussian cdf., and dequantization noise $\epsilon$ to get continuous quantiles $u\sim \mathcal{U}(0,1)$ and generalized $Z$ -scores $\xi \sim \mathcal{N}(0,1)$ from the probability integral transform. + +With $\xi$ , one can completely describe single neuron statistics with respect to the model. Correlations in the neural activity however will cause $\xi$ to be correlated. We define generalized lagged correlations $r_{ij}(\Delta) \in [-1, 1]$ and Fisher $Z \in \mathbb{R}$ that is more convenient for statistical testing + +$$ +r _ {i j} (\Delta) = \left\langle \xi_ {i} (t) \xi_ {j} (t + \Delta) \right\rangle_ {t}, \quad Z _ {\text {F i s h e r}} = \frac {1}{2} \log \frac {1 + r}{1 - r} \tag {8} +$$ + +which describes spatio-temporal correlations not captured by the model. Noise correlations [50] refer to the case of $\Delta = 0$ , when $r_{ij}$ becomes symmetric. + +# 2.4 Assessing model fit + +Our model depends on a hyperparameter $C \leq K$ that trades off flexibility with computational burden. In practice, one likely captures the neural activity accurately with $C$ well below $K$ and a simple basis expansion as the linear-exponential above or quadratic-exponential $\phi(\pmb{f}) = (f_1, f_1^2, e^{f_1}, \dots, f_1 f_2, \dots)$ . This can be quantified by the statistical measures provided below, and allows us to select appropriate hyperparameters to capture the data sufficiently well. + +To assess the model fit to neural spike count data, a conventional machine learning approach is to evaluate the expected log-likelihood of the posterior predictive distribution on held-out data $Y$ , leading to the cross-validated log-likelihood + +$$ +\operatorname {c v L L} = \mathbb {E} _ {q (Z)} \mathbb {E} _ {q (\Pi | X, Z)} [ \log P (Y | \Pi) ] \tag {9} +$$ + +where we cross validate over the neuron dimension by using the majority of neurons to infer the latent states $q(Z)$ in the held-out segment of the data, and then evaluate Equation 9 over the remaining neurons. Without latent variables, we simply take the expectation with respect to $q(\Pi |X)$ . However, the cvLL does not reveal how well the data is described by the model in an absolute sense. Likelihood bootstrap methods are possible [28], but become cumbersome for large datasets. To assess whether the neural data is statistically distinguishable from the single neuron statistics predicted by the model, we use the Kolmogorov-Smirnov framework [51] with $u$ from Equation 7 across time steps $t$ + +$$ +T _ {\mathrm {K S}} = \max _ {t} | F _ {T} (u _ {t}) - u _ {t} | \tag {10} +$$ + +with empirical distribution function $F_{T}(u)$ (for details see Appendix B). This scalar number is positive and does not indicate whether the data is under- or overdispersed relative to the model. For this, a useful measure of dispersion is the logarithm of the variance of $\xi$ with a correction + +$$ +T _ {\mathrm {D S}} = \log \left\langle \xi_ {t} ^ {2} \right\rangle_ {t} + \left(\frac {1}{T} + \frac {1}{3 T ^ {2}}\right) \tag {11} +$$ + +which provides a real number with positive and negative sign indicating over- and underdispersion, respectively. Its sampling distribution under $\xi \sim \mathcal{N}(0,1)$ is asymptotically normal, centered around 0 (due to the additive parenthetical term) with a variance depending on the number of timesteps $T$ (subsection B.3). This extends the notion of over- and underdispersion beyond the usual definition of dispersion relative to Poisson models [52]. To quantify whether the model has captured noise correlations in the data, we compute $\xi$ with respect to the mean posterior predictive distribution + +$$ +Q _ {\theta , \varphi} (Y | X) = \int \prod_ {t} ^ {T} \left(\prod_ {n} ^ {N} \mathbb {E} _ {q \left(\boldsymbol {\pi} _ {n t} \mid \boldsymbol {x} _ {t}, \boldsymbol {z} _ {t}\right)} \left[ P \left(y _ {t n} \mid \boldsymbol {\pi} _ {n t}\right) \right]\right) q _ {\varphi} (\boldsymbol {z} _ {t}) d \boldsymbol {z} _ {t} \tag {12} +$$ + +which whitens $\xi$ , hence reducing noise correlations $r$ in Equation 8, if correlations are explained away by co-modulation of neurons due to shared low-dimensional factors [44]. These are captured through latent states $Z$ using the posterior $q_{\varphi}(Z)$ , inferred from the same data used to compute $\xi$ . Overall, this can be interpreted as treating $Z$ as if it was part of the observed input to the model. + +# 3 Results + +In the following, we use $C = 3$ with an element-wise linear-exponential basis expansion (subsection 2.1). This empirically provided sufficient model flexibility as seen in goodness-of-fit metrics. We use an RBF kernel with cosine distances in case of angular input dimensions (subsection E.3). + +# 3.1 Synthetic data + +Animals maintain an internal estimate of their head direction [4, 42, 53]. Here, we extend simple statistical models of head direction cell populations [54] for validating the ability of the UCM to capture complex count statistics, as well as neural correlations through latent structure. The task is to jointly recover the ground truth count likelihoods, their tuning to covariates, and latent trajectories if relevant from activity generated using two synthetic populations. The first population was generated with a parametric heteroscedastic Conway-Maxwell-Poisson (CMP) model [55], which has decoupled mean and variance modulation as well as simultaneously over- and underdispersed activity (Fano + +![](images/80a52072df535f23c720f91e2486c9f86e082ea9c1be58314d75db0d4dc4d391.jpg) +A + +![](images/b11184939a9f82df5c7163040b4c14d53fcc313bf36ba6cea893414e3f9ad69b.jpg) +B +Figure 2: Model validation with two synthetic head direction cell populations. (A) Applying Poisson, heteroscedastic negative binomial (hNB) and universal (U, with either GP or ANN mappings) models to synthetic data from the heteroscedastic CMP population. Error bars indicate s.e.m. over cross-validation runs. Shaded regions for tuning curves and $T_{\mathrm{KS}}$ indicate the $95\%$ CI. $\Delta \mathrm{cvLL}$ is the difference w.r.t. Poisson baseline. Left: regression models, visualizing SCDs (top right), tuning curves (bottom right), and fitting scores (bottom left) for two representative cells. Right: models with an angular latent variable, visualizing inferred latent states (top right), comparing the GP to ANN model (bottom right), and plotting fitting scores (bottom left). Root-mean-squared errors (RMSE) between the inferred latent and ground truth uses the geodesic distance on the ring (subsection D.9). (B) Applying regression (Poisson, Universal (X)) and joint latent-observed (Universal (X,Z)) models to the modulated Poisson population data. Left: three columns showing progressively how single neurons variability, with $\xi$ and $T_{\mathrm{DS}}$ (middle), and noise correlations, with $r_{ij}$ and Fisher $Z$ (bottom), are captured (see subsection 2.4). Right: $\Delta \mathrm{cvLL}$ for all models (top) and visualization of the joint latent-observed model input spaces (middle) and tuning curves (bottom). + +factors above and below 1). The second population consists of Poisson neurons tuned to head direction and an additional hidden signal, which gives rise to apparent overdispersion [28] as well as noise correlations when only regressing to observed covariates. For mathematical details of the count distributions and synthetic populations, see Appendix A and Appendix D, respectively. + +We compare our UCM to the Poisson GP model [33] and the heteroscedastic negative binomial GP model, a non-parametric extension of [55]. To show data-efficiency and regularization benefits of + +GPs, we also compare to a UCM with an artificial neural network (ANN) mapping replacing the GP mapping. For details of the baseline models, see Appendix D. For cross-validation we split the data into 10 roughly equal non-overlapping segments, and validated on 3 chosen segments that were evenly spread out across the data. When a latent space was present, we used $90\%$ of the neurons to infer the latent signal while validating on the remaining neurons, and repeated this for non-overlapping subsets. We rescale the log-likelihoods by the ratio of total neurons to neurons in subset and then take the average over all subsets to obtain comparable cross-validation runs to regression. + +Figure 2A shows that only the UCM successfully captures the heteroscedastic CMP data, indicated by $T_{\mathrm{KS}}$ . Baseline models cannot capture frequent cases where the Fano factor drops below 1. In addition, we observe that using a Bayesian GP over an ANN mapping in the model leads to a reduction in overfitting, especially in the latent setting (Figure 2A). Therefore, all other analyses with the UCM reported here used the GP mapping. Figure 2B shows that the modulated Poisson population activity is seen by a Poisson regression model as overdispersed, indicated by $T_{\mathrm{DS}}$ . Our model flexibly captures the overdispersed single neuron statistics, independent from noise correlations $r_{ij}$ that are captured when we introduce a Euclidean latent dimension. As expected, the $\xi$ scatter plots show whitening under the posterior predictive distribution when the correlations are captured. + +# 3.2 Mouse head direction cells + +We apply the UCM to a recording of 33 head direction cells in the anterodorsal thalamic nucleus (ADn) and the postsubiculum (PoS) of freely moving mice [41, 42], see subsection D.2. Neural data was binned into $40\mathrm{ms}$ intervals, giving $K = 11$ . Note that observed count statistics differ with bin size, see subsection C.2 for a discussion. Regression was performed against head direction (HD), angular head velocity (AHV), animal speed, two-dimensional position in arena, and absolute time, which collectively form $X$ in this model. We used 64 inducing points for regression, and added 8 for every latent dimension added (Appendix E). Cross-validation was performed as in synthetic experiments, but with 6 validation segments and subsets of $85\%$ of neurons to infer the latent signal. + +Figure 3A shows that for regression hNB overfits and performs worst, despite containing Poisson as a special case. However, this limit is not reached in practice due to the numerical implementation, see Appendix A. Only the UCM captures the training data satisfactorily with respect to confidence bounds for $T_{\mathrm{KS}}$ and $T_{\mathrm{DS}}$ , although the data remained slightly underdispersed to the model with $T_{\mathrm{DS}}$ values slightly skewed to negative. Compared to the Poisson model, the cvLL is only slightly higher for the UCM as the data deviates from Poisson statistics in subtle ways. We see both FF above and below 1 (over- and underdispersed) across the neural firing range in Figure 3B, with quite some neurons crossing 1. Correspondingly, FF-mean correlations coefficients are often negative. Their spread away from $\pm 1$ indicates firing rate and FF do not generally satisfy a simple relationship, especially for examples such as cell 27. Furthermore, ADn neurons seem to deviate less from Poisson statistics. From Figure 3C, we note in particular that FFs tend to decrease at the preferred head direction, but rise transiently as the head direction approaches the preferred value. We also see that tuning to speed and time primarily modulates variability rather than firing rates. All of this is impossible to pick up with baseline models, which constrain FF $\geq 1$ as well as FF increasing with firing rate (Appendix A). Finally, we see more tuning of the firing rate to position in PoS cells. + +When adding latent dimensions, Figure 3D shows a peak in the cvLL at two dimensions, where correspondingly the Fisher $Z$ distribution starts to match the unit normal well. Kernel length scales however did not indicate redundant latent subspaces for higher dimensions as expected for automatic relevance determination, likely due to mixing of latent dimensions. Notice the noise correlation patterns in Figure 3E tend to show positive correlations for similarly tuned neurons roughly around the diagonal of blocks, as expected from ring attractor models [22]. Intrinsic neuron variability, roughly quantified by the average FF, further decreased and thus become even more underdispersed when considering additional tuning to latents, in particular for ADn. In addition, latent signals primarily modulate firing rate as seen from TIs in Figure 3F. When looking at time scales of covariates in Figure 3G (computed as the decay time constant of the autocorrelogram (Appendix D), the latent processes seem to vary on time scales right in the gap of behavioural time scales. + +Tangential to our main contribution of characterising the detailed structure of neural variability, our results have another novel element that does not specifically rely on the UCM. Using GP-based non-parametric methods, we successfully estimated the tuning of cells to as many as 8 different covariates (6 observed + 2 latent, see Figure 3G) in a statistically sound fashion, while previous + +![](images/e6a931c5090fe52d95bf323c611aa03276ae6ac445f17674bbac2aae08b86e50.jpg) +A + +![](images/837df380b39d8d5f644a19df25ebb73523de6944f79044eaaf6cb5b65ad9cec2.jpg) +B + +![](images/e7faff60e66f7d3bd3f0aa4649bd0817e88af8d093223cddbb14975733de4779.jpg) +C + +![](images/2c22146d9c7182851a463f225046c8c20bed7443a9e7ed2d36e5b10e293a328b.jpg) +D +Figure 3: Application to mouse head direction cells in the anterodorsal thalamic nucleus (ADn) and the postsubiculum (PoS). (A) Goodness-of-fit for Poisson (P), heteroscedastic negative binomial (hNB) and universal (U) regression with covariates described in the text. Our method (U) outperforms baselines $(p = 7 \cdot 10^{-3}$ for $\Delta$ cvLL w.r.t. Poisson, one-sample $t$ -test). (B) Left: Fano factor (FF) versus mean count of the predictive distribution for all time steps (scatter dots) for two representative cells. Red lines are linear regression fits to scatter points. Right: average FF across time steps and Pearson $r$ correlation between FF and mean count for all cells, with colour indicating region ADn (orange) or PoS (green). (C) Top: conditional tuning curves (subsection D.5) of the UCM with complementary $x$ at preferred HD, positioned at centre of arena, with zero speed, AHV and at time $t = 0$ . Bottom: TIs w.r.t. corresponding covariates for the FF and firing rates. (D) Adding Euclidean latent dimensions $D_z$ . Top: $\Delta$ cvLL w.r.t. regression only. Bottom: Fisher $Z$ histogram, with red curves its sampling distribution. (E) Comparison between models with latent space dimensions $Dz = 2$ and $D_z = 0$ . Top: off-diagonal noise correlations $r_{ij}$ , with neurons ordered by region first (PoS and ADn), and then by preferred head direction within region. Bottom: average FF (same as in (B)) and Fisher $Z$ under the posterior predictive distribution Equation 12. (F) Left: inferred latent trajectories for $D_z = 2$ . Right: corresponding TIs for FF and firing rates. (G) Time scales for covariates computed from autocorrelograms (Appendix D). Note pos. refers to both $x$ and $y$ position (near-identical values). The top horizontal line is the minimum kernel length scale over absolute time across neurons. The bottom line depicts the $40~\mathrm{ms}$ time bin. Error bars in A and D show s.e.m. over cross-validation runs. Shaded regions for $T_{\mathrm{KS}}$ , $T_{\mathrm{DS}}$ , tuning curves and latent states show the $95\%$ CI. + +![](images/3f3922c9853e81197c6bba19447fefffc365e1afc6803d32d0ec11e567466a35.jpg) +E + +![](images/5b7afdd4d059ce4b5802e13b2c67bb63ad79a73ea6228ef084a198708f5de231.jpg) +F + +![](images/6d7b5f79e2df0d418c9b5c7ae8121bc71ae84887285556780300b2f6b787fb82.jpg) +G + +GP-based approaches typically only consider around 2 to 3 input dimensions [56, 33, 43]. Specifically, one of our covariates was absolute experimental time to capture non-stationarities in neural tuning. As a result, our model captured several experimental phenomena that are studied separately in the literature: drifting neural representations [57, 58, 59], anticipatory time intervals [54] and conjunctive tuning to behaviour [60]. We also applied the model in a purely latent setting similar to the example in Figure 2A, with the UCM uncovering a latent signal more closely correlated to the head direction compared to baseline models. These additional results are presented in Appendix C. + +# 4 Discussion + +Related work Neural encoding model provide a statistical description of neural count activity, and typically rely on a parametric count likelihood, such as Poisson [33] or negative binomial [30, 31, 61], that is often mismatched to empirical count statistics. Heteroscedastic versions additionally regress the dispersion parameter of count distributions to covariates [62, 63]. This has shown improvements in stimulus decoding and more calibrated posterior uncertainties [55]. Copula-based models [36, 64] separate marginal distributions of single neurons from the multivariate dependency structure parameterized by the copula family, and thus remove parametric constraints on single neuron count statistics. Generally, the idea of a universal model that can capture arbitrary joint distributions has been explored for binary spike trains [37]. However, neither approach naturally incorporates modulation of spike count distributions by input covariates. + +Our model deals with discrete spike counts ranging from 0 to $K$ in a manner similar to categorical output variables in classification, where existing GP-based approaches pass function points directly through a softmax nonlinearity [65, 66]. Our approach instead relies on a basis expansion and linear-softmax mapping. At small time bins where $K = 1$ , our model becomes identical to Bernoulli models [67] and comparable to point process models [51, 68, 69, 70]. In these cases, modulation of count variability becomes inseparable from firing rate modulation, making it difficult to generalize for heteroscedasticity in an interpretable manner and thus inconvenient for studying response variability. Introducing unobserved input variables incorporates aspects of Gaussian process latent variable models [71, 72]. Such models have been applied to neural data to perform dimensionality reduction [33], with extensions to non-Euclidean latent spaces and non-reversible temporal priors [43, 73]. + +Limitations and further work The empirical choice of hyperparameters $C$ and basis functions $\phi$ is based on achieving sufficient model flexibility, as confirmed with the Kolmogorov-Smirnov approach. Recently, a multivariate extension of the Kolmogorov-Smirnov test has been proposed to directly test multivariate samples against the model [74], instead of looking at single neuron statistics. Alternatively, one could perform ARD [75, 76, 61] by placing a Gaussian prior on $W$ , allowing automatic selection of relevant dimensions once a basis expansion is chosen. Another avenue for future work could consider going completely non-parametric by adding a count dimension to the input space, which is evaluated at counts 0 to $K$ for every time step. This however increases the number of evaluation points by a factor $K + 1$ . For high-dimensional input stimuli common in sensory areas, deep kernels [77] provide a scalable modification of our framework. In addition, extending our model with more powerful priors for latent covariates, such as Gaussian process priors [33, 73], can improve latent variable analysis, especially at smaller time bins where the temporal prior influence becomes more important. Regularization methods may help to decorrelate inferred trajectories [78, 79]. + +Conclusion and impact We introduced a universal probabilistic encoding model for neural spike count data. Our model flexibly captures both single neuron count statistics and their modulation by covariates. By adding latent variables, one can additionally capture neural correlations with potentially interpretable unobserved signals underlying the neural activity. We applied our model to mouse head direction cells and found count statistics that cannot be captured with current methods. Neural activity tends to be less variable at higher firing rates, with many cells showing both over- and underdispersion. Fano factors and mean counts generally do not show a simple relation and can even be decoupled, with Fano factor modulation comparable or in some cases even exceeding that of the rate. Finally, we found that a two-dimensional latent trajectory with a timescale of around a second explained away noise correlations in these cells. + +Neural variability is usually not considered on the same footing as mean firing rates, with models assigning most computational relevance to rates [80, 81]. However, recent work on V1 has started to explore variability as playing a computationally well-defined useful role in the representation of uncertainty [24, 25, 22, 26]. The framework introduced in this paper provides a principled tool for empirically characterising neural variability and its modulations – without the biases inherent in traditional approaches, which would likely miss potentially meaningful patterns in neural activities beyond mean rates. Our model has the potential to reveal new aspects of neural coding, and may find practical applications in designing and improving algorithms for brain-machine interfaces. As progress is made in scaling and applying such technology beyond research environments [82], it becomes increasingly more important to maintain transparency, e.g. through open source code, and to raise awareness of potential ethical issues [83]. + +# Acknowledgments and Disclosure of Funding + +This work was supported by the Cambridge European and Wolfson College Scholarship by the Cambridge Trust (D.L.) and by the Wellcome Trust (Investigator Award in Science 212262/Z/18/Z to M.L). We are grateful to K.T. Jensen and A. Melkonyan for helpful feedback on the manuscript. + +# References + +[1] David H Hubel and Torsten N Wiesel. Receptive fields of single neurones in the cat's striate cortex. The Journal of physiology, 148(3):574, 1959. +[2] Frédéric E Theunissen, Kamal Sen, and Allison J Doupe. Spectral-temporal receptive fields of nonlinear auditory neurons obtained using natural sounds. Journal of Neuroscience, 20(6):2315-2331, 2000. +[3] John O'Keefe and Jonathan Dostrovsky. The hippocampus as a spatial map: preliminary evidence from unit activity in the freely-moving rat. *Brain research*, 1971. +[4] Jeffrey S Taube, Robert U Muller, and James B Ranck. Head-direction cells recorded from the postsubiculum in freely moving rats. i. description and quantitative analysis. Journal of Neuroscience, 10(2):420-435, 1990. +[5] Torkel Hafting, Marianne Fyhn, Sturla Molden, May-Britt Moser, and Edvard I Moser. Microstructure of a spatial map in the entorhinal cortex. Nature, 436(7052):801-806, 2005. +[6] Colin Lever, Stephen Burton, Ali Jeewajee, John O'Keefe, and Neil Burgess. Boundary vector cells in the subiculum of the hippocampal formation. Journal of Neuroscience, 29(31):9771-9777, 2009. +[7] Michael N Shadlen and William T Newsome. The variable discharge of cortical neurons: implications for connectivity, computation, and information coding. Journal of neuroscience, 18(10):3870-3896, 1998. +[8] André A Fenton and Robert U Muller. Place cell discharge is extremely variable during individual passes of the rat through the firing field. Proceedings of the National Academy of Sciences, 95(6):3182-3187, 1998. +[9] Alexandre Pouget, Peter Dayan, and Richard Zemel. Information processing with population codes. Nature Reviews Neuroscience, 1(2):125-132, 2000. +[10] George J Tomko and Donald R Crapper. Neuronal variability: non-stationary responses to identical visual stimuli. *Brain research*, 79(3):405–418, 1974. +[11] A Aldo Faisal, Luc PJ Selen, and Daniel M Wolpert. Noise in the nervous system. Nature reviews neuroscience, 9(4):292-303, 2008. +[12] Johannes Nagele, Andreas VM Herz, and Martin B Stemmler. Untethered firing fields and intermittent silences: Why grid-cell discharge is so variable. Hippocampus, 2020. +[13] Justin Keat, Pamela Reinagel, R Clay Reid, and Markus Meister. Predicting every spike: a model for the responses of visual neurons. Neuron, 30(3):803-817, 2001. +[14] Gaby Maimon and John A Assad. Beyond poisson: increased spike-time regularity across primate parietal cortex. Neuron, 62(3):426-440, 2009. +[15] Mark M Churchland, M Yu Byron, John P Cunningham, Leo P Sugrue, Marlene R Cohen, Greg S Corrado, William T Newsome, Andrew M Clark, Paymon Hosseini, Benjamin B Scott, et al. Stimulus onset quenches neural variability: a widespread cortical phenomenon. Nature neuroscience, 13(3):369, 2010. +[16] Adrián Ponce-Alvarez, Alexander Thiele, Thomas D Albright, Gene R Stoner, and Gustavo Deco. Stimulus-dependent variability and noise correlations in cortical mt neurons. Proceedings of the National Academy of Sciences, 110(32):13162-13167, 2013. + +[17] Alexander S Ecker, Philipp Berens, R James Cotton, Manivannan Subramaniyan, George H Denfield, Cathryn R Cadwell, Stelios M Smirnakis, Matthias Bethge, and Andreas S Tolias. State dependence of noise correlations in macaque primary visual cortex. Neuron, 82(1):235-248, 2014. +[18] Neil C Rabinowitz, Robbe L Goris, Marlene Cohen, and Eero P Simoncelli. Attention stabilizes the shared gain of v4 populations. *Elite*, 4:e08998, 2015. +[19] Larry F Abbott and Peter Dayan. The effect of correlated variability on the accuracy of a population code. Neural computation, 11(1):91-101, 1999. +[20] Bruno B Averbeck, Peter E Latham, and Alexandre Pouget. Neural correlations, population coding and computation. Nature reviews neuroscience, 7(5):358-366, 2006. +[21] Rubén Moreno-Bote, Jeffrey Beck, Ingmar Kanitscheider, Xaq Pitkow, Peter Latham, and Alexandre Pouget. Information-limiting correlations. Nature neuroscience, 17(10):1410, 2014. +[22] Guillaume Hennequin, Yashar Ahmadian, Daniel B Rubin, Máté Lengyel, and Kenneth D Miller. The dynamical regime of sensory cortex: stable dynamics around a single stimulus-tuned attractor account for patterns of noise variability. Neuron, 98(4):846-860, 2018. +[23] Wei Ji Ma, Jeffrey M Beck, Peter E Latham, and Alexandre Pouget. Bayesian inference with probabilistic population codes. Nature neuroscience, 9(11):1432-1438, 2006. +[24] József Fiser, Pietro Berkes, Gergő Orbán, and Mate Lengyel. Statistically optimal perception and learning: from behavior to neural representations. Trends in cognitive sciences, 14(3):119-130, 2010. +[25] Gergő Orbán, Pietro Berkes, József Fiser, and Máté Lengyel. Neural variability and sampling-based probabilistic representations in the visual cortex. *Neuron*, 92(2):530–543, 2016. +[26] Rodrigo Echeveste, Laurence Aitchison, Guillaume Hennequin, and Máté Lengyel. Cortical-like dynamics in recurrent circuits optimized for sampling-based probabilistic inference. Nature Neuroscience, 23(9):1138-1149, 2020. +[27] David J Tolhurst, J Anthony Movshon, and Andrew F Dean. The statistical reliability of signals in single neurons in cat and monkey visual cortex. Vision research, 23(8):775-785, 1983. +[28] Robbe LT Goris, J Anthony Movshon, and Eero P Simoncelli. Partitioning neuronal variability. Nature neuroscience, 17(6):858, 2014. +[29] Jonathan W Pillow, Jonathon Shlens, Liam Paninski, Alexander Sher, Alan M Litke, EJ Chichilnisky, and Eero P Simoncelli. Spatio-temporal correlations and visual signalling in a complete neuronal population. Nature, 454(7207):995-999, 2008. +[30] Jonathan Pillow and James Scott. Fully bayesian inference for neural models with negative-binomial spiking. Advances in neural information processing systems, 25:1898-1906, 2012. +[31] Yuanjun Gao, Lars Busing, Krishna V Shenoy, and John P Cunningham. High-dimensional neural spike train analysis with generalized count linear dynamical systems. In Advances in neural information processing systems, pages 2044-2052, 2015. +[32] Byron M Yu, John P Cunningham, Gopal Santhanam, Stephen Ryu, Krishna V Shenoy, and Maneesh Sahani. Gaussian-process factor analysis for low-dimensional single-trial analysis of neural population activity. Advances in neural information processing systems, 21:1881-1888, 2008. +[33] Anqi Wu, Nicholas A Roy, Stephen Keeley, and Jonathan W Pillow. Gaussian process based nonlinear latent structure discovery in multivariate spike train data. In Advances in neural information processing systems, pages 3496-3505, 2017. +[34] Ryan J Low, Sam Lewallen, Dmitriy Aronov, Rhino Nevers, and David W Tank. Probing variability in a cognitive map using manifold inference from neural dynamics. bioRxiv, page 418939, 2018. + +[35] Chethan Pandarinath, Daniel J O'Shea, Jasmine Collins, Rafal Jozefowicz, Sergey D Stavisky, Jonathan C Kao, Eric M Trautmann, Matthew T Kaufman, Stephen I Ryu, Leigh R Hochberg, et al. Inferring single-trial neural population dynamics using sequential auto-encoders. Nature methods, 15(10):805–815, 2018. +[36] Pietro Berkes, Frank Wood, and Jonathan Pillow. Characterizing neural dependencies with copula models. Advances in neural information processing systems, 21:129-136, 2008. +[37] II Memming Park, Evan W Archer, Kenneth Latimer, and Jonathan W Pillow. Universal models for binary spike patterns using centered dirichlet processes. In Advances in neural information processing systems, pages 2463-2471, 2013. +[38] Michalis Titsias. Variational learning of inducing variables in sparse gaussian processes. In Artificial Intelligence and Statistics, pages 567-574, 2009. +[39] James Hensman, Nicolo Fusi, and Neil D Lawrence. Gaussian processes for big data. arXiv preprint arXiv:1309.6835, 2013. +[40] James Hensman, Alexander Matthews, and Zoubin Ghahramani. Scalable variational gaussian process classification. In Artificial Intelligence and Statistics, pages 351-360. PMLR, 2015. +[41] Adrien Peyrache and György Buzsáki. Extracellular recordings from multi-site silicon probes in the anterior thalamus and subicular formation of freely moving mice. CRCNS, 2015. +[42] Adrien Peyrache, Marie M Lacroix, Peter C Petersen, and György Buzsáki. Internally organized mechanisms of the head direction sense. Nature neuroscience, 18(4):569-575, 2015. +[43] Kristopher Jensen, Ta-Chu Kao, Marco Tripodi, and Guillaume Hennequin. Manifold gplvms for discovering non-euclidean latent structure in neural data. Advances in Neural Information Processing Systems, 33, 2020. +[44] Jakob H Macke, Lars Buesing, John P Cunningham, Byron M Yu, Krishna V Shenoy, and Maneesh Sahani. Empirical models of spiking in neural populations. In Advances in Neural Information Processing Systems 24: 25th conference on Neural Information Processing Systems (NIPS 2011), pages 1350-1358, 2012. +[45] Luca Falorsi, Pim de Haan, Tim R Davidson, and Patrick Forre. Reparameterizing distributions on lie groups. arXiv preprint arXiv:1903.02958, 2019. +[46] Matthew D Hoffman, David M Blei, Chong Wang, and John Paisley. Stochastic variational inference. The Journal of Machine Learning Research, 14(1):1303-1347, 2013. +[47] Diederik P. Kingma and Max Welling. Auto-encoding variational bayes. In 2nd International Conference on Learning Representations, 2014. +[48] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014. +[49] Adam Kohn and Matthew A Smith. Stimulus dependence of neuronal correlation in primary visual cortex of the macaque. Journal of Neuroscience, 25(14):3661-3673, 2005. +[50] I-Chun Lin, Michael Okun, Matteo Carandini, and Kenneth D Harris. The nature of shared cortical variability. Neuron, 87(3):644-656, 2015. +[51] Jonathan W Pillow. Time-rescaling methods for the estimation and assessment of non-poisson neural encoding models. In Advances in neural information processing systems, pages 1473-1481, 2009. +[52] Adam S Charles, Mijung Park, J Patrick Weller, Gregory D Horwitz, and Jonathan W Pillow. Dethroning the fano factor: a flexible, model-based approach to partitioning neural variability. Neural computation, 30(4):1012-1045, 2018. +[53] Rishidev Chaudhuri, Berk Gerçek, Biraj Pandey, Adrien Peyrache, and Ila Fiete. The intrinsic attractor manifold and population dynamics of a canonical cognitive circuit across waking and sleep. Nature neuroscience, 22(9):1512-1520, 2019. + +[54] Johannes Zirkelbach, Martin Stemmler, and Andreas VM Herz. Anticipatory neural activity improves the decoding accuracy for dynamic head-direction signals. Journal of Neuroscience, 39(15):2847-2859, 2019. +[55] Abed Ghanbari, Christopher M Lee, Heather L Read, and Ian H Stevenson. Modeling stimulus-dependent variability improves decoding of population neural responses. Journal of Neural Engineering, 16(6):066018, 2019. +[56] Kamiar Rahnama Rad and Liam Paninski. Efficient, adaptive estimation of two-dimensional firing rate surfaces via gaussian process methods. Network: Computation in Neural Systems, 21(3-4):142-168, 2010. +[57] Yaniv Ziv, Laurie D Burns, Eric D Cocker, Elizabeth O Hamel, Kunal K Ghosh, Lacey J Kitch, Abbas El Gamal, and Mark J Schnitzer. Long-term dynamics of cal hippocampal place codes. Nature neuroscience, 16(3):264, 2013. +[58] Michael E Rule, Adrianna R Loback, Dhruva V Raman, Laura N Driscoll, Christopher D Harvey, and Timothy O'Leary. Stable task information from an unstable neural population. *Elife*, 9:e51121, 2020. +[59] Daniel Deitch, Alon Rubin, and Yaniv Ziv. Representational drift in the mouse visual cortex. bioRxiv, 2020. +[60] Francesca Sargolini, Marianne Fyhn, Torkel Hafting, Bruce L McNaughton, Menno P Witter, May-Britt Moser, and Edvard I Moser. Conjunctive representation of position, direction, and velocity in entorhinal cortex. Science, 312(5774):758-762, 2006. +[61] Christopher T Jensen, Ta-Chu Kao, Jasmine Talia Stone, and Guillaume Hennequin. Scalable bayesian gpfa with automatic relevance determination and discrete noise models. *bioRxiv*, 2021. +[62] Seth D Guikema and Jeremy P Goffelt. A flexible count data regression model for risk analysis. Risk Analysis: An International Journal, 28(1):213-223, 2008. +[63] Kimberly F Sellers and Galit Shmueli. A flexible regression model for count data. The Annals of Applied Statistics, pages 943-961, 2010. +[64] Meng Hu, Kelsey L Clark, Xiajing Gong, Behrad Noudoost, Mingyao Li, Tirin Moore, and Hualou Liang. Copula regression analysis of simultaneously recorded frontal eye field and inferotemporal spiking activity during object-based working memory. Journal of Neuroscience, 35(23):8745-8757, 2015. +[65] Kian Ming A Chai. Variational multinomial logit gaussian process. The Journal of Machine Learning Research, 13:1745-1808, 2012. +[66] Yarin Gal, Yutian Chen, and Zoubin Ghahramani. Latent gaussian processes for distribution estimation of multivariate categorical data. In International Conference on Machine Learning, pages 645-654. PMLR, 2015. +[67] Robert Haslinger, Gordon Pipa, and Emery Brown. Discrete time rescaling theorem: determining goodness of fit for discrete time statistical models of neural spiking. Neural computation, 22(10):2477-2506, 2010. +[68] Shuai Xiao, Junchi Yan, Xiaokang Yang, Hongyuan Zha, and Stephen Chu. Modeling the intensity function of point process via recurrent neural networks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 31, 2017. +[69] Takahiro Omi, Naonori Ueda, and Kazuyuki Aihara. Fully neural network based model for general temporal point processes. arXiv preprint arXiv:1905.09690, 2019. +[70] Oleksandr Shchur, Nicholas Gao, Marin Biloš, and Stephan Günnmann. Fast and flexible temporal point processes with triangular maps. Advances in Neural Information Processing Systems, 33, 2020. +[71] Neil D Lawrence. Gaussian process latent variable models for visualisation of high dimensional data. In Nips, volume 2, page 5. Citeseer, 2003. + +[72] Michalis Titsias and Neil D Lawrence. Bayesian gaussian process latent variable model. In Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics, pages 844-851, 2010. +[73] Virginia Rutten, Alberto Bernacchia, Maneesh Sahani, and Guillaume Hennequin. Nonreversible gaussian processes for identifying latent dynamical structure in neural data. Advances in Neural Information Processing Systems, 33, 2020. +[74] Michael Naaman. On the tight constant in the multivariate dvoretzky-kiefer-wolffowitz inequality. Statistics & Probability Letters, 173:109088, 2021. +[75] Christopher M Bishop. Bayesian pca. Advances in neural information processing systems, pages 382-388, 1999. +[76] Andreas C. Damianou, Carl Henrik Ek, Michalis K. Titsias, and Neil D. Lawrence. Manifold relevance determination. In Proceedings of the 29th International Conference on Machine Learning, ICML 2012, Edinburgh, Scotland, UK, June 26 - July 1, 2012. icml.cc / Omnipress, 2012. +[77] Andrew Gordon Wilson, Zhiting Hu, Ruslan Salakhutdinov, and Eric P Xing. Deep kernel learning. In Artificial intelligence and statistics, pages 370-378. PMLR, 2016. +[78] Irina Higgins, Loic Matthews, Arka Pal, Christopher Burgess, Xavier Glorot, Matthew 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, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017. +[79] Ricky TQ Chen, Xuechen Li, Roger Grosse, and David Duvenaud. Isolating sources of disentanglement in vaes. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, pages 2615-2625, 2018. +[80] Guillaume Hennequin, Tim P Vogels, and Wulfram Gerstner. Optimal control of transient dynamics in balanced networks supports generation of complex movements. Neuron, 82(6):1394-1406, 2014. +[81] Klaus Wimmer, Duane Q Nykamp, Christos Constantinidis, and Albert Compte. Bump attractor dynamics in prefrontal cortex explains behavioral precision in spatial working memory. Nature neuroscience, 17(3):431-439, 2014. +[82] Elon Musk et al. An integrated brain-machine interface platform with thousands of channels. Journal of medical Internet research, 21(10):e16194, 2019. +[83] Jens Clausen. Man, machine and in between. Nature, 457(7233):1080-1081, 2009. \ No newline at end of file diff --git a/auniversalprobabilisticspikecountmodelrevealsongoingmodulationofneuralvariability/images.zip b/auniversalprobabilisticspikecountmodelrevealsongoingmodulationofneuralvariability/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ac282a918fa908b8ce890b41e60e3791fe4bd7d7 --- /dev/null +++ b/auniversalprobabilisticspikecountmodelrevealsongoingmodulationofneuralvariability/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27dce7e5815ef53054de795be07800742e9a6aaed486228246bfef29acb2c3e2 +size 370260 diff --git a/auniversalprobabilisticspikecountmodelrevealsongoingmodulationofneuralvariability/layout.json b/auniversalprobabilisticspikecountmodelrevealsongoingmodulationofneuralvariability/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..ef97c2c5a2017a702a817103f6f3807c92d15719 --- /dev/null +++ b/auniversalprobabilisticspikecountmodelrevealsongoingmodulationofneuralvariability/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:36d34b8831d6bb611f589ddd1bfb11633b1164144069c4941c3b37f0785f9943 +size 473815 diff --git a/avariationalapproximateposteriorforthedeepwishartprocess/9129b8d0-60e1-4128-8b60-19d706089ad5_content_list.json b/avariationalapproximateposteriorforthedeepwishartprocess/9129b8d0-60e1-4128-8b60-19d706089ad5_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..e8a9b68673fd67bfa9509ba1e19a33e81cdd03e0 --- /dev/null +++ b/avariationalapproximateposteriorforthedeepwishartprocess/9129b8d0-60e1-4128-8b60-19d706089ad5_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3609ebaa86a89cfe8565d35fbc61f09f5d7e4904d9b5d22870a6ab037ea8f55d +size 95481 diff --git a/avariationalapproximateposteriorforthedeepwishartprocess/9129b8d0-60e1-4128-8b60-19d706089ad5_model.json b/avariationalapproximateposteriorforthedeepwishartprocess/9129b8d0-60e1-4128-8b60-19d706089ad5_model.json new file mode 100644 index 0000000000000000000000000000000000000000..eb348bee5fed1a6e3fe23430c74837606b334a2f --- /dev/null +++ b/avariationalapproximateposteriorforthedeepwishartprocess/9129b8d0-60e1-4128-8b60-19d706089ad5_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f5817f6a5e649b31d06eac77a221322de19e6c3329df39afece98f29f0c4a3c6 +size 115092 diff --git a/avariationalapproximateposteriorforthedeepwishartprocess/9129b8d0-60e1-4128-8b60-19d706089ad5_origin.pdf b/avariationalapproximateposteriorforthedeepwishartprocess/9129b8d0-60e1-4128-8b60-19d706089ad5_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f967b9718e60878eb5b90d7cfc37d441557d6048 --- /dev/null +++ b/avariationalapproximateposteriorforthedeepwishartprocess/9129b8d0-60e1-4128-8b60-19d706089ad5_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f821f8edd00372115c05d8f65e9110d94e8dd37031ddd971de7ccc63bb5094f2 +size 569817 diff --git a/avariationalapproximateposteriorforthedeepwishartprocess/full.md b/avariationalapproximateposteriorforthedeepwishartprocess/full.md new file mode 100644 index 0000000000000000000000000000000000000000..7fa5efc0158726af258b555964c890020ccce820 --- /dev/null +++ b/avariationalapproximateposteriorforthedeepwishartprocess/full.md @@ -0,0 +1,501 @@ +# A variational approximate posterior for the deep Wishart process + +Sebastian W. Ober + +Department of Engineering + +University of Cambridge + +Cambridge, UK + +swo25@cam.ac.uk + +Laurence Aitchison + +Department of Computer Science + +University of Bristol + +Bristol, UK + +laurence.aitchison@bristol.ac.uk + +# Abstract + +Recent work introduced deep kernel processes as an entirely kernel-based alternative to NNs (Aitchison et al. 2020). Deep kernel processes flexibly learn good top-layer representations by alternately sampling the kernel from a distribution over positive semi-definite matrices and performing nonlinear transformations. A particular deep kernel process, the deep Wishart process (DWP), is of particular interest because its prior can be made equivalent to deep Gaussian process (DGP) priors for kernels that can be expressed entirely in terms of Gram matrices. However, inference in DWPs has not yet been possible due to the lack of sufficiently flexible distributions over positive semi-definite matrices. Here, we give a novel approach to obtaining flexible distributions over positive semi-definite matrices by generalising the Bartlett decomposition of the Wishart probability density. We use this new distribution to develop an approximate posterior for the DWP that includes dependency across layers. We develop a doubly-stochastic inducing-point inference scheme for the DWP and show experimentally that inference in the DWP can improve performance over doing inference in a DGP with the equivalent prior. + +# 1 Introduction + +The successes of modern deep learning have highlighted that good performance on tasks such as image classification (Krizhevsky et al., 2012) requires deep models with lower layers that have the flexibility to learn good representations. Up until very recently, this was only possible in feature-based methods such as neural networks (NNs). Kernel methods did not have this flexibility because the kernel could be modified only using a few kernel hyperparameters. However, with the advent of deep kernel processes (DKPs; Aitchison et al., 2021), we now have deep kernel methods that offer neural-network like flexibility in the kernel / top-layer representation. DKPs introduce this flexibility by taking the kernel from the previous layer, then sampling from a Wishart or inverse Wishart centered on that kernel, followed by a nonlinear transformation. The sampling and nonlinear transformation steps are repeated multiple times to form a deep architecture. Remarkably, deep Gaussian processes (DGPs; Damianou & Lawrence, 2013; Salimbeni & Deisenroth, 2017), standard Bayesian NNs, infinite-width Bayesian NNs (neural network Gaussian processes or NNGPs; Lee et al., 2018; Matthews et al., 2018; Novak et al., 2019; Garriga-Alonso et al., 2019) and infinite NNs with finite width bottlenecks (Aitchison, 2020) can be written as DKPs (Aitchison et al., 2021). Indeed, for kernels that can be expressed in terms of operations on Gram matrices, Aitchison et al. (2021) showed that a particular DKP, the deep Wishart process (DWP) has a prior equivalent to a DGP's prior. In a DGP, the random variables inferred in variational inference are the model's intermediate features, with kernels computed as a function of these features at each layer. However, in a DWP, there are no features at all: the only random variables are the positive semi-definite kernel + +matrices themselves, which are sampled directly from Wishart distributions: the DWP works entirely on the kernel matrices implied by the DGP's features. + +Aitchison et al. (2021) argued that DWPs should have considerable advantages over related feature-based models, because feature-based models have pervasive symmetries in the true posterior, which are difficult to capture in standard variational approximate posteriors. For instance, in a neural network, it is possible to permute rows and columns of weight matrices, such that the activations at a given layer are permuted, but the network's overall input-output function remains the same (MacKay, 1992; Sussmann, 1992; Bishop et al., 1995). These permutations result in network weights with exactly the same probability density under the true posterior, but with very different probability densities under standard variational approximate posteriors, which are generally unimodal. However, these issues do not arise with DWPs, because all permutations of the hidden units correspond to the same kernel (see Appendix D in Aitchison et al. (2021) for more details). + +While Aitchison et al. (2021) showed the equivalence between DWPs and DGPs, they were not able to do inference in DWPs because they were not able to find a sufficiently flexible distribution over positive semi-definite matrices to form the basis of an approximate posterior. Instead, they were forced to work with a different DKP: the deep inverse Wishart processes (DIwPs), which was easier because the inverse Wishart itself forms a suitable approximate posterior. While the DIWP also avoids using features, it does not correspond directly to an already-established Bayesian model. Therefore, the DWP is a more important model, as it allows us to directly compare feature-based and kernel-based inference. In this work, we show how to create a sufficiently flexible approximate posterior for DWPs, thereby enabling us to compare directly to their equivalent DGPs. In particular, our contributions are: + +- We develop a new family of flexible distributions over positive semi-definite matrices by generalising the Bartlett decomposition (Sec. 3.1). +- We use this distribution to develop an effective approximate posterior for the deep Wishart process which incorporates dependency across layers (Sec. 3.2). +- We develop a doubly stochastic inducing-point inference scheme for the DWP. While the derivation mostly follows that for deep inverse Wishart processes (Aitchison et al., 2021), we need to give a novel scheme for sampling the test/training points conditioned on the inducing points, as this is very different in the DWP compared to the previous DIWP (Sec. 3.3). +- We empirically compare DGP and DWP inference with the exact same prior. This was not possible in Aitchison et al. (2021) as they only derived an inference scheme for deep inverse Wishart processes, whose prior is not equivalent to a DGP prior. + +We provide a reference implementation at https://github.com/LaurenceA/bayesfunc. + +# 2 Background + +# 2.1 Wishart distribution + +The Wishart, $\mathcal{W}(\Sigma ,\nu)$ , is a distribution over positive semi-definite $P\times P$ matrices, $\mathbf{G}$ , with positive definite scale parameter $\boldsymbol {\Sigma}\in \mathbb{R}^{P\times P}$ and a positive, integer-valued degrees-of-freedom parameter, $\nu$ . The Wishart distribution is defined by taking $\nu$ vectors $\mathbf{n}_{\lambda}\in \mathbf{R}^{P}$ sampled from a zero-mean Gaussian. These vectors can be generated from standard Gaussian vectors, $\xi_{\lambda}$ , by transforming them with the Cholesky, $\mathbf{L}$ of the scale parameter, $\boldsymbol {\Sigma} = \mathbf{L}\mathbf{L}^T$ , + +$$ +\mathbf {L} \boldsymbol {\xi} _ {\lambda} = \mathbf {n} _ {\lambda} \sim \mathcal {N} (\mathbf {0}, \boldsymbol {\Sigma}) \quad \text {w h e r e} \boldsymbol {\xi} _ {\lambda} \sim \mathcal {N} (\mathbf {0}, \mathbf {I}) +$$ + +Both $\mathbf{n}_{\lambda}$ and $\xi_{\lambda}$ can be stacked to form $P\times \nu$ matrices, $\mathbf{N}$ and $\Xi$ + +$$ +\mathbf {N} = \left( \begin{array}{c c c c} \mathbf {n} _ {1} & \mathbf {n} _ {2} & \dots & \mathbf {n} _ {\nu} \end{array} \right) \hskip 2 8. 4 5 2 7 5 6 p t \Xi = \left( \begin{array}{c c c c} \boldsymbol {\xi} _ {1} & \boldsymbol {\xi} _ {2} & \dots & \boldsymbol {\xi} _ {\nu} \end{array} \right). +$$ + +Wishart samples are defined by taking the sum of the outer products of the $\mathbf{n}_{\lambda}$ 's, which can be written as a matrix-multiplication, + +$$ +\sum_ {\lambda = 1} ^ {\nu} \mathbf {n} _ {\lambda} \mathbf {n} _ {\lambda} ^ {T} = \mathbf {N N} ^ {T} = \mathbf {L} \boldsymbol {\Xi} \boldsymbol {\Xi} ^ {T} \mathbf {L} = \mathbf {L} \mathbf {Z} \mathbf {L} ^ {T} = \mathbf {G} \sim \mathcal {W} (\boldsymbol {\Sigma}, \nu) \tag {1} +$$ + +where $\mathbf{Z} = \Xi \Xi^T$ is a sample from a standard Wishart (i.e. one with an identity scale parameter,) + +$$ +\sum_ {\lambda = 1} ^ {\nu} \boldsymbol {\xi} _ {\lambda} \boldsymbol {\xi} _ {\lambda} ^ {T} = \boldsymbol {\Xi} \boldsymbol {\Xi} ^ {T} = \mathbf {Z} \sim \mathcal {W} (\mathbf {I}, \nu). \tag {2} +$$ + +Note that therefore the Wishart has mean, + +$$ +\mathbb {E} \left[ \mathbf {G} \right] = \nu \mathbb {E} \left[ \mathbf {n} _ {\lambda} \mathbf {n} _ {\lambda} ^ {T} \right] = \nu \boldsymbol {\Sigma} \tag {3} +$$ + +# 2.2 Bartlett decomposition + +However, sampling $\Xi$ can be computationally expensive for very large values of $\nu$ . Instead, it is possible to sample a Wishart by writing down the distribution over the Cholesky of $\mathbf{Z}$ , denoted $\mathbf{A}$ (Bartlett, 1934). Taking $\mathbf{Z} = \mathbf{A}\mathbf{A}^T$ , the distribution over $\mathbf{A}$ is, + +$$ +\mathrm {P} \left(A _ {j j} ^ {2}\right) = \operatorname {G a m m a} \left(A _ {j j} ^ {2}; \alpha = \frac {\nu - j + 1}{2}, \beta = \frac {1}{2}\right), \tag {4a} +$$ + +$$ +\mathrm {P} \left(A _ {j > k}\right) = \mathcal {N} \left(A _ {j k}; 0, 1\right). \tag {4b} +$$ + +i.e. the square of the on-diagonal elements are Gamma distributed and the off-diagonal elements are IID standard Gaussian. + +# 2.3 Deep Gaussian processes (DGPs) + +In a DGP, we progressively sample features, $\mathbf{F}_{\ell}$ , from a Gaussian process, conditioned on features from the previous layer, + +$$ +\mathrm {P} \left(\mathbf {F} _ {\ell} \mid \mathbf {F} _ {\ell - 1}\right) = \prod_ {\lambda = 1} ^ {\nu_ {\ell}} \mathcal {N} \left(\mathbf {f} _ {\lambda} ^ {\ell}; \mathbf {0}, \mathbf {K} _ {\text {f e a t u r e s}} \left(\mathbf {F} _ {\ell - 1}\right)\right) \quad \text {w i t h} \mathbf {F} _ {0} = \mathbf {X}, \tag {5a} +$$ + +$$ +\mathrm {P} (\mathbf {Y} | \mathbf {F} _ {L + 1}) = \prod_ {\lambda = 1} ^ {\nu_ {L + 1}} \mathcal {N} (\mathbf {y} _ {\lambda}; \mathbf {f} _ {\lambda} ^ {L + 1}, \sigma^ {2} \mathbf {I}) \tag {5b} +$$ + +where $\mathbf{X} \in \mathbb{R}^{P \times \nu_0}$ is the input and $\mathbf{F}_{\ell} \in \mathbb{R}^{P \times \nu_{\ell}}$ are the features. We use $P$ for the number of input points and $\nu_{\ell}$ for the width of layer $\ell$ ; thus $\nu_0$ is the number of inputs and $\nu_{L + 1}$ is the number of outputs. In addition, the features and targets can be written as a stack of vectors, $\mathbf{f}_{\lambda}^{\ell} \in \mathbb{R}^{P}$ and $\mathbf{y}_{\lambda} \in \mathbb{R}^{P}$ , i.e. + +$$ +\mathbf {F} _ {\ell} = \left( \begin{array}{l l l l} \mathbf {f} _ {1} ^ {\ell} & \mathbf {f} _ {2} ^ {\ell} & \dots & \mathbf {f} _ {\nu_ {\ell}} ^ {\ell} \end{array} \right) \qquad \qquad \mathbf {Y} = \left( \begin{array}{l l l l} \mathbf {y} _ {1} & \mathbf {y} _ {2} & \dots & \mathbf {y} _ {\nu_ {L + 1}} \end{array} \right). +$$ + +The function $\mathbf{K}_{\mathrm{features}}(\mathbf{F}_{\ell -1})$ takes the features at the previous layer and returns the corresponding $P\times P$ kernel matrix. We consider isotropic kernels such as the squared exponential, which can be written as a function of $R_{ij}^{\ell -1}$ , the distance between input features $i$ and $j$ , + +$$ +K _ {\text {f e a t u r e s}; i j} = k \left(R _ {i j} ^ {\ell - 1}\right), +$$ + +$$ +R _ {i j} ^ {\ell - 1} = \frac {1}{N _ {\ell}} \sum_ {\lambda = 1} ^ {N _ {\ell}} \left(F _ {i \lambda} ^ {\ell - 1} - F _ {j \lambda} ^ {\ell - 1}\right) ^ {2}. +$$ + +# 2.4 Deriving equivalent deep Wishart processes + +Following Aitchison et al. (2021), we show how the DGP model of Eq. (5) can be expressed as a deep Wishart process. We first consider the $P \times P$ Gram matrices defined as + +$$ +\mathbf {G} _ {\ell} = \frac {1}{\nu_ {\ell}} \mathbf {F} _ {\ell} \mathbf {F} _ {\ell} ^ {T} = \frac {1}{\nu_ {\ell}} \sum_ {\lambda = 1} ^ {\nu_ {\ell}} \mathbf {f} _ {\lambda} ^ {\ell} (\mathbf {f} _ {\lambda} ^ {\ell}) ^ {T}, +$$ + +where $\mathbf{f}_{\lambda}^{\ell}$ are IID and multivariate-Gaussian distributed conditioned on the features at the previous layer (Eq. 5a). Thus, $\mathbf{G}_{\ell}$ follows the definition of the Wishart (Eq. 1), and we can sample $\mathbf{G}_{\ell}$ directly, + +$$ +\mathrm {P} \left(\mathbf {G} _ {\ell} | \mathbf {F} _ {\ell - 1}\right) = \mathcal {W} \left(\mathbf {G} _ {\ell}; \frac {1}{\nu_ {\ell}} \mathbf {K} _ {\mathrm {f e a t u r e s}} (\mathbf {F} _ {\ell - 1}), \nu_ {\ell}\right). +$$ + +To work entirely with Gram matrices rather than features, we need to be able to compute the kernel, $\mathbf{K}_{\mathrm{features}}(\mathbf{F}_{\ell -1})$ as a function of the Gram matrix at the previous layer, $\mathbf{G}_{\ell -1}$ . Remarkably, this is possible for a large family of practically relevant kernels (Aitchison et al., 2021), for instance + +isotropic kernels and the arc-cosine (or ReLU) kernel. In particular, as we focus on isotropic kernels, note that it is possible to recover distances from the Gram matrix: + +$$ +R _ {i j} ^ {\ell} = \frac {1}{N _ {\ell}} \sum_ {\lambda = 1} ^ {N _ {\ell}} \left(\left(F _ {i \lambda} ^ {\ell}\right) ^ {2} - 2 F _ {i \lambda} ^ {\ell} F _ {j \lambda} ^ {\ell} + \left(F _ {j \lambda} ^ {\ell}\right) ^ {2}\right) = G _ {i i} ^ {\ell} - 2 G _ {i j} ^ {\ell} + G _ {j j} ^ {\ell}. +$$ + +Thus, since isotropic kernels depend only on the distance, it is possible to obtain $\mathbf{K}(\cdot)$ , which takes the Gram matrix from the previous layer and returns the same kernel matrix as that returned by applying $\mathbf{K}_{\mathrm{features}}$ to the features from the previous layer: + +$$ +\mathbf {K} _ {\mathrm {f e a t u r e s}} \left(\mathbf {F} _ {\ell - 1}\right) = \mathbf {K} \left(\mathbf {G} _ {\ell - 1}\right) = \mathbf {K} \left(\frac {1}{\nu_ {\ell}} \mathbf {F} _ {\ell - 1} \mathbf {F} _ {\ell - 1} ^ {T}\right). +$$ + +By using the equivalent kernel written as a function of the Gram matrix at the previous layer, we can entirely eliminate intermediate layer features, resulting in a deep Wishart process, + +$$ +\mathrm {P} \left(\mathbf {G} _ {\ell} \mid \mathbf {G} _ {\ell - 1}\right) = \mathcal {W} \left(\mathbf {G} _ {\ell}; \frac {1}{\nu_ {\ell}} \mathbf {K} \left(\mathbf {G} _ {\ell - 1}\right), \nu_ {\ell}\right) \quad \text {w i t h} \mathbf {G} _ {0} = \frac {1}{\nu_ {0}} \mathbf {X} \mathbf {X} ^ {T}, \tag {6a} +$$ + +$$ +\mathrm {P} \left(\mathbf {F} _ {L + 1} \mid \mathbf {G} _ {L}\right) = \prod_ {\lambda = 1} ^ {\nu_ {L + 1}} \mathcal {N} \left(\mathbf {f} _ {\lambda} ^ {L + 1}; \mathbf {0}, \mathbf {K} \left(\mathbf {G} _ {L}\right)\right), \tag {6b} +$$ + +$$ +\mathrm {P} \left(\mathbf {Y} \mid \mathbf {F} _ {L + 1}\right) = \prod_ {\lambda = 1} ^ {\nu_ {L + 1}} \mathcal {N} \left(\mathbf {y} _ {\lambda}; \mathbf {f} _ {\lambda} ^ {L + 1}, \sigma^ {2} \mathbf {I}\right). \tag {6c} +$$ + +# 2.5 The DWP formulation captures true-posterior symmetries while DGP does not + +We now have two equivalent generative models: one phrased in terms of features, $\mathbf{F}_{\ell}$ and another phrased in terms of Gram matrices, $\mathbf{G}_{\ell}$ . Is there any reason to prefer one over the other? It turns out that there is. In particular, consider a transformation of the features, $\mathbf{F}_{\ell}^{\prime} = \mathbf{F}_{\ell}\mathbf{U}$ where $\mathbf{U}$ is a unitary matrix, such that $\mathbf{UU}^T = \mathbf{I}$ . Remarkably, the true posterior is symmetric under these transformations, in the sense that all unitary transformations of the underlying features have the exact same true-posterior probability density (see Aitchison et al., 2021, Appendix D.2), + +$$ +\mathrm {P} \left(\mathbf {F} _ {1} ^ {\prime}, \dots , \mathbf {F} _ {L} ^ {\prime}, \mathbf {F} _ {L + 1} | \mathbf {X}, \mathbf {Y}\right) = \mathrm {P} \left(\mathbf {F} _ {1}, \dots , \mathbf {F} _ {L}, \mathbf {F} _ {L + 1} | \mathbf {X}, \mathbf {Y}\right). +$$ + +It would be desirable for variational approximate posteriors to capture these true posterior symmetries. However, the usual family of Gaussian approximate posteriors over features fails to capture these symmetries because they use non-zero means. Worryingly, the failure to capture these symmetries can bias variational inference to focus on low-mass areas of the true posterior (Moore, 2016; Pourzanjani et al., 2017). + +In contrast, the deep Wishart process sidesteps this issue by phrasing posteriors entirely in terms of Gram matrices, $\mathbf{G}_{\ell} = \frac{1}{\nu_{\ell}}\mathbf{F}_{\ell}\mathbf{F}_{\ell}^{T}$ . Critically, the Gram matrix is invariant to unitary transformations of the features, + +$$ +\mathbf {G} _ {\ell} = \frac {1}{\nu_ {\ell}} \mathbf {F} _ {\ell} \mathbf {F} _ {\ell} ^ {T} = \frac {1}{\nu_ {\ell}} \mathbf {F} _ {\ell} \mathbf {U} _ {\ell} \mathbf {U} _ {\ell} ^ {T} \mathbf {F} _ {\ell} ^ {T} = \frac {1}{\nu_ {\ell}} \mathbf {F} _ {\ell} ^ {\prime} \mathbf {F} _ {\ell} ^ {\prime T}. +$$ + +As such, DWP approximate posteriors written in terms of $\mathbf{G}_{\ell}$ implicitly respect this unitary symmetry over the features. + +# 2.6 Equivalent DWP posteriors will have better ELBOs and generalisation + +Let us consider the ELBOs implied by using a DGP posterior $\mathrm{Q}(\{\mathbf{F}_{\ell}\}_{\ell})$ and the DWP posterior implied by this posterior, which for this section we denote $\mathrm{Q}(\{\mathbf{G}_{\ell}\}_{\ell})$ . Using $\mathcal{D} = (\mathbf{X},\mathbf{Y})$ : + +$$ +\mathcal {L} _ {\mathrm {D G P}} = \mathbb {E} _ {\mathcal {Q}} [ \mathrm {P} (\mathbf {Y} | \mathbf {F} _ {L + 1}) ] - \mathrm {K L} (\mathrm {Q} (\{\mathbf {F} _ {\ell} \} _ {\ell}) | | \mathrm {P} (\{\mathbf {F} _ {\ell} \} _ {\ell} | \mathcal {D})) +$$ + +$$ +\mathcal {L} _ {\mathrm {D W P}} = \mathbb {E} _ {\mathcal {Q}} [ \mathrm {P} (\mathbf {Y} | \mathbf {F} _ {L + 1}) ] - \mathrm {K L} (\mathrm {Q} (\{\mathbf {G} _ {\ell} \} _ {\ell}) | | \mathrm {P} (\{\mathbf {G} _ {\ell} \} _ {\ell} | \mathcal {D})) +$$ + +By the data processing inequality (see e.g. Thm 6.2 in Polyanskiy & Wu (2014)), since $\mathbf{G}_{\ell}$ is a deterministic transformation of $\mathbf{F}_{\ell}$ , it is straightforward to show that $\mathcal{L}_{\mathrm{DWP}} \geq \mathcal{L}_{\mathrm{DGP}}$ . This result is one of the main motivations of the recent trend towards function-space inference (Sun et al., 2018; Ma et al., 2019); for a deeper theoretical understanding of this result we refer the reader to Burt et al. (2021), This fact can also be used to derive better PAC Bayes generalisation bounds (Section 6.1.3 of Alquier (2021)). + +Note that this analysis relied on the assumption that $\mathrm{Q}(\{\mathbf{G}_{\ell}\}_{\ell})$ would be the distribution implied by $\mathrm{Q}(\{\mathbf{F}_{\ell}\}_{\ell})$ . In practice, this is will not be the case, as we wish to directly specify our distribution in terms of Gram matrices. However, given a sufficiently flexible posterior over Gram matrices, we should still see this advantages in practice. We now turn to developing such a distribution. + +# 3 Methods + +As detailed in Aitchison et al. (2021), the key difficulty in obtaining a variational inference scheme for DWPs is the difficulty of providing a sufficiently flexible approximate posterior. In particular, as we are working with a probabilistic process, the number of input points, $P$ , can be arbitrarily large, and thus there is always the possibility that $\nu < P$ and hence that our sampled Gram matrices are low-rank. We therefore need to form flexible variational approximate posteriors over rank $\nu$ Gram matrices. An obvious first choice is the Wishart distribution itself with degrees of freedom $\nu$ , so as to match the rank of matrices sampled from the prior. However, for fixed degrees of freedom the Wishart variance, + +$$ +\mathbb {V} \left[ G _ {i j} \right] = \nu \left(\Sigma_ {i j} ^ {2} + \Sigma_ {i i} \Sigma_ {j j}\right) +$$ + +cannot be specified independently of the mean (Eq. 3), which is essential for a variational approximate posterior that can flexibly capture potentially narrow true posteriors. An alternative approach would be to work with a non-central Wishart, which is defined by taking $\Xi$ , which is IID standard Gaussian in the case of the Wishart, to have non-zero mean. However, the non-central Wishart has a probability density function that is too difficult to evaluate in the inner loop of a deep learning algorithm (Koev & Edelman, 2006). Instead, we develop a new Generalised Singular Wishart distribution, based on the Bartlett decomposition, which modifies the Wishart to give independent control over the mean and variance of sampled matrices. + +# 3.1 The Generalised Singular Wishart + +To define the Generalised Singular Wishart distribution, we first need to generalise the Bartlett construction to potentially singular matrices (i.e. those for which $\nu < P$ ). Remembering that $\mathbf{Z} = \mathbf{A}\mathbf{A}^T$ , in the singular case $\mathbf{A}$ is given by + +$$ +\mathbf {A} = \left( \begin{array}{c c c} A _ {1 1} & \dots & 0 \\ \vdots & \ddots & \vdots \\ A _ {\nu 1} & \dots & A _ {\nu \nu} \\ \vdots & \vdots & \vdots \\ A _ {P 1} & \dots & A _ {P \nu} \end{array} \right), \tag {7a} +$$ + +$$ +\mathrm {P} \left(A _ {j j} ^ {2}\right) = \operatorname {G a m m a} \left(A _ {j j} ^ {2}; \frac {\nu - j + 1}{2}, \frac {1}{2}\right), \quad \mathrm {P} \left(A _ {i > j}\right) = \mathcal {N} \left(A _ {i j}; 0, 1\right). \tag {7b} +$$ + +Recalling that $\mathbf{G} = \mathbf{L}\mathbf{A}\mathbf{A}^T\mathbf{L}^T$ and by applying the results of Appendices B and C, we have that + +$$ +\mathrm {P} \left(\mathbf {G}\right) = \left(\prod_ {j = 1} ^ {P} \frac {1}{L _ {j j} ^ {\min (j , \nu)}}\right) \prod_ {j = 1} ^ {\min (P, \nu)} \frac {\operatorname {G a m m a} \left(A _ {j j} ^ {2} ; \frac {\nu - j + 1}{2} , \frac {1}{2}\right)}{A _ {j j} ^ {P - j} L _ {j j} ^ {P - j + 1}} \prod_ {i = j + 1} ^ {P} \mathcal {N} \left(A _ {i j}; 0, 1\right). +$$ + +In Appendix D we prove that this corresponds to the known full rank and singular Wishart distribution. Equipped with the singular Bartlett, we can now develop a generalisation of the Wishart distribution: + +Definition 1 The Generalised Singular Wishart, $\mathcal{W}(\mathbf{G};\pmb {\Sigma},\nu ,\pmb {\alpha},\pmb {\beta},\pmb {\mu},\pmb {\sigma})$ , is a distribution over positive semi-definite $P\times P$ matrices, $\mathbf{G}$ , with positive definite scale matrix $\pmb {\Sigma} = \pmb {L}\pmb{L}^{T}\in \mathbb{R}^{P\times P}$ a positive, integer-valued degrees-of-freedom parameter $\nu$ , and Bartlett-generalising parameters $\alpha ,\beta ,\mu ,\sigma$ . These latter parameters modify the Bartlett decomposition as follows: + +$$ +\mathrm {Q} \left(A _ {j j} ^ {2}\right) = G a m m a \left(A _ {j j} ^ {2}; \alpha_ {j}, \beta_ {j}\right) \qquad \qquad \text {f o r} j \leq \nu , +$$ + +$$ +\mathrm {Q} \left(A _ {i > j}\right) = \mathcal {N} \left(A _ {i j}; \mu_ {i j}, \sigma_ {i j} ^ {2}\right) \qquad \qquad \text {f o r} j \leq \nu . +$$ + +This implies a distribution over $\mathbf{G} = \mathbf{L}\mathbf{A}\mathbf{A}^T\mathbf{L}^T$ with density + +$$ +\mathrm {Q} \left(\mathbf {G}\right) = \left(\prod_ {j = 1} ^ {P} \frac {1}{L _ {j j} ^ {\min (j , \nu)}}\right) \prod_ {j = 1} ^ {\min (P, \nu)} \frac {1}{A _ {j j} ^ {P - j} L _ {j j} ^ {P - j + 1}} G a m m a \left(A _ {j j} ^ {2}; \alpha_ {j}, \beta_ {j}\right) \prod_ {i = j + 1} ^ {P} \mathcal {N} \left(A _ {i j}; \mu_ {i j}, \sigma_ {i j} ^ {2}\right). +$$ + +Note that we use $\mathrm{Q}(\cdot)$ to reflect the fact that we will use the Generalised Singular Wishart as the basis for our approximate posterior. The density is derived using the same transformations and Jacobians as for the singular Wishart above. + +# 3.2 Full approximate posterior distribution + +Unlike the deep inverse Wishart process in Aitchison et al. (2021), it is not possible to obtain an optimal last-layer posterior for the deep Wishart process. Therefore, we choose a form that mimics the form of the DIWP posterior, allowing for similar across-layer dependencies: + +$$ +\mathrm {Q} \left(\mathbf {G} _ {\ell} \mid \mathbf {G} _ {\ell - 1}\right) = \mathcal {W} \left(\mathbf {G} _ {\ell}; \left(1 - q _ {\ell}\right) \frac {1}{\nu_ {\ell}} \mathbf {K} \left(\mathbf {G} _ {\ell - 1}\right) + q _ {\ell} \mathbf {V} _ {\ell} \mathbf {V} _ {\ell} ^ {T}, \nu_ {\ell}, \alpha_ {\ell}, \beta_ {\ell}, \boldsymbol {\mu} _ {\ell}, \boldsymbol {\sigma} _ {\ell}\right), \tag {9} +$$ + +where the approximate posterior parameters are $\{\mathbf{V}_{\ell},\pmb {\alpha}_{\ell},\pmb {\beta}_{\ell},\pmb {\mu}_{\ell},\pmb {\sigma}_{\ell},q_{\ell}\}_{\ell = 1}^{L}$ , where $0 < q_{\ell} < 1$ is a scalar, and $\mathbf{V}_{\ell}\in \mathbb{R}^{P\times P}$ . Here, the learnable parameter $q_{\ell}$ allows us to trade the off influence on the scale matrix from the prior and the learned covariance $\mathbf{V}_{\ell}\mathbf{V}_{\ell}^{T}$ , which allows for similar across-layer dependencies as in (Aitchison et al., 2021). $\nu_{\ell}$ is fixed, as it determines the width of the layer; the remaining parameters are simply the parameters from the Bartlett generalisation. + +# 3.3 Doubly stochastic inducing-point variational inference in deep inverse Wishart processes + +For efficient inference in high-dimensional problems, we take inspiration from the DGP literature (Salimbeni & Deisenroth, 2017) by considering doubly-stochastic inducing-point deep Wishart processes. We begin by decomposing all variables into inducing and training (or test) points $\mathbf{X}_{\mathrm{i}} \in \mathbb{R}^{P_{\mathrm{i}} \times N_0}$ and $\mathbf{X}_{\mathrm{t}} \in \mathbb{R}^{P_{\mathrm{t}} \times N_0}$ where $P_{\mathrm{i}}$ is the number of inducing points, and $P_{\mathrm{t}}$ is the number of testing/training points, + +$$ +\mathbf {X} = \left( \begin{array}{c} \mathbf {X} _ {\mathrm {i}} \\ \mathbf {X} _ {\mathrm {t}} \end{array} \right), \qquad \qquad \mathbf {F} _ {L + 1} = \left( \begin{array}{c} \mathbf {F} _ {\mathrm {i}} ^ {L + 1} \\ \mathbf {F} _ {\mathrm {t}} ^ {L + 1} \end{array} \right), \qquad \qquad \mathbf {G} _ {\ell} = \left( \begin{array}{c c} \mathbf {G} _ {\mathrm {i i}} ^ {\ell} & \mathbf {G} _ {\mathrm {i t}} ^ {\ell} \\ \mathbf {G} _ {\mathrm {t i}} ^ {\ell} & \mathbf {G} _ {\mathrm {t t}} ^ {\ell} \end{array} \right), +$$ + +where e.g. $\mathbf{G}_{\mathrm{ii}}^{\ell}$ is $P_{\mathrm{i}} \times P_{\mathrm{i}}$ and $\mathbf{G}_{\mathrm{it}}^{\ell}$ is $P_{\mathrm{i}} \times P_{\mathrm{t}}$ . The full ELBO including latent variables for all the inducing and training points is + +$$ +\mathcal {L} = \mathbb {E} \left[ \log \mathrm {P} (\mathbf {Y} | \mathbf {F} _ {L + 1}) + \log \frac {\mathrm {P} \left(\left\{\mathbf {G} _ {\ell} \right\} _ {\ell = 1} ^ {L} , \mathbf {F} _ {L + 1} \mid \mathbf {X}\right)}{\mathrm {Q} \left(\left\{\mathbf {G} _ {\ell} \right\} _ {\ell = 1} ^ {L} , \mathbf {F} _ {L + 1} \mid \mathbf {X}\right)} \right], \tag {10} +$$ + +where the expectation is taken over $\mathrm{Q}\left(\left\{\mathbf{G}_{\ell}\right\}_{\ell = 1}^{L},\mathbf{F}_{L + 1}|\mathbf{X}\right)$ . The prior is given by combining all terms in Eq. (6) for both inducing and test/train inputs, + +$$ +\mathrm {P} \left(\left\{\mathbf {G} _ {\ell} \right\} _ {\ell = 1} ^ {L}, \mathbf {F} _ {L + 1} | \mathbf {X}\right) = \left[ \prod_ {\ell = 1} ^ {L} \mathrm {P} \left(\mathbf {G} _ {\ell} | \mathbf {G} _ {\ell - 1}\right) \right] \mathrm {P} \left(\mathbf {F} _ {L + 1} | \mathbf {G} _ {L}\right), +$$ + +where the $\mathbf{X}$ -dependence enters on the right because $\mathbf{G}_0 = \frac{1}{\nu_0} \mathbf{X} \mathbf{X}^T$ . Taking inspiration from Salimbeni & Deisenroth (2017), the full approximate posterior is the product of an approximate posterior over inducing points and the conditional prior for train/test points, + +$$ +\mathrm {Q} \left(\left\{\mathbf {G} _ {\ell} \right\} _ {\ell = 1} ^ {L}, \mathbf {F} _ {L + 1} | \mathbf {X}\right) = +$$ + +$$ +\mathrm {Q} \left(\left\{\mathbf {G} _ {\mathrm {i i}} ^ {\ell} \right\} _ {\ell = 1} ^ {L}, \mathbf {F} _ {\mathrm {i}} ^ {L + 1} \mid \mathbf {X} _ {\mathrm {i}}\right) \mathrm {P} \left(\left\{\mathbf {G} _ {\mathrm {i t}} ^ {\ell} \right\} _ {\ell = 1} ^ {L}, \left\{\mathbf {G} _ {\mathrm {t t}} ^ {\ell} \right\} _ {\ell = 1} ^ {L}, \mathbf {F} _ {\mathrm {t}} ^ {L + 1} \mid \left\{\mathbf {G} _ {\mathrm {i i}} ^ {\ell} \right\} _ {\ell = 1} ^ {L}, \mathbf {F} _ {\mathrm {i}} ^ {L + 1}, \mathbf {X}\right). \tag {11} +$$ + +And the prior can be written in the same form, + +$$ +\mathrm {P} \left(\left\{\mathbf {G} _ {\ell} \right\} _ {\ell = 1} ^ {L}, \mathbf {F} _ {L + 1} | \mathbf {X}\right) = +$$ + +$$ +\mathrm {P} \left(\left\{\mathbf {G} _ {\mathrm {i i}} ^ {\ell} \right\} _ {\ell = 1} ^ {L}, \mathbf {F} _ {\mathrm {i}} ^ {L + 1} \mid \mathbf {X} _ {\mathrm {i}}\right) \mathrm {P} \left(\left\{\mathbf {G} _ {\mathrm {i t}} ^ {\ell} \right\} _ {\ell = 1} ^ {L}, \left\{\mathbf {G} _ {\mathrm {t t}} ^ {\ell} \right\} _ {\ell = 1} ^ {L}, \mathbf {F} _ {\mathrm {t}} ^ {L + 1} \mid \left\{\mathbf {G} _ {\mathrm {i i}} ^ {\ell} \right\} _ {\ell = 1} ^ {L}, \mathbf {F} _ {\mathrm {i}} ^ {L + 1}, \mathbf {X}\right). \tag {12} +$$ + +We discuss the second terms (the conditional prior) in Eq. (15). The first terms (the prior and approximate posteriors over inducing points), are given by combining terms in Eq. (6) and Eq. (9), + +$$ +\mathrm {P} \left(\left\{\mathbf {G} _ {\mathrm {i i}} ^ {\ell} \right\} _ {\ell = 1} ^ {L}, \mathbf {F} _ {\mathrm {i}} ^ {L + 1} \mid \mathbf {X} _ {\mathrm {i}}\right) = \left[ \prod_ {\ell = 1} ^ {L} \mathrm {P} \left(\mathbf {G} _ {\mathrm {i i}} ^ {\ell} \mid \mathbf {G} _ {\mathrm {i i}} ^ {\ell - 1}\right) \right] \mathrm {P} \left(\mathbf {F} _ {\mathrm {i}} ^ {L + 1} \mid \mathbf {G} _ {\mathrm {i i}} ^ {L}\right), \tag {13} +$$ + +$$ +\mathrm {Q} \left(\left\{\mathbf {G} _ {\mathrm {i i}} ^ {\ell} \right\} _ {\ell = 1} ^ {L}, \mathbf {F} _ {\mathrm {i}} ^ {L + 1} \mid \mathbf {X} _ {\mathrm {i}}\right) = \left[ \prod_ {\ell = 2} ^ {L} \mathrm {Q} \left(\mathbf {G} _ {\mathrm {i i}} ^ {\ell} \mid \mathbf {G} _ {\mathrm {i i}} ^ {\ell - 1}\right) \right] \mathrm {Q} \left(\mathbf {F} _ {\mathrm {i}} ^ {L + 1} \mid \mathbf {G} _ {\mathrm {i i}} ^ {L}\right). \tag {14} +$$ + +Substituting Eqs. (11-14) into the ELBO (Eq. 10), the conditional prior cancels and we obtain, + +$$ +\mathcal {L} = \mathbb {E} \left[ \log \mathrm {P} \left(\mathbf {Y} | \mathbf {F} _ {\mathrm {t}} ^ {L + 1}\right) + \log \frac {\left[ \prod_ {\ell = 1} ^ {L} \mathrm {Q} \left(\mathbf {G} _ {\mathrm {i i}} ^ {\ell} | \mathbf {G} _ {\mathrm {i i}} ^ {\ell - 1}\right) \right] \mathrm {Q} \left(\mathbf {F} _ {\mathrm {i}} ^ {L + 1} | \mathbf {G} _ {\mathrm {i i}} ^ {L}\right)}{\left[ \prod_ {\ell = 1} ^ {L} \mathrm {P} \left(\mathbf {G} _ {\mathrm {i i}} ^ {\ell} | \mathbf {G} _ {\mathrm {i i}} ^ {\ell - 1}\right) \right] \mathrm {P} \left(\mathbf {F} _ {\mathrm {i}} ^ {L + 1} | \mathbf {G} _ {\mathrm {i i}} ^ {L}\right)} \right]. +$$ + +The first term is a summation across test/train datapoints, and the second term depends only on the inducing points, so as in Salimbeni & Deisenroth (2017) we can compute unbiased estimates of the expectation by taking only a minibatch of datapoints. We also never need to compute the density of the conditional prior in Eq. (12), we only need to be able to sample from it, + +$$ +\begin{array}{l} \mathrm {P} \left(\left\{\mathbf {G} _ {\mathrm {t i}} ^ {\ell}, \mathbf {G} _ {\mathrm {t t}} ^ {\ell} \right\} _ {\ell = 1} ^ {L}, \mathbf {F} _ {\mathrm {t}} ^ {L + 1} \mid \left\{\mathbf {G} _ {\mathrm {i i}} ^ {\ell} \right\} _ {\ell = 1} ^ {L}, \mathbf {F} _ {\mathrm {i}} ^ {L + 1}, \mathbf {X}\right) = \\ \mathrm {P} \left(\mathbf {F} _ {\mathrm {t}} ^ {L + 1} \mid \mathbf {F} _ {\mathrm {i}} ^ {L + 1}, \mathbf {G} _ {L}\right) \prod_ {\ell = 1} ^ {L} \mathrm {P} \left(\mathbf {G} _ {\mathrm {t i}} ^ {\ell}, \mathbf {G} _ {\mathrm {t t}} ^ {\ell} \mid \mathbf {G} _ {\mathrm {i i}} ^ {\ell}, \mathbf {G} _ {\ell - 1}\right). \tag {15} \\ \end{array} +$$ + +The first distribution, $\mathrm{P}\left(\mathbf{F}_{\mathrm{t}}^{L + 1}|\mathbf{F}_{\mathrm{i}}^{L + 1},\mathbf{G}_{L}\right)$ , is a multivariate Gaussian, and can be evaluated using methods from the GP literature (Rasmussen & Williams, 2006; Salimbeni & Deisenroth, 2017). Specifically, we use the global inducing point scheme from Ober & Aitchison (2021). The second distribution is more difficult to sample from. To address this issue, we go back to features, + +$$ +\mathbf {F} _ {\ell} \mathbf {F} _ {\ell} ^ {T} = \nu \mathbf {G} _ {\ell} \sim \mathcal {W} \left(\mathbf {K} \left(\mathbf {G} _ {\ell - 1}\right), \nu\right), \tag {16} +$$ + +with + +$$ +\mathbf {F} _ {\ell} = \left( \begin{array}{c} \mathbf {F} _ {\mathrm {i}} ^ {\ell} \\ \mathbf {F} _ {\mathrm {t}} ^ {\ell} \end{array} \right) \qquad \qquad \qquad \mathbf {K} \left(\mathbf {G} _ {\ell - 1}\right) = \left( \begin{array}{c c} \mathbf {K} _ {\mathrm {i i}} & \mathbf {K} _ {\mathrm {t i}} ^ {T} \\ \mathbf {K} _ {\mathrm {t i}} & \mathbf {K} _ {\mathrm {t t}} \end{array} \right), +$$ + +where $\mathbf{F}_{\ell} \in \mathbb{R}^{(P_{\mathrm{i}} + P_{\mathrm{t}}) \times \nu_{\ell}}$ , $\mathbf{F}_{\mathrm{i}} \in \mathbb{R}^{P_{\mathrm{i}} \times \nu_{\ell}}$ and $\mathbf{F}_{\mathrm{t}} \in \mathbb{R}^{P_{\mathrm{t}} \times \nu_{\ell}}$ . Our goal is to sample $\mathbf{G}_{\mathrm{it}}^{\ell}$ and $\mathbf{G}_{\mathrm{tt}}^{\ell}$ given $\mathbf{G}_{\mathrm{ii}}^{\ell}$ . Our approach is to note that, $\mathbf{F}_{\mathrm{t}}$ conditioned on $\mathbf{F}_{\mathrm{i}}$ is given by a matrix normal, (Eaton et al., 2007, page 310), + +$$ +\mathrm {P} \left(\mathbf {F} _ {\mathrm {t}} ^ {\ell} \mid \mathbf {F} _ {\mathrm {i}} ^ {\ell}\right) = \mathcal {M N} \left(\mathbf {K} _ {\mathrm {t i}} ^ {T} \mathbf {K} _ {\mathrm {i i}} ^ {- 1} \mathbf {F} _ {\mathrm {i}}, \mathbf {K} _ {\mathrm {t t} \cdot \mathrm {i}}, \mathbf {I}\right), \tag {17} +$$ + +where + +$$ +\mathbf {K} _ {\mathrm {t t} \cdot \mathrm {i}} = \mathbf {K} _ {\mathrm {t t}} - \mathbf {K} _ {\mathrm {i t}} ^ {T} \mathbf {K} _ {\mathrm {i i}} ^ {- 1} \mathbf {K} _ {\mathrm {i t}}. +$$ + +Note that we sample each test/train point one-at-a-time/independently, in which case, $P_{\mathrm{t}} = 1$ and $\Sigma_{22:1}$ is scalar. + +Then $\mathbf{G}_{\ell}$ , which includes $\mathbf{G}_{\mathrm{it}}^{\ell}$ and $\mathbf{G}_{\mathrm{tt}}^{\ell}$ is given by, + +$$ +\mathbf {G} _ {\ell} = \left( \begin{array}{c c} \mathbf {G} _ {\mathrm {i i}} ^ {\ell} & \mathbf {G} _ {\mathrm {i t}} ^ {\ell} \\ \mathbf {G} _ {\mathrm {t i}} ^ {\ell} & \mathbf {G} _ {\mathrm {t t}} ^ {\ell} \end{array} \right) = \frac {1}{\nu} \left( \begin{array}{c c} \mathbf {F} _ {\mathrm {i}} ^ {\ell} \left(\mathbf {F} _ {\mathrm {i}} ^ {\ell}\right) ^ {T} & \mathbf {F} _ {\mathrm {i}} ^ {\ell} \left(\mathbf {F} _ {\mathrm {t}} ^ {\ell}\right) ^ {T} \\ \mathbf {F} _ {\mathrm {t}} ^ {\ell} \left(\mathbf {F} _ {\mathrm {i}} ^ {\ell}\right) ^ {T} & \mathbf {F} _ {\mathrm {t}} ^ {\ell} \left(\mathbf {F} _ {\mathrm {t}} ^ {\ell}\right) ^ {T} \end{array} \right) = \frac {1}{\nu} \mathbf {F} _ {\ell} \mathbf {F} _ {\ell} ^ {T} +$$ + +For $\mathbf{F}_{\mathrm{i}}$ , we can use any value as long as $\mathbf{G}_{\mathrm{ii}}^{\ell} = \mathbf{F}_{\mathrm{i}}^{\ell}\left(\mathbf{F}_{\mathrm{i}}^{\ell}\right)^{T}$ , as the resulting distribution over $\mathbf{G}_{\ell}$ arising from Eq. (16) does not depend on the specific choice of $\mathbf{F}_{\mathrm{i}}$ (App. E). Remembering that to sample $\mathbf{G}_{\mathrm{ii}}$ , we explicitly sample its potentially low-rank Cholesky, $\mathbf{L}_{\ell}\mathbf{A}_{\ell}$ , we can directly use + +$$ +\mathbf {F} _ {\mathrm {i}} ^ {\ell} = \mathbf {L} _ {\ell} \mathbf {A} _ {\ell} +$$ + +However, this only works if $\nu \leq P_{\mathrm{i}}$ , in which case, $\mathbf{L}_{\ell}\mathbf{A}_{\ell} \in \mathbb{R}^{P_{\mathrm{i}} \times \nu}$ . In the unusual case where we have fewer inducing points than degrees of freedom, $P_{\mathrm{i}} < \nu$ , then $\mathbf{L}_{\ell}\mathbf{A}_{\ell} \in \mathbb{R}^{P_{\mathrm{i}} \times P_{\mathrm{i}}}$ , so we need to pad to achieve the required size of $P_{\mathrm{i}} \times \nu_{\ell}$ , + +$$ +\mathbf {F} _ {\mathrm {i}} ^ {\ell} = \left( \begin{array}{c c} \mathbf {L} _ {\ell} \mathbf {A} _ {\ell} & \mathbf {0} \end{array} \right). +$$ + +Finally, note that we can optimise all the variational parameters using standard reparameterised variational inference (Kingma & Welling, 2014; Rezende et al., 2014). For an algorithm, see Alg. 1. + +# 3.4 Computational complexity + +Recalling that $\nu_{\ell}$ is the width of the $\ell$ th layer, $P_{i}$ is the number of inducing points, and $P_{t}$ is the number of train or test points, the computational complexity of one DWP layer is given by $O(P_i^3 + P_t P_i^2)$ . This is a decrease of a factor of $\nu_{\ell+1}$ over the complexity for standard DGP inference, such as doubly stochastic variational inference (Salimbeni & Deisenroth, 2017), which has complexity $O(\nu_{\ell+1}(P_i^3 + P_t P_i^2))$ . The difference arises from the fact that in a DGP, $\nu_{\ell+1}$ Gaussian processes are sampled in each layer, whereas for a DWP we sample a single Gram matrix. + +Algorithm 1 Computing predictions/ELBO for one batch +P parameters: $\{\nu_{\ell}\}_{\ell = 1}^{L}$ +Q parameters: $\{\mathbf{V}_{\ell},q_{\ell},\alpha_{\ell},\beta_{\ell},\mu_{\ell},\sigma_{\ell}\}_{\ell = 1}^{L},\mathbf{X}_{\mathrm{i}}$ Inputs: $\mathbf{X}_{\mathrm{t}}$ Targets: Y +combine inducing and test/train inputs + $\mathbf{X} = (\mathbf{X}_{\mathrm{i}}\quad \mathbf{X}_{\mathrm{t}})$ +sample first Gram matrix and update ELBO + $\mathbf{G}_0 = \frac{1}{\nu_0}\mathbf{XX}^T$ +for $\ell$ in $\{1,\dots ,L\}$ do sample inducing Gram matrix and its Cholesky, $\mathbf{L}_{\ell}\mathbf{A}_{\ell}$ and update ELBO $\mathbf{L}_{\ell}\mathbf{A}_{\ell}\mathbf{A}_{\ell}^{T}\mathbf{L}_{\ell}^{T} = \mathbf{G}_{ii}^{\ell}\sim \mathrm{Q}\left(\mathbf{G}_{ii}^{\ell}|\mathbf{G}_{ii}^{\ell -1}\right)$ $\mathcal{L}\gets \mathcal{L} + \log \mathrm{P}\left(\mathbf{G}_{ii}^{\ell}|\mathbf{G}_{ii}^{\ell -1}\right) - \log \mathrm{Q}\left(\mathbf{G}_{ii}^{\ell}|\mathbf{G}_{ii}^{\ell -1}\right)$ sample full Gram matrix from conditional prior + $\boldsymbol {\Sigma} = \frac{1}{\nu_{\ell}}\mathbf{K}(\mathbf{G}_{\ell -1})$ $\boldsymbol{\Sigma}_{\mathrm{tt - i}} = \boldsymbol{\Sigma}_{\mathrm{tt}} - \boldsymbol{\Sigma}_{\mathrm{it}}^{T}\boldsymbol{\Sigma}_{\mathrm{ii}}^{-1}\boldsymbol{\Sigma}_{\mathrm{it}}$ $\mathbf{F_i^\ell = L_\ell A_\ell}$ $\mathbf{F_t^\ell}\sim \mathcal{MN}\left(\Sigma_{ii}^T\Sigma_{ii}^{-1}\hat{\mathbf{F}}_i,\Sigma_{tt - i},\mathbf{I}\right)$ ${\bf G}_{\ell} = \left( \begin{array}{cc}{\bf G}_{ii}^{\ell} & {\hat{\bf F}}_{i}^{\ell}({\hat{\bf F}}_{t}^{\ell})^{T}\\ {\hat{\bf F}}_{t}^{\ell}({\hat{\bf F}}_{i}^{\ell})^{T} & {\hat{\bf F}}_{t}^{\ell}({\hat{\bf F}}_{t}^{\ell})^{T} \end{array} \right)$ +end for +sample GP inducing outputs and update ELBO + $\mathbf{F_i^{L + 1}}\sim \mathrm{Q}\left(\mathbf{F_i^{L + 1}}|\mathbf{G_{ii}^{L}}\right)$ $\mathcal{L}\gets \mathcal{L} + \log \mathrm{P}\left(\mathbf{F_i^{L + 1}}|\mathbf{G_{ii}^{L}}\right) - \log \mathrm{Q}\left(\mathbf{F_i^{L + 1}}|\mathbf{G_{ii}^{L}}\right)$ +sample GP predictions conditioned on inducing points + $\mathbf{F_t^{L + 1}}\sim \mathrm{Q}\left(\mathbf{F_t^{L + 1}}|\mathbf{G_L^L},\mathbf{F_i^{L + 1}}\right)$ +add likelihood to ELBO + $\mathcal{L}\gets \mathcal{L} + \log \mathrm{P}\left(\mathbf{Y}|\mathbf{F_t^{L + 1}}\right)$ + +# 4 Results + +The DWP prior is equivalent to a DGP prior (Sec. 2.4) (Aitchison et al., 2021); the only difference is that in a DGP, we use features as the latent variables, whereas in the DWP we use Gram matrices. Using Gram matrices as in the DWP should be beneficial as the true posteriors are expected to be simpler than in the DGP (Sec. 2.5). We perform a comparison of the posterior intermediate-layer features implied by a DWP and those of a DGP on a toy problem in App. G; these show the benefits of being more able to model the true posterior. + +For more quantitative experiments, we trained a DWP and a DGP with the exact same generative model with a squared exponential kernel on the UCI datasets from Gal & Ghahramani (2015). We trained both models for 20000 gradient steps using the Adam optimizer Kingma & Ba (2015); we detail the exact experimental setup in Appendix F. We report ELBOs and test log likelihoods for depth 5 in Table 1; we report other depths and quote the relevant results from Aitchison et al. (2021) for reference in Appendix H. We found that the DWP often outperformed the DGP model, especially evident if we look at the ELBOs and smaller datasets (boston, concrete, energy, and yacht). On larger datasets, the benefits often disappear, as accurate uncertainty modelling is less relevant. Note that we compared against the recently introduced DGP method based on global inducing points (Ober & Aitchison, 2021). Global inducing point methods were particularly important in our setting because we use a standard feedforward architecture without skip connections to ensure equivalence between the DGP and DWP. Standard DSVI has considerable difficulties with optimizing the approximate posterior in such models; to get optimization to work effectively Salimbeni & Deisenroth (2017) were forced to modify the prior to introduce skip connections. + +Table 1: ELBOs and log-likelihoods for UCI datasets from (Gal & Ghahramani, 2015) for a five-layer network. See Appendix H for other depths. Significantly better results are highlighted. + +
datasetDWPDGP
ELBOboston-0.38 ± 0.01-0.45 ± 0.01
concrete-0.49 ± 0.00-0.50 ± 0.00
energy1.41 ± 0.001.39 ± 0.00
kin8nm-0.14 ± 0.00-0.13 ± 0.00
naval3.65 ± 0.073.91 ± 0.10
power0.03 ± 0.000.02 ± 0.00
protein-1.01 ± 0.00-1.00 ± 0.00
wine-1.19 ± 0.00-1.19 ± 0.00
yacht1.65 ± 0.011.37 ± 0.03
LLboston-2.39 ± 0.04-2.44 ± 0.04
concrete-3.13 ± 0.01-3.14 ± 0.02
energy-0.70 ± 0.03-0.70 ± 0.03
kin8nm1.40 ± 0.001.38 ± 0.01
naval8.21 ± 0.058.31 ± 0.07
power-2.77 ± 0.01-2.78 ± 0.01
protein-2.73 ± 0.00-2.73 ± 0.00
wine-0.96 ± 0.01-0.96 ± 0.01
yacht-0.43 ± 0.10-0.88 ± 0.08
+ +# 4.1 Runtimes & training curves + +In Sec. 3.4, we showed that DWPs have a lower computational complexity than DGPs, because of the need for DGPs to sample $\nu_{\ell}$ features in each layer, whereas DWPs only need to sample one Gram matrix. Here, we briefly discuss the runtimes of our implementations. We show a plot of the training curves for one split of boston with a 5-layer DGP and DWP in Fig. 1, plotted against both runtime and epoch. From these plots, we make two observations. First, the DWP trains much more quickly than the DGP in terms of runtime. However, it seems to require slightly more epochs than the DGP to converge (note that the spike at the start of the DGP curve is an artifact of the tempering scheme we use). In Appendix H, we provide a table of time per epoch, which shows that we obtain faster runtime for protein and for shallower models, although the gains are slightly more modest due to the models being shallower and the fact that we run protein on a GPU, as opposed to a CPU for boston. + +# 5 Related Work + +The DWP prior was introduced by Aitchison et al. (2021). However, they were not able to do variational inference with the DWP because they did not have a sufficiently flexible approximate posterior over positive semi-definite matrices. Instead, they were forced to work with a deep inverse Wishart process, which is easier because the inverse Wishart itself is a suitable approximate posterior. Here, we give a flexible generalised Wishart distribution over positive semi-definite matrices which is suitable for use as a variational approximate posterior in the DWP. As the deep Wishart process prior is equivalent to a DGP prior, we were able to directly compare DGP and DWP inference in models with the exact same prior. Such a comparison with equivalent priors was not possible in Aitchison et al. (2021), because their deep inverse Wishart process priors are not equivalent to DGP priors. + +There is an alternative line of work using generalised Wishart processes (Wilson & Ghahramani, 2011, as opposed to our deep Wishart processes). Note that the "generalised Wishart process" terminology does not seem to have spread as widely as it should, but it is very useful in our context. A generalised Wishart process specifies a distribution over an infinite number of finite-dimensional Wishart-distributed matrices. These matrices might represent e.g. the noise covariance in a dynamical system, in which case there might be an infinite number of such matrices, one for each time or location in the state-space (Wilson & Ghahramani, 2011; Heaukulani & van der Wilk, 2019; Jorgensen et al., 2020). In contrast, the Wishart process (Dawid, 1981; Bru, 1991) describes finite dimensional marginals of a single, potentially infinite dimensional matrix. In our context, we stack + +![](images/3eb743f88fcbedff24c3f68d66b18210004942be210efd5befcb2ce278e54f4d.jpg) +(a) ELBO vs. time + +![](images/36af04e0f40d88e1b3b35bcacfcdded4506d0ec50d581783ab8d9f01e3420fba.jpg) +(b) ELBO vs. epoch +Figure 1: ELBO versus time and epoch for five-layer models on one split of boston + +(non-generalised) Wishart processes to form a deep Wishart process. Importantly, these generalised Wishart priors do not have the flexibility to capture a DGP prior because the underlying features at all locations are jointly multivariate Gaussian (Sec. 4 in Wilson & Ghahramani, 2011) and therefore lack the required nonlinearities between layers. Further, not only do the underlying stochastic processes (deep vs generalised Wishart process) differ, inference is also radically different. In particular, work on the generalised Wishart performs inference on the underlying multivariate Gaussian feature vectors (Eq. 1 e.g. Eq. 15-18 in Wilson & Ghahramani 2011, Eq. 12 in Heaukulani & van der Wilk 2019 or Eq. 24 in Jorgensen et al. 2020). Unfortunately, variational approximate posteriors defined over multivariate Gaussian feature vectors fail to capture symmetries in the true posterior (Sec. 2.5). In contrast, we define approximate posteriors directly over the symmetric positive semi-definite Gram matrices themselves, which required us to develop new, more flexible distributions over these matrices. + +# 6 Limitations + +There are a few limitations of our work. First, it is only possible to derive equivalent DWPs for certain kernels - namely, those where we can skip the feature representation and work entirely in Gram matrices. While this holds for a large range of kernels, such as isotropic kernels and the arc-cosine kernel, it does not hold for some common kernels such as automatic relevance determination (ARD) kernels. However, we note that we are able to use any kernel for the first layer, and that in practice we did not find that ARD kernels in intermediate layers significantly improved performance, as all the features have a shared prior. The second limitation is that it is not currently possible to incorporate modifications to the basic DGP model such as skip connections (Duvenaud et al., 2014; Salimbeni & Deisenroth, 2017). Such modifications would require the use of the non-central Wishart distribution, which is difficult to evaluate in the inner loop of a deep learning algorithm (Koev & Edelman, 2006). Third, the generalisation of our work to more complex architectures such as convolutional models is non-trivial, and will be left to future work. Finally, it seems that the performance is not as competitive for larger datasets, where uncertainty representation is of more limited use - we will explore improving this in future work. + +# 7 Conclusions + +We introduced a flexible distribution over positive semi-definite matrices which formed the basis of a variational approximate posterior for the deep Wishart process. We adapted the doubly stochastic variational inference scheme from Aitchison et al. (2021) to the deep Wishart process. Thus, we were able to directly compare the performance for inference in a DWP vs. DGP with exactly the same prior. This isolates the effects on performance of the prior and the inference procedure. We found DWPs often have improved performance over their corresponding equivalent DGP models, particularly in the ELBOs, indicating improved uncertainty representation. + +There are no anticipated social impacts as the work is largely theoretical. + +# Acknowledgements + +The authors thank David R. Burt, Mark van der Wilk, Samuel Power, and Adam X. Yang for helpful discussions, and would like to thank the reviewers for their comments. + +# Funding Transparency + +SWO acknowledges funding from the Gates Cambridge Trust for his doctoral studies. The authors have no competing interests or additional funding to declare. + +# References + +Laurence Aitchison. Why bigger is not always better: on finite and infinite neural networks. International Conference on Machine Learning (ICML), 2020. +Laurence Aitchison, Adam X Yang, and Sebastian W Ober. Deep kernel processes. International Conference on Machine Learning (ICML), 2021. +Pierre Alquier. User-friendly introduction to PAC-Bayes bounds, 2021. +Maurice Stevenson Bartlett. On the theory of statistical regression. Proceedings of the Royal Society of Edinburgh, 53:260-283, 1934. +Christopher M Bishop et al. Neural networks for pattern recognition. Oxford university press, 1995. +Marie-France Bru. Wishart processes. Journal of Theoretical Probability, 4(4):725-751, 1991. +David R Burt, Sebastian W Ober, Adrià Garriga-Alonso, and Mark van der Wilk. Understanding variational inference in function-space. In Symposium on Advances in Approximate Bayesian Inference (AABI), 2021. +Andreas Damianou and Neil Lawrence. Deep Gaussian processes. In Artificial Intelligence and Statistics (AISTATS), 2013. +A Philip Dawid. Some matrix-variate distribution theory: notational considerations and a Bayesian application. Biometrika, 68(1):265-274, 1981. +David Duvenaud, Oren Rippel, Ryan P. Adams, and Zoubin Ghahramani. Avoiding pathologies in very deep networks. In Artificial Intelligence and Statistics (AISTATS), 2014. +Morris L Eaton et al. The Wishart distribution. In Multivariate Statistics, pp. 302-333. Institute of Mathematical Statistics, 2007. +Yarin Gal and Zoubin Ghahramani. Dropout as a Bayesian approximation: Representing model uncertainty in deep learning. International Conference on Machine Learning (ICML), 2015. +Adrià Garriga-Alonso, Carl Edward Rasmussen, and Laurence Aitchison. Deep convolutional networks as shallow Gaussian processes. International Conference on Learning Representations (ICLR), 2019. +Creighton Heaukulani and Mark van der Wilk. Scalable Bayesian dynamic covariance modeling with variational Wishart and inverse Wishart processes. In Advances in Neural Information Processing Systems, 2019. +Martin Jorgensen, Marc Deisenroth, and Hugh Salimbeni. Stochastic differential equations with variational Wishart diffusions. In International Conference on Machine Learning (ICML), 2020. +Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. International Conference on Learning Representations (ICLR), 2015. +Diederik P Kingma and Max Welling. Auto-encoding variational bayes. International Conference on Learning Representations (ICLR), 2014. + +Plamen Koev and Alan Edelman. The efficient evaluation of the hypergeometric function of a matrix argument. Mathematics of Computation, 75(254):833-846, 2006. +Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In Advances in Neural Information Processing Systems, 2012. +Jaehoon Lee, Yasaman Bahri, Roman Novak, Samuel S Schoenholz, Jeffrey Pennington, and Jascha Sohl-Dickstein. Deep neural networks as Gaussian processes. International Conference on Learning Representations (ICLR), 2018. +Chao Ma, Yingzhen Li, and José Miguel Hernández-Lobato. Variational implicit processes. In International Conference on Machine Learning (ICML), 2019. +David JC MacKay. A practical Bayesian framework for backpropagation networks. Neural Computation, 4(3):448-472, 1992. +Arak M Mathai. Jacobians of matrix transformation and functions of matrix arguments. World Scientific Publishing Company, 1997. +Arakaparampil M Mathai and Hans J Haubold. *Special functions for applied scientists*. Springer, 2008. +Alexander G de G Matthews, Mark Rowland, Jiri Hron, Richard E Turner, and Zoubin Ghahramani. Gaussian process behaviour in wide deep neural networks. International Conference on Learning Representations (ICLR), 2018. +David A Moore. Symmetrized variational inference. In NIPS Workshop on Advances in Approximate Bayesian Inference, volume 4, pp. 31, 2016. +Roman Novak, Lechao Xiao, Jaehoon Lee, Yasaman Bahri, Greg Yang, Jiri Hron, Daniel A Abolafia, Jeffrey Pennington, and Jascha Sohl-Dickstein. Bayesian deep convolutional networks with many channels are Gaussian processes. International Conference on Learning Representations (ICLR), 2019. +Sebastian W Ober and Laurence Aitchison. Global inducing point variational posteriors for Bayesian neural networks and deep Gaussian processes. International Conference on Machine Learning (ICML), 2021. +Yury Polyanskiy and Yihong Wu. Lecture notes on information theory. Lecture Notes for ECE563 (UIUC), 2014. +Arya A Pourzanjani, Richard M Jiang, and Linda R Petzold. Improving the identifiability of neural networks for Bayesian inference. In NIPS Workshop on Bayesian Deep Learning, volume 4, pp. 31, 2017. +Carl Edward Rasmussen and Christopher KI Williams. Gaussian processes for machine learning. MIT press Cambridge, MA, 2006. +Danilo Jimenez Rezende, Shakir Mohamed, and Daan Wierstra. Stochastic backpropagation and approximate inference in deep generative models. International Conference on Machine Learning (ICML), 2014. +Geoffrey Roeder, Yuhuai Wu, and David Duvenaud. Sticking the landing: Simple, lower-variance gradient estimators for variational inference. In Advances in Neural Information Processing Systems, 2017. +Hugh Salimbeni and Marc Deisenroth. Doubly stochastic variational inference for deep Gaussian processes. In Advances in Neural Information Processing Systems, 2017. +Muni S Srivastava et al. Singular Wishart and multivariate beta distributions. The Annals of Statistics, pp. 1537-1560, 2003. +Shengyang Sun, Guodong Zhang, Jiaxin Shi, and Roger Grosse. Functional variational Bayesian neural networks. In International Conference on Learning Representations (ICLR), 2018. + +Héctor J Sussmann. Uniqueness of the weights for minimal feedforward nets with a given input-output map. Neural networks, 5(4):589-593, 1992. + +Andrew Gordon Wilson and Zoubin Ghahramani. Generalised Wishart processes. Uncertainty in Artificial Intelligence (UAI), 2011. + +# Checklist + +1. For all authors... + +(a) Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope? [Yes] +(b) Did you describe the limitations of your work? [Yes] +(c) Did you discuss any potential negative societal impacts of your work? [Yes] Though none were anticipated +(d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes] + +2. If you are including theoretical results... + +(a) Did you state the full set of assumptions of all theoretical results? [Yes] +(b) Did you include complete proofs of all theoretical results? [Yes] + +3. If you ran experiments... + +(a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)? [Yes] (Code in supplementary material, and a reference implementation is provided at https: //github.com/LaurenceA/bayesfunc) +(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] +(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] +(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)? [Yes] + +4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... + +(a) If your work uses existing assets, did you cite the creators? [Yes] +(b) Did you mention the license of the assets? [N/A] UCI datasets have unclear licenses. +(c) Did you include any new assets either in the supplemental material or as a URL? [Yes] (Code in supplementary material +(d) Did you discuss whether and how consent was obtained from people whose data you're using/curating? [N/A] Standard datasets. +(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content? [N/A] \ No newline at end of file diff --git a/avariationalapproximateposteriorforthedeepwishartprocess/images.zip b/avariationalapproximateposteriorforthedeepwishartprocess/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..ec6358d92593c84434799a11034f196894064f4d --- /dev/null +++ b/avariationalapproximateposteriorforthedeepwishartprocess/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b8d79c4129bf1729962ce5bd20247b345a2985fdc90d64da227b52fa7c202c2a +size 451367 diff --git a/avariationalapproximateposteriorforthedeepwishartprocess/layout.json b/avariationalapproximateposteriorforthedeepwishartprocess/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..05e14886c4d4e7664c4a5b4a9e4f33359fca2389 --- /dev/null +++ b/avariationalapproximateposteriorforthedeepwishartprocess/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f33693a95da4fa6386fd6bc6c3fede9ceb70764ad93d0614942fd098566eb09 +size 483863 diff --git a/avariationalperspectiveondiffusionbasedgenerativemodelsandscorematching/fa814dcb-2b22-4931-b094-ba4bf55efd6c_content_list.json b/avariationalperspectiveondiffusionbasedgenerativemodelsandscorematching/fa814dcb-2b22-4931-b094-ba4bf55efd6c_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..86e4684744a5921388deb2c96ba956eb14e5e8f4 --- /dev/null +++ b/avariationalperspectiveondiffusionbasedgenerativemodelsandscorematching/fa814dcb-2b22-4931-b094-ba4bf55efd6c_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7b961f1b8dc00a2ca365caea7ef43759bf966771b6df4fa0b26f2dac4c930517 +size 85596 diff --git a/avariationalperspectiveondiffusionbasedgenerativemodelsandscorematching/fa814dcb-2b22-4931-b094-ba4bf55efd6c_model.json b/avariationalperspectiveondiffusionbasedgenerativemodelsandscorematching/fa814dcb-2b22-4931-b094-ba4bf55efd6c_model.json new file mode 100644 index 0000000000000000000000000000000000000000..a1934884412aa1452a06c39f36521fdc13d0aa01 --- /dev/null +++ b/avariationalperspectiveondiffusionbasedgenerativemodelsandscorematching/fa814dcb-2b22-4931-b094-ba4bf55efd6c_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fc5db81578bae2910eb9f9104ea49452d3a2b5394e86b4e3853120dc6d67c15e +size 106426 diff --git a/avariationalperspectiveondiffusionbasedgenerativemodelsandscorematching/fa814dcb-2b22-4931-b094-ba4bf55efd6c_origin.pdf b/avariationalperspectiveondiffusionbasedgenerativemodelsandscorematching/fa814dcb-2b22-4931-b094-ba4bf55efd6c_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9e7543a912eeeabbfb2f60bf1841717db8371f0d --- /dev/null +++ b/avariationalperspectiveondiffusionbasedgenerativemodelsandscorematching/fa814dcb-2b22-4931-b094-ba4bf55efd6c_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:96fefa25524b2392757eb6742f4baf7e50cf453618081b702af8632774b844c7 +size 1852738 diff --git a/avariationalperspectiveondiffusionbasedgenerativemodelsandscorematching/full.md b/avariationalperspectiveondiffusionbasedgenerativemodelsandscorematching/full.md new file mode 100644 index 0000000000000000000000000000000000000000..4a904180bd9a57ddbaf1806f7382387309f4067d --- /dev/null +++ b/avariationalperspectiveondiffusionbasedgenerativemodelsandscorematching/full.md @@ -0,0 +1,397 @@ +# A Variational Perspective on Diffusion-Based Generative Models and Score Matching + +Chin-Wei Huang, Jae Hyun Lim, Aaron Courville + +University of Montreal & Mila + +{chin-wei.huang, jae.hyun.lim, aaron.courville}@umontreal.ca + +# Abstract + +Discrete-time diffusion-based generative models and score matching methods have shown promising results in modeling high-dimensional image data. Recently, Song et al. (2021) show that diffusion processes that transform data into noise can be reversed via learning the score function, i.e. the gradient of the log-density of the perturbed data. They propose to plug the learned score function into an inverse formula to define a generative diffusion process. Despite the empirical success, a theoretical underpinning of this procedure is still lacking. In this work, we approach the (continuous-time) generative diffusion directly and derive a variational framework for likelihood estimation, which includes continuous-time normalizing flows as a special case, and can be seen as an infinitely deep variational autoencoder. Under this framework, we show that minimizing the score-matching loss is equivalent to maximizing a lower bound of the likelihood of the plug-in reverse SDE proposed by Song et al. (2021), bridging the theoretical gap. + +# 1 Introduction + +Generative modeling can be thought of as inverting an inference process. If the inference process is invertible, then one can focus on transforming the data into a tractable distribution (Dinh et al., 2016). If the inference process is deterministic yet non-invertible, one could learn to invert it stochastically (Dinh et al., 2019; Nielsen et al., 2020). Most generally, both inference and generation can be stochastic. This is known as the variational autoencoder (Kingma & Welling, 2014; Rezende et al., 2014, VAE). + +Under the variational framework, one has a lot of flexibility in choosing the generative and inference models. Recent work on diffusion-based modeling (Sohl-Dickstein et al., 2015; Ho et al., 2020) can be thought of as removing one degree of freedom, by freezing the inference path. The inference model is a fixed discrete-time Markov chain, that slowly transforms the data into a tractable prior, such as the standard normal distribution. The generative model is another Markov chain that is trained to revert this process iteratively. Diffusion-based models have been shown to perform remarkably well on image synthesis (Dhariwal & Nichol, 2021), rivaling the performance of state-of-the-art Generative Adversarial Networks (Brock et al., 2018). + +Song et al. (2021) connect diffusion-based model and score matching (Hyvärinen & Dayan, 2005), by looking at the stochastic differential equation (SDE) associated with the inference process. They realize that the dynamic of the inference process can be inverted if one has access to the score function of the perturbed data, by solving another SDE reversed in time. They then propose to learn the score function of the inference process and substitute the approximate score into the formula of the reverse SDE to obtain a generative model. We call the resulting generative model the plug-in reverse SDE. + +![](images/70aa585b65e867ad68756be6d0fa097b3469adfe386f50f60d2d0b61fff4d79d.jpg) +Figure 1: Three special cases of generative SDEs. The stars indicate the initial values, followed by some random sample paths. Left: trained with no diffusion $\sigma = 0$ (i.e. neural ODE). Middle: trained with some fixed diffusion $\sigma > 0$ . Right: trained with a fixed inference process, $f$ and $g$ (i.e. the plug-in reverse SDE). + +![](images/ae14695d184c8798a45d055fdfabb3ce17141978a47078d8937f485bc785533e.jpg) + +![](images/50fd1b9e2e6a790c15371f432fd6766761022360e70595290da125d4176c0787.jpg) + +Conceptually simple as this learning procedure may seem, little is known about how the score matching loss relates to the plug-in reverse SDE. In this paper, we propose a variational framework suitable for likelihood estimation for general generative diffusion processes, and use this framework to connect score matching with maximum likelihood. We do so by combining two important theorems in stochastic calculus: the Feynman-Kac formula for representing the marginal density of the generative diffusion as an expectation (Section 3), and the Girsanov theorem for performing inference in function space (Section 4). We derive a functional evidence lower bound that consistently extends discrete-time diffusion models to have infinite depth, i.e. the number of layers goes to infinity (Section 5). Finally, by reparameterizing our generative and inference SDEs, we obtain a training objective equivalent to minimizing the (implicit) score matching loss (Section 6). Our theory suggests that by matching the score, one actually maximizes a lower bound on the log marginal density of the plug-in reverse SDE, laying a theoretical foundation for this learning procedure. We further generalize our result to a family of marginal-equivalent plug-in reverse SDEs, including an equivalent ODE as a limiting case. + +Notation: We use $(Y_{s}, s)$ to denote the inference process (where $Y_{0}$ is the data), and $(X_{t}, t)$ to denote the generative process (where $X_{0}$ is a random variable following an unstructured prior). We use $s$ and $t$ to distinguish the two directions, and always integrate the differential equations from 0 to $T > 0$ (different from the literature, where sometimes one might see integration from $T$ to 0). $\hat{B}_{s}$ and $B_{t}$ denote the Brownian motions associated with the inference and generative SDEs, respectively. $B_{s}^{\prime}$ is a reparameterization of $\hat{B}_{s}$ (see Section 4). $q(y, s)$ and $p(x, t)$ denote the probability density functions of $Y_{s}$ and $X_{t}$ , respectively. We let $\mathbf{s}_{\theta}$ denote a time-indexed parameterized function that will be used to approximate the score $\nabla \log q(y, s)$ . $\nabla$ is the gradient wrt the spatial variable ( $x$ or $y$ , which we sometimes call position), $\partial_{t}$ , $\partial_{s}$ and $\partial_{x_{i}}$ are partial derivatives, and $H_{*}$ denotes Hessian. + +# 2 Background + +Assume $Y_{0}$ follows the data distribution $q(y,0)$ , and $Y_{s}$ satisfies the Ito SDE (Øksendal, 2003) + +$$ +\mathrm {d} Y = f (Y, s) \mathrm {d} s + g (Y, s) \mathrm {d} \hat {B} _ {s}, \tag {1} +$$ + +where $f$ and $g$ are chosen such that the density $q(y,s)$ will converge to some tractable prior $p_0$ as $s \to T$ . Following Song et al. (2021), we assume $g$ is position-independent. It is possible to find a "reverse" SDE, whose marginal density evolves according to $q(y,s)$ , reversed in time, for example1 + +$$ +\mathrm {d} X = \left(g g ^ {\top} \nabla \log q (X, T - t) - f\right) \mathrm {d} t + g \mathrm {d} B _ {t}. \tag {2} +$$ + +If $X_0 \sim p_0$ , then the density $p(x, t)$ of $X_t$ is equal to $q(x, T - t)$ . This means that if we have access to the score function $\nabla \log q$ , we can solve the above SDE to obtain $X_T \stackrel{d}{=} Y_0$ . Song et al. (2021) + +
MethodLoss
LESM1/2E[||sθ(Ys,s) - ∇ log q(Ys)||2]
ISME[1/2||sθ(Ys,s)||2/λ + ∇ · (Λ^T sθ)]
SSME[1/2||sθ(Ys,s)||2/λ + v^T ∇(Λ^T sθ)v]
DSM1/2E[||sθ(Ys,s) - ∇ log q(Ys|Y0)||2]
+ +Table 1: Score matching losses. $v$ follows the Rademacher distribution. + +
F-KF-P
v(y,vars)p(y,T-s)
c(y,vars)-∇·μ(y,T-s)
b(y,vars)-μ(y,T-s)
η(y,vars)σ(T-s)
g(y)p0(y)
+ +Table 2: Feynman-Kac coefficients. + +propose to approximate the score via a parameterized score function $S_{\theta}$ by minimizing + +$$ +\int_ {0} ^ {T} \mathbb {E} _ {Y _ {s}} \left[ \frac {1}{2} | | \boldsymbol {s} _ {\theta} (Y _ {s}, s) - \nabla \log q (Y _ {s}, s) | | _ {\Lambda (s)} ^ {2} \right] d s +$$ + +where the expectation in the integral is known as the explicit score matching (ESM) loss $\mathcal{L}_{\mathrm{ESM}}$ , and $\Lambda(s)$ is a positive definite matrix² that serves as a weighting function for the overall loss. $\mathcal{L}_{\mathrm{ESM}}$ is not immediately useful, since we do not have access to the ground truth score $\nabla \log q$ . A few alternative losses can be used, which are all equal to one another up to a constant, including implicit score matching (Hyvarinen & Dayan, 2005, ISM), sliced score matching (Song et al., 2020, SSM), and denoising score matching (Vincent, 2011, DSM). The losses are summarized in Table 1, and are related through the following identity (see Appendix A for the derivation): + +$$ +\mathcal {L} _ {\mathrm {E S M}} - \frac {1}{2} \mathcal {I} \left(q \left(y _ {s}, s\right)\right) = \mathcal {L} _ {\mathrm {I S M}} = \mathcal {L} _ {\mathrm {S S M}} = \mathcal {L} _ {\mathrm {D S M}} - \frac {1}{2} \mathbb {E} _ {Y _ {0}} \left[ \mathcal {I} \left(q \left(y _ {s} \mid y _ {0}\right)\right) \right], \tag {3} +$$ + +where $\mathcal{I}(q) = \mathbb{E}[\|\nabla\log q\|_{\Lambda}^{2}]$ is a constant. After training, Song et al. (2021) plug $s_{\theta}$ into (2) to define a generative model. We refer to this SDE as the plug-in reverse SDE. The plug-in reverse SDE has been demonstrated to have impressive empirical results, but a theoretical underpinning of this learning framework is still lacking. For example, it is unclear how the training objective (minimizing the score matching loss) relates to the sampling procedure, e.g. whether the probability distribution induced by the plug-in reverse SDE gets closer to the data distribution in the sense of any statistical divergence or metric. We seek to answer the following question in this paper: How will minimizing the score-matching loss impact the plug-in reverse SDE? We first provide a framework to estimate the likelihood of generative SDEs, and then get back to this question in Section 6. + +# 3 Marginal density and stochastic instantaneous change of variable + +Let $X_{t}$ be a diffusion process solving the following Itô SDE: + +$$ +\mathrm {d} X = \mu (X, t) \mathrm {d} t + \sigma (X, t) \mathrm {d} B _ {t} \tag {4} +$$ + +with the initial condition $X_0 \sim p_0$ , which induces a family of densities $X_t \sim p(\cdot, t)$ . We use this SDE as the generative SDE, and we are interested in $\log p(x, T)$ for maximum likelihood. The density $p(x, t)$ follows the Kolmogorov forward (or the Fokker Planck) equation: + +$$ +\partial_ {t} p (x, t) = - \sum_ {j} \partial_ {x _ {j}} [ \mu_ {j} (x, t) p (x, t) ] + \sum_ {i, j} \partial_ {x _ {i}, x _ {j}} ^ {2} [ D _ {i j} (x, t) p (x, t) ] \tag {5} +$$ + +with the initial value $p(\cdot, 0) = p_0(\cdot)$ , where $D = \frac{1}{2}\sigma\sigma^T$ is the diffusion matrix. We can expand the Fokker Planck and rearrange the terms to obtain + +$$ +\begin{array}{l} \partial_ {t} p (x, t) = \left[ - \nabla \cdot \mu (x, t) + \sum_ {i, j} \partial_ {x _ {i}, x _ {j}} ^ {2} D _ {i j} (x, t) \right] p (x, t) + \\ \sum_ {i} \left[ - \mu_ {i} (x, t) + 2 \sum_ {j} \partial_ {x _ {j}} D _ {i j} (x, t) \right] \partial_ {x _ {i}} p (x, t) + \sum_ {i, j} D _ {i j} (x, t) \partial_ {x _ {i}, x _ {j}} ^ {2} p (x, t) \tag {6} \\ \end{array} +$$ + +so that all coefficients of the same order are grouped together. For simplicity, we assume the diffusion term $\sigma$ is independent of $x$ throughout the paper. Then (6) reduces to + +$$ +\partial_ {t} p (x, t) = - \left(\nabla \cdot \mu (x, t)\right) p (x, t) - \mu (x, t) ^ {\top} \nabla p (x, t) + D (t): H _ {p} (x, t) \tag {7} +$$ + +where : denotes the Frobenius inner product between matrices. Even with this simplification, solving (7) is not trivial. Fortunately, we can estimate this quantity using the Feynman-Kac formula, which tells us that the solution of certain second-order linear partial differential equations have a probabilistic representation. + +Theorem 1 (Feynman-Kac representation, Chapter 5.7 of Karatzas & Shreve (2014)). Let $T > 0$ . Let $y$ and $\varsigma$ be the spatial and temporal arguments to the function $v \in C^{2,1}(\mathbb{R}^d \times [0,T])$ solving + +$$ +\partial_ {\zeta} v + c v + b ^ {\top} \nabla v + A: H _ {v} = 0 \tag {8} +$$ + +with the terminal condition $v(y, T) = h(y)$ , where $A = \frac{1}{2}\eta \eta^{\top}$ for some matrix-valued function $\eta(y, \varsigma)$ . Under the assumption stated in Appendix B, if $B_s'$ is a Brownian motion and $Y_s$ solves + +$$ +\mathrm {d} Y = b (Y, s) \mathrm {d} s + \eta (Y, s) \mathrm {d} B _ {s} ^ {\prime}, \tag {9} +$$ + +with the initial datum $Y_{\varsigma} = y$ , then + +$$ +v (y, \varsigma) = \mathbb {E} \left[ h \left(Y _ {T}\right) \exp \left(\int_ {\varsigma} ^ {T} c \left(Y _ {s}, s\right) \mathrm {d} s\right) \mid Y _ {\varsigma} = y \right]. \tag {10} +$$ + +To estimate the density $p(\cdot, T)$ of (7), we can apply the change of variable $p(x, t) \coloneqq v(x, T - t)$ by letting the Feynman-Kac (F-K) coefficients correspond to their Fokker-Planck (F-P) counterparts according to Table 2. This way, solving (8) backward is equivalent to solving (7) forward, and we have the following representation of the marginal density at $T$ : + +$$ +p (x, T) = \mathbb {E} \left[ p _ {0} \left(Y _ {T}\right) \exp \left(\int_ {0} ^ {T} - \nabla \cdot \mu \left(Y _ {s}, T - s\right) \mathrm {d} s\right) \mid Y _ {0} = x \right], \tag {11} +$$ + +where $Y_{s}$ is a diffusion process solving + +$$ +\mathrm {d} Y = - \mu (Y, T - s) \mathrm {d} s + \sigma (T - s) \mathrm {d} B _ {s} ^ {\prime}. \tag {12} +$$ + +Remark 1 (Marginalization). This representation can be interpreted as a mixture of continuous time flows. Assume a sample path of the Brownian motion is given, and we are interested in how the density evolves following the dynamic (4). In the infinitesimal setting, it can been seen as applying the invertible map $x \mapsto x + \mu(x,t)\Delta t + \sigma(t)\Delta B_i$ , where $\Delta B_i \coloneqq B_{(i+1)\Delta t} - B_{i\Delta t}$ is the Brownian increment. Since the diffusion term is independent of the spatial variable, it can be seen as a constant additive transformation, which is volume preserving, so it will not be taken into account when computing the change of density. The only contribution to the change of density will be from the log-determinant of the Jacobian of $\mathrm{id} + \mu\Delta t$ , which means we can simply apply the instantaneous change of variable formula (Chen et al., 2018). This will be the conditional density given the entire $\{B_t : t \geq 0\}$ , and marginalizing it out results in the expectation in (11). See Appendix C for details. + +Our framework also works with the general case where $\sigma$ depends on $x$ , but the formulae need to be adapted to account for the spatial partial derivatives. See Appendix D for the derivation. + +# 4 Inferring latent Brownian motion + +As our goal is to estimate likelihood, we would like to compute the log density value using (11). However, this involves integrating out all possible Brownian paths, which is intractable. To resolve this, we view the Brownian motion as a latent variable, and perform inference by assigning higher probability to sample paths that are more likely to generate the observation. One can view this as a VAE, except we have an infinite dimensional latent variable. + +Formally, let $(\Omega, \mathcal{F}, \mathbb{P})$ be the underlying probability space for which $B_s'$ is a Brownian motion. Suppose $\mathbb{Q}$ is another probability measure on $(\Omega, \mathcal{F})$ equivalent to $\mathbb{P}$ ; that is, $\mathbb{P}$ and $\mathbb{Q}$ are similar in + +the sense that they have the same measure zero sets. This allows us to apply the change-of-measure trick and lower bound the log-likelihood with a finite quantity using Jensen's inequality: + +$$ +\log p (x, T) \geq \mathbb {E} _ {\mathbb {Q}} \left[ \log \frac {\mathrm {d} \mathbb {P}}{\mathrm {d} \mathbb {Q}} + \log p _ {0} \left(Y _ {T}\right) - \int_ {0} ^ {T} \nabla \cdot \mu \mathrm {d} s \mid Y _ {0} = x \right]. \tag {13} +$$ + +Note that $\frac{\mathrm{d}\mathbb{P}}{\mathrm{d}\mathbb{Q}}$ is the Radon-Nikodym derivative of $\mathbb{P}$ wrt $\mathbb{Q}$ . When both measures are absolutely continuous wrt a third measure, say Lebesgue, then the derivative can be expressed as the ratio of the two densities. However, since we are dealing with an infinite dimensional space, we are immediately faced with the following problems: + +1. Is there a measure $\mathbb{Q}$ (equiv. to $\mathbb{P}$ ) for which $\frac{\mathrm{d}\mathbb{P}}{\mathrm{d}\mathbb{Q}}$ can be easily computed, or at least numerically approximated? +2. Can we find a reparameterization (similar to the Gaussian reparameterization) of $B_s'$ under the new law $\mathbb{Q}$ to estimate the gradient needed for training? + +We resort to the Girsanov theorem, which describes a general framework for dealing with the change of measure of Gaussian random variables under additive perturbation. It allows us to consider the law of a diffusion process as $\mathbb{Q}$ . See Appendix E for an explanation using the more familiar notion of probability densities. + +Theorem 2 (Girsanov theorem, Theorem 8.6.3 of Øksendal (2003)). Let $\hat{B}_s$ be an Itô process solving + +$$ +\mathrm {d} \hat {B} _ {s} = - a (\omega , s) \mathrm {d} s + \mathrm {d} B _ {s} ^ {\prime}, \tag {14} +$$ + +for $\omega \in \Omega, 0 \leq s \leq T$ and $\hat{B}_0 = 0$ , where $a(\omega, s)$ satisfies the Novikov's condition $\mathbb{E}\left[\exp \left(\frac{1}{2} \int_0^T a^2 \, \mathrm{d}s\right)\right] < \infty$ . Then $\hat{B}_s$ is a Brownian motion wrt $\mathbb{Q}$ where + +$$ +\frac {\mathrm {d} \mathbb {Q}}{\mathrm {d} \mathbb {P}} (\omega) := \exp \left(\int_ {0} ^ {T} a (\omega , s) \cdot \mathrm {d} B _ {s} ^ {\prime} - \frac {1}{2} \int_ {0} ^ {T} | | a (\omega , s) | | _ {2} ^ {2} \mathrm {d} s\right). \tag {15} +$$ + +Equation (14) provides a standardization formula of $B_{s}^{\prime}$ under $\mathbb{Q}$ , which means we can "invert" it to reparameterize $B_{s}^{\prime}$ . This leads to the following lower bound. + +Theorem 3 (Continuous-time ELBO). Let $\mathbb{Q}$ be defined via the density (15). Then the RHS of (13) can be rewritten as + +$$ +\mathbb {E} \left[ - \frac {1}{2} \int_ {0} ^ {T} | | a (\omega , s) | | _ {2} ^ {2} \mathrm {d} s + \log p _ {0} \left(Y _ {T}\right) - \int_ {0} ^ {T} \nabla \cdot \mu \mathrm {d} s \mid Y _ {0} = x \right] =: \mathcal {E} ^ {\infty}, \tag {16} +$$ + +where the expectation is taken wrt the Brownian motion $\hat{B}_s$ , and $Y_s$ solves4 + +$$ +\mathrm {d} Y = (- \mu + \sigma a) \mathrm {d} s + \sigma \mathrm {d} \hat {B} _ {s}. \tag {17} +$$ + +We call $Y_{s}$ solving (17) the inference SDE, and $\mathcal{E}^{\infty}$ the continuous-time ELBO (CT-ELBO). + +Remark 2 (Computation). This lower bound can be numerically estimated by using any black box SDE solver, by augmenting the dynamic of $y$ with the accumulation of $\|a\|^2$ and $\nabla \cdot \mu$ . Computing the divergence term $\nabla \cdot \mu$ directly can be expensive, but it can be efficiently estimated using the Hutchinson trace estimator (Hutchinson, 1989) along with reverse-mode automatic differentiation, similar to Grathwohl et al. (2018). As the parameters of both the generative and inference models are decoupled from the random variable $\hat{B}_s$ , their gradients can be estimated via the reparameterization trick (Kingma & Welling, 2014; Rezende et al., 2014). Furthermore, backpropagation can be computed using an adjoint method with a constant memory cost (Li et al., 2020). + +Remark 3 (Drift $a$ ). (i) In general, the drift term of the approximate posterior to the latent Brownian motion can be amortized, so that it will encode the information of individual datum $x$ . (ii) The regularization $\| a\|^2$ ensures that $a$ is kept close to 0, since it represents the deviation of the measure + +it induces (i.e. $\mathbb{Q}$ ) from the classical Wiener measure (which is a centered Gaussian measure). (iii) When the diffusion coefficient $\sigma$ is 0, the inference SDE reduces to the reverse dynamic of the generative ODE, and if $a \equiv 0$ in this case, the lower bound is tight. (iv) There is generally no constraint on the form of $a(\omega, s)$ , so one can potentially augment it with additional dimensions to have a non-Markovian inference SDE. For simplicity, we let the inference SDE be a Markovian model, i.e. $a = a(y, s)$ . This is justified by the following theorem. + +Theorem 4 (Variational gap and optimal inference SDE). The variational gap can be written as + +$$ +\log p (x, T) - \mathcal {E} ^ {\infty} = \int_ {0} ^ {T} \mathbb {E} \left[ | | a (\omega , s) - \sigma^ {\top} \nabla \log p \left(Y _ {s}, T - s\right) | | ^ {2} \right] d s. \tag {18} +$$ + +In particular, $\mathcal{E}^{\infty} = \log p(x,T)$ if and only if $a(\omega ,s)$ can be written as $a(\omega ,s) = a(Y_s(\omega),s)$ for almost every $s\in [0,T]$ and $\omega \in \Omega$ , and $a(y,s) = \sigma^\top \nabla \log p(y,T - s)$ almost everywhere. + +Remark 4 (Variational gap). Even though the inference SDE seemingly takes a simple form, it is sufficiently flexible in that this type of variational problem can be generally solved by taking the supremem over all progressively measurable processes $a(\omega, s)$ (Boué et al., 1998). In fact, the above theorem shows that $\mathcal{E}^{\infty} = \log p(x, T)$ if and only if $a(y, s) = \sigma^{\top} \nabla \log p(y, T - s)$ . This means a non-amortized Markovian inference process is powerful enough. + +# 5 Infinitely deep hierarchical VAE + +Before we make the connection to score matching, we formally address the common belief that "diffusion models can be viewed as the continuous limit of hierarchical VAEs" (Tzen & Raginsky, 2019), and show that the CT-ELBO consistently extends their discrete-time counterpart. We do so by inspecting the ELBO of a hierarchical VAE defined as discretized5 generative and inference SDEs. We assume the generative model (i.e. the decoder) follows the transitional distributions + +$$ +p \left(x _ {i + 1} \mid x _ {i}\right) = \mathcal {N} \left(x _ {i + 1}; \tilde {\mu} _ {i} \left(x _ {i}\right), \tilde {\sigma} _ {i} ^ {2}\right) \tag {19} +$$ + +$$ +\tilde {\sigma} _ {i} ^ {2} = \Delta t \sigma^ {2} (i \Delta t), \tag {20} +$$ + +where $\Delta t = T / L$ is the step size and $L$ is the number of layers. For the inference model (i.e. the encoder), we assume + +$$ +q \left(x _ {i} \mid x _ {i + 1}\right) = \mathcal {N} \left(x _ {i}; \hat {\mu} _ {i + 1} \left(x _ {i + 1}\right), \hat {\sigma} _ {i + 1} ^ {2}\right) \tag {21} +$$ + +$$ +\hat {\mu} _ {i} (x) = x + \Delta t (- \mu (x, i \Delta t) + \sigma (i \Delta t) a (x, T - i \Delta t)) \quad \hat {\sigma} _ {i} ^ {2} = \Delta t \sigma^ {2} (i \Delta t). \tag {22} +$$ + +These transition kernels constitute a hierarchical variational autoencoder of $L$ stochastic layers, whose marginal likelihood can be lower bounded by + +$$ +\log p \left(x _ {L}\right) \geq \mathbb {E} _ {q} \left[ \log p \left(x _ {0}\right) + \sum_ {i = 0} ^ {L - 1} \log \frac {p \left(x _ {i + 1} \mid x _ {i}\right)}{q \left(x _ {i} \mid x _ {i + 1}\right)} \right] =: \mathcal {E} ^ {L}, \tag {23} +$$ + +which we refer to as the discrete-time ELBO (DT-ELBO). The reconstruction error of the stochastic layer can be seen as some form of finite difference approximation to differentiation, which gives rise to $\nabla \cdot \mu$ in the CT-ELBO in the infinitesimal limit (as $\Delta t$ approaches 0). The regularization of $||a||^2$ pops up when we compare the difference between $\tilde{\mu}_i$ and $\hat{\mu}_i$ using the Gaussian reparameterization to compute the reconstruction error. We formalize this idea in the following theorem. + +Theorem 5 (Consistency). Assume $\mu, \sigma, \sigma^{-2}, a, ||a||^2$ and their derivatives up to the fourth order are all bounded and continuous, and that $\sigma$ is non-singular. Then $\mathcal{E}^L \to \mathcal{E}^\infty$ as $L \to \infty$ . + +This theorem tells us that the CT-ELBO we derive for continuous-time diffusion models is not that different from the traditional ELBO, and that maximizing the CT-ELBO can be seen as training an infinitely deep hierarchical VAE. We present the proof in Appendix F, which formalizes the above intuition, using Taylor's theorem to control the polynomial approximation error, which will go to 0 as the step size $\Delta t$ vanishes when the number of layers $L$ increases to infinity. + +![](images/77ae93dfd14e92f3d7a0d2834728717fd63e7157b5a2fa312253ef46b1f6d8db.jpg) +Figure 2: Left: Samples from plug-in reverse SDEs with different $\lambda$ values (rows). We use the same score function $S_{\theta}$ trained on the Swiss roll dataset, and plug it into (27). For generation, we use the Euler Maruyama method with a step size of $\Delta t = 1/1000$ . We visualize the samples for the $i$ -th iterates (columns), which approximately represent the same marginal distribution when the score function is well trained. Right: Lower bound on the marginal likelihood of a continuum of plug-in reverse SDEs. The lower bound is optimized when the score matching loss is minimized, which will push up the entire dark blue curve. + +![](images/c549299b78129eb2a278b4050f43ac07af957fa77c628a89ba9f842064a6964e.jpg) + +# 6 Score-based generative modeling + +Recall that our goal is to analyze the plug-in reverse SDE and draw connection to score matching. To this end, we reparameterize the generative (4) and inference (17) SDEs as + +$$ +\mathrm {d} X = \left(g g ^ {\top} \boldsymbol {s} _ {\theta} - f\right) \mathrm {d} t + g \mathrm {d} B _ {t} \text {a n d} \mathrm {d} Y = f \mathrm {d} s + g \mathrm {d} \hat {B} _ {s}, \tag {24} +$$ + +by letting $a = g^{\top}\mathcal{S}_{\theta}$ , where the time variable is reversed $(T - t)$ for the generative process, and forward in time $(s)$ for inference. The ELBO (16) can be rewritten as + +$$ +\mathcal {E} ^ {\infty} = \mathbb {E} _ {Y _ {T}} [ \log p _ {0} (Y _ {T}) \mid Y _ {0} = x ] - \int_ {0} ^ {T} \mathbb {E} _ {Y _ {s}} \left[ \frac {1}{2} \| \boldsymbol {s} _ {\theta} \| _ {g g ^ {\top}} ^ {2} + \nabla \cdot (g g ^ {\top} \boldsymbol {s} _ {\theta} - f) \right| Y _ {0} = x \bigg ] d s. \tag {25} +$$ + +Comparing the integrand to the implicit score matching loss in Table 1, we immediately see that the network $S_{\theta}$ approximates $\nabla \log q(y,s)$ , the score function of the marginal density of $Y_{s}$ . That is, matching the score of $q(y,t)$ amounts to maximizing the lower bound on the marginal likelihood of the plug-in reverse SDE. + +Recently, Durkan & Song (2021) $^6$ also attempt to establish the equivalency between maximum likelihood and score matching, by showing the following relationship between the forward KL divergence and a weighted sum of score matching loss (aka the Fisher divergence): + +$$ +D _ {\mathrm {K L}} (q (y, 0) | | r (y, 0)) = \frac {1}{2} \int_ {0} ^ {T} \mathbb {E} _ {q (\cdot , s)} \left[ | | \nabla \log r (Y _ {s}, s) - \nabla \log q (Y _ {s}, s) | | _ {g g ^ {\top}} ^ {2} \right] \mathrm {d} s, \tag {26} +$$ + +where $r(y,s)$ is the density of $Y_{s}$ solving the same inference SDE with the initial condition $y_0 \sim r(\cdot,0)$ , assuming $q(y,T) = r(y,T)$ . However, it is inaccurate to claim that score matching is equivalent to maximum likelihood. This is because if we simply let $r(y,0) = p(y,T)$ , i.e. the density of the generative SDE evaluated at $y$ , $r(y,s)$ will not necessarily be the same as either $p(y,T - s)$ or $\mathbf{s}_{\theta}(y,s)$ . This means the KL divergence is not equal to the integral of the weighted score matching loss $\mathbb{E}\left[\frac{1}{2} ||\mathbf{s}_{\theta} - \nabla \log q||_{gg^{\top}}^{2}\right]$ . In fact, the latter corresponds to a lower bound on the likelihood (the cross-entropy term of the KL) up to some constant, as equation (25) suggests. + +More generally, we can apply our analysis to a family of plug-in reverse SDEs indexed by some parameter $\lambda \leq 1$ : + +$$ +\mathrm {d} X = \left(\left(1 - \frac {\lambda}{2}\right) g ^ {2} \mathbf {s} _ {\theta} - f\right) \mathrm {d} t + \sqrt {1 - \lambda} g \mathrm {d} B _ {t} \text {a n d} \mathrm {d} Y = \left(f - \frac {\lambda}{2} g ^ {2} \nabla \log q\right) \mathrm {d} s + \sqrt {1 - \lambda} g \mathrm {d} \hat {B} _ {s}, \tag {27} +$$ + +where we assume $g$ is diagonal for simplicity. We defer the formal discussion to Appendix G, but the essence is that this inference SDE induces the same marginal distribution as (1), and the generative SDE is its corresponding plug-in reverse. Equation (27) includes the original plug-in reverse SDE (24) and an equivalent ODE as special cases with $\lambda = 0$ and $\lambda = 1$ . Denote its corresponding CT-ELBO by $\mathcal{E}_{\lambda}^{\infty}$ . Specifically, (25) becomes $\mathcal{E}_0^\infty$ . Then we have the following relationship. + +Theorem 6 (Plug-in reverse SDE ELBO, abridged). For $\lambda < 1$ + +$$ +\mathbb {E} _ {Y _ {0}} \left[ \mathcal {E} _ {\lambda} ^ {\infty} \right] = \mathbb {E} _ {Y _ {0}} \left[ \mathcal {E} _ {0} ^ {\infty} \right] - \left(\frac {\lambda^ {2}}{4 (1 - \lambda)}\right) \int_ {0} ^ {T} \mathbb {E} _ {Y _ {s}} \left[ \frac {1}{2} | | \boldsymbol {s} _ {\theta} (Y _ {s}, s) - \nabla \log q (Y _ {s}, s) | | _ {g ^ {2}} ^ {2} \right] d s \tag {28} +$$ + +We state the full theorem in Appendix H, where we rearrange the terms to show that the average CT-ELBO of the $\lambda$ -plug-in reverse SDE is also equivalent to the ISM loss, similarly to (25) but up to some multiplying and additive constants. The implication is that while minimizing the score matching loss, we implicitly maximize the likelihood of a continuum of plug-in reverse SDEs which include the ODE as a limiting case ( $\lambda \rightarrow 1$ ). See Figure 2 (right) for illustration. This suggests the likelihood of the equivalent ODE can be improved by minimizing the score matching loss, as the ODE's likelihood will be close to plug-in reverse SDEs with $\lambda \approx 1$ , which explains the good likelihood of the equivalent ODE reported in Song et al. (2021). In practice, we can only estimate the ELBO of the case $\lambda = 0$ since otherwise there will be some constant we do not have access to, but their gradients can all be estimated via score matching. + +# 6.1 Computational trade-off + +Having a general framework for estimating the likelihood of diffusion processes allows us to compare a wide family of models, including continuous-time flows and plug-in reverse SDEs trained by score matching. We compare the two by measuring the negative ELBO throughout training to highlight their computation-estimation trade-off. We train the models on the Swiss roll toy data. For continuous-time flow, we set $\sigma = 0$ , using the Hutchinson trace estimator following Grathwohl et al. (2018). The ELBO in this case is tight since $a$ will be penalized to be 0. We use the torchdiffreq library (Chen et al., 2018) for numerical integration for fairer comparison7. For plug-in reverse SDE, we train the drift network $a$ using SSM and DSM (for DSM the loss is weighted to reduce variance, which introduces some bias; see the next subsection). We use the variance-preserving inference SDE from Song et al. (2021), which allows us to sample $Y_{s}$ using a closed form formula, for $s$ sampled uniformly between $[0, T]$ . The trained models are visualized in Figure 1, the learning curves presented in Figure 3. + +From the learning curve figures, we see that neg-likelihood decreases rapidly for the continuous-time flow in terms of the number of parameter updates. But once the x-axis is normalized by runtime, the convergence speed becomes almost indistinguishable. This is because for continuous-time flows, numerical integration takes time, whereas for plug-in reverse SDEs, we train on a random time step $s$ ; that is, within a fixed amount of time the latter can make more parameter updates at the cost of noisier gradients. Note that both models have constant memory cost (wrt $T$ or $L$ , the number of integration steps), so a large batch size can be used to reduce variance for training. + +# 6.2 Bias and variance trade-off + +The integral in equation (25) can be estimated by sampling $(Y_{s}, s)$ , and using the Hutchinson trace estimator to estimate the divergence, which corresponds to implicit score matching. However, in practice the variance of this estimator is very high when the norm of the Jacobian $\nabla \mathcal{S}_{\theta}$ is large. Another popular approach is to use the denoising estimator (recall the identity from (3)), + +$$ +\mathbb {E} _ {Y _ {s}} \left[ \frac {1}{2} | | \mathbf {s} _ {\theta} (Y _ {s}, s) - \nabla \log q (Y _ {s} | Y _ {0}) | | _ {g g ^ {\top}} ^ {2} \right| Y _ {0} = x \Bigg ]. \tag {29} +$$ + +The inference SDE is typically chosen so that $Y_{s}$ can be easily sampled, e.g. following $\mathcal{N}(\mu_s,\sigma_s^2)$ , where $\mu_{s}$ and $\sigma_{s}$ are functions of $Y_{0}$ and $s$ . In this case, if we reparameterize $Y_{s} = \mu_{s} + \sigma_{s}\epsilon$ where + +![](images/e2c4855b2ee64dca57ef95d433fc0434ea3953f284ac6fd7c3c1fe3105f6ed3a.jpg) +Figure 3: Neural ODE vs plug-in reverse SDE (denoising or slice score matching). The learning curves are presented as a function of iterations (left) and runtime (right) to emphasize the computational distinction between the two families of models. + +![](images/77736002cb66072411a1ad760437e988b600cd90dba953a8cb9300faed31c728.jpg) + +![](images/06b265ac53216740ca3dd63702c17f1ba016626bbd5f8e1632aa35f198a3eb4f.jpg) + +![](images/80cd7ce6976f49db87627b0bb0ee60fbb74f1ac92de409dd5974b278be884ec6.jpg) + +![](images/c0caa42547900827b8b4e0c6a19cac16c0d9d3f8465bd48c9567f9b2716715c5.jpg) +Figure 4: Likelihood estimation on MNIST (first row) and CIFAR10 (second row). $s_{\theta}$ and $a$ denote which model we parameterize. Y-axes are bits-per-dim and the standard error of BPD of the test set. The debiased curves improve upon the original biased gradient estimator (Song et al., 2021) since it maximizes a proper ELBO. Shaded area reflects the uncertainty estimated by 3 random seeds. + +![](images/51a351b6cda675725f5303ca0726a8acb217099d3be55a203bac9728fba84a47.jpg) + +$\epsilon \sim \mathcal{N}(0,\mathbf{I})$ , then the score becomes $\nabla \log q = -\frac{\epsilon}{\sigma_s}$ . Since $\sigma_{s} \to 0$ as $s \to 0$ , this estimator normally has unbounded variance. Song & Ermon (2019); Song et al. (2021) propose to remedy this by multiplying the DSM loss by $\sigma_s^2 / g^2$ (assuming $g$ is a scalar for simplicity), so that the target has constant magnitude on average $\mathbb{E}\left[\frac{1}{2} ||\sigma_s s_\theta + \epsilon ||^2\right]$ , which would result in a biased gradient estimate with much smaller variance. We can debias this estimator by sampling $s \sim q(s) \propto g^2 / \sigma_s^2$ . This ratio, however, is usually not normalizable in practice (as it integrates to $\infty$ ). As an alternative, we consider the following unnormalized density $\tilde{q}_{\epsilon}(s) = g^{2}(s_{\epsilon}) / \sigma_{s_{\epsilon}}^{2}$ for $s \in [0, s_{\epsilon}]$ , and $\tilde{q}_{\epsilon}(s) = g^{2}(s) / \sigma_{s}^{2}$ for $s \in [s_{\epsilon}, T]$ . We experiment with this debiased procedure by sampling $s \sim q_{\epsilon} \propto \tilde{q}_{\epsilon}$ , for $f$ and $g$ chosen to be the variance-preserving SDE. $s_{\epsilon}$ is small so that the bias is negligible. + +We train the model on MNIST (LeCun et al., 1998) and CIFAR10 (Krizhevsky et al., 2009). We present the learning curves and the standard error of the estimate of the ELBO in Figure 4. The lower bound is estimated using the Hutchinson trace estimator with $s$ sampled uniformly from $[0, T]$ , with the same batch size, so the only thing that will affect the dispersion is the magnitude of $\nabla s_{\theta}$ . Since smaller values of $s$ are more likely to be sampled under $q_{\epsilon}$ , the debiased model will see samples with less perturbation more often. On the contrary, sampling $s$ uniformly will bias the model to learn from noisier data, causing the learned score to be smoother. We also experiment with parameterizing $s_{\theta}$ vs parameterizing $a$ . We find the latter parameterization to be helpful since the relationship $s_{\theta} = g^{-1}a$ has the effect of negating the multiplier $\sigma_{s}$ in the reweighted loss, i.e. $\mathbb{E}\left[\frac{1}{2} ||\frac{\sigma_s}{g}a + \epsilon ||^2\right]$ . This is similar to the noise conditioning technique introduced in Song & Ermon (2020). + +# 7 Related work + +Diffusion-based generative models Our work lays a theoretical foundation for Song et al. (2021), which recognizes that conditional denoising score matching (Song & Ermon, 2019, 2020) and + +discrete-time diffusion-based generative models (Sohl-Dickstein et al., 2015; Goyal et al., 2017; Ho et al., 2020) can be viewed as learning to revert an inference process (using the plug-in reverse SDE). Different from Ho et al. (2020), which shows the ELBO of discrete time diffusion process can be likened to DSM (Section 3.2 of the paper), we show that ISM loss naturally arises from the Fokker-Planck equation of the marginal density, via the Fenman-Kac representation and the Girsanov change of measure. This line of work has been successfully applied to modeling high dimensional natural images (Dhariwal & Nichol, 2021; Sahara et al., 2021), audio (Kong et al., 2020), 3D point cloud (Cai et al., 2020; Zhou et al., 2021), and discrete data (Hoogeboom et al., 2021). + +Time-reversal of diffusion processes Plenty of works have studied the reverse-time diffusion processes (2), including Anderson (1982); Föllmer (1985); Elliott & Anderson (1985); Haussmann & Pardoux (1986). These are different from our marginal-equivalent (reverse) processes (27) when $\mathbf{s}_{\theta} = \nabla \log q$ , since the latter is related by the marginals only. + +Score matching for energy-based models Besides the connection to diffusion models, score matching is also often used as a method for learning energy based models (EBM)—see Song & Kingma (2021) for a comprehensive review on useful techniques. When used as an EBM, sampling from the conditional score model can be achieved by running the annealed Langevin diffusion (Neal, 2001), which is connected to free-energy estimation in physics (Jarzynski, 1997), wherein the path integral is essentially a Feynman Kac representation. + +De Bruijn's identity To connect maximum likelihood and score matching, Durkan & Song (2021) shows that KL divergence can be represented as an integral of weighted Fisher divergence, generalizing the case of Lyu (2009) where the inference perturbation is a simple Brownian motion. This type of formulas fall into the category of de Bruijn's identity (Cover, 1999) for relative entropy. A similar differential form result can be found in Wibisono et al. (2017). + +Learning SDEs Tzen & Raginsky (2019); Li et al. (2020) also propose to learn a neural SDE by applying Girsanov's theorem. The key difference is that they treat the SDE entirely as a latent variable, with an additional emission probability, whereas we use the Feynman-Kac formula to directly express the marginal density as an expectation, side-stepping the need to smooth out the density using the emission probability (which will be a Dirac point mass in our case). In their case, the inference direction is the same as the generative direction, since they infer the latent SDE directly, whereas we apply Girsanov to the Feynman-Kac diffusion (opposite the generative direction). Xu et al. (2021) further apply neural SDE as an infinitely deep Bayesian neural network. + +# 8 Conclusion and Discussion + +In this work, we derive a general variational framework for estimating the marginal likelihood of continuous-time diffusion models. This framework allows us to study a wide spectrum of models, including continuous-time normalizing flows and score-based generative models. Using our framework, we show that performing score matching with a particular choice of mixture weighting is equivalent to maximizing a lower bound on the marginal likelihood of a family of plug-in reverse SDEs, of which the one used in Song et al. (2021) and the equivalent ODE are special cases. Empirically, we validate our theory by monitoring the ELBO while performing score matching, and discuss the implication of the choice of mixture weighting and the potential of debiasing via nonuniform sampling. We emphasize that our theory does not explain the impressive sample quality of this family of models, which is still an open research problem and we leave it for future work. + +This work introduces a general framework to estimate the likelihood of diffusion-based models, which allows the parameters of both the generative and inference SDEs to be learned, using a numerical solver with constant memory cost (as per Remark 2). The training time can be reduced via the connection to score matching and the reverse-time parameterization (24) as long as $f$ and $g$ take a simple form (so that $Y_{t}$ can be sampled without numerical integration). For example, one can generalize the Ornstein-Uhlenbeck process to have non-linear (in time) $f$ and $g$ , similar to the variance-preserving SDE, by parameterizing the integral of $f$ using a monotone network (Sill, 1998; Kay & Ungar, 2000; Daniels & Velikova, 2010; Huang et al., 2018). This has been explored in a concurrent work by Kingma et al. (2021) in a different framework. + +# Acknowledgements + +We would like to thank David Kanaa, Ricky Chen, Simon Verret, Rémi Piché-Taillefer, Alexia Jolicoeur-Martineau, and Faruk Ahmed for giving their feedback on this manuscript. We would also like to thank the INNF+ 2021 reviewers and NeurIPS 2021 reviewers for their constructive suggestions, which help us improve the clarity of the paper. Chin-Wei is supported by the Google PhD fellowship. +We also acknowledge the Python community (Van Rossum & Drake Jr, 1995; Oliphant, 2007) for developing the tools that enabled this work, including numpy (Oliphant, 2006; Van Der Walt et al., 2011; Walt et al., 2011; Harris et al., 2020), PyTorch (Paszke et al., 2019), matplotlib (Hunter, 2007), seaborn (Waskom et al., 2018), and SciPy (Jones et al., 2014). + +# References + +Anderson, B. D. Reverse-time diffusion equation models. Stochastic Processes and their Applications, 12(3):313-326, 1982. +Boué, M., Dupuis, P., et al. A variational representation for certain functionals of brownian motion. The Annals of Probability, 26(4):1641-1659, 1998. +Brock, A., Donahue, J., and Simonyan, K. Large scale gan training for high fidelity natural image synthesis. arXiv preprint arXiv:1809.11096, 2018. +Cai, R., Yang, G., Averbuch-Elor, H., Hao, Z., Belongie, S., Snavely, N., and Hariharan, B. Learning gradient fields for shape generation. In Computer Vision - ECCV 2020 - 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part III, 2020. +Chen, R. T., Rubanova, Y., Bettencourt, J., and Duvenaud, D. Neural ordinary differential equations. In Proceedings of the 32nd International Conference on Neural Information Processing Systems, pp. 6572-6583, 2018. +Cover, T. M. Elements of information theory. John Wiley & Sons, 1999. +Daniels, H. and Velikova, M. Monotone and partially monotone neural networks. IEEE Transactions on Neural Networks, 21(6):906-917, 2010. +Dhariwal, P. and Nichol, A. Diffusion models beat gans on image synthesis. arXiv preprint arXiv:2105.05233, 2021. +Dinh, L., Sohl-Dickstein, J., and Bengio, S. Density estimation using real nvp. In International Conference on Learning Representations, 2016. +Dinh, L., Sohl-Dickstein, J., Larochelle, H., and Pascanu, R. A rad approach to deep mixture models. arXiv preprint arXiv:1903.07714, 2019. +Durkan, C. and Song, Y. On maximum likelihood training of score-based generative models. arXiv preprint arXiv:2101.09258, 2021. +Elliott, R. J. and Anderson, B. D. Reverse time diffusions. Stochastic processes and their applications, 19(2):327-339, 1985. +Föllmer, H. An entropy approach to the time reversal of diffusion processes. In Stochastic Differential Systems Filtering and Control, pp. 156-163. Springer, 1985. +Goyal, A., Ke, N. R., Ganguli, S., and Bengio, Y. Variational walkback: Learning a transition operator as a stochastic recurrent net. Advances in Neural Information Processing Systems, 2017. +Grathwohl, W., Chen, R. T., Bettencourt, J., Sutskever, I., and Duvenaud, D. Ffjord: Free-form continuous dynamics for scalable reversible generative models. In International Conference on Learning Representations, 2018. +Harris, C. R., Millman, K. J., van der Walt, S. J., Gommers, R., Virtanen, P., Cournapeau, D., Wieser, E., Taylor, J., Berg, S., Smith, N. J., et al. Array programming with numpy. Nature, 585(7825): 357-362, 2020. + +Haussmann, U. G. and Pardoux, E. Time reversal of diffusions. The Annals of Probability, pp. 1188-1205, 1986. +Ho, J., Jain, A., and Abbeel, P. Denoising diffusion probabilistic models. In Advances in neural information processing systems, 2020. +Hoogeboom, E., Nielsen, D., Jaini, P., Forre, P., and Welling, M. Argmax flows and multinomial diffusion: Towards non-autoregressive language models. arXiv preprint arXiv:2102.05379, 2021. +Huang, C.-W., Krueger, D., Lacoste, A., and Courville, A. Neural autoregressive flows. In International Conference on Machine Learning, pp. 2078-2087, 2018. +Hunter, J. D. Matplotlib: A 2d graphics environment. Computing in science & engineering, 9(3): 90, 2007. +Hutchinson, M. F. A stochastic estimator of the trace of the influence matrix for laplacian smoothing splines. Communications in Statistics-Simulation and Computation, 18(3):1059-1076, 1989. +Hyvarinen, A. and Dayan, P. Estimation of non-normalized statistical models by score matching. Journal of Machine Learning Research, 6(4), 2005. +Jarzynski, C. Equilibrium free-energy differences from nonequilibrium measurements: A master-equation approach. Physical Review E, 56(5):5018, 1997. +Jones, E., Oliphant, T., and Peterson, P. {SciPy}: Open source scientific tools for {Python}. 2014. +Karatzas, I. and Shreve, S. Brownian motion and stochastic calculus, volume 113. springer, 2014. +Kay, H. and Ungar, L. H. Estimating monotonic functions and their bounds. AIChE Journal, 46 (12):2426-2434, 2000. +Kingma, D. P. and Welling, M. Auto-encoding variational bayes. In International Conference on Learning Representations, 2014. +Kingma, D. P., Salimans, T., Poole, B., and Ho, J. Variational diffusion models. arXiv preprint arXiv:2107.00630, 2021. +Kong, Z., Ping, W., Huang, J., Zhao, K., and Catanzaro, B. Diffwave: A versatile diffusion model for audio synthesis. arXiv preprint arXiv:2009.09761, 2020. +Krizhevsky, A., Hinton, G., et al. Learning multiple layers of features from tiny images. 2009. +LeCun, Y., Bottou, L., Bengio, Y., and Haffner, P. Gradient-based learning applied to document recognition. Proceedings of the IEEE, 86(11):2278-2324, 1998. +Li, X., Wong, T.-K. L., Chen, R. T., and Duvenaud, D. Scalable gradients for stochastic differential equations. In International Conference on Artificial Intelligence and Statistics, pp. 3870-3882. PMLR, 2020. +Lyu, S. Interpretation and generalization of score matching. In Proceedings of the Twenty-Fifth Conference on Uncertainty in Artificial Intelligence, pp. 359-366, 2009. +Milshtein, G. Approximate integration of stochastic differential equations. Theory of Probability & Its Applications, 19(3):557-562, 1975. +Neal, R. M. Annealed importance sampling. Statistics and computing, 11(2):125-139, 2001. +Nielsen, D., Jaini, P., Hoogeboom, E., Winther, O., and Welling, M. Survae flows: Surjections to bridge the gap between vaes and flows. Advances in Neural Information Processing Systems, 33, 2020. +Øksendal, B. Stochastic differential equations. In Stochastic differential equations, pp. 65-84. Springer, 2003. +Oliphant, T. E. A guide to NumPy, volume 1. Trelgol Publishing USA, 2006. + +Oliphant, T. E. Python for scientific computing. Computing in Science & Engineering, 9(3):10-20, 2007. +Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., Killeen, T., Lin, Z., Gimelshein, N., Antiga, L., et al. Pytorch: An imperative style, high-performance deep learning library. In Advances in neural information processing systems, pp. 8026-8037, 2019. +Rezende, D. J., Mohamed, S., and Wierstra, D. Stochastic backpropagation and approximate inference in deep generative models. In International conference on machine learning, pp. 1278-1286. PMLR, 2014. +Ronneberger, O., Fischer, P., and Brox, T. U-net: Convolutional networks for biomedical image segmentation. In International Conference on Medical image computing and computer-assisted intervention, pp. 234-241. Springer, 2015. +Saharia, C., Ho, J., Chan, W., Salimans, T., Fleet, D. J., and Norouzi, M. Image super-resolution via iterative refinement. arXiv preprint arXiv:2104.07636, 2021. +Sill, J. Monotonic networks. In Advances in neural information processing systems, pp. 661-667, 1998. +Sohl-Dickstein, J., Weiss, E., Maheswaranathan, N., and Ganguli, S. Deep unsupervised learning using nonequilibrium thermodynamics. In International Conference on Machine Learning, pp. 2256-2265. PMLR, 2015. +Song, Y. and Ermon, S. Generative modeling by estimating gradients of the data distribution. In Advances in neural information processing systems, 2019. +Song, Y. and Ermon, S. Improved techniques for training score-based generative models. arXiv preprint arXiv:2006.09011, 2020. +Song, Y. and Kingma, D. P. How to train your energy-based models. arXiv preprint arXiv:2101.03288, 2021. +Song, Y., Garg, S., Shi, J., and Ermon, S. Sliced score matching: A scalable approach to density and score estimation. In Uncertainty in Artificial Intelligence, pp. 574-584. PMLR, 2020. +Song, Y., Sohl-Dickstein, J., Kingma, D. P., Kumar, A., Ermon, S., and Poole, B. Score-based generative modeling through stochastic differential equations. In International Conference on Learning Representations, 2021. +Tzen, B. and Raginsky, M. Neural stochastic differential equations: Deep latent gaussian models in the diffusion limit. arXiv preprint arXiv:1905.09883, 2019. +Van Der Walt, S., Colbert, S. C., and Varoquaux, G. The numpy array: a structure for efficient numerical computation. Computing in Science & Engineering, 13(2):22, 2011. +Van Rossum, G. and Drake Jr, F. L. Python reference manual. Centrum voor Wiskunde en Informatica Amsterdam, 1995. +Vincent, P. A connection between score matching and denoising autoencoders. Neural computation, 23(7):1661-1674, 2011. +Walt, S. v. d., Colbert, S. C., and Varoquaux, G. The numpy array: a structure for efficient numerical computation. Computing in science & engineering, 13(2):22-30, 2011. +Waskom, M., Botvinnik, O., O'Kane, D., Hobson, P., Ostblom, J., Lukauskas, S., Gemperline, D. C., Augspurger, T., Halchenko, Y., Cole, J. B., Warmenhoven, J., de Ruiter, J., Pye, C., Hoyer, S., Vanderplas, J., Villalba, S., Kunter, G., Quintero, E., Bachant, P., Martin, M., Meyer, K., Miles, A., Ram, Y., Brunner, T., Yarkoni, T., Williams, M. L., Evans, C., Fitzgerald, C., Brian, and Qalieh, A. mwaskom/seaborn: v0.9.0, July 2018. +Wibisono, A., Jog, V., and Loh, P.-L. Information and estimation in fokker-planck channels. In 2017 IEEE International Symposium on Information Theory (ISIT), pp. 2673-2677. IEEE, 2017. + +Xu, W., Chen, R. T., Li, X., and Duvenaud, D. Infinitely deep bayesian neural networks with stochastic differential equations. arXiv preprint arXiv:2102.06559, 2021. +Zhou, L., Du, Y., and Wu, J. 3d shape generation and completion through point-voxel diffusion. arXiv preprint arXiv:2104.03670, 2021. \ No newline at end of file diff --git a/avariationalperspectiveondiffusionbasedgenerativemodelsandscorematching/images.zip b/avariationalperspectiveondiffusionbasedgenerativemodelsandscorematching/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..75415f87f28bc44ecd28f0fc43535e79c899c7e8 --- /dev/null +++ b/avariationalperspectiveondiffusionbasedgenerativemodelsandscorematching/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1bdcae934c7e5b03246c3a6fb19976304584eb4805d9be1a0db72efbdf77b41b +size 393734 diff --git a/avariationalperspectiveondiffusionbasedgenerativemodelsandscorematching/layout.json b/avariationalperspectiveondiffusionbasedgenerativemodelsandscorematching/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..f28823228688ce1bcedb632bd90817c23ab46c36 --- /dev/null +++ b/avariationalperspectiveondiffusionbasedgenerativemodelsandscorematching/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4babab3317f3e12f3dd515a68588caf4630186b3e6cb18fd94cc1142a77a4be0 +size 560729 diff --git a/awinninghandcompressingdeepnetworkscanimproveoutofdistributionrobustness/f410ce08-8d40-4f97-b5a3-e025bf37dfc5_content_list.json b/awinninghandcompressingdeepnetworkscanimproveoutofdistributionrobustness/f410ce08-8d40-4f97-b5a3-e025bf37dfc5_content_list.json new file mode 100644 index 0000000000000000000000000000000000000000..f48ff22268dcb3060835d3dbb9de14a010c2dccc --- /dev/null +++ b/awinninghandcompressingdeepnetworkscanimproveoutofdistributionrobustness/f410ce08-8d40-4f97-b5a3-e025bf37dfc5_content_list.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ec67c899e9c44164f26da433882a09f3b8433e474e6a3d6083eb88d7cdf4013 +size 75131 diff --git a/awinninghandcompressingdeepnetworkscanimproveoutofdistributionrobustness/f410ce08-8d40-4f97-b5a3-e025bf37dfc5_model.json b/awinninghandcompressingdeepnetworkscanimproveoutofdistributionrobustness/f410ce08-8d40-4f97-b5a3-e025bf37dfc5_model.json new file mode 100644 index 0000000000000000000000000000000000000000..4d5ab6997cb84ddf3c3b9c185439f5375099f7e9 --- /dev/null +++ b/awinninghandcompressingdeepnetworkscanimproveoutofdistributionrobustness/f410ce08-8d40-4f97-b5a3-e025bf37dfc5_model.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ad5ce32e4c627d8f16efbdb09b4efbccaa1886dfe18d5c484c87180833e21999 +size 94671 diff --git a/awinninghandcompressingdeepnetworkscanimproveoutofdistributionrobustness/f410ce08-8d40-4f97-b5a3-e025bf37dfc5_origin.pdf b/awinninghandcompressingdeepnetworkscanimproveoutofdistributionrobustness/f410ce08-8d40-4f97-b5a3-e025bf37dfc5_origin.pdf new file mode 100644 index 0000000000000000000000000000000000000000..359b939a5e3f5ecfe3ee01068275ad1bcceb243e --- /dev/null +++ b/awinninghandcompressingdeepnetworkscanimproveoutofdistributionrobustness/f410ce08-8d40-4f97-b5a3-e025bf37dfc5_origin.pdf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5bb534b77dba4a9de142aa909ee7f7d0d46852b34155018cf3843201db0a92ba +size 2517617 diff --git a/awinninghandcompressingdeepnetworkscanimproveoutofdistributionrobustness/full.md b/awinninghandcompressingdeepnetworkscanimproveoutofdistributionrobustness/full.md new file mode 100644 index 0000000000000000000000000000000000000000..7055290b632e5ef8bdeb5126e67b627b8bdb03d4 --- /dev/null +++ b/awinninghandcompressingdeepnetworkscanimproveoutofdistributionrobustness/full.md @@ -0,0 +1,249 @@ +# A Winning Hand: Compressing Deep Networks Can Improve Out-Of-Distribution Robustness + +James Diffenderfer, Brian R. Bartoldson,\* Shreya Chaganti\*, Jize Zhang, Bhavya Kailkhura + +Lawrence Livermore National Laboratory + +{diffenderfer2, bartoldson, chaganti1, zhang64, kailkhura1}@llnl.gov + +# Abstract + +Successful adoption of deep learning (DL) in the wild requires models to be: (1) compact, (2) accurate, and (3) robust to distributional shifts. Unfortunately, efforts towards simultaneously meeting these requirements have mostly been unsuccessful. This raises an important question: "Is the inability to create Compact, Accurate, and Robust Deep neural networks (CARDs) fundamental?" To answer this question, we perform a large-scale analysis of popular model compression techniques which uncovers several intriguing patterns. Notably, in contrast to traditional pruning approaches (e.g., fine tuning and gradual magnitude pruning), we find that "lottery ticket-style" approaches can surprisingly be used to produce CARDs, including binary-weight CARDs. Specifically, we are able to create extremely compact CARDs that, compared to their larger counterparts, have similar test accuracy and matching (or better) robustness—simply by pruning and (optionally) quantizing. Leveraging the compactness of CARDs, we develop a simple domain-adaptive test-time ensembling approach (CARD-Deck) that uses a gating module to dynamically select appropriate CARDs from the CARD-Deck based on their spectral-similarity with test samples. The proposed approach builds a "winning hand" of CARDs that establishes a new state-of-the-art [8] on CIFAR-10-C accuracies (i.e., $96.8\%$ standard and $92.75\%$ robust) and CIFAR-100-C accuracies (i.e., $80.6\%$ standard and $71.3\%$ robust) with better memory usage than non-compressed baselines (pretrained CARDs available at [8]). Finally, we provide theoretical support for our empirical findings. + +# 1 Introduction + +Deep Neural Networks (DNNs) have achieved unprecedented success in a wide range of applications due to their remarkably high accuracy [15]. However, this high performance stems from significant growth in DNN model size; i.e., massive overparameterization. Furthermore, these highly overparameterized models are known to be susceptible to the out-of-distribution (OOD) shifts encountered during their deployment in the wild [5]. This resource-inefficiency and OOD brittleness of state-of-the-art (SOTA) DNNs severely limits the potential applications DL can make an impact on. + +For example, consider the "Mars rover mission" that uses laser-induced breakdown spectroscopy (LIBS) to search for microbial life. It is well accepted that endowing the rover with DNNs to analyze complex LIBS spectra could produce scientific breakthroughs [3]. However, employing DNNs in such circumstances is challenging: 1) as these devices are battery operated, the model has to be lightweight so it consumes less memory with reduced power consumption, and 2) the model must be able to efficiently handle domain shifts in spectra caused by environmental noise. These requirements are not specific only to the aforementioned use case but arise in any resource-limited application using DL in the wild. The fact that SOTA DNNs do not satisfy compactness and OOD robustness requirements is holding us back from leveraging advances in DL to make scientific discoveries. + +This work is driven by two questions around this crucial problem. Q1. Can we show the existence of compact, accurate, and robust DNNs (CARDs)? Q2. If yes, can we apply existing robustness improvement techniques to CARDs to further amplify performance while maintaining compactness? + +Notably, there have been some recent successes in addressing each of the challenges CARDs present in isolation. The authors in [24, 27] developed data augmentation methods for achieving high OOD robustness without sacrificing accuracy on the clean data. The authors in [12, 9] developed pruning and quantization approaches for achieving high accuracy at extreme levels of model compression. However, efforts towards achieving model compactness, high accuracy, and OOD robustness simultaneously have mostly been unsuccessful. For example, [26] and [32] recently showed that compressed DNNs achieve accuracies similar to the original networks' but are far more brittle when faced with OOD data. Perhaps unsurprisingly, the current solution in the robust DL community to improve the OOD robustness (and accuracy) is to increase the model size (e.g., [25, 16, 8]). + +In this paper, we demonstrate that these negative results are a byproduct of inapt compression strategies, and the inability to create CARDs is not fundamental (answering Q1 in the affirmative). Specifically, we perform a large-scale comparison by varying architectures, training methods, and pruning rates for a range of compression techniques. We find that in contrast to traditional pruning methods (e.g., fine tuning [18] and gradual magnitude pruning [60]), "lottery ticket-style" compression approaches [12, 43, 41, 9] can surprisingly be used to create CARDs. In other words, we are able to create extremely compact (i.e., sparse and, optionally, binary) CARDs that are significantly more robust compared to their larger and full-precision counterparts while having comparable test accuracy. Our results are in sharp contrast to the existing observation that compression is harmful to OOD robustness. In fact, we show that compression is capable of providing improved robustness. + +We subsequently explore the possibility of using existing robustness-improvement techniques in conjunction with compression strategies to further improve the performance of CARDs. Empirically, we show the compatibility of CARDs with popular existing strategies, such as data augmentation and model size increase. We also propose a new robustness-improvement strategy that leverages the compactness of CARDs via ensembling—this ensembling approach is referred to as a domain-adaptive CARD-Deck and uses a gating module to dynamically choose appropriate CARDs for each test sample such that the spectral-similarity of the chosen CARDs and test data is maximized. This proposed adaptive ensembling approach builds a "winning hand" of CARDs that establishes a new state-of-the-art robustness (and accuracy) on the popular OOD benchmark datasets CIFAR-10-C and CIFAR-100-C with a compact ensemble [8] (answering Q2 in the affirmative). + +Broad implications of our findings are as follows. First, there exist sparse networks early in training (sometimes at initialization) that can be trained to become CARDs (i.e., we extend the lottery ticket hypothesis [12] to robust neural networks via our CARD hypothesis). Second, within a random-weight neural network, there exist CARDs which (despite having untrained weights) perform comparably to more computationally expensive DNNs (i.e., we extend the strong lottery ticket hypothesis [41] to robust neural networks via our CARD hypothesis). Third, compression can be complementary with existing robustness-improving strategies, which suggests that appropriate compression approaches should be considered whenever training models that may be deployed in the wild. + +# To summarize our main contributions: + +- Contrary to most prior results in the literature, we show that compression can improve robustness, providing evidence via extensive experiments on benchmark datasets, supporting our CARD hypothesis. Our experiments suggest "lottery ticket-style" pruning methods and a sufficiently overparameterized model are key factors for producing CARDs (Section 2.2). +- As corruptions in benchmark datasets could be limited (or biased) to certain frequency ranges, we tested the ability of compression to improve robustness to Fourier basis perturbations. This analysis corroborates findings on CIFAR-10/100-C and further highlights that models compressed via different methods have different robustness levels (Section 2.3). +- Leveraging the compactness of CARDs, we develop a test-time adaptive ensembling method, called a domain-adaptive CARD-Deck, that utilizes CARDs trained with existing techniques for improving OOD robustness. Resulting models set a new SOTA performance [8] on CIFAR-10-C and CIFAR-100-C while maintaining compactness (Section 3). +- Finally, we provide theoretical support for the CARD hypothesis and the robustness of the domain-adaptive CARD-Deck ensembling method (Section 4). + +# 2 Is the inability to create CARDs fundamental? + +Recent studies of the effects of model compression on OOD robustness have been mostly negative. For instance, Hooker et al. [26] showed that gradual magnitude pruning [60] of a ResNet-50 [19] trained on ImageNet [44] caused accuracy to decrease by as much as $40\%$ on corrupted images from ImageNet-C [23], while performance on the non-corrupted validation images remained strong. Liebenwein et al. [32] reported similar findings for different pruning approaches [43, 2] applied to a ResNet-20 model [19] tested on an analogously corrupted dataset, CIFAR-10-C. Consistent with these findings, Hendrycks et al. [25] found that increasing model size tended to improve robustness.[2] + +Critically, these studies suggest that model compression may be at odds with the simultaneous achievement of high accuracy and OOD (natural corruption) robustness. However, it's possible that these negative results are a byproduct of inapt compression strategies and/or insufficient overparameterization of the network targeted for compression. As such, to motivate the scientific question of interest and our empirical/theoretical analyses, we propose the following alternative hypothesis. + +CARD Hypothesis. Given a sufficiently overparameterized neural network, a suitable model compression (i.e., pruning and binarization) scheme can yield a compact network with comparable (or higher) accuracy and robustness than the same network when it is trained without compression. + +# 2.1 Model compression approaches + +For a comprehensive analysis of existing pruning methods, we introduce a framework inspired by those in [43, 51] that covers traditional-through-emerging pruning methodologies. Broadly, this framework places a pruning method into one of three categories: (a) traditional, (b) rewinding-based lottery ticket, and (c) initialization-based (strong) lottery ticket. Specific pruning methods considered in these respective categories are: (a) fine-tuning and gradual magnitude pruning, (b) weight rewinding and learning rate rewinding, and (c) edgepopulation and biprop. Precise definitions of these pruning methods and discussion of differences are available in Appendix A.1. + +Briefly, fine-tuning (FT) [18] prunes models once at the end of normal training, then fine-tunes the models for a given number of epochs to recover accuracy lost due to pruning; while gradual magnitude pruning (GMP) [60] prunes models throughout training. Weight rewinding (LTH) [12, 13] is iterative like GMP but fully trains the network, prunes, rewrites the unpruned weights (and learning rate schedule) to their values early in training, then fully trains the subnetwork before pruning again; learning rate rewinding (LRR) [43] is identical to LTH, except only the learning rate schedule is rewound, not the unpruned weights. Finally, edgepopulation (EP) [41] does not weight-train the network but instead prunes a randomly initialized network, using training data to find weights whose removal improves accuracy (notably, EP can, and does here, operate on signed initialization); biprop (BP) [9] proceeds similarly but incorporates a binarization scheme resulting in a binary-weight network regardless of the initialization used. For all of these methods, we make use of global unstructured pruning, which allows for different pruning percentages at each layer of the network. For BP and EP, we additionally consider layerwise pruning, which prunes the same percentage across all layers. We use the hyperparameters specifically tuned for each approach; see Appendix B for additional details. + +# 2.2 Accuracy-robustness comparison of global pruning methods + +To test the CARD hypothesis, we use: five models (VGG [12, 46] and ResNet [19] style architectures of varying size), five sparsity levels (50%, 60%, 80%, 90%, 95%), and six model compression methods (FT, GMP, LTH, LRR, EP, BP). For each model, sparsity level, and compression method, five realizations are trained on the CIFAR-10 training set [28]. Model accuracy and robustness are measured using top-1 accuracy on the CIFAR-10 and CIFAR-10-C test sets, respectively. CIFAR-10-C contains 15 different common corruptions from four categories: noise, blur, weather, and digital corruptions [23]. As a baseline, we train 5 realizations of each model without compression. + +In Figure 1, we plot our experimental results. Accuracy and robustness values are averaged over the five realizations and plotted relative to the average non-compressed baseline performance. The y-axis measures relative difference in percentage points. The mean baseline accuracy and robustness for each architecture is listed as the reference accuracy in each plot. The first row of plots indicate + +accuracy (top-1 accuracy on CIFAR-10 relative to baseline) while the second row indicate robustness (top-1 accuracy on CIFAR-10-C relative to baseline). At each sparsity level, error bars extend to the minimum and maximum relative percentage point difference across all realizations. + +![](images/80942fd80f2a20e0c4ef3416b4146fd8ee357bfc1fe95e6b858bdba554b0e3d5.jpg) +Figure 1: Suitable pruning approaches can improve robustness over dense models: Comparing the Top-1 accuracy of pruned models relative to the average of dense baseline models on CIFAR-10 and CIFAR-10-C demonstrates that CARDs exist and can be produced using LRR, LTH, BP, or EP. + +Our results for traditional methods, i.e., Fine-Tuning and Gradual Magnitude Pruning, are consistent with previous works [26, 32] as the robustness of models pruned using these methods degrades relative to the dense models', particularly in higher pruning regimes. However, we find that rewinding and initialization based pruning approaches consistently produce notable gains in robustness relative to dense baselines while matching (and sometimes surpassing) the accuracy of the dense baseline. In particular, the rewinding class of methods provide a consistent, moderate improvement to both accuracy and robustness while the initialization class provides more substantial gains in robustness even when the accuracy is slightly below the baseline accuracy. The significance of overparameterization to finding highly compact CARDs using initialization methods is evident for all architecture types, as the robustness of these models in higher pruning regimes improves at increasing levels of parameterization for a given architecture class. However, even in models with fewer parameters, we find that initialization methods are able to provide notable robustness gains. + +Additional experiments involving initialization methods are provided in Appendix C. Specifically, a comparison of the performance EP and BP using layerwise and global pruning is performed in Section C.1 and a comparison of full-precision and binary-weight EP models in Section C.2. Empirical results in Section C.2 indicate that robustness gains provided by EP- and BP-pruned models may be a feature of initialization pruning methods and not solely due to weight-binarization. + +# 2.3 Viewing the effect of compression on OOD robustness through a spectral lens + +As CIFAR-10-C corruptions are limited to certain frequency ranges and combinations [55], it is of interest to validate if the robustness effects of different pruning methods observed in Section 2.2 hold on a broader ranges of frequencies. To this end, we perform a frequency-domain analysis by utilizing the Fourier sensitivity method [55], which we briefly summarize below. + +Given a model and a test dataset, each image in the test dataset is perturbed using additive noise in the form of 2D Fourier basis matrices, denoted by $U_{i,j} \in \mathbb{R}^{d1 \times d2}$ . Specifically, for an image $X$ and a 2D Fourier basis matrix $U_{i,j}$ a perturbed image is computed by $X_{i,j} = X + r\varepsilon U_{i,j}$ , where $r$ is chosen uniformly at random from $\{-1,1\}$ and $\varepsilon > 0$ is used to scale the norm of the perturbation. Note that each channel of the image is perturbed independently. Given a set of test images, each Fourier basis matrix can be used to generate a perturbed test set of images on which the test error for the model is measured. Plotting the error rates as a function of frequencies $(i,j)$ yields the Fourier error heatmap of a model – a visualization of the sensitivity of a model to different frequency perturbations in the Fourier domain. Informally, the center of the heat map contains perturbations corresponding to the lowest frequencies and the edges correspond to the highest frequencies. + +We generate heatmaps for models corresponding to each pruning method as well as layerwise pruned models using EP and BP. The norm of the perturbation, $\varepsilon$ , is varied over the set $\{3,4,6\}$ to represent + +low, medium, and high levels of perturbation severity. As a reference, we include heatmaps for the dense (non-compressed) baseline model. Fourier heatmaps for the Conv8 architecture at $80\%$ prune percentage are provided in Figure 2 while additional heatmaps can be found in Section D. + +![](images/b83192688952076a08177d6f03266dc4ef9ba07ca78c4fc94fd3b76819904822.jpg) +Figure 2: Visualizing the response of compressed models to perturbations at different frequencies: The top three rows are Fourier heatmaps for Conv8 trained on CIFAR-10 with $80\%$ of weights pruned. The bottom three rows are difference to the baseline with blue regions indicating lower error rate than baseline. Init. methods provide up to a 50 percentage point improvement in some instances. + +Figure 2 illustrates that initialization pruning methods reduce the error rate across nearly the full spectrum of Fourier perturbations relative to the dense model. Additionally, initialization pruning methods using layerwise pruning present a different response, or error rate, at certain frequency corruptions when compared to heatmaps of global initialization pruning methods. The difference heatmaps show that rewinding methods offer mild to moderate improvements across much of the frequency spectrum with LRR outperforming LTH in a few regions of the heatmap. The difference heatmaps also highlight that traditional methods degrade the robustness to more Fourier perturbations than other compression methods and result in an increased error rate of 10 percentage points (relative to the dense baseline) in some cases. These findings further suggest that the robustness of a compressed model is dependent on the compression method used or the resulting structure of the sparsity. In Appendix E, we provide additional heatmaps to examine the impact on robustness when varying the number of rewinding steps used by rewinding methods. + +To summarize, we have empirically verified our CARD hypothesis by demonstrating that "lottery ticket-style" compression methods can produce compact models with accuracy and robustness comparable to (or higher than) their dense counterparts. + +# 3 Creating a winning hand of CARDs + +Having demonstrated that certain model compression techniques are capable of producing CARDs, we explore using existing techniques for improving model robustness in conjunction with compression strategies to produce CARDs that further improve robustness. We consider three popular existing strategies for improving model robustness and, further, propose a test-time adaptive ensembling strategy, called a domain-adaptive CARD-Deck, that leverages these strategies to maintain compactness and efficiency while improving accuracy and robustness over individual CARDs. + +# 3.1 Popular strategies for improving model robustness + +Data augmentation. A popular approach for improving robustness involves data augmentations. We consider two augmentation techniques that are (at the time of writing) leading methods on Robust-Bench [8]. The first is AugMix [24] which can provide improved robustness without compromising accuracy by randomly sampling different augmentations, applying them to a training image, then "mixing" the resulting augmented image with the original. The second method independently adds Gaussian noise $\mathcal{N}(\mu = 0,\sigma = 0.1)$ to all the pixels with probability $p = 0.5$ [27]. + +Larger models. Another popular strategy for improving OOD robustness (and accuracy) in the robust DL community is to increase the model size (e.g., [25, 16, 8]). Hence, we also consider this strategy to investigate if the performance of CARDs can be amplified by compressing larger models. + +Model Ensembling. It is natural to consider exploiting CARD compactness to amplify accuracy and robustness by ensembling [40] CARDs. For example, an ensemble of two to six CARDs pruned to $95\%$ sparsity only uses $10\%$ to $30\%$ of the parameter count required by a single dense model. + +# 3.2 Playing the right CARD to improve accuracy-robustness performance + +Ensembling CARDs trained with state-of-the-art data augmentation techniques has the potential to provide additional robustness gains. We call such ensembles CARD-Decks and propose two strategies: (1) domain-agnostic CARD-Decks and (2) domain-adaptive CARD-Decks. In both strategies, the ensemble consists of CARDs that have been trained on the same dataset under different augmentation schemes. The domain-adaptive CARD-Deck utilizes a spectral-similarity metric to select a subset of CARDs from the CARD-Deck that should be used to make predictions based on the current test data. We first define this metric then provide formal definitions for both CARD-Deck methods. + +A spectral-similarity metric. Let $x_{train} \in \mathbb{R}^{D_1 \times D_2 \times N}$ denote the $N$ unaugmented training images of dimension $D_1 \times D_2$ , $A = \{a_k\}_{k=1}^m$ denote a set of $m$ different augmentation schemes, and $\hat{S}_{a,P}(x)$ denote a sampling of $P$ images from $x$ where augmentation $a \in A$ has been applied to $x$ . Motivated by our analysis using Fourier heatmaps, we propose a spectral-similarity metric to compare representatives from augmented versions of the training sets, $\{\hat{S}_{a,P}(x_{train})\}_{a \in A}$ to the test data. First, we define $F(\cdot)$ as a map that computes the 1D radially-averaged power spectrum for images of dimension $D_1 \times D_2$ then takes the reciprocal of each component. Our spectral-similarity metric is a map $d_{ss}: \mathbb{R}^{D_1 \times D_2 \times P} \times \mathbb{R}^{D_1 \times D_2 \times M} \to \mathbb{R}$ defined by $d_{ss}(\boldsymbol{X},\boldsymbol{Y}) = \min_{1 \leq i \leq P} \| (F(X_i) / \| F(X_i)) \| - \frac{1}{M} \sum_{j=1}^{M} (F(Y_j) / \| F(Y_j) \|)$ . In practice, we found that the 1D power spectra for different augmentation types were more separable in the higher frequencies of the power spectrum leading to the use of the reciprocal in the definition of $F(\cdot)$ . + +A "winning hand" of CARDs by test-time ensembling. An $n$ -CARD-Deck ensemble is composed of $n$ CARDs given by $f^{Deck} = \{f^{a_k}\}_{k=1}^n$ where $a_k$ is one of the $m$ augmentation schemes from $A$ and the superscript in $f^{a_k}$ denotes that this CARD was trained used data from the distribution $S_{a_k}(x_{train})$ . Our domain-agnostic $n$ -CARD-Deck averages the prediction of all $n$ CARDs in the deck. Supposing that the output of each CARD in $f^{Deck}$ is softmax vectors, then the output of the domain-agnostic $n$ -CARD-Deck can be expressed as $\frac{1}{n} \sum_{k=1}^n f^{a_k}(x_{test})$ . In our domain-adaptive CARD-Deck, a gating module uses the spectral-similarity metric $d_{ss}$ to determine which augmentation method is most similar to a batch of $M$ test images $x_{test} \in \mathbb{R}^{D_1 \times D_2 \times M}$ provided to the ensemble. When an augmentation scheme, say $a \in A$ , is identified as the most similar to the incoming test data, the domain-adaptive CARD-Deck utilizes only the CARDs that were trained using the data from the distribution $S_a(x_{train})$ . The set of the most similar augmentations is given by $a^* \in \arg \min_{a \in A} d_{ss}(\hat{S}_a, P(x_{train}), x_{test})$ . We note that $a^*$ is likely to be a singleton set indicating that a single augmentation scheme is most similar. If the domain-adaptive CARD-Deck contains multiple CARDs trained using the same data augmentation scheme, prediction averaging is used on these CARDs and returned as the CARD-Deck prediction. Given $a^*$ and letting $\mathcal{I}(a) = \{k : a_k \in a\}$ , the output of the domain-adaptive CARD-Deck can be expressed as $\frac{1}{|\mathcal{I}(a^*)|} \sum_{k \in \mathcal{I}(a^*)} f^{a_k}(x_{test})$ . As computing the spectral-similarity scheme is independent of CARD evaluation, the domain-adaptive CARD-Deck provides reduced inference time over the domain-agnostic CARD-Deck by only evaluating the CARDs necessary for prediction. Figure 3 provides an illustration of the CARD-Deck design. + +![](images/8b39998d200a5240404913133dbf6c377e690278501460b88d700d2a2850c19c.jpg) +Figure 3: Selecting a "winning hand" using a domain-adaptive CARD-Deck: CARDs are grouped based on the data augmentation scheme used during training. At test time, a gating function identifies the augmentation scheme, $a^*$ with data most similar to the test data. The CARDs trained using $a^*$ are used and the average prediction is returned as the output. + +# 3.3 Experimental results + +We experiment with four models of increasing size (ResNeXt-29, ResNet-18, ResNet-50, WideResNet-18-2), three data augmentation methods (clean, AugMix, Gaussian), two sparsity levels $(90\%, 95\%)$ , and six compression methods (LTH, LRR, EP (layerwise and global), BP (layerwise and global)). For each model, sparsity level, data augmentation method, and compression method, three realizations are trained on CIFAR-10 [28] and robustness is measured using CIFAR-10-C. Model compactness is measured by calculating the memory usage [54]. Similar experiments are performed for CIFAR-100 and CIFAR-100-C, however only WideResNet-18-2 and four model compression methods (LTH, LRR, EP (global), BP (global)) are used. As a baseline, three realizations of each model are trained without compression for each data augmentation method. Visualizations of key results are provided in this section and detailed ablation studies are in Appendix F. + +In addition to measuring the performance of CARDs for each configuration (i.e. model, data augmentation, compression method, sparsity level), we also formed domain-agnostic and domain-adaptive $n$ -CARD-Decks of size $n \in \{2, 4, 6\}$ comprised of models using the same compression method and sparsity level. For each $n$ -CARD-Deck, half of the CARDs were trained using AugMix and the other half were trained using the Gaussian augmentation. To facilitate computation of the spectral-similarity metric in domain-adaptive CARD-Decks, for each augmentation method $a \in \{AugMix, Gaussian\}$ we statically created a KD-Tree containing $F(X) / \|F(X)\|$ , for all $X \in \hat{S}_{a,P}(x_{train})$ . In our experiments, we took $P = 5000$ and these KD-Trees were generated once and saved (separate from inference process). At test time, batches of $M = 100$ test images were used in the spectral-similarity metric to determine which augmentation method best represented the corrupted test data. + +Test-time ensembling can provide a "winning hand". Figure 4 provides a visualization of the performance (accuracy, robustness, and memory usage) of several CARDs and CARD-Decks as well as dense baselines and the previous SOTA model. This figure highlights our findings that both CARD-Deck methods, domain-agnostic and adaptive, are capable of improving the performance beyond the dense baselines while maintaining reduced memory usage. Notably, we found a single LRR CARD (a WideResNet-18 at $96\%$ sparsity) trained with AugMix can attain $91.24\%$ CIFAR-10-C accuracy, outperforming dense ResNeXt-29 trained with AugMix (a state-of-the-art among methods that do not require non-CIFAR-10 training data) by more than 2 percentage points simply by pruning a larger model, i.e., WideResNet-18. Our best performing 6-CARD-Deck using LRR WideResNet-18 models (53.58 MB) sets a new state-of-the-art for CIFAR-10 and CIFAR-10-C accuracies of $96.8\%$ and $92.75\%$ , respectively. In contrast, the previous best method [6] achieves accuracies $(94.93\%)$ + +![](images/fb860cdc1bfb54fd1b42d00723b97703631aa0cc158ec253250163da9a346211.jpg) +(a) CIFAR-10-C + +![](images/2129bfa88b26a7047cb8db3ffb1b44fca11f13190157273dc7cf3e8bb2187238.jpg) +(b) CIFAR-100-C +Figure 4: Accuracy, robustness, and memory trends. CARDs and CARD-Decks reduce memory usage (as indicated by the area of each circle) while achieving comparable or improved accuracy (x-axis) and robustness (y-axis). Annotation indicates {Compression Method, Data Augmentation, ResNet-18 Width} with A for AugMix, G for Gaussian, and AG for both (used by CARD-Decks). + +$92.17\%$ ) using increased memory (ResNet-50 with 94.12 MB), extra data (a super resolution network was pre-trained with non-CIFAR-10 data), and a computationally expensive adversarial training procedure. More impressively, our computationally lighter binary-weight CARD-Decks provide comparable accuracy and robustness to the dense baseline with memory usage as low as $1.67\mathrm{MB}$ . Similar trends hold on CIFAR-100-C where rewinding domain-adaptive CARD-Decks set a new SOTA performance $(80.6\%, 71.3\%)$ compared to the previous best $(78.90\%, 65.14\%)$ [24]. Note that the binary-weight CARD-Decks provide almost 5 percentage point robustness gain over the previous best at only $9\%$ of the memory usage. Note that the performance of EP and BP CARD-Decks can be further improved by leveraging more computationally expensive training procedures, e.g., tuning batchnorm parameters [9] or searching for EP and BP CARDs in pretrained neural nets. + +To summarize, CARD-Decks can maintain compactness while leveraging additional robustness improvement techniques, LRR CARD-Decks set a new SOTA on CIFAR-10-C and CIFAR-100-C in terms of accuracy and robustness, binary-weight CARD-Decks can provide up to $\sim 105\mathrm{x}$ reduction in memory while providing comparable accuracy and robustness, and the domain-adaptive CARD-Decks used here are $\sim 2\mathrm{x}$ faster than the domain-agnostic CARD-Decks as only half of the CARDs are used at inference. Additionally, for 2-CARD-Decks our domain-adaptive method provides an average robustness gain of 1-2 percentage points over the domain-agnostic method (see Appendix F). + +# 4 Theoretical justifications + +This section provides (1) theoretical results that provide support for the CARD hypothesis beyond what we demonstrated empirically and (2) robustness analysis for domain-adaptive CARD-Deck strategy. + +# 4.1 Function approximation view of CARDs + +By leveraging existing theoretical analyses of the Strong and Multi-Prize Lottery Ticket Hypotheses [39, 38, 9], we can provide theoretical support for the CARD hypothesis. While we were able to empirically produce CARDs within the same architecture used by the dense model, to prove theoretical results supporting the CARD hypothesis using existing techniques requires that the compressed network be searched for within an architecture larger than the architecture used for the dense model. An informal version of this result for binary-weight CARDs is provided here relevant to models produced by joint pruning and binarization compression strategies such as multi-prize tickets [9]. + +Theorem 1. Given a non-compressed network $F$ with depth $\ell$ and width $w$ with bounded weights that achieves a desired target accuracy and robustness, a random binary network of depth $2\ell$ and width $O\left((\ell w^{3/2}/\varepsilon) + \ell w\log(\ell w/\delta)\right)$ contains with probability $(1 - \delta)$ a binary-weighted CARD that approximates the target non-compressed network with error at most $\varepsilon$ , for any $\varepsilon, \delta > 0$ . + +We note that Theorem 1 follows immediately from Theorem 2 in [9] and, thereby, refer the reader to Theorem 2 in [9] for a formal statement. This result provides a level of confidence with which one can expect to find a binary-weight CARD that is an $\varepsilon$ -approximation of a target (i.e. trained and non-compressed) network. For full-precision weight CARDs, tighter bounds on the depth and width of a fully-connected network with ReLU activations containing a CARD that is an $\varepsilon$ -approximation of a target network follow from Theorem 3 in [38] which also utilizes a more relaxed hypothesis set. Hence, theoretical results supporting the existence of both full-precision and binary-weight CARDs, with high probability, provided that a sufficiently overparameterized network is used. + +Leveraging these theoretical results, we provide a corollary on the approximation capabilities of CARD-Deck. We denote by $F(\ell, \boldsymbol{w})$ a fully-connected neural network with ReLU activations where $\ell$ denotes the depth of the network and $\boldsymbol{w} = [w_0, w_1, \dots, w_\ell] \in \mathbb{N}^{\ell+1}$ is a vector where component $i \in \{1, \dots, \ell\}$ denotes the width of layer $i$ in $F$ and $w_0$ denotes the input dimension of $F$ . + +Corollary 2 (CARD-Deck Approximation Theorem). Let $\varepsilon >0$ , $\delta >0$ , $n\geq 1$ , and $\lambda = [\lambda_1,\dots ,\lambda_n]$ satisfying $\sum_{k = 1}^{n}\lambda_{k} = 1$ and $\lambda_{k}\geq 0$ , for all $k\in [n]$ , be given. Let $\mathcal{F} = \{F_k(\ell_k,\pmb {w}_k)\}_{k = 1}^n$ be a deck of non-compressed fully-connected networks with ReLU activations. If the input space $\mathcal{X}$ and each network in the collection $\mathcal{F}$ satisfies the hypotheses of Theorem 3 in [38] (Theorem 2 in [9]), then with probability $(1 - \delta)^{n}$ there exists a deck of $n$ full-precision (binary-weight) CARDs denoted $f^{Deck} = \{f_k\}_{k = 1}^n$ of depth and width specified by Theorem 3 in [38] (Theorem 2 in [9]) such that + +$$ +\sup _ {x \in \mathcal {X}} \left\| \sum_ {k = 1} ^ {n} \lambda_ {k} f _ {k} (x) - \sum_ {k = 1} ^ {n} \lambda_ {k} F _ {k} (\ell , \boldsymbol {w}) (x) \right\| \leq \varepsilon . \tag {1} +$$ + +A proof of Corollary 2 is provided in Appendix G. Note that the target non-compressed networks in Corollary 2 could be trained on data sampled from augmented distributions, such as augmented distributions using the AugMix and Gaussian methods, provided that the weights of the resulting networks satisfy the hypothesis required from the existing results in [38, 9]. Additionally, the appropriate choice of $\lambda$ in Corollary 2 can yield a domain-agnostic or domain-adaptive CARD-Deck. + +# 4.2 Robustness analysis of CARD-Deck + +To provide the theoretical justification behind our CARD-Deck approach over a single classifier, we first define a robustness measure for a given classifier ensemble trained on a set of augmentations w.r.t. a corruption set encountered at the test-time. We assume that each test sample may encounter a specific corruption type $c$ from a given OOD set and be transformed to a corrupted test sample $x_{c}$ . Let us assume $f^{a}$ is learnt using a learning algorithm $L$ using the augmented training data $S_{a}$ sampled from distribution $\mathcal{D}_a$ , thus, we have $f^{\bar{D}\bar{e}\bar{c}\bar{k}} = \{f^{a} = L(S_{a})|a\in \mathbb{N}^{A}\}$ where $\mathbb{N}^A = \{1,\dots ,A\}$ . Let us denote by $\hat{S}_a$ an empirical distribution w.r.t. sampled dataset $S_{a}$ . + +Definition 1 (Average OOD Robustness). Let $f^{Deck} = \{f^a | a \in \mathbb{N}^A\}$ denote a CARD-Deck trained using an augmentation set $S^A = \{S_a \sim \mathcal{D}_a | a \in \mathbb{N}^A\}$ . We define the average out-of-distribution robustness for a CARD-Deck w.r.t. corruption set $\mathcal{D}^C = \{\mathcal{D}_c | c \in \mathbb{N}^C\}$ as + +$$ +R o b \left(\mathcal {D} ^ {C}, f ^ {D e c k}\right) = \sum_ {a = 1} ^ {| A |} \sum_ {c = 1} ^ {| C |} R o b \left(\mathcal {D} _ {c}, f ^ {a}\right) w _ {c} ^ {a}, \tag {2} +$$ + +where $\operatorname{Rob}(\mathcal{D}_c, f^a) = \mathbb{E}_{(x_c, y) \sim \mathcal{D}_c} \left[ \inf_{f^a(x_c') \neq y} d(x_c', x_c) \right]$ with $x_c'$ being a perturbed version of $x_c$ , $d$ corresponds to a distance metric, and $w_c^a$ denotes the probability of $f^{Deck}$ gating module selecting the classifier $f^a$ to make a prediction on test data coming from corruption type $c$ . + +This definition refers to the expectation of the distance to the closest misclassified corrupted sample for a given test sample. Note that this is a stronger notion of robustness than the generalization error corresponding to a corrupted data distribution. Having this definition, our goal is to provide a lower bound on the average OOD robustness of $f^{Deck}$ and show that the use of domain-adaptive classifier + +ensemble achieves a better OOD robustness compared to the case where we use just a single classifier $f^a$ . To understand this quantity better, we derive the following decomposition (see Appendix G): + +$$ +\operatorname {R o b} (\mathcal {D} ^ {C}, f ^ {D e c k}) \geq \sum_ {a, c} w _ {c} ^ {a} [ \underbrace {R o b (\hat {S} _ {a} , f ^ {a})} _ {(a)} - \underbrace {\| R o b (\mathcal {D} _ {a} , f ^ {a}) - R o b (\hat {S} _ {a} , f ^ {a}) \|} _ {(b)} - \underbrace {\| R o b (\mathcal {D} _ {c} , f ^ {a}) - R o b (\mathcal {D} _ {a} , f ^ {a}) \|} _ {(c)} ]. +$$ + +This shows that the average OOD robustness can be bounded from below in terms of the following three error terms for a classifier-corruption pair weighted by their selection probabilities: (a) empirical robustness, (b) generalization gap, and (c) out-of-distribution-shift. This implies that in order to bound the average OOD robustness, we need to bound both the generalization gap and the OOD-shift. Next, we provide a bound on the OOD-shift penalty that is independent of the classifier $f^a$ and is only related to the closeness of the augmented data distribution and corrupted data distribution. The closeness is defined in terms of Wasserstein distance $W(\cdot, \cdot)$ (see Definition 2 in Appendix G). + +Theorem 3 (Average OOD-Shift Bound). For any CARD-Deck, the average OOD-shift (i.e., $ADS = \sum_{a,c} w_c^a \| Rob(\mathcal{D}_c, f^a) - Rob(\mathcal{D}_a, f^a) \|$ ) can be bounded as follows $ADS \leq \sum_{a=1}^{|A|} \sum_{c=1}^{|C|} w_c^a \times W(\mathcal{D}_c, \mathcal{D}_a)$ . + +Proof. This result can be proved by applying Theorem 1 in [45] to ADS. + +![](images/e1fb9a48e5c71aedbfe731860b9e004e4466407479dd191b0feaf445c0d578ec.jpg) + +Key insights. Theorem 3 provides some key insights into the OOD robustness of classifiers trained on augmented datasets. First, unlike the generalization gap, the OOD-shift does not converge to zero with more augmentation data. This imposes a fundamental limit on the OOD robustness in terms of the distance between augmented train data distribution and corrupted test data distribution. Second, having diverse augmentations is critical to improving the OOD robustness. Also, it highlights that existing solutions trained with a single augmentation scheme might just be getting lucky or overfitting to the corrupted test data. Finally, the domain-adaptive CARD-Deck with a suitable gating function is provably better than using a single classifier because it can achieve the minimum conditional Wasserstein distance (or best achievable OOD robustness) over given augmentation-corruption pairs. + +# 5 Limitations and future directions + +In this paper, we showed that model compression and high robustness (and accuracy) are not necessarily conflicting objectives. We found that compression, if done properly (e.g., using "lottery ticket-style" objectives), can improve the OOD robustness compared to a non-compressed model. Leveraging this finding, we proposed a simple domain-adaptive ensemble of CARDs that outperformed existing SOTA in terms of the clean accuracy and the OOD robustness (at a fraction of the original memory usage). Our results are consistent with past results in that we also show that the use of test accuracy alone to evaluate the quality/deployability of a compressed model in the wild is not sufficient—one needs to adopt harder metrics such as OOD robustness. However, as opposed to the existing works in this direction, we present a construction that satisfies these "harder" requirements. + +There are still many interesting questions that remain to be explored. First, while we were able to produce CARDs it remains unclear (i) why only certain pruning strategies were able to produce them and (ii) why introducing compression can improve "effective robustness" [49] (e.g. Conv and VGG19 BP and EP models in Figure 1). Second, the spectral relationship of train and test data (as considered in this work) is not the only interaction determining the performance of a compressed model. It will be worthwhile to take a more holistic approach that also takes spectral behavior of the compressed model (e.g., using intermediate features) into account, which could possibly benefit from using CARDs compressed via different strategies when building a "winning hand". Third, we only derived an upper bound on the amount of overparameterization needed to approximate a target dense network in our theoretical analysis; it will also be interesting to explore a lower bound (a necessary condition) on the same which may indicate scenarios where the proposed approach will not work (e.g., underparameterized NNs). Fourth, "lottery ticket-style" models in theory can be found more efficiently, which was not our focus but is a valuable future direction. Finally, achieving the theoretical memory savings obtained from CARDs (reported in this paper) would require their implementation on specialized hardware. We hope that our results will help researchers better understand the limits of compressed neural nets, and motivate future work on CARDs and their applications to areas where DL struggles currently due to its parameter-inefficiency and OOD brittleness. + +# Acknowledgements + +We would like to thank the reviewers for their valuable discussion during the rebuttal period that resulted in improved clarity and presentation of our research. This work was performed under the auspices of the U.S. Department of Energy by the Lawrence Livermore National Laboratory under Contract No. DE-AC52-07NA27344 and LLNL LDRD Program Project No. 20-ER-014 (LLNL-CONF-823802). + +# References + +[1] Subutai Ahmad and Luiz Scheinkman. How can we be so dense? the benefits of using highly sparse representations. arXiv preprint arXiv:1903.11257, 2019. +[2] Cenk Baykal, Lucas Liebenwein, Igor Gilitschenski, Dan Feldman, and Daniela Rus. Sipping neural networks: Sensitivity-informed provable pruning of neural networks. arXiv preprint arXiv:1910.05422, 2019. +[3] Kshitij Bhardwaj and Maya Gokhale. Semi-supervised on-device neural network adaptation for remote and portable laser-induced breakdown spectroscopy. arXiv preprint arXiv:2104.03439, 2021. +[4] Tom B Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. arXiv preprint arXiv:2005.14165, 2020. +[5] Saikiran Bulusu, Bhavya Kailkhura, Bo Li, Pramod K Varshney, and Dawn Song. Anomalous example detection in deep learning: A survey. IEEE Access, 8:132330-132347, 2020. +[6] Dan A Calian, Florian Stimberg, Olivia Wiles, Sylvestre-Alvise Rebuffi, Andras Gyorgy, Timothy Mann, and Sven Gowal. Defending against image corruptions through adversarial augmentations. arXiv preprint arXiv:2104.01086, 2021. +[7] Matthieu Courbariaux, Yoshua Bengio, and Jean-Pierre David. Binaryconnect: Training deep neural networks with binary weights during propagations. In Advances in neural information processing systems, pages 3123-3131, 2015. +[8] Francesco Croce, Maksym Andriushchenko, Vikash Sehwag, Nicolas Flammarion, Mung Chiang, Prateek Mittal, and Matthias Hein. Robustbench: a standardized adversarial robustness benchmark. arXiv preprint arXiv:2010.09670, 2020. +[9] James Diffenderfer and Bhavya Kailkhura. Multi-prize lottery ticket hypothesis: Finding accurate binary neural networks by pruning a randomly weighted network. International Conference on Learning Representations, 2021. +[10] Pierre Foret, Ariel Kleiner, Hossein Mobahi, and Behnam Neyshabur. Sharpness-aware minimization for efficiently improving generalization. arXiv preprint arXiv:2010.01412, 2020. +[11] Jonathan Frankle. Openth: A framework for lottery tickets and beyond, 2020. URL https://github.com/facebookresearch/open_lth. +[12] Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. arXiv preprint arXiv:1803.03635, 2018. +[13] Jonathan Frankle, Gintare Karolina Dziugaite, Daniel Roy, and Michael Carbin. Linear mode connectivity and the lottery ticket hypothesis. In International Conference on Machine Learning, pages 3259-3269. PMLR, 2020. +[14] Trevor Gale, Erich Elsen, and Sara Hooker. The state of sparsity in deep neural networks. arXiv preprint arXiv:1902.09574, 2019. +[15] Ian Goodfellow, *Yoshua Bengio*, Aaron Courville, and *Yoshua Bengio. Deep learning*, volume 1. MIT press Cambridge, 2016. +[16] Sven Gowal, Chongli Qin, Jonathan Uesato, Timothy Mann, and Pushmeet Kohli. Uncovering the limits of adversarial training against norm-bounded adversarial examples. arXiv preprint arXiv:2010.03593, 2020. +[17] Song Han, Huizi Mao, and William J Dally. Deep compression: Compressing deep neural networks with pruning, trained quantization and huffman coding. arXiv preprint arXiv:1510.00149, 2015. + +[18] Song Han, Jeff Pool, John Tran, and William J Dally. Learning both weights and connections for efficient neural networks. arXiv preprint arXiv:1506.02626, 2015. +[19] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition, 2015. +[20] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Identity mappings in deep residual networks, 2016. +[21] Yihui He, Xiangyu Zhang, and Jian Sun. Channel pruning for accelerating very deep neural networks. In Proceedings of the IEEE International Conference on Computer Vision, pages 1389-1397, 2017. +[22] Yihui He, Ji Lin, Zhijian Liu, Hanrui Wang, Li-Jia Li, and Song Han. Amc: Automl for model compression and acceleration on mobile devices. In Proceedings of the European Conference on Computer Vision (ECCV), pages 784-800, 2018. +[23] Dan Hendrycks and Thomas Dietterich. Benchmarking neural network robustness to common corruptions and perturbations. arXiv preprint arXiv:1903.12261, 2019. +[24] Dan Hendrycks, Norman Mu, Ekin D Cubuk, Barret Zoph, Justin Gilmer, and Balaji Lakshminarayanan. Augmix: A simple data processing method to improve robustness and uncertainty. arXiv preprint arXiv:1912.02781, 2019. +[25] Dan Hendrycks, Steven Basart, Norman Mu, Saurav Kadavath, Frank Wang, Evan Dorundo, Rahul Desai, Tyler Zhu, Samyak Parajuli, Mike Guo, et al. The many faces of robustness: A critical analysis of out-of-distribution generalization. arXiv preprint arXiv:2006.16241, 2020. +[26] Sara Hooker, Aaron Courville, Gregory Clark, Yann Dauphin, and Andrea Frome. What do compressed deep neural networks forget? arXiv preprint arXiv:1911.05248, 2019. +[27] Klim Kireev, Maksym Andriushchenko, and Nicolas Flammarion. On the effectiveness of adversarial training against common corruptions. arXiv preprint arXiv:2103.02325, 2021. +[28] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009. +[29] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. Advances in neural information processing systems, 25:1097-1105, 2012. +[30] Yann LeCun, John S Denker, and Sara A Solla. Optimal brain damage. In Advances in neural information processing systems, pages 598-605, 1990. +[31] Hao Li, Asim Kadav, Igor Durdanovic, Hanan Samet, and Hans Peter Graf. Pruning filters for efficient convnets. arXiv preprint arXiv:1608.08710, 2016. +[32] Lucas Liebenwein, Cenk Baykal, Brandon Carter, David Gifford, and Daniela Rus. Lost in pruning: The effects of pruning neural networks beyond test accuracy. arXiv preprint arXiv:2103.03014, 2021. +[33] Xiaofan Lin, Cong Zhao, and Wei Pan. Towards accurate binary convolutional neural network. In Advances in Neural Information Processing Systems, pages 345-353, 2017. +[34] Zhuang Liu, Mingjie Sun, Tinghui Zhou, Gao Huang, and Trevor Darrell. Rethinking the value of network pruning. arXiv preprint arXiv:1810.05270, 2018. +[35] Christos Louizos, Max Welling, and Diederik P Kingma. Learning sparse neural networks through $l\_0$ regularization. arXiv preprint arXiv:1712.01312, 2017. +[36] Dmitry Molchanov, Arsenii Ashukha, and Dmitry Vetrov. Variational dropout sparsifies deep neural networks. In International Conference on Machine Learning, pages 2498-2507. PMLR, 2017. +[37] Sharan Narang, Erich Elsen, Gregory Diamos, and Shubho Sengupta. Exploring sparsity in recurrent neural networks. arXiv preprint arXiv:1704.05119, 2017. +[38] Laurent Orseau, Marcus Hutter, and Omar Rivasplata. Logarithmic pruning is all you need. In H. Larochelle, M. Ranzato, R. Hadsell, M. F. Balcan, and H. Lin, editors, Advances in Neural Information Processing Systems, volume 33, pages 2925-2934. Curran Associates, Inc., 2020. +[39] Ankit Pensia, Shashank Rajput, Alliot Nagle, Harit Vishwakarma, and Dimitris Papailiopoulos. Optimal lottery tickets via subsetsum: Logarithmic over-parameterization is sufficient, 2021. + +[40] Robi Polikar. Ensemble learning. In Ensemble machine learning, pages 1-34. Springer, 2012. +[41] Vivek Ramanujan, Mitchell Wortsman, Aniruddha Kembhavi, Ali Farhadi, and Mohammad Rastegari. What's hidden in a randomly weighted neural network? In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 11893-11902, 2020. +[42] Mohammad Rastegari, Vicente Ordonez, Joseph Redmon, and Ali Farhadi. Xnor-net: Imagenet classification using binary convolutional neural networks. In European conference on computer vision, pages 525-542. Springer, 2016. +[43] Alex Renda, Jonathan Frankle, and Michael Carbin. Comparing rewinding and fine-tuning in neural network pruning, 2020. +[44] Olga Russakovsky, Jia Deng, Hao Su, Jonathan Krause, Sanjeev Satheesh, Sean Ma, Zhiheng Huang, Andrej Karpathy, Aditya Khosla, Michael Bernstein, et al. Imagenet large scale visual recognition challenge. International journal of computer vision, 115(3):211-252, 2015. +[45] Vikash Sehwag, Saeed Mahloujifar, Tinashe Handina, Sihui Dai, Chong Xiang, Mung Chiang, and Prateek Mittal. Improving adversarial robustness using proxy distributions. arXiv preprint arXiv:2104.09425, 2021. +[46] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv 1409.1556, 09 2014. +[47] Kartik Sreenivasan, Shashank Rajput, Jy yong Sohn, and Dimitris Papailiopoulos. Finding everything within random binary networks, 2021. +[48] Mingxing Tan and Quoc V Le. Efficientnetv2: Smaller models and faster training. arXiv preprint arXiv:2104.00298, 2021. +[49] Rohan Taori, Achal Dave, Vaishaal Shankar, Nicholas Carlini, Benjamin Recht, and Ludwig Schmidt. When robustness doesn't promote robustness: Synthetic vs. natural distribution shifts onImagenet. 2019. +[50] Bindya Venkatesh, Jayaraman J Thiagarajan, Kowshik Thopalli, and Prasanna Sattigeri. Calibrate and prune: Improving reliability of lottery tickets through prediction calibration. arXiv preprint arXiv:2002.03875, 2020. +[51] Huan Wang, Can Qin, Yulun Zhang, and Yun Fu. Emerging paradigms of neural network pruning. arXiv preprint arXiv:2103.06460, 2021. +[52] Shufan Wang, Ningyi Liao, Liyao Xiang, Nanyang Ye, and Quanshi Zhang. Achieving adversarial robustness via sparsity. arXiv preprint arXiv:2009.05423, 2020. +[53] Wei Wen, Chunpeng Wu, Yandan Wang, Yiran Chen, and Hai Li. Learning structured sparsity in deep neural networks. arXiv preprint arXiv:1608.03665, 2016. +[54] Yinghao Xu, Xin Dong, Yudian Li, and Hao Su. A main/subsidiary network framework for simplifying binary neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 7154-7162, 2019. +[55] Dong Yin, Raphael Gontijo Lopes, Jon Shlens, Ekin Dogus Cubuk, and Justin Gilmer. A fourier perspective on model robustness in computer vision. In Advances in Neural Information Processing Systems, volume 32, 2019. +[56] Chiyuan Zhang, Samy Bengio, Moritz Hardt, Benjamin Recht, and Oriol Vinyals. Understanding deep learning requires rethinking generalization. arXiv preprint arXiv:1611.03530, 2016. +[57] Dinghuai Zhang, Kartik Ahuja, Yilun Xu, Yisen Wang, and Aaron Courville. Can subnetwork structure be the key to out-of-distribution generalization? arXiv preprint arXiv:2106.02890, 2021. +[58] Aojun Zhou, Anbang Yao, Yiwen Guo, Lin Xu, and Yurong Chen. Incremental network quantization: Towards lossless cnns with low-precision weights. arXiv preprint arXiv:1702.03044, 2017. +[59] Shuchang Zhou, Yuxin Wu, Zekun Ni, Xinyu Zhou, He Wen, and Yuheng Zou. Dorefa-net: Training low bitwidth convolutional neural networks with low bitwidth gradients. arXiv preprint arXiv:1606.06160, 2016. +[60] Michael Zhu and Suyog Gupta. To prune, or not to prune: exploring the efficacy of pruning for model compression, 2017. \ No newline at end of file diff --git a/awinninghandcompressingdeepnetworkscanimproveoutofdistributionrobustness/images.zip b/awinninghandcompressingdeepnetworkscanimproveoutofdistributionrobustness/images.zip new file mode 100644 index 0000000000000000000000000000000000000000..e3211872b830ecd1ce7da73815f7db8954c76be7 --- /dev/null +++ b/awinninghandcompressingdeepnetworkscanimproveoutofdistributionrobustness/images.zip @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:32a5777b5ba7e6d8312f7785378f74cea0e1e93bf0360ed7cea7eb9a9c8493da +size 353236 diff --git a/awinninghandcompressingdeepnetworkscanimproveoutofdistributionrobustness/layout.json b/awinninghandcompressingdeepnetworkscanimproveoutofdistributionrobustness/layout.json new file mode 100644 index 0000000000000000000000000000000000000000..eb434feb9914347e3acd2a033d5779cb1f8927d0 --- /dev/null +++ b/awinninghandcompressingdeepnetworkscanimproveoutofdistributionrobustness/layout.json @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:26e3bd4c26bf5a7a6a998bae2ddc95a2027b622ebd221e36691d00ff24f9f88b +size 400864