SlowGuess commited on
Commit
e92ba0c
·
verified ·
1 Parent(s): 82b3a4a

Add Batch 6ab14018-dabc-471d-b96a-e75823600ccd

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/6d258242-903c-489b-ae9b-a8204d589125_content_list.json +3 -0
  2. a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/6d258242-903c-489b-ae9b-a8204d589125_model.json +3 -0
  3. a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/6d258242-903c-489b-ae9b-a8204d589125_origin.pdf +3 -0
  4. a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/full.md +291 -0
  5. a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/images.zip +3 -0
  6. a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/layout.json +3 -0
  7. abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/85b474c0-b943-4f6a-80a4-4003071c79ef_content_list.json +3 -0
  8. abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/85b474c0-b943-4f6a-80a4-4003071c79ef_model.json +3 -0
  9. abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/85b474c0-b943-4f6a-80a4-4003071c79ef_origin.pdf +3 -0
  10. abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/full.md +272 -0
  11. abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/images.zip +3 -0
  12. abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/layout.json +3 -0
  13. abntestingwithcontrolinthepresenceofsubpopulations/08e77774-2ec8-4983-a7db-f355e70f40c9_content_list.json +3 -0
  14. abntestingwithcontrolinthepresenceofsubpopulations/08e77774-2ec8-4983-a7db-f355e70f40c9_model.json +3 -0
  15. abntestingwithcontrolinthepresenceofsubpopulations/08e77774-2ec8-4983-a7db-f355e70f40c9_origin.pdf +3 -0
  16. abntestingwithcontrolinthepresenceofsubpopulations/full.md +296 -0
  17. abntestingwithcontrolinthepresenceofsubpopulations/images.zip +3 -0
  18. abntestingwithcontrolinthepresenceofsubpopulations/layout.json +3 -0
  19. abtestingforrecommendersystemsinatwosidedmarketplace/77dc5e15-16d4-4322-9e68-8698111e2fdf_content_list.json +3 -0
  20. abtestingforrecommendersystemsinatwosidedmarketplace/77dc5e15-16d4-4322-9e68-8698111e2fdf_model.json +3 -0
  21. abtestingforrecommendersystemsinatwosidedmarketplace/77dc5e15-16d4-4322-9e68-8698111e2fdf_origin.pdf +3 -0
  22. abtestingforrecommendersystemsinatwosidedmarketplace/full.md +345 -0
  23. abtestingforrecommendersystemsinatwosidedmarketplace/images.zip +3 -0
  24. abtestingforrecommendersystemsinatwosidedmarketplace/layout.json +3 -0
  25. acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/e7d48d0a-77c0-4d72-89c3-125c14933553_content_list.json +3 -0
  26. acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/e7d48d0a-77c0-4d72-89c3-125c14933553_model.json +3 -0
  27. acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/e7d48d0a-77c0-4d72-89c3-125c14933553_origin.pdf +3 -0
  28. acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/full.md +294 -0
  29. acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/images.zip +3 -0
  30. acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/layout.json +3 -0
  31. acgclossyactivationcompressionwithguaranteedconvergence/cdea0826-f065-4d36-aab4-fb57bd5292fa_content_list.json +3 -0
  32. acgclossyactivationcompressionwithguaranteedconvergence/cdea0826-f065-4d36-aab4-fb57bd5292fa_model.json +3 -0
  33. acgclossyactivationcompressionwithguaranteedconvergence/cdea0826-f065-4d36-aab4-fb57bd5292fa_origin.pdf +3 -0
  34. acgclossyactivationcompressionwithguaranteedconvergence/full.md +373 -0
  35. acgclossyactivationcompressionwithguaranteedconvergence/images.zip +3 -0
  36. acgclossyactivationcompressionwithguaranteedconvergence/layout.json +3 -0
  37. afasterdecentralizedalgorithmfornonconvexminimaxproblems/b0e8dcfe-e3b3-40e8-9e3a-9cf865dce49c_content_list.json +3 -0
  38. afasterdecentralizedalgorithmfornonconvexminimaxproblems/b0e8dcfe-e3b3-40e8-9e3a-9cf865dce49c_model.json +3 -0
  39. afasterdecentralizedalgorithmfornonconvexminimaxproblems/b0e8dcfe-e3b3-40e8-9e3a-9cf865dce49c_origin.pdf +3 -0
  40. afasterdecentralizedalgorithmfornonconvexminimaxproblems/full.md +361 -0
  41. afasterdecentralizedalgorithmfornonconvexminimaxproblems/images.zip +3 -0
  42. afasterdecentralizedalgorithmfornonconvexminimaxproblems/layout.json +3 -0
  43. afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/52112131-c964-4798-81d9-c7b36dd828ab_content_list.json +3 -0
  44. afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/52112131-c964-4798-81d9-c7b36dd828ab_model.json +3 -0
  45. afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/52112131-c964-4798-81d9-c7b36dd828ab_origin.pdf +3 -0
  46. afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/full.md +316 -0
  47. afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/images.zip +3 -0
  48. afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/layout.json +3 -0
  49. afecactiveforgettingofnegativetransferincontinuallearning/7ea88ec5-7a8f-4240-899d-5add09d673b3_content_list.json +3 -0
  50. afecactiveforgettingofnegativetransferincontinuallearning/7ea88ec5-7a8f-4240-899d-5add09d673b3_model.json +3 -0
a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/6d258242-903c-489b-ae9b-a8204d589125_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7be8a43abb59d82e70855809d0cf67db8b1cf3ea41027631b7472d04c98b6022
3
+ size 72819
a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/6d258242-903c-489b-ae9b-a8204d589125_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:178727ccb52483ed89da2a9e02c42ed7d820de0c3b2af14b9f581e8dc10d7a13
3
+ size 89512
a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/6d258242-903c-489b-ae9b-a8204d589125_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3f2ea67bbfcf2c836d141d7ee4982c577de57c0d4ee03d20053b4e2013f11195
3
+ size 7193441
a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/full.md ADDED
@@ -0,0 +1,291 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # $\mathbf{A}^{2}$ -NET: Learning Attribute-Aware Hash Codes for Large-Scale Fine-Grained Image Retrieval
2
+
3
+ Xiu-Shen Wei $^{1,2}$ , Yang Shen $^{1}$ , Xuhao Sun $^{1}$ , Han-Jia Ye $^{2}$ , Jian Yang $^{1*}$
4
+
5
+ $^{1}$ Nanjing University of Science and Technology
6
+
7
+ $^{2}$ State Key Lab. for Novel Software Technology, Nanjing University
8
+
9
+ # Abstract
10
+
11
+ 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.
12
+
13
+ # 1 Introduction
14
+
15
+ 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.
16
+
17
+ 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,
18
+
19
+ ![](images/b4e060f90e263be1d74b470394cb690d0dc7c61ea3e73d72b90b9081cbe3a723.jpg)
20
+ 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.
21
+
22
+ 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.
23
+
24
+ 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.
25
+
26
+ 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.
27
+
28
+ 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.
29
+
30
+ # 2 Related Work
31
+
32
+ # 2.1 Fine-Grained Image Retrieval
33
+
34
+ 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
35
+
36
+ ![](images/6179f80dbefc26deef990461b0ecc6f884bdf160cc27f57437d49a9dab858b3c.jpg)
37
+ 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.
38
+
39
+ 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]).
40
+
41
+ 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].
42
+
43
+ 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.
44
+
45
+ # 2.2 Learning to Hash
46
+
47
+ 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]).
48
+
49
+ 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.
50
+
51
+ # 2.3 Visual Attributes
52
+
53
+ 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.
54
+
55
+ # 3 Methodology
56
+
57
+ 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.
58
+
59
+ # 3.1 Overall Framework and Notations
60
+
61
+ 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$ .
62
+
63
+ # 3.2 Fine-Grained Representation Learning
64
+
65
+ 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
66
+
67
+ 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.
68
+
69
+ In concretely, we extract the deep feature of its input image $\mathcal{I}_i$ via a backbone CNN model $\Phi_{\mathrm{CNN}}(\cdot)$ by
70
+
71
+ $$
72
+ \boldsymbol {T} _ {i} = \Phi_ {\mathrm {C N N}} (\mathcal {I} _ {i}) \in \mathbb {R} ^ {C \times H \times W}. \tag {1}
73
+ $$
74
+
75
+ 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
76
+
77
+ $$
78
+ \boldsymbol {T} _ {i} ^ {c} = \boldsymbol {A} ^ {c} \odot \boldsymbol {T} _ {i}, \tag {2}
79
+ $$
80
+
81
+ 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:
82
+
83
+ $$
84
+ \hat {\boldsymbol {T}} _ {i} ^ {c} = \phi \left(\boldsymbol {T} _ {i} ^ {c}; \theta_ {\text {l o c a l}}\right), \tag {3}
85
+ $$
86
+
87
+ $$
88
+ \hat {\boldsymbol {T}} _ {i} = \phi (\boldsymbol {T} _ {i}; \theta_ {\text {g l o b a l}}), \tag {4}
89
+ $$
90
+
91
+ 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$ .
92
+
93
+ # 3.3 Attribute-Aware Hash Codes Generating
94
+
95
+ 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.
96
+
97
+ # 3.3.1 Unsupervised Attribute-Guided Learning
98
+
99
+ 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.
100
+
101
+ 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").
102
+
103
+ 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
104
+
105
+ $$
106
+ \boldsymbol {u} _ {i} = \operatorname {s g n} \left(\tanh \left(\boldsymbol {v} _ {i}\right)\right). \tag {5}
107
+ $$
108
+
109
+ 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
110
+
111
+ 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).
112
+
113
+ In concretely, the learning objective of unsupervised attribute-guided reconstruction is written as follows:
114
+
115
+ $$
116
+ \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}
117
+ $$
118
+
119
+ 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
120
+
121
+ $$
122
+ \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}
123
+ $$
124
+
125
+ # 3.3.2 Attribute-Specific Feature Decorrelation
126
+
127
+ 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
128
+
129
+ $$
130
+ \min _ {\boldsymbol {V} ^ {\prime}} \left\| \boldsymbol {V} ^ {\prime} \boldsymbol {V} ^ {\prime \top} - n \boldsymbol {I} \right\| _ {F} ^ {2}, \tag {8}
131
+ $$
132
+
133
+ 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.
134
+
135
+ # 3.3.3 Hash Code Learning
136
+
137
+ 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
138
+
139
+ $$
140
+ \boldsymbol {u} _ {i} = \operatorname {s g n} \left(\tanh \left(\boldsymbol {q} _ {i}\right)\right), \tag {9}
141
+ $$
142
+
143
+ $$
144
+ \boldsymbol {z} _ {j} = \operatorname {s g n} \left(\tanh \left(\boldsymbol {v} _ {j}\right)\right), \tag {10}
145
+ $$
146
+
147
+ 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:
148
+
149
+ $$
150
+ \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}
151
+ $$
152
+
153
+ $$
154
+ \text {s . t .} \quad \boldsymbol {U} \in \{- 1, + 1 \} ^ {n \times k}, \boldsymbol {Z} \in \{- 1, + 1 \} ^ {m \times k}. \tag {11}
155
+ $$
156
+
157
+ 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:
158
+
159
+ $$
160
+ \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}
161
+ $$
162
+
163
+ where $\lambda, \alpha$ and $\beta$ are hyper-parameters as the trade-off.
164
+
165
+ 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
166
+
167
+ optimization formulation of $\mathbf{A}^2$ -NET can be rewritten with only database points $\{\pmb{v}_j\}_{j=1}^m$ for training as:
168
+
169
+ $$
170
+ \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}
171
+ $$
172
+
173
+ 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.
174
+
175
+ # 3.4 Out-of-Sample Extension
176
+
177
+ 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$ :
178
+
179
+ $$
180
+ \boldsymbol {u} _ {q} = \operatorname {s g n} \left(\tanh \left(\boldsymbol {W} \cdot F \left(\mathcal {I} _ {q}; \Theta\right)\right)\right). \tag {14}
181
+ $$
182
+
183
+ # 4 Experiments
184
+
185
+ # 4.1 Datasets
186
+
187
+ 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.
188
+
189
+ # 4.2 Baselines and Implementation Details
190
+
191
+ 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.
192
+
193
+ 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.
194
+
195
+ Table 1: Comparisons of retrieval accuracy (\% mAP) on five fine-grained benchmark datasets.
196
+
197
+ <table><tr><td>Datasets</td><td># bits</td><td>ITQ</td><td>SDH</td><td>DPSH</td><td>HashNet</td><td>ADSH</td><td>ExchNet</td><td>Ours</td></tr><tr><td rowspan="4">CUB200-2011</td><td>12</td><td>6.80</td><td>10.52</td><td>8.68</td><td>12.03</td><td>20.03</td><td>25.14</td><td>33.83</td></tr><tr><td>24</td><td>9.42</td><td>16.95</td><td>12.51</td><td>17.77</td><td>50.33</td><td>58.98</td><td>61.01</td></tr><tr><td>32</td><td>11.19</td><td>20.43</td><td>12.74</td><td>19.93</td><td>61.68</td><td>67.74</td><td>71.61</td></tr><tr><td>48</td><td>12.45</td><td>22.23</td><td>15.58</td><td>22.13</td><td>65.43</td><td>71.05</td><td>77.33</td></tr><tr><td rowspan="4">Aircraft</td><td>12</td><td>4.38</td><td>4.89</td><td>8.74</td><td>14.91</td><td>15.54</td><td>33.27</td><td>40.00</td></tr><tr><td>24</td><td>5.28</td><td>6.36</td><td>10.87</td><td>17.75</td><td>23.09</td><td>45.83</td><td>63.66</td></tr><tr><td>32</td><td>5.82</td><td>6.90</td><td>13.54</td><td>19.42</td><td>30.37</td><td>51.83</td><td>72.51</td></tr><tr><td>48</td><td>6.05</td><td>7.65</td><td>13.94</td><td>20.32</td><td>50.65</td><td>59.05</td><td>81.37</td></tr><tr><td rowspan="4">Food101</td><td>12</td><td>6.46</td><td>10.21</td><td>11.82</td><td>24.42</td><td>35.64</td><td>45.63</td><td>46.44</td></tr><tr><td>24</td><td>8.20</td><td>11.44</td><td>13.05</td><td>34.48</td><td>40.93</td><td>55.48</td><td>66.87</td></tr><tr><td>32</td><td>9.70</td><td>13.36</td><td>16.41</td><td>35.90</td><td>42.89</td><td>56.39</td><td>74.27</td></tr><tr><td>48</td><td>10.07</td><td>15.55</td><td>20.06</td><td>39.65</td><td>48.81</td><td>64.19</td><td>82.13</td></tr><tr><td rowspan="4">NABirds</td><td>12</td><td>2.53</td><td>3.10</td><td>2.17</td><td>2.34</td><td>2.53</td><td>5.22</td><td>8.20</td></tr><tr><td>24</td><td>4.22</td><td>6.72</td><td>4.08</td><td>3.29</td><td>8.23</td><td>15.69</td><td>19.15</td></tr><tr><td>32</td><td>5.38</td><td>8.86</td><td>3.61</td><td>4.52</td><td>14.71</td><td>21.94</td><td>24.41</td></tr><tr><td>48</td><td>6.10</td><td>10.38</td><td>3.20</td><td>4.97</td><td>25.34</td><td>34.81</td><td>35.64</td></tr><tr><td rowspan="4">VegFru</td><td>12</td><td>3.05</td><td>5.92</td><td>6.33</td><td>3.70</td><td>8.24</td><td>23.55</td><td>25.52</td></tr><tr><td>24</td><td>5.51</td><td>11.55</td><td>9.05</td><td>6.24</td><td>24.90</td><td>35.93</td><td>44.73</td></tr><tr><td>32</td><td>7.48</td><td>14.55</td><td>10.28</td><td>7.83</td><td>36.53</td><td>48.27</td><td>52.75</td></tr><tr><td>48</td><td>8.74</td><td>16.45</td><td>9.11</td><td>10.29</td><td>55.15</td><td>69.30</td><td>69.77</td></tr></table>
198
+
199
+ ![](images/8bb2e8cc3b13e017f5a99fc443e931f587a83be7724caa595f68847ce842e061.jpg)
200
+ Figure 3: Examples of top-10 retrieved images on CUB200-2011 of 48-bit hash codes by our $\mathrm{A}^2$ -NET.
201
+
202
+ # 4.3 Main Results
203
+
204
+ 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.
205
+
206
+ # 4.4 Ablation Studies
207
+
208
+ 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
209
+
210
+ Table 2: Retrieval accuracy (% mAP) with incremental components of the proposed A ${}^{2}$ -NET model.
211
+
212
+ <table><tr><td rowspan="2">Configurations</td><td colspan="4">CUB200-2011</td><td colspan="4">Food101</td></tr><tr><td>12 bits</td><td>24 bits</td><td>32 bits</td><td>48 bits</td><td>12 bits</td><td>24 bits</td><td>32 bits</td><td>48 bits</td></tr><tr><td>Vanilla backbone</td><td>20.03</td><td>50.33</td><td>61.68</td><td>65.43</td><td>35.64</td><td>40.93</td><td>42.89</td><td>48.81</td></tr><tr><td>+ Attention (Sec. 3.2)</td><td>27.42</td><td>58.17</td><td>68.24</td><td>76.10</td><td>41.33</td><td>65.07</td><td>70.06</td><td>78.51</td></tr><tr><td>+ Reconstruction (Sec. 3.3.1)</td><td>33.31</td><td>60.65</td><td>71.28</td><td>77.10</td><td>45.02</td><td>67.49</td><td>73.57</td><td>81.63</td></tr><tr><td>+ Feature decorrelation (Sec. 3.3.2)</td><td>33.83</td><td>61.01</td><td>71.61</td><td>77.33</td><td>46.44</td><td>66.87</td><td>74.27</td><td>82.13</td></tr></table>
213
+
214
+ ![](images/f5be703109a64fe81b81d0377a928c993d33a08fc931056b329a88777d48e335.jpg)
215
+ (a) CUB200-2011
216
+
217
+ ![](images/8cfe542e5341fa5eee50f8e36b760acb17c6127e90b84b1b7ff87eb4585143cd.jpg)
218
+ (b) Aircraft
219
+
220
+ ![](images/0626c357675d00f0d13ce318dfa64353b986ff9a144d5c93b4b23f4de07d12a3.jpg)
221
+ (c) Food101
222
+ 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.)
223
+
224
+ ![](images/5a6c657bb8706fd6245fc339c09abcf741045bba5831de8064066aa7b9694959.jpg)
225
+ (d) NABirds
226
+
227
+ ![](images/073d76733db66e01d9426a2e6162fe31fbf79273e5fdc25d92f0ad6b7828b333.jpg)
228
+ (e) VegFru
229
+
230
+ 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.
231
+
232
+ # 4.5 Qualitative Analyses of Attribute-Aware Hash Codes
233
+
234
+ 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.
235
+
236
+ # 5 Conclusion
237
+
238
+ 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.
239
+
240
+ # References
241
+
242
+ [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.
243
+ [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.
244
+ [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.
245
+ [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.
246
+ [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.
247
+ [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.
248
+ [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.
249
+ [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.
250
+ [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.
251
+ [10] Vittorio Ferrari and Andrew Zisserman. Learning visual attributes. In Proc. Advances in Neural Inf. Process. Syst., pages 433-440, 2007.
252
+ [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.
253
+ [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.
254
+ [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.
255
+ [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.
256
+ [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.
257
+ [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.
258
+ [17] Qing-Yuan Jiang and Wu-Jun Li. Asymmetric deep supervised hashing. In Proc. Conf. AAAI, pages 3342-3349, 2018.
259
+ [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.
260
+ [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.
261
+ [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.
262
+ [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.
263
+ [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.
264
+ [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.
265
+ [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.
266
+ [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
267
+
268
+ 1-12, 2014.
269
+ [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.
270
+ [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.
271
+ [28] Subhransu Maji, Esa Rahtu, Juho Kannala, Matthew Blaschko, and Andrea Vedaldi. Fine-grained visual classification of aircraft. arXiv preprint arXiv:1306.5151, 2013.
272
+ [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.
273
+ [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.
274
+ [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.
275
+ [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.
276
+ [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.
277
+ [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.
278
+ [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.
279
+ [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.
280
+ [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.
281
+ [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.
282
+ [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.
283
+ [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.
284
+ [41] Xiu-Shen Wei, Jianxin Wu, and Quan Cui. Deep learning for fine-grained image analysis: A survey. arXiv preprint arXiv:1907.03069, 2019.
285
+ [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.
286
+ [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.
287
+ [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.
288
+ [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.
289
+ [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.
290
+ [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.
291
+ [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.
a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2acf8d867d5fd700dde006ceb1336b46cef0a0fe19242e0f2a517d169aec8312
3
+ size 529042
a2netlearningattributeawarehashcodesforlargescalefinegrainedimageretrieval/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f1024d32f7965487e2ab8fc6f62a98cda5a0b6db6217acdc86400c395007a3b6
3
+ size 418018
abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/85b474c0-b943-4f6a-80a4-4003071c79ef_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b7f0536dac092605c5262961725d618ad633f108022cf3dde86390c72d1a91fb
3
+ size 78147
abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/85b474c0-b943-4f6a-80a4-4003071c79ef_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b249a53f732423043f6997acd608c723e85f67625b16e41a1dd45fb6c6b44274
3
+ size 97367
abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/85b474c0-b943-4f6a-80a4-4003071c79ef_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c52e9be10462a7fe6321c99a1c91d79c99e79d8dcb4a4f5e913a0e4cf48d26d9
3
+ size 1918711
abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/full.md ADDED
@@ -0,0 +1,272 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ABC: Auxiliary Balanced Classifier for Class-Imbalanced Semi-Supervised Learning
2
+
3
+ Hyuck Lee Seungjae Shin Heeyoung Kim
4
+
5
+ Department of Industrial and Systems Engineering, KAIST
6
+
7
+ {dlgur0921, tmdwo0910, heeyoungkim}@kaist.ac.kr
8
+
9
+ # Abstract
10
+
11
+ 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.
12
+
13
+ # 1 Introduction
14
+
15
+ 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.
16
+
17
+ 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
18
+
19
+ ![](images/70ca829a4dcbfc7184cd16800e1a3bdd1b80000c6839e10b95422431d43b9ab6.jpg)
20
+ (a) Class-imbalanced training set
21
+
22
+ ![](images/f363f63b16cf92f006502b133dbfaab2a73cea941f2cfa12d6eb947a05ab35e0.jpg)
23
+ (b) ReMixMatch
24
+ 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).
25
+
26
+ ![](images/a7b98c16c522995d204c563f80c3ad817896fb3db90f9478e353b5814a0e6b27.jpg)
27
+ (c) Proposed algorithm
28
+
29
+ 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].
30
+
31
+ 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.
32
+
33
+ # 2 Related Work
34
+
35
+ 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.
36
+
37
+ 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
38
+
39
+ 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].
40
+
41
+ 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.
42
+
43
+ # 3 Methodology
44
+
45
+ # 3.1 Problem setting
46
+
47
+ 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.
48
+
49
+ # 3.2 Backbone SSL algorithm
50
+
51
+ 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.
52
+
53
+ 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.
54
+
55
+ # 3.3 ABC for class-imbalanced Semi-supervised learning
56
+
57
+ 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
58
+
59
+ $$
60
+ 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}
61
+ $$
62
+
63
+ $$
64
+ M \left(x _ {b}\right) = \mathcal {B} \left(\frac {N _ {L}}{N _ {y _ {b}}}\right), \tag {2}
65
+ $$
66
+
67
+ 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$ .
68
+
69
+ ![](images/0f17125dd8eef38bd5b8b9ebdab31e2bf821887de0ca7853ffd7dba2c403a934.jpg)
70
+ Figure 2: Overall procedure for balanced training of the ABC with a $0 / 1$ mask
71
+
72
+ # 3.4 Consistency regularization for ABC
73
+
74
+ 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}$ .
75
+
76
+ 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,
77
+
78
+ 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
79
+
80
+ $$
81
+ 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}
82
+ $$
83
+
84
+ $$
85
+ M \left(u _ {b}\right) = \mathcal {B} \left(\frac {N _ {L}}{N _ {\widehat {q} _ {b}}}\right), \tag {4}
86
+ $$
87
+
88
+ 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.
89
+
90
+ # 3.5 End-to-end training
91
+
92
+ 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
93
+
94
+ $$
95
+ L _ {t o t a l} = L _ {c l s} + L _ {c o n} + L _ {b a c k}. \tag {5}
96
+ $$
97
+
98
+ 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.
99
+
100
+ # 4 Experiments
101
+
102
+ # 4.1 Experimental setup
103
+
104
+ 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
105
+
106
+ 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].
107
+
108
+ We compared the performance of the proposed algorithm with that of various baseline algorithms. Specifically, we considered the following baseline algorithms:
109
+
110
+ - Deep CNN (vanilla algorithm): This is trained on only labeled data with the cross-entropy loss.
111
+ - BALMS [27] (CIL algorithm): This state-of-the-art CIL algorithm does not use unlabeled data.
112
+ - VAT [24], ReMixMatch [3], and FixMatch [29] (SSL algorithms): These are state-of-the-art SSL algorithms, but do not consider class imbalance.
113
+ 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.
114
+ - ReMixMatch+DARP and FixMatch+DARP (CISSL algorithms): These algorithms use DARP [18] to refine the pseudo labels obtained from ReMixMatch or FixMatch.
115
+ - 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].
116
+
117
+ 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.
118
+
119
+ # 4.2 Experimental results
120
+
121
+ 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
122
+
123
+ 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.
124
+
125
+ Table 1: Overall accuracy/minority-class-accuracy under the main setting
126
+
127
+ <table><tr><td></td><td>CIFAR-10-LT</td><td>SVHN-LT</td><td>CIFAR-100-LT</td></tr><tr><td>Algorithm</td><td>γ = 100, β = 20%</td><td>γ = 100, β = 20%</td><td>γ = 20, β = 40%</td></tr><tr><td>Vanilla</td><td>55.3±1.30 / 33.9±1.88</td><td>77.0±0.67 / 63.3±1.25</td><td>40.1±1.15 / 25.2±0.95</td></tr><tr><td>VAT [24]</td><td>55.3±0.88 / 28.2±1.55</td><td>81.3±0.47 / 68.2±0.88</td><td>40.4±0.34 / 24.8±0.38</td></tr><tr><td>BALMS [27]</td><td>70.7±0.59 / 69.8±1.03</td><td>87.6±0.53 / 85.0±0.67</td><td>50.2±0.54 / 42.9±1.03</td></tr><tr><td>FixMatch [29]</td><td>72.3±0.33 / 53.8±0.63</td><td>88.0±0.30 / 79.4±0.54</td><td>51.0±0.20 / 32.8±0.41</td></tr><tr><td>w/ CReST+PDA [34]</td><td>76.6±0.46 / 61.4±0.85</td><td>89.1±0.69 / 81.7±1.18</td><td>51.6±0.29 / 36.4±0.46</td></tr><tr><td>w/ DARP [18]</td><td>73.7±0.98 / 57.0±2.12</td><td>88.6±0.19 / 80.5±0.54</td><td>51.4±0.37 / 33.9±0.77</td></tr><tr><td>w/ DARP+cRT [18]</td><td>78.1±0.89 / 66.6±1.55</td><td>89.9±0.44 / 83.5±0.61</td><td>54.7±0.46 / 41.2±0.42</td></tr><tr><td>w/ ABC</td><td>81.1±0.82 / 72.0±1.77</td><td>92.0±0.38 / 87.9±0.73</td><td>56.3±0.19 / 43.4±0.42</td></tr><tr><td>ReMixMatch [3]</td><td>73.7±0.39 / 55.9±0.87</td><td>89.8±0.42 / 82.8±0.68</td><td>54.0±0.29 / 37.1±0.37</td></tr><tr><td>w/ CReST+PDA [34]</td><td>75.7±0.34 / 59.6±0.76</td><td>90.9±0.20 / 85.2±0.39</td><td>54.6±0.48 / 38.1±0.69</td></tr><tr><td>w/ DARP [18]</td><td>74.4±0.41 / 56.9±0.67</td><td>90.2±0.22 / 83.5±0.40</td><td>54.5±0.33 / 37.7±0.58</td></tr><tr><td>w/ DARP+cRT [18]</td><td>78.5±0.61 / 66.4±1.68</td><td>92.1±0.48 / 87.6±0.75</td><td>55.1±0.45 / 43.6±0.58</td></tr><tr><td>w/ ABC</td><td>82.4±0.45 / 75.7±1.18</td><td>93.9±0.16 / 92.5±0.4</td><td>57.6±0.26 / 46.7±0.50</td></tr></table>
128
+
129
+ 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$ .
130
+
131
+ Table 2: Overall accuracy/minority-class accuracy for CIFAR-10 under various settings
132
+
133
+ <table><tr><td colspan="5">CIFAR-10-LT</td></tr><tr><td>Algorithm</td><td>γ = 100, β = 10%</td><td>γ = 100, β = 30%</td><td>γ = 50, β = 20%</td><td>γ = 150, β = 20%</td></tr><tr><td>FixMatch [29]</td><td>70.0±0.59/48.9±1.04</td><td>74.9±0.63/58.2±1.28</td><td>81.2±0.07/70.7±0.36</td><td>68.5±0.60/45.8±1.15</td></tr><tr><td>w/ CReST+PDA [34]</td><td>73.9±0.40/58.9±1.14</td><td>77.6±0.73/64.0±1.39</td><td>83.3±0.10/75.7±0.39</td><td>70.0±0.82/49.4±1.52</td></tr><tr><td>w/ DARP+cRT [18]</td><td>74.6±0.98/59.2±2.12</td><td>79.0±0.25/67.7±0.95</td><td>83.6±0.42/77.1±1.19</td><td>73.2±0.85/57.1±1.13</td></tr><tr><td>w/ ABC</td><td>77.2±1.60/65.7±2.85</td><td>81.5±0.29/72.9±0.96</td><td>85.2±0.51/80.2±0.64</td><td>77.1±0.46/64.4±0.92</td></tr><tr><td>ReMixMatch [3]</td><td>71.5±0.51/52.2±1.08</td><td>75.8±0.10/59.4±0.17</td><td>81.5±0.17/70.7±0.32</td><td>69.9±0.23/48.4±0.60</td></tr><tr><td>w/ CReST+PDA [34]</td><td>73.8±0.32/56.6±0.43</td><td>78.6±0.73/64.8±1.49</td><td>83.9±0.26/75.4±0.52</td><td>71.3±0.77/50.8±1.59</td></tr><tr><td>w/ DARP+cRT [18]</td><td>75.9±1.20/62.1±3.10</td><td>81.0±0.16/70.7±0.72</td><td>84.5±0.80/77.8±1.67</td><td>73.9±0.59/57.4±1.45</td></tr><tr><td>w/ ABC</td><td>79.8±0.36/70.8±0.92</td><td>84.3±1.03/80.6±0.97</td><td>87.5±0.31/84.6±1.19</td><td>80.6±0.66/72.1±1.51</td></tr></table>
134
+
135
+ 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.
136
+
137
+ Table 3: Overall accuracy/minority-class accuracy on CIFAR-10 under a step imbalance setting
138
+
139
+ <table><tr><td colspan="5">CIFAR-10-Step, γ = 100, β = 20%</td></tr><tr><td>Algorithm</td><td>w/ -</td><td>w/ CReST+PDA [34]</td><td>w/ DARP+cRT [18]</td><td>w/ ABC</td></tr><tr><td>FixMatch [29]</td><td>54.0±0.84/ 11.8±1.71</td><td>71.1±0.78/ 48.2±2.26</td><td>69.8±1.51/ 45.1±2.70</td><td>75.9±0.49/ 57.0±1.07</td></tr><tr><td>ReMixMatch [3]</td><td>60.8±0.10/ 25.1±1.28</td><td>64.6±0.97/ 33.5±2.05</td><td>72.3±1.77/ 50.6±3.53</td><td>76.4±1.70/ 65.7±1.30</td></tr></table>
140
+
141
+ 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.
142
+
143
+ Table 4: Overall accuracy/minority-class accuracy for the large-scale LSUN dataset
144
+
145
+ <table><tr><td colspan="6">LSUN, γ = 100, β = 20%</td></tr><tr><td>Algorithm</td><td>w/ -</td><td>w/ cRT [17]</td><td>w/ DARP [18]</td><td>w/ DARP+cRT [18]</td><td>w/ ABC</td></tr><tr><td>FixMatch [29]</td><td>73.1 / 55.3</td><td>77.0 / 71.5</td><td>71.0 / 51.8</td><td>75.8 / 69.5</td><td>78.9 / 75.5</td></tr><tr><td>ReMixMatch [3]</td><td>69.4 / 49.1</td><td>75.4 / 69.5</td><td>65.6 / 44.1</td><td>72.1 / 67.5</td><td>76.9 / 69.5</td></tr></table>
146
+
147
+ # 4.3 Complexity of the proposed algorithm
148
+
149
+ 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.
150
+
151
+ # 4.4 Qualitative analysis of high-quality representations and balanced classification
152
+
153
+ 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.
154
+
155
+ ![](images/f3a6cc8854c2052b75adff1e9d6feb3088835f8f49df7014e90833da19579bd1.jpg)
156
+ Figure 3: t-SNE of the proposed algorithm and the ABC (without SSL backbone)
157
+
158
+ ![](images/3689a826b219b2eab6db43126bc245568c32dd53159950ecebf93d0d5bf41937.jpg)
159
+
160
+ ![](images/d4c8bc8dfdc60427470e9acfd2e2939325fefe1c286df033d04bda62ff2a29f3.jpg)
161
+
162
+ 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.
163
+
164
+ ![](images/beaa7e909d9a519af7287029d772bc82081bb5f86f6b5d88fb9e733770a35094.jpg)
165
+ (a)ReMixMatch
166
+
167
+ ![](images/54bb9519d9aea7b47ba96e830156bffc61f3d3e6ef1d5986929503c189956584.jpg)
168
+ (b)ReMixMatch+DARP+cRT
169
+
170
+ ![](images/78526a4995c433c0a5d1adf93222720bdac59774d037934a6f0d299fd47a5bdc.jpg)
171
+ (c) ReMixMatch+ABC
172
+ Figure 4: Confusion matrices of the predictions on the test set of CIFAR-10
173
+
174
+ ![](images/1d8b92e223d76a4e6e528aa662a2228c4ecff34ca66b7f21d5d4ec6030b58e80.jpg)
175
+
176
+ # 4.5 Ablation study
177
+
178
+ 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
179
+
180
+ 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.
181
+
182
+ Table 5: Ablation study for ReMixMatch+ABC on CIFAR-10-LT, $\gamma = {100},\beta = {20}\%$
183
+
184
+ <table><tr><td>Ablation study</td><td>Overall</td><td>Minority</td></tr><tr><td>ReMixMatch+ABC (proposed algorithm)</td><td>82.4</td><td>75.7</td></tr><tr><td>Without gradually decreasing the parameter of B (·) for consistency regularization</td><td>81.8</td><td>74.6</td></tr><tr><td>Without consistency regularization for the ABC</td><td>79.4</td><td>66.9</td></tr><tr><td>Without using the 0/1 mask for the consistency regularization loss Lcon</td><td>79.0</td><td>69.2</td></tr><tr><td>Without using the 0/1 mask for the classification loss Lcls</td><td>74.4</td><td>57.8</td></tr><tr><td>Without using the confidence threshold τ for consistency regularization</td><td>74.3</td><td>75.4</td></tr><tr><td>Using hard pseudo labels for consistency regularization</td><td>70.2</td><td>75.1</td></tr><tr><td>Without training backbone (ABC without SSL backbone)</td><td>68.7</td><td>56.2</td></tr><tr><td>Training the ABC with a re-weighting technique</td><td>81.2</td><td>74.1</td></tr><tr><td>Decoupled training of the backbone and ABC</td><td>79.5</td><td>72.3</td></tr></table>
185
+
186
+ # 5 Conclusion
187
+
188
+ 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.
189
+
190
+ # Acknowledgments
191
+
192
+ This work was supported by the National Research Foundation of Korea (NRF) grant funded by the Korea government (MSIT) (2018R1C1B6004511, 2020R1A4A10187747).
193
+
194
+ # References
195
+
196
+ [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.
197
+ [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.
198
+
199
+ [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.
200
+ [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.
201
+ [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.
202
+ [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.
203
+ [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.
204
+ [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.
205
+ [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.
206
+ [10] DeVries, T. and Taylor, G. W. (2017). Improved regularization of convolutional neural networks with cutout. arXiv preprint arXiv:1708.04552.
207
+ [11] Gidaris, S., Singh, P., and Komodakis, N. (2018). Unsupervised representation learning by predicting image rotations. In International Conference on Learning Representations.
208
+ [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.
209
+ [13] He, H. and Garcia, E. A. (2009). Learning from imbalanced data. IEEE Transactions on knowledge and data engineering, 21(9):1263-1284.
210
+ [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.
211
+ [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.
212
+ [16] JAPKOWICZ, N. (2000). The class imbalance problem: Significance and strategies. In Proc. 2000 International Conference on Artificial Intelligence, volume 1, pages 111-117.
213
+ [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.
214
+ [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.
215
+ [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.
216
+
217
+ [20] Kingma, D. P. and Ba, J. (2015). Adam: A method for stochastic optimization. In ICLR, 2015.
218
+ [21] Krizhevsky, A. (2009). Learning multiple layers of features from tiny images. Technical report, Department of Computer Science, University of Toronto.
219
+ [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.
220
+ [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.
221
+ [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.
222
+ [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.
223
+ [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.
224
+ [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.
225
+ [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.
226
+ [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.
227
+ [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.
228
+ [31] Van der Maaten, L. and Hinton, G. (2008). Visualizing data using t-sne. Journal of machine learning research, 9(11).
229
+ [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.
230
+ [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.
231
+ [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.
232
+ [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.
233
+ [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.
234
+
235
+ [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.
236
+ [38] Zagoruyko, S. and Komodakis, N. (2016). Wide residual networks. arXiv preprint arXiv:1605.07146.
237
+ [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.
238
+
239
+ # Checklist
240
+
241
+ 1. For all authors...
242
+
243
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope? [Yes]
244
+ (b) Did you describe the limitations of your work? [Yes] See Section 5.
245
+ (c) Did you discuss any potential negative societal impacts of your work? [Yes] See Section 5.
246
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
247
+
248
+ 2. If you are including theoretical results...
249
+
250
+ (a) Did you state the full set of assumptions of all theoretical results? [N/A]
251
+ (b) Did you include complete proofs of all theoretical results? [N/A]
252
+
253
+ 3. If you ran experiments...
254
+
255
+ (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.
256
+ (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.
257
+ (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)? [Yes] See Section 4.2.
258
+ (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.
259
+
260
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
261
+
262
+ (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.
263
+ (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.
264
+ (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.
265
+ (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
266
+ (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
267
+
268
+ 5. If you used crowdsourcing or conducted research with human subjects...
269
+
270
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
271
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
272
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e2a2fe6b57a797fa85ddd07a0349f5b8635bc66f5c5985af2fdc7eeb2a93de2d
3
+ size 487164
abcauxiliarybalancedclassifierforclassimbalancedsemisupervisedlearning/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:52aca0b56ec6bcafc8a62f509c5b7de14dd6391323817243a6352b1bb19155b4
3
+ size 391487
abntestingwithcontrolinthepresenceofsubpopulations/08e77774-2ec8-4983-a7db-f355e70f40c9_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9dc813e69f3f773d3b8170b2c237f7e4b87ff86f0c9f52587b1883e7d24a7df0
3
+ size 73964
abntestingwithcontrolinthepresenceofsubpopulations/08e77774-2ec8-4983-a7db-f355e70f40c9_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:313f1897ef417600ef38e6e7bbc37a4847d06c974224797c23645e9ce99ed93d
3
+ size 85486
abntestingwithcontrolinthepresenceofsubpopulations/08e77774-2ec8-4983-a7db-f355e70f40c9_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2117f5243cc638a1430ec2d1f5b00f30090db2180e623f5ebd37c37e6975b714
3
+ size 424815
abntestingwithcontrolinthepresenceofsubpopulations/full.md ADDED
@@ -0,0 +1,296 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # A/B/n Testing with Control in the Presence of Subpopulations
2
+
3
+ Yoan Russac
4
+
5
+ CNRS, Inria, ENS
6
+
7
+ Université PSL
8
+
9
+ yoan.russac@ens.fr
10
+
11
+ Christina Katsimerou
12
+
13
+ Booking.com
14
+
15
+ christina.katsimerou@booking.com
16
+
17
+ Dennis Bohle
18
+
19
+ Booking.com
20
+
21
+ dennis.bohle@booking.com
22
+
23
+ Olivier Cappé
24
+
25
+ CNRS, Inria, ENS
26
+
27
+ Université PSL
28
+
29
+ olivier.cappe@cnrs.fr
30
+
31
+ Aurelien Garivier
32
+
33
+ UMPA, CNRS
34
+
35
+ Inria, ENS Lyon
36
+
37
+ aurelien.garivier@ens-lyon.fr
38
+
39
+ Wouter M. Koolen
40
+
41
+ Centrum Wiskunde & Informatica
42
+
43
+ wmkoolen@cwi.nl
44
+
45
+ # Abstract
46
+
47
+ 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.
48
+
49
+ # 1 Introduction
50
+
51
+ 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.
52
+
53
+ 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.
54
+
55
+ 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.
56
+
57
+ 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.
58
+
59
+ 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.
60
+
61
+ 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.).
62
+
63
+ 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
64
+
65
+ 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.
66
+
67
+ 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.
68
+
69
+ 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.
70
+
71
+ # 2 The complexity of the ABC-S problem
72
+
73
+ # 2.1 Mathematical framework
74
+
75
+ 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
76
+
77
+ $$
78
+ \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\}.
79
+ $$
80
+
81
+ 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$ .
82
+
83
+ 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.
84
+
85
+ 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:
86
+
87
+ $$
88
+ 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),
89
+ $$
90
+
91
+ <table><tr><td></td><td>1. See It ~ α</td><td>1. Pick At</td><td>1. Pick At</td></tr><tr><td>1. Pick At and It</td><td>2. Pick At</td><td>2. See It ~ α</td><td>2. Do not see It ~ α</td></tr><tr><td>2. See Xt ~νAt,It</td><td>3. See Xt ~νAt,It</td><td>3. See Xt ~νAt,It</td><td>3. See Xt ~νAt,It</td></tr><tr><td>(a) Active mode</td><td>(b) Proportional mode</td><td>(c) Agnostic mode</td><td>(d) Oblivious mode.</td></tr></table>
92
+
93
+ 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$ .
94
+
95
+ 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$ .
96
+
97
+ 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
98
+
99
+ $$
100
+ \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}
101
+ $$
102
+
103
+ 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$ .
104
+
105
+ 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.
106
+
107
+ # 2.2 General form of the sample complexity
108
+
109
+ 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.
110
+
111
+ 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:
112
+
113
+ $$
114
+ \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}
115
+ $$
116
+
117
+ where (recalling that $\lambda_{a} = \sum_{i = 1}^{J}\beta_{i}\lambda_{a,i})$
118
+
119
+ $$
120
+ \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}
121
+ $$
122
+
123
+ This result is established in Appendix A. $T^{\star}$ characterizes the difficulty of the learning problem.
124
+
125
+ # 2.3 Influence of the mode of interaction
126
+
127
+ 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}\}$ .
128
+
129
+ 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.
130
+
131
+ 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.
132
+
133
+ 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
134
+
135
+ $$
136
+ \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}
137
+ $$
138
+
139
+ 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.
140
+
141
+ 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$
142
+
143
+ $$
144
+ \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}
145
+ $$
146
+
147
+ 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).
148
+
149
+ # 2.4 Single population and relationship with best arm identification
150
+
151
+ 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.
152
+
153
+ $$
154
+ 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})
155
+ $$
156
+
157
+ 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}$ .
158
+
159
+ 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).
160
+
161
+ 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
162
+
163
+ $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.
164
+
165
+ Proposition 1. Let $\delta \in (0,1)$ and $\pmb{\mu} \in \mathcal{L}$ . For any strategy satisfying Equation 1, Equation 2 holds with
166
+
167
+ $$
168
+ 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).
169
+ $$
170
+
171
+ 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.
172
+
173
+ # 2.5 The Gaussian case
174
+
175
+ 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.
176
+
177
+ 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).
178
+
179
+ 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
180
+
181
+ 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}}}$
182
+ 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}}$ .
183
+ 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})}$
184
+
185
+ 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.
186
+
187
+ 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.
188
+
189
+ 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
190
+
191
+ $$
192
+ \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} |}.
193
+ $$
194
+
195
+ If, in addition $\alpha = \beta$ , the above also holds for the agnostic and the proportional modes.
196
+
197
+ 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.
198
+
199
+ # 3 Algorithms
200
+
201
+ 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.
202
+
203
+ 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).
204
+
205
+ 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.
206
+
207
+ 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
208
+
209
+ $$
210
+ \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}
211
+ $$
212
+
213
+ 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.
214
+
215
+ 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
216
+
217
+ $$
218
+ \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}).
219
+ $$
220
+
221
+ We include the proof in Appendix E.
222
+
223
+ # 4 Experiments
224
+
225
+ # 4.1 Simulations
226
+
227
+ We conduct numerical experiments to evaluate the proposed algorithms, focusing on Bernoulli bandit models, which are ubiquitous in practical applications.
228
+
229
+ 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.
230
+
231
+ 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)$ .
232
+
233
+ ![](images/bdb1a3f461c5ba15be189617b9c0eb2d2f0e465a4021017636612aa32a9c3663.jpg)
234
+ 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.
235
+
236
+ ![](images/24d5d34b555d4efa117edac81c579f58eb324d3ba79a2d9363c973e8980e405f.jpg)
237
+
238
+ 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.
239
+
240
+ Table 1: Average stopping time. Description in text.
241
+
242
+ <table><tr><td>T-a-S (active)</td><td>T-a-S (proportional)</td><td>T-a-S (agnostic)</td><td>BC-ABC</td><td>Uniform</td></tr><tr><td>14871</td><td>15231</td><td>15444</td><td>15279</td><td>21586</td></tr></table>
243
+
244
+ 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.
245
+
246
+ # 4.2 Application to A/B/n experiment
247
+
248
+ 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.
249
+
250
+ 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.
251
+
252
+ 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.
253
+
254
+ 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.
255
+
256
+ # 5 Conclusion
257
+
258
+ 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
259
+
260
+ ![](images/5c8684b941d1d877034dc8d188b85f5708879fe848467dc8782e9a7314e3bf6f.jpg)
261
+ (a) Click-through rate per 6 hours for 12 days.
262
+
263
+ ![](images/b86728662ed96ea2a890ed43153365372956643ecd414d5bf5f51712b0873594.jpg)
264
+ (b) Risk assessment over time.
265
+ Figure 3: Real data and results.
266
+
267
+ variances. Finally, we proposed a natural way to provide anytime decisions with risk guarantees in the Track-and-Stop framework.
268
+
269
+ # 6 Potential Societal Impact
270
+
271
+ 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.
272
+
273
+ # Acknowledgment
274
+
275
+ 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).
276
+
277
+ # References
278
+
279
+ [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.
280
+ [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.
281
+ [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.
282
+ [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.
283
+ [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.
284
+ [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.
285
+ [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.
286
+ [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.
287
+ [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.
288
+ [10] A. Garivier and E. Kaufmann. Optimal best arm identification with fixed confidence. In Conference on Learning Theory, pages 998-1027. PMLR, 2016.
289
+ [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.
290
+ [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.
291
+ [13] E. Kaufmann and W. M. Koolen. Mixture martingales revisited with applications to sequential tests and confidence intervals. Preprint, Oct. 2018.
292
+ [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.
293
+ [15] T. Lattimore and C. Szepesvári. Bandit Algorithms. Cambridge University Press, 2020. doi: 10.1017/9781108571401.
294
+ [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.
295
+ [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.
296
+ [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.
abntestingwithcontrolinthepresenceofsubpopulations/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:60a839a8c5b9b38110146904d08507a97ed1246678fe0af2e93d79ecb9665cc4
3
+ size 219577
abntestingwithcontrolinthepresenceofsubpopulations/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2e770c1da86012f25dbbd061f54a4a471489184b4077c7bb31df6d16af85d23e
3
+ size 428015
abtestingforrecommendersystemsinatwosidedmarketplace/77dc5e15-16d4-4322-9e68-8698111e2fdf_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b3ceaaf0590182a57d52c3b600d73615a51bd8fe2f4c7967fb897c4189b6354b
3
+ size 84147
abtestingforrecommendersystemsinatwosidedmarketplace/77dc5e15-16d4-4322-9e68-8698111e2fdf_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e26d97c18e2dfb1f3c27da96e6d0a6c4f6ffcf5bc92f84333370281ebd8d00e3
3
+ size 103659
abtestingforrecommendersystemsinatwosidedmarketplace/77dc5e15-16d4-4322-9e68-8698111e2fdf_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b55c367a787bd714c76ffab2418659e9638095e7c1bdd15645b39c227cf567b4
3
+ size 1056081
abtestingforrecommendersystemsinatwosidedmarketplace/full.md ADDED
@@ -0,0 +1,345 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # A/B Testing for Recommender Systems in a Two-sided Marketplace
2
+
3
+ Preetam Nandy, Divya Venugopalan, Chun Lo, Shaunak Chatterjee
4
+
5
+ LinkedIn Corporation
6
+
7
+ Mountain View, CA 94083
8
+
9
+ {pnandy, dvenugopalan, chunlo, shchatterjee}@linkedin.com
10
+
11
+ # Abstract
12
+
13
+ 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.
14
+
15
+ # 1 Introduction
16
+
17
+ 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.
18
+
19
+ 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).
20
+
21
+ 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.
22
+
23
+ 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.
24
+
25
+ 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.
26
+
27
+ 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.
28
+
29
+ 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.
30
+
31
+ 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.
32
+
33
+ The key contributions of our work are as follows:
34
+
35
+ - An inaccuracy based metric to quantify the quality of an experiment and a novel producer side experiment design mechanism that unifies multiple counterfactual rankings.
36
+ - We prove the optimality of our experiment design, as well as bias and variance bounds.
37
+ - We show through extensive simulations how the method performs in various synthetic scenarios and against multiple existing approaches [3][9].
38
+ - A real-world implementation of the proposal in an edge recommendation problem.
39
+
40
+ 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.
41
+
42
+ # 2 Problem setup
43
+
44
+ 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.
45
+
46
+ 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).
47
+
48
+ 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.
49
+
50
+ 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
51
+
52
+ Definition 1. The inaccuracy of the experimental design $\mathcal{D}$ is given by
53
+
54
+ $$
55
+ 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} \}}.
56
+ $$
57
+
58
+ 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.
59
+
60
+ ![](images/24186f0a88b2e7da89bb4dca7e0d467f0c2e2dd673f3e245cb827702eef3aa24.jpg)
61
+ (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.
62
+ (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.
63
+ 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.
64
+
65
+ ![](images/5b04d33c2b9810a25f69e1c365cd962ba683afe90b0b60a96baa0c6c24f56cdf.jpg)
66
+ (i) Problem setup
67
+
68
+ (ii) Unrealizable pair of counterfactual rankings
69
+ ![](images/b0b86d0d52170d26e38ff58425ffbf2ba5abe0964cdfae89e0a3a4b03e34262d.jpg)
70
+ 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)$ .
71
+
72
+ ![](images/f89937344b22396314bfc2fcc966557cd07fb65251a705e32f981d7946e180a3.jpg)
73
+ (iii) Realizable pair of counterfactual rankings
74
+
75
+ # 3 UniCoRn: Unifying Counterfactual Rankings
76
+
77
+ 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
78
+
79
+ # 3.1 The UniCoRn algorithm
80
+
81
+ 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$ .
82
+
83
+ 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:
84
+
85
+ - Initial slot allocation (Step2): Identify positions allocated to all items using $T_0$ .
86
+ - 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.
87
+
88
+ - $\alpha$ determines the fraction of $P_0$ items and slots that will be used in the mixing
89
+ - All items in $P_{1}$ and their corresponding slots participate in the mixing
90
+
91
+ - 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).
92
+
93
+ # Algorithm 1 UniCoRn $(P_0, P_1, \alpha)$
94
+
95
+ Require: producer sets $P_0, P_1$ , scoring models $T_0$ and $T_1$ and tuning parameter $\alpha$ ;
96
+
97
+ Ensure: a ranking of items for each session $s$ ;
98
+
99
+ 1: for Each session $s$ with item set $\mathcal{I}_s$ do
100
+ 2: Get a ranking of all items $\{R_0(i,\mathcal{I}_s)\}$ according to $T_{0}$
101
+ 3: Construct $P_0^*$ by randomly selecting producers from $P_0$ with probability $\alpha$ ;
102
+ 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;
103
+ 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}^{*}$
104
+ 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}$ ;
105
+ 7: Compute the following rank-based score
106
+
107
+ $$
108
+ \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} \}};
109
+ $$
110
+
111
+ 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;
112
+
113
+ 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).
114
+
115
+ ![](images/1ace278070947d9b55af5f98eefb4febe43bd2cdf0b9848f3d655d827b56347d.jpg)
116
+ (i) A pair of counterfactual rankings
117
+ (ii) $\alpha = 0.5$ $\mathsf{P}_{\cdot 0}^{\star} = \{2,3\}$ $\mathsf{L} = \{2,3,5,6,7,8\}$
118
+ (iii) Rank-score of L
119
+ (iv) Unified (v) ranking in ra
120
+ (v) Final ranking
121
+ (1) Unrealizable pair of counterfactual rankings
122
+ (ii) $\alpha = 0$
123
+ (iii) $\alpha = 0.5$
124
+ (iv) $\alpha = 1$
125
+
126
+ (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}$ .
127
+
128
+ (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.
129
+
130
+ 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}$ .
131
+
132
+ # 3.2 Handling multiple treatments
133
+
134
+ 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$ .
135
+
136
+ 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$ .
137
+
138
+ 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}$ .
139
+
140
+ 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.
141
+
142
+ # 3.3 Theoretical results
143
+
144
+ 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.
145
+
146
+ 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}$
147
+
148
+ $$
149
+ \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}
150
+ $$
151
+
152
+ 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.
153
+
154
+ 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
155
+
156
+ 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
157
+ 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))$
158
+
159
+ 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.
160
+
161
+ 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
162
+
163
+ $$
164
+ 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} ^ {*})
165
+ $$
166
+
167
+ 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.
168
+
169
+ # 4 Empirical Evaluation
170
+
171
+ 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.
172
+
173
+ 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.
174
+
175
+ # 4.1 Impact of $\alpha$
176
+
177
+ 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
178
+
179
+ ![](images/2e860f1f5d7495c4431a93563a97e27fb1f495604c3851bc0b2703273756c24a.jpg)
180
+ (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.
181
+
182
+ ![](images/eae7ae66233276dfae66db3a461a0a16dad99fce0c4baf4c23296f3d67ea1d3b.jpg)
183
+ (3b) Cost vs. (in)accuracy trade-off at different treatment proportions (TP).
184
+
185
+ 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).
186
+
187
+ 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$ .
188
+
189
+ # 4.2 Comparison with existing methods
190
+
191
+ 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.
192
+
193
+ 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\}}$ .
194
+
195
+ 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:
196
+
197
+ $$
198
+ \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\},
199
+ $$
200
+
201
+ 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.
202
+
203
+ ![](images/7cd1930203c1010454dda39942f98338092efc041dfd0a0d95ee04d3a49a7468.jpg)
204
+ (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.
205
+
206
+ ![](images/d793caa8a0712f0c7744696e48dc92e7354e1a878590fec5dc0b0c99932cd0aa.jpg)
207
+ (4b) Hypothetical cost based on Definition2 for treatment proportion (TP) equals 0.1 and 0.5.
208
+
209
+ 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)$ .
210
+
211
+ # 4.3 Social Network application
212
+
213
+ 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)
214
+
215
+ 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.
216
+
217
+ 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).
218
+
219
+ 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$ .
220
+
221
+ <table><tr><td>Metrics</td><td>Delta % (candidate generation)</td><td>Delta % (ranking model)</td></tr><tr><td>Weekly Active Unique users</td><td>+0.51%</td><td>+0.13%</td></tr><tr><td>Sessions</td><td>+0.57%</td><td>+0.11%</td></tr></table>
222
+
223
+ 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$ .
224
+
225
+ 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}$ .
226
+
227
+ 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.
228
+
229
+ 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
230
+
231
+ 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.
232
+
233
+ # 5 Discussion
234
+
235
+ 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]).
236
+
237
+ 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.
238
+
239
+ 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.
240
+
241
+ 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).
242
+
243
+ 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).
244
+
245
+ # 6 Acknowledgment
246
+
247
+ 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.
248
+
249
+ 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.
250
+
251
+ # References
252
+
253
+ [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.
254
+ [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.
255
+ [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.
256
+ [4] P. W. Holland. Statistics and causal inference. Journal of the American statistical Association, 81(396):945-960, 1986.
257
+ [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.
258
+ [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.
259
+ [7] M. Liu, J. Mao, and K. Kang. Trustworthy online marketplace experimentation with budget-split design. arXiv preprint arXiv:2012.08724, 2020.
260
+ [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.
261
+ [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.
262
+ [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.
263
+ [11] D. B. Rubin. Estimating causal effects of treatments in randomized and nonrandomized studies. Journal of educational Psychology, 66(5):688, 1974.
264
+ [12] D. B. Rubin. Bayesian inference for causal effects: The role of randomization. The Annals of Statistics, pages 34-58, 1978.
265
+ [13] D. B. Rubin. Formal mode of statistical inference for causal effects. Journal of statistical planning and inference, 25(3):279-292, 1990.
266
+ [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.
267
+ [15] G. Saint-Jacques, M. Varshney, J. Simpson, and Y. Xu. Using ego-clusters to measure network effects at LinkedIn. arXiv: 1903.08755, 2019.
268
+ [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.
269
+ [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.
270
+ [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.
271
+ [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.
272
+
273
+ # 7 Checklist
274
+
275
+ 1(a) Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope?
276
+
277
+ Yes. Please see Sections 3 and 4.
278
+
279
+ 1(b) Have you read the ethics review guidelines and ensured that your paper conforms to them?
280
+
281
+ Yes
282
+
283
+ 1(c) Did you discuss any potential negative societal impacts of your work?
284
+
285
+ N/A
286
+
287
+ 1(d) Did you describe the limitations of your work?
288
+
289
+ Yes. Please see section 5
290
+
291
+ 2(a) Did you state the full set of assumptions of all theoretical results?
292
+
293
+ Yes.
294
+
295
+ 2(b) Did you include complete proofs of all theoretical results?
296
+
297
+ Yes. Please see the Appendix.
298
+
299
+ 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)?
300
+
301
+ Yes. All code, data, and instructions needed to reproduce the main experimental results are given in the supplementary materials.
302
+
303
+ 3(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)?
304
+
305
+ Yes. The details are given in Section 4
306
+
307
+ 3(c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)?
308
+
309
+ Yes. We have shown Box-plots.
310
+
311
+ 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)?
312
+
313
+ Yes. The details are given in Section 4
314
+
315
+ 4(a) If your work uses existing assets, did you cite the creators?
316
+
317
+ N/A.
318
+
319
+ 4(b) Did you mention the license of the assets?
320
+
321
+ N/A.
322
+
323
+ 4(c) Did you include any new assets either in the supplemental material or as a URL?
324
+
325
+ N/A
326
+
327
+ 4(d) Did you discuss whether and how consent was obtained from people whose data you're using/curating?
328
+
329
+ N/A.
330
+
331
+ 4(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content?
332
+
333
+ N/A.
334
+
335
+ 5(a) Did you include the full text of instructions given to participants and screenshots, if applicable?
336
+
337
+ N/A.
338
+
339
+ 5(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable?
340
+
341
+ N/A.
342
+
343
+ 5(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation?
344
+
345
+ N/A.
abtestingforrecommendersystemsinatwosidedmarketplace/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e29ac37a806ddcf6bd4b4fac393188042e4d0c582b2f3c05329f780dda4c20ec
3
+ size 305349
abtestingforrecommendersystemsinatwosidedmarketplace/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:012c2d11242e06b9a79bc485ad85a5aaef3346eb803a9838db8de194a24aab80
3
+ size 594029
acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/e7d48d0a-77c0-4d72-89c3-125c14933553_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e9e467b6a402005746db7efe4b596e982e57e4cd5d79cdd5a573df2dab4d858e
3
+ size 85249
acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/e7d48d0a-77c0-4d72-89c3-125c14933553_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cf55723d8ef68f03ab975b752adda5281c225b3c7e953df2c8e1db0e4c79652a
3
+ size 105236
acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/e7d48d0a-77c0-4d72-89c3-125c14933553_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:161ed9410f4453f3fdd9a7d894036723f3b73f07a42d83e0239676440b533cc4
3
+ size 542095
acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/full.md ADDED
@@ -0,0 +1,294 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AC/DC: Alternating Compressed/DeCompressed Training of Deep Neural Networks
2
+
3
+ Alexandra Peste * IST Austria
4
+
5
+ Eugenia Iofinova
6
+ IST Austria
7
+
8
+ Adrian Vladu
9
+ CNRS & IRIF
10
+
11
+ Dan Alistarh
12
+ IST Austria & Neural Magic
13
+
14
+ # Abstract
15
+
16
+ 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.
17
+
18
+ # 1 Introduction
19
+
20
+ 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].
21
+
22
+ 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.
23
+
24
+ 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].
25
+
26
+ 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
27
+
28
+ 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.
29
+
30
+ 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.
31
+
32
+ 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.
33
+
34
+ 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.
35
+
36
+ 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.
37
+
38
+ 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].
39
+
40
+ 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
41
+
42
+ 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.
43
+
44
+ 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.
45
+
46
+ # 2 Related Work
47
+
48
+ 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.
49
+
50
+ 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.
51
+
52
+ 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.
53
+
54
+ 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.
55
+
56
+ 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,
57
+
58
+ 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].
59
+
60
+ 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.
61
+
62
+ 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.
63
+
64
+ # 3 Alternating Compressed / DeCompressed (AC/DC) Training
65
+
66
+ # 3.1 Background and Assumptions
67
+
68
+ 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:
69
+
70
+ $$
71
+ \min _ {\theta \in \mathbb {R} ^ {N}} f (\theta) \quad \text {s . t .} \quad \| \theta \| _ {0} \leq k. \tag {1}
72
+ $$
73
+
74
+ 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:
75
+
76
+ $$
77
+ \theta_ {t + 1} = T _ {k} \left(\theta_ {t} - \eta \nabla f \left(\theta_ {t}\right)\right). \tag {2}
78
+ $$
79
+
80
+ 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.
81
+
82
+ 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:
83
+
84
+ $$
85
+ \theta_ {t + 1} = T _ {k} \left(\theta_ {t} - \eta g _ {\theta_ {t}}\right). \tag {3}
86
+ $$
87
+
88
+ 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.
89
+
90
+ Analytical Assumptions. Formally, our analysis uses the following assumptions on $f$ .
91
+
92
+ ![](images/c8dd9e08112281a2e3b2a6bdab1a044ebbed46f3ce81012f65fd8223057a8be3.jpg)
93
+ 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.
94
+
95
+ 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$ .
96
+ 2) Existence of a $k^*$ -sparse minimizer $\theta^{*}\colon \exists \theta^{*}\in \arg \min_{\theta}f(\theta)$ , s.t. $\| \theta^{*}\|_{0}\leq k^{*}$ .
97
+ 3) For $\beta > 0$ , the $\beta$ -smoothness condition when restricted to $t$ coordinates $((t, \beta)$ -smoothness):
98
+
99
+ $$
100
+ 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}
101
+ $$
102
+
103
+ 4) For $\alpha > 0$ and number of indices $r$ , the $r$ -concentrated Polyak-Lojasiewicz $((r, \alpha)$ -CPL condition:
104
+
105
+ $$
106
+ \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}
107
+ $$
108
+
109
+ 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.
110
+
111
+ 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].
112
+
113
+ We are now ready to state our main analytical result.
114
+
115
+ 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
116
+
117
+ $$
118
+ \mathbb {E} \left[ f \left(\theta\right) - f \left(\theta^ {*}\right) \right] \leq \epsilon + \frac {1 6 \sigma^ {2}}{\alpha}.
119
+ $$
120
+
121
+ 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.
122
+
123
+ Algorithm 1 Alternating Compressed/Decompressed (AC/DC) Training
124
+ Require: Weights $\theta \in \mathbb{R}^N$ , data $S$ , sparsity $k$ , compression phases $\mathcal{C}$ , decompression phases $\mathcal{D}$
125
+ 1: Train the weights $\theta$ for $\Delta_w$ epochs
126
+ 2: while epoch $\leq$ max epochs do
127
+ 3: if entered a compression phase then
128
+ 4: $\theta \gets T_k(\theta, k)$
129
+ 5: $m \gets 11[\theta_i \neq 0]$
130
+ 6: end if
131
+ 7: if entered a decompression phase then
132
+ 8: $m \gets 11_N$
133
+ 9: end if
134
+ 10: $\theta \gets \theta \odot m$
135
+ 11: $\tilde{\theta} \gets \{\theta_i | m_i \neq 0, 1 \leq i \leq N\}$
136
+ 12: for x mini-batch in $S$ do
137
+ 13: $\theta \gets \theta - \eta \nabla_{\tilde{\theta}} f(\theta; x)$
138
+ 14: end for
139
+ 15: epoch $\leftarrow$ epoch +1
140
+ 16: end while
141
+ 17: return $\theta$
142
+
143
+ # 3.2 AC/DC: Applying IHT to Deep Neural Networks
144
+
145
+ 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.
146
+
147
+ 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.
148
+
149
+ 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.
150
+
151
+ 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.
152
+
153
+ # 4 Experimental Validation
154
+
155
+ 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.
156
+
157
+ 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].
158
+
159
+ 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.
160
+
161
+ Table 1: ResNet50/ImageNet, medium sparsity results.
162
+
163
+ <table><tr><td>Method</td><td>Sparsity (%)</td><td>Top-1 Acc. (%)</td><td>GFLOPs Inference</td><td>EFLOPs Train</td></tr><tr><td>Dense</td><td>0</td><td>76.84</td><td>8.2</td><td>3.14</td></tr><tr><td>\( AC/DC \)</td><td>80</td><td>76.3 ± 0.1</td><td>0.29×</td><td>0.65×</td></tr><tr><td>\( RigL_{1×} \)</td><td>80</td><td>74.6 ± 0.06</td><td>0.23×</td><td>0.23×</td></tr><tr><td>\( RigL_{1×} (ERK) \)</td><td>80</td><td>75.1 ± 0.05</td><td>0.42×</td><td>0.42×</td></tr><tr><td>Top-KAST</td><td>80 fwd, 50 bwd</td><td>75.03</td><td>0.23×</td><td>0.32×</td></tr><tr><td>STR</td><td>79.55</td><td>76.19</td><td>0.19×</td><td>-</td></tr><tr><td>WoodFisher</td><td>80</td><td>76.76</td><td>0.25×</td><td>-</td></tr><tr><td>\( AC/DC \)</td><td>90</td><td>75.03 ± 0.1</td><td>0.18×</td><td>0.58×</td></tr><tr><td>\( RigL_{1×} \)</td><td>90</td><td>72.0 ± 0.05</td><td>0.13×</td><td>0.13×</td></tr><tr><td>\( RigL_{1×} (ERK) \)</td><td>90</td><td>73.0 ± 0.04</td><td>0.24×</td><td>0.25×</td></tr><tr><td>Top-KAST</td><td>90 fwd, 80 bwd</td><td>74.76</td><td>0.13×</td><td>0.16×</td></tr><tr><td>STR</td><td>90.23</td><td>74.31</td><td>0.08×</td><td>-</td></tr><tr><td>WoodFisher</td><td>90</td><td>75.21</td><td>0.15×</td><td>-</td></tr></table>
164
+
165
+ Table 2: ResNet50/ImageNet, high sparsity results.
166
+
167
+ <table><tr><td>Method</td><td>Sparsity (%)</td><td>Top-1 Acc. (%)</td><td>GFLOPs Inference</td><td>EFLOPs Train</td></tr><tr><td>Dense</td><td>0</td><td>76.84</td><td>8.2</td><td>3.14</td></tr><tr><td>\( AC/DC \)</td><td>95</td><td>73.14 ± 0.2</td><td>0.11×</td><td>0.53×</td></tr><tr><td>\( RigL_{1×} \)</td><td>95</td><td>67.5 ± 0.1</td><td>0.08×</td><td>0.08×</td></tr><tr><td>\( RigL_{1×} (ERK) \)</td><td>95</td><td>69.7 ± 0.17</td><td>0.12×</td><td>0.13×</td></tr><tr><td>Top-KAST</td><td>95 fwd, 50 bwd</td><td>71.96</td><td>0.08×</td><td>0.22×</td></tr><tr><td>STR</td><td>94.8</td><td>70.97</td><td>0.04×</td><td>-</td></tr><tr><td>WoodFisher</td><td>95</td><td>72.12</td><td>0.09×</td><td>-</td></tr><tr><td>\( AC/DC \)</td><td>98</td><td>68.44 ± 0.09</td><td>0.06×</td><td>0.46×</td></tr><tr><td>Top-KAST</td><td>98 fwd, 90 bwd</td><td>67.06</td><td>0.05×</td><td>0.08×</td></tr><tr><td>STR</td><td>97.78</td><td>62.84</td><td>0.02×</td><td>-</td></tr><tr><td>WoodFisher</td><td>98</td><td>65.55</td><td>0.05×</td><td>-</td></tr></table>
168
+
169
+ 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.
170
+
171
+ 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,
172
+
173
+ 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).
174
+ ![](images/7aeee93635e16696095026d90a4aa0e602b0e332ef81b2790fb25c9dd3872a5a.jpg)
175
+ (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).
176
+
177
+ ![](images/55811c40df9e67abc8607954d896266cebbe4f56db1b03d427829c7bb0330a29.jpg)
178
+
179
+ 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.
180
+
181
+ 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.
182
+
183
+ 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.
184
+
185
+ 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.
186
+
187
+ 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
188
+
189
+ ![](images/553c4844f9d475128ea17179d842f21cca85ad702a5277c759926334f941cf21.jpg)
190
+ 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).
191
+
192
+ ![](images/ca758f3724162aaca00605d0d2081536fcc32e1921e8d130e2a6618ce9febca5.jpg)
193
+
194
+ 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.
195
+
196
+ 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.
197
+
198
+ Table 3: MobileNetV1/ImageNet sparsity results
199
+
200
+ <table><tr><td>Method</td><td>Sparsity (%)</td><td>Top-1 Acc. (%)</td><td>GFLOPs Inference</td><td>EFLOPs Train</td></tr><tr><td>Dense</td><td>0</td><td>71.78</td><td>1.1</td><td>0.44</td></tr><tr><td>AC/DC</td><td>75</td><td>70.3 ± 0.07</td><td>0.34×</td><td>0.64×</td></tr><tr><td>RigL1× (ERK)</td><td>75</td><td>68.39</td><td>0.52×</td><td>0.53×</td></tr><tr><td>STR</td><td>75.28</td><td>68.35</td><td>0.18×</td><td>-</td></tr><tr><td>WoodFisher</td><td>75.28</td><td>70.09</td><td>0.28×</td><td>-</td></tr><tr><td>AC/DC</td><td>90</td><td>66.08 ± 0.09</td><td>0.18×</td><td>0.56×</td></tr><tr><td>RigL1× (ERK)</td><td>90</td><td>63.58</td><td>0.27×</td><td>0.29×</td></tr><tr><td>STR</td><td>89.01</td><td>62.1</td><td>0.07×</td><td>-</td></tr><tr><td>WoodFisher</td><td>89</td><td>63.87</td><td>-</td><td>-</td></tr></table>
201
+
202
+ Table 4: Transformer-XL/WikiText sparsity results
203
+
204
+ <table><tr><td>Method</td><td>Sparsity (%)</td><td>Perplexity Sparse</td><td>Perplexity Dense</td><td>Perplexity Finetuned Dense</td></tr><tr><td>Dense</td><td>0</td><td>-</td><td>18.95</td><td>-</td></tr><tr><td>AC/DC</td><td>80</td><td>20.65</td><td>20.24</td><td>19.54</td></tr><tr><td>AC/DC</td><td>80, 50 embed.</td><td>20.83</td><td>20.25</td><td>19.68</td></tr><tr><td>Top-KAST</td><td>80, 0 bwd</td><td>19.8</td><td>-</td><td>-</td></tr><tr><td>Top-KAST</td><td>80, 60 bwd</td><td>21.3</td><td>-</td><td>-</td></tr><tr><td>AC/DC</td><td>90</td><td>22.32</td><td>21.0</td><td>20.28</td></tr><tr><td>AC/DC</td><td>90, 50 embed.</td><td>22.84</td><td>21.34</td><td>20.41</td></tr><tr><td>Top-KAST</td><td>90, 80 bwd</td><td>25.1</td><td>-</td><td>-</td></tr></table>
205
+
206
+ 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].
207
+
208
+ 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
209
+
210
+ 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.
211
+
212
+ 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.
213
+
214
+ 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.
215
+
216
+ 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.
217
+
218
+ # 5 Conclusion, Limitations, and Future Work
219
+
220
+ 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.
221
+
222
+ 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].
223
+
224
+ # Acknowledgments and Disclosure of Funding
225
+
226
+ 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.
227
+
228
+ # References
229
+
230
+ [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.
231
+ [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.
232
+ [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.
233
+ [4] Guillaume Bellec, David Kappel, Wolfgang Maass, and Robert Legenstein. Deep rewiring: Training very sparse deep networks. International Conference on Learning Representations (ICLR), 2018.
234
+ [5] Lukas Biewald. Experiment Tracking with Weights and Biases, 2020. Software available from wandb.com.
235
+ [6] Thomas Blumensath and Mike E Davies. Iterative thresholding for sparse approximations. Journal of Fourier analysis and Applications, 14(5-6):629-654, 2008.
236
+ [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.
237
+ [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.
238
+ [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.
239
+ [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.
240
+ [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.
241
+ [12] DeepSparse. NeuralMagic DeepSparse Inference Engine, 2021.
242
+ [13] Tim Dettmers and Luke Zettlemoyer. Sparse networks from scratch: Faster training without losing performance. arXiv preprint arXiv:1907.04840, 2019.
243
+ [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.
244
+ [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.
245
+ [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.
246
+ [17] Simon Foucart. Hard thresholding pursuit: an algorithm for compressive sensing. SIAM Journal on Numerical Analysis, 49(6):2543-2563, 2011.
247
+
248
+ [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.
249
+ [19] Jonathan Frankle and Michael Carbin. The lottery ticket hypothesis: Finding sparse, trainable neural networks. In International Conference on Learning Representations (ICLR), 2019.
250
+ [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.
251
+ [21] Trevor Gale, Erich Elsen, and Sara Hooker. The state of sparsity in deep neural networks. arXiv preprint arXiv:1902.09574, 2019.
252
+ [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.
253
+ [23] Graphcore. Graphcore Poplar SDK 2.0, 2021.
254
+ [24] Masafumi Hagiwara. A simple and effective method for removal of hidden units and weights. Neurocomputing, 6(2):207 - 218, 1994. Backpropagation, Part IV.
255
+ [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.
256
+ [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.
257
+ [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.
258
+ [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.
259
+ [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.
260
+ [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.
261
+ [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.
262
+ [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.
263
+ [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.
264
+ [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.
265
+ [35] Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. International Conference on Learning Representations (ICLR), 2015.
266
+ [36] Alex Krizhevsky, Geoffrey Hinton, et al. Learning multiple layers of features from tiny images. 2009.
267
+ [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.
268
+ [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.
269
+
270
+ [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.
271
+ [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.
272
+ [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.
273
+ [42] Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. arXiv preprint arXiv:1609.07843, 2016.
274
+ [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.
275
+ [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.
276
+ [45] Amirkeivan Mohtashami, Martin Jaggi, and Sebastian U Stich. Simultaneous training of partially masked neural networks. arXiv preprint arXiv:2106.08895, 2021.
277
+ [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.
278
+ [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.
279
+ [48] Ning Qian. On the momentum term in gradient descent learning algorithms. Neural networks, 12(1):145-151, 1999.
280
+ [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.
281
+ [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.
282
+ [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.
283
+ [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.
284
+ [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.
285
+ [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.
286
+ [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.
287
+ [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.
288
+ [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.
289
+
290
+ [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.
291
+ [59] Sergey Zagoruyko and Nikos Komodakis. Wide residual networks. In British Machine Vision Conference (BMVC). British Machine Vision Association, 2016.
292
+ [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.
293
+ [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.
294
+ [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.
acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:07bd084f82669e936b23a66692ce5bf1534d5cc0045048ba53435020d1c07071
3
+ size 228434
acdcalternatingcompresseddecompressedtrainingofdeepneuralnetworks/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7e486b38f76115acd02560f1256e5d32cdf25703f0240fcd73afd8e1ff371350
3
+ size 435870
acgclossyactivationcompressionwithguaranteedconvergence/cdea0826-f065-4d36-aab4-fb57bd5292fa_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d687b5566845e53e581ecc1da781809c5a156448e454560a10785b39e2719c36
3
+ size 90038
acgclossyactivationcompressionwithguaranteedconvergence/cdea0826-f065-4d36-aab4-fb57bd5292fa_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:0b432bd02e1287e1457a6c29a121bf1aa25fe7795370507451d529eb54fcef10
3
+ size 114861
acgclossyactivationcompressionwithguaranteedconvergence/cdea0826-f065-4d36-aab4-fb57bd5292fa_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:40057e83cdb84dfb3a1daeca7d35c41094961bd554318a910b03d2768b034798
3
+ size 609967
acgclossyactivationcompressionwithguaranteedconvergence/full.md ADDED
@@ -0,0 +1,373 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # AC-GC: Lossy Activation Compression with Guaranteed Convergence
2
+
3
+ R. David Evans
4
+
5
+ Dept. of Electrical and Computer Engineering
6
+
7
+ University of British Columbia
8
+
9
+ Vancouver, BC V6T 1Z4
10
+
11
+ rdevans@ece.ubc.ca
12
+
13
+ Tor M. Aamodt
14
+
15
+ Dept. of Electrical and Computer Engineering
16
+
17
+ University of British Columbia
18
+
19
+ Vancouver, BC V6T 1Z4
20
+
21
+ aamodt@ece.ubc.ca
22
+
23
+ # Abstract
24
+
25
+ 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.
26
+
27
+ # 1 Introduction
28
+
29
+ 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].
30
+
31
+ 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
32
+
33
+ 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.
34
+
35
+ 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
36
+
37
+ 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
38
+
39
+ ![](images/8e4c354748e2fb67983d285a1961c3079b7f65732431a2d292bf24c240503ba5.jpg)
40
+ Figure 1: Activation compression rate search cost for ImageNet/ResNet50 [20]. Each box indicates a different compression from 1- to 16-bit fixpoint.
41
+
42
+ 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.
43
+
44
+ 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:
45
+
46
+ - We prove convergence bounds on SGD under error bounded activation compression with weak assumptions on convexity.
47
+ - We express activation compression and convergence as a constrained optimization problem and analyze the activation error tolerance of common DNN layers within this framework.
48
+ - 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.
49
+
50
+ # 2 Preliminaries
51
+
52
+ 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
53
+
54
+ $$
55
+ \mathcal {L} (\theta) = \sum_ {n} f \left(\theta , X _ {n}\right) \tag {1}
56
+ $$
57
+
58
+ where $f$ represents the loss of one example input $X_{n}$ with weights $\theta$ .
59
+
60
+ Stochastic Gradient Descent (SGD) is typically used to optimize these finite sums, using the iteration
61
+
62
+ $$
63
+ \theta^ {(t + 1)} = \theta^ {(t)} - \alpha \nabla_ {\theta} f \left(\theta^ {(t)}, X _ {n _ {t}}\right) \tag {2}
64
+ $$
65
+
66
+ 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)})$ .
67
+
68
+ 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
69
+
70
+ ![](images/7be896ac65bd5ae6bcb8645a39d5b8c81d4f4f588b55e1105bb31754f7ebac6b.jpg)
71
+ 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.
72
+
73
+ ![](images/0b04abb08cedc3b1deb02f545bae46a68327253f6785888462c310dc1b1d96f0.jpg)
74
+ a) Direct activation storage
75
+
76
+ ![](images/978464c0c0c44576ec2488fd2d9c0ec704966904d5906a70175a21396b10621c.jpg)
77
+ b) With activation compression
78
+
79
+ 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.
80
+
81
+ 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.
82
+
83
+ 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))$ .
84
+
85
+ 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)$ .
86
+
87
+ # 3 Guaranteed Convergence
88
+
89
+ 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
90
+
91
+ $$
92
+ b \geq - \log_ {2} | \Delta x _ {n c h w} | + \dots \tag {3}
93
+ $$
94
+
95
+ ![](images/3bb6e4868d40c62505c1d6af4ef6d52d235c1e59ca51358b4f6c6e6708dbf722.jpg)
96
+ 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).
97
+
98
+ ![](images/9eef9a163a2fc789dc118508cceefb5ffd6dcd5c42b83dfd814b21334e51d415.jpg)
99
+
100
+ ![](images/7ab845628c447bfdfb08b2ebf9c9f5fd9ecb6c861e88843548a23a7202e10685.jpg)
101
+
102
+ ![](images/e82dfcddbed3d8f8fe67ea8372a4172edf24ee60a0c718037e204595fdf50cbf.jpg)
103
+
104
+ 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).
105
+
106
+ # 3.1 SGD Convergence
107
+
108
+ 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
109
+
110
+ $$
111
+ \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}
112
+ $$
113
+
114
+ 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$ .
115
+
116
+ 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].
117
+
118
+ # 3.2 Compressed Convergence
119
+
120
+ 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$ .
121
+
122
+ 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.
123
+
124
+ 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
125
+
126
+ ![](images/3b9f35e0c2105c9561b36841f62a6c83f408303df524bf4a717d731c79a2a32d.jpg)
127
+ 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$ .
128
+
129
+ ![](images/7270c4fcd13becd2baa9aca9977fd940a5a6b6241b33ccafaee123c3d6ed2396.jpg)
130
+
131
+ 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.
132
+
133
+ 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$ :
134
+
135
+ $$
136
+ \left\| \Delta \nabla_ {\theta} f (\theta , X) \right\| ^ {2} \leq D (\Delta X) \tag {5}
137
+ $$
138
+
139
+ then any activation error $\Delta X^{(*)}$ where $D(\Delta X^{(*)})\leq e^{2}V^{2}$ satisfies
140
+
141
+ $$
142
+ \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}
143
+ $$
144
+
145
+ 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$ .
146
+
147
+ Proof: See Appendix A.
148
+
149
+ 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.
150
+
151
+ # 4 Framework for Activation Compression
152
+
153
+ 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
154
+
155
+ $$
156
+ \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}
157
+ $$
158
+
159
+ $$
160
+ \text {w h e r e} D (\Delta X) \geq \| \Delta \nabla_ {\theta} f (\theta , X) \| ^ {2} \tag {8}
161
+ $$
162
+
163
+ 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).
164
+
165
+ 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).
166
+
167
+ 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.
168
+
169
+ $$
170
+ B (\Delta X) := \sum_ {n, c, h, w} ^ {N, C, H, W} \log | \Delta x _ {n c h w} | \tag {9}
171
+ $$
172
+
173
+ To derive AC-GC error bounds for DNN layers not presented in this work, one can:
174
+
175
+ 1. Derive $\| \Delta \nabla_{\theta}f(\theta ,X)\| ^2$ for the layer type
176
+ 2. Choose a suitable convex bounding function, $D(\Delta X)\geq \| \Delta \nabla_{\theta}f(\theta ,X)\| ^2$
177
+ 3. Obtain the maximum error $\Delta X^{(*)}$ by solving (7) using the method of Lagrange multipliers
178
+
179
+ 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$ .
180
+
181
+ 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.
182
+
183
+ 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)$ .
184
+
185
+ 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]).
186
+
187
+ 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
188
+
189
+ $$
190
+ \left\| \Delta \nabla_ {X} f \right\| ^ {2} \leq e ^ {2} V ^ {2} \tag {10}
191
+ $$
192
+
193
+ 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.
194
+
195
+ Layer Normalization: This layer type is similar to batch normalization and requires a similar set of assumptions and derivations (Appendix B).
196
+
197
+ 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.
198
+
199
+ 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$
200
+
201
+ <table><tr><td>QUANTITY</td><td>A) FULLY CONNECTED</td><td>B) CONVOLUTION</td><td>C) BATCHNORMALIZATION</td></tr><tr><td>D(ΔX):=</td><td>||∇Yf||2||ΔX||2</td><td>RS/T2||∇Yf||2||ΔX||2</td><td>∑2γc2gc2/M2σc4Δxchw</td></tr><tr><td>Δxnchw=(*)2</td><td>e2V2/2NC||∇Yf||2</td><td>e2V2T2/2RSMC||∇Yf||2</td><td>e2V2Mσc4/Cγc2gc2</td></tr></table>
202
+
203
+ # 5 Practical Automatic Lossy Compression
204
+
205
+ 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.
206
+
207
+ 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
208
+
209
+ $$
210
+ b \geq - \log_ {2} | \Delta x _ {n c h w} | + \dots = - \log_ {2} | e | - \log_ {2} \| \nabla_ {\theta} f \| + \dots \tag {11}
211
+ $$
212
+
213
+ 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.
214
+
215
+ 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).
216
+
217
+ # 6 Evaluation
218
+
219
+ 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.
220
+
221
+ 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]).
222
+
223
+ ![](images/d3b388d28a0592aeecc072ede8985dd538ff0e497a8bf44483f55a7869d70dcb.jpg)
224
+ 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.
225
+
226
+ 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.
227
+
228
+ # 6.1 Parameter Sensitivity
229
+
230
+ 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.
231
+
232
+ 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.
233
+
234
+ 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).
235
+
236
+ # 6.2 CIFAR10, Div2K and IMDB
237
+
238
+ 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
239
+
240
+ 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.
241
+
242
+ <table><tr><td>MODEL</td><td>BASE</td><td>AUTO QUANTZ</td><td>AUTO CUSZ</td><td>AUTO JPEGZ</td><td>JPEG- ACT[14]</td><td>GRID QUANTZ</td></tr><tr><td colspan="7">CIFAR10 % TOP-1 TEST ACCURACY</td></tr><tr><td>VGG</td><td>93.6</td><td>93.5 (7.4×)</td><td>93.5 (9.4×)</td><td>92.9 (12.5×)</td><td>92.4 (11.9×)</td><td>93.5 (6.3×)</td></tr><tr><td>RN50</td><td>94.9</td><td>95.0 (4.2×)</td><td>94.7 (15.5×)</td><td>94.3 (9.2×)</td><td>94.4 (7.5×)</td><td>95.0 (5.7×)</td></tr><tr><td>WRN</td><td>95.8</td><td>95.9 (6.5×)</td><td>95.8 (14.6×)</td><td>95.3 (11.7×)</td><td>94.2 (10.9×)</td><td>96.0 (7.6×)</td></tr><tr><td colspan="7">DIV2K BEST VAL. PSNR</td></tr><tr><td>VDSR</td><td>36.1</td><td>36.1 (5.1×)</td><td>35.8 (25.2×)</td><td>36.1 (7.9×)</td><td>35.4 (9.1×)</td><td>36.0 (6.7×)</td></tr><tr><td colspan="7">IMDB % BEST VAL. ACCURACY</td></tr><tr><td>CNN</td><td>61.4</td><td>61.6 (12.2×)</td><td>61.8 (19.3×)</td><td>61.4 (11.2×)</td><td>N/A</td><td>61.7 (16.5×)</td></tr><tr><td>LSTM</td><td>60.3</td><td>60.1 (10.0×)</td><td>60.9 (8.8×)</td><td>N/A</td><td>N/A</td><td>60.4 (14.7×)</td></tr><tr><td colspan="7">TEXT COPY % BEST TEST ACCURACY</td></tr><tr><td>TRANS</td><td>98.8</td><td>98.6 (7.1×)</td><td>98.3 (12.7×)</td><td>N/A</td><td>N/A</td><td>98.9 (5.1×)</td></tr><tr><td colspan="7">IMAGENET % TOP-1 CENTER CROP VAL. ACCURACY</td></tr><tr><td>RN18</td><td>68.6</td><td>68.5 (4.2×)</td><td>68.1 (6.8×)</td><td>68.1 (8.1×)</td><td>67.3 (7.2×)</td><td>68.5 (2.9×)</td></tr><tr><td>RN50</td><td>72.3</td><td>72.7 (4.8×)</td><td>72.5 (10.1×)</td><td>71.5 (8.5×)</td><td>71.6 (5.9×)</td><td>72.5 (4.9×)</td></tr><tr><td colspan="7">AVERAGE %-POINT CHANGE AND COMPRESSION RATIO</td></tr><tr><td>ALL</td><td>0</td><td>+0.0 (7.5×)</td><td>-0.1 (15.1×)</td><td>-0.6 (10.5×)</td><td>-1.0 (7.4×)</td><td>+0.1 (7.8×)</td></tr></table>
243
+
244
+ 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.
245
+
246
+ # 6.3 ImageNet
247
+
248
+ 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.
249
+
250
+ # 6.4 Overheads
251
+
252
+ 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).
253
+
254
+ 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.
255
+
256
+ <table><tr><td></td><td>AUTO CUSZ</td><td>WAGE [57]</td><td>BAA* [6]</td><td>JPEG- ACT[14]</td><td>ULP [51]</td><td>EBC [27]</td><td>ACTNN -L3[7]</td></tr><tr><td>DATASET</td><td>IN</td><td>C10</td><td>IN</td><td>IN</td><td>IN</td><td>IN</td><td>IN</td></tr><tr><td>MODEL</td><td>RN50</td><td>VGG16</td><td>RN152</td><td>RN50</td><td>RN50</td><td>RN50</td><td>RN152</td></tr><tr><td>METHOD</td><td>AUTO</td><td>8-BIT</td><td>4-BIT</td><td>JPEG</td><td>4-BIT</td><td>CUSZ</td><td>2-BIT</td></tr><tr><td></td><td>-CUSZ</td><td></td><td>+RECALC.</td><td>+ZVC</td><td></td><td></td><td>MIX. PREC.</td></tr><tr><td>Acc. (%)</td><td>-0.2±0.2</td><td>-0.3</td><td>-0.5</td><td>-0.1</td><td>-0.3</td><td>-0.9</td><td>-0.2</td></tr><tr><td>COMPR.</td><td>10.1×</td><td>4×</td><td>8×</td><td>5.9×</td><td>8×</td><td>11.0×</td><td>12×</td></tr></table>
257
+
258
+ # 7 Related Works
259
+
260
+ 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.
261
+
262
+ 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.
263
+
264
+ 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.
265
+
266
+ # 8 Conclusions
267
+
268
+ 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.
269
+
270
+ # Funding Transparency Statement
271
+
272
+ 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.
273
+
274
+ # References
275
+
276
+ [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.
277
+ [2] Alex Krizhevsky and Geoffrey Hinton. Learning Multiple Layers of Features from Tiny Images. PhD thesis, University of Toronto, Toronto, Canada, 2009.
278
+ [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.
279
+ [4] Bartz, C. chainer-transformer. https://github.com/Bartzi/chainer-transformer/blob/master/LIC ENSE, January 2021.
280
+ [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.
281
+ [6] Chakrabarti, A. and Moseley, B. Backprop with Approximate Activations for Memory-efficient Network Training. Advances in Neural Information Processing Systems, 32, 2019.
282
+ [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.
283
+ [8] Chen, T., Xu, B., Zhang, C., and Guestrin, C. Training Deep Nets with Sublinear Memory Cost. arXiv:1604.06174 [cs], April 2016.
284
+ [9] Courbariaux, M., Bengio, Y., and David, J.-P. Training deep neural networks with low precision multiplications. arXiv:1412.7024 [cs], December 2014.
285
+ [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.
286
+ [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.
287
+ [12] DeVries, T. and Taylor, G. W. Improved Regularization of Convolutional Neural Networks with Cutout. arXiv:1708.04552 [cs], November 2017.
288
+ [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.
289
+ [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.
290
+ [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.
291
+
292
+ [16] Frankle, J. and Carbin, M. The Lottery Ticket Hypothesis: Finding Sparse, Trainable Neural Networks. arXiv:1803.03635 [cs], March 2019.
293
+ [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.
294
+ [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.
295
+ [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.
296
+ [20] He, K., Zhang, X., Ren, S., and Sun, J. Deep Residual Learning for Image Recognition. arXiv:1512.03385 [cs], December 2015.
297
+ [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.
298
+ [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.
299
+ [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.
300
+ [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.
301
+ [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.
302
+ [26] Jamieson, K. and Talwalkar, A. Non-stochastic Best Arm Identification and Hyperparameter Optimization. arXiv:1502.07943 [cs, stat], February 2015.
303
+ [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.
304
+ [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.
305
+ [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.
306
+ [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.
307
+ [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.
308
+ [32] LeCun, Y. and Cortes, C. MNIST handwritten digit database. http://yann.lecun.com/exdb/mnist/, 2010.
309
+
310
+ [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.
311
+ [34] Li, F., Zhang, B., and Liu, B. Ternary Weight Networks. arXiv:1605.04711 [cs], May 2016.
312
+ [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.
313
+ [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.
314
+ [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.
315
+ [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.
316
+ [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.
317
+ [40] Milne, T. Piecewise Strong Convexity of Neural Networks. Advances in Neural Information Processing Systems, 32:12973-12983, 2019.
318
+ [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.
319
+ [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.
320
+ [43] Raihan, M. A. and Aamodt, T. M. Sparse Weight Activation Training. arXiv:2001.01969 [cs, stat], October 2020.
321
+ [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.
322
+ [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.
323
+ [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.
324
+ [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.
325
+ [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.
326
+ [49] Saito, S. Chainer-cifar10: Various CNN models including for CIFAR10 with Chainer. https://github.com/mitmul/chainer-cifar10, May 2018.
327
+ [50] Simonyan, K. and Zisserman, A. Very Deep Convolutional Networks for Large-Scale Image Recognition. arXiv:1409.1556 [cs], September 2014.
328
+
329
+ [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.
330
+ [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.
331
+ [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.
332
+ [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.
333
+ [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.
334
+ [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.
335
+ [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.
336
+ [58] Wu, W. Reproduce ResNet-v2 (Identity Mappings in Deep Residual Networks) with MXNet. https://github.com/ tornadomeet/ResNet, January 2021.
337
+ [59] Zagoruyko, S. and Komodakis, N. Wide Residual Networks. arXiv:1605.07146 [cs], May 2016.
338
+
339
+ # Checklist
340
+
341
+ 1. For all authors...
342
+
343
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope? [Yes] See Section 6
344
+ (b) Did you describe the limitations of your work? [Yes] See Section 6
345
+ (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.
346
+ (d) Have you read the ethics review guidelines and ensured that your paper conforms to them? [Yes]
347
+
348
+ 2. If you are including theoretical results...
349
+
350
+ (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
351
+ (b) Did you include complete proofs of all theoretical results? [Yes] See Appendix A
352
+
353
+ 3. If you ran experiments...
354
+
355
+ (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
356
+ (b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)? [Yes] See Section 6 and Appendix D
357
+
358
+ (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
359
+ (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.
360
+
361
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
362
+
363
+ (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
364
+ (b) Did you mention the license of the assets? [No] All are public use
365
+ (c) Did you include any new assets either in the supplemental material or as a URL? [No]
366
+ (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
367
+ (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
368
+
369
+ 5. If you used crowdsourcing or conducted research with human subjects...
370
+
371
+ (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
372
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
373
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
acgclossyactivationcompressionwithguaranteedconvergence/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d8680d32c6f6262ed0a2257784ebce74c9981a2308fb2a5cba37579ef6944fa5
3
+ size 428668
acgclossyactivationcompressionwithguaranteedconvergence/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:188edc1dc2cc845fff8dfd5fec50f454706a4d0d0fcfed8f402ab328e1e711f6
3
+ size 514959
afasterdecentralizedalgorithmfornonconvexminimaxproblems/b0e8dcfe-e3b3-40e8-9e3a-9cf865dce49c_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7067c931d64b8502f4e20e97c73b2ab0541f14ea0ea3b00926ab2dc604f7f558
3
+ size 79788
afasterdecentralizedalgorithmfornonconvexminimaxproblems/b0e8dcfe-e3b3-40e8-9e3a-9cf865dce49c_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aa026f039655061e5a5087690f6b76de739bf80be15aeb7a9da3394c8246c3e9
3
+ size 102404
afasterdecentralizedalgorithmfornonconvexminimaxproblems/b0e8dcfe-e3b3-40e8-9e3a-9cf865dce49c_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fb2194fdcc67d00ce5e10370245d959075ac8ae8ca82e75e6e5d0c98e1e789c2
3
+ size 606909
afasterdecentralizedalgorithmfornonconvexminimaxproblems/full.md ADDED
@@ -0,0 +1,361 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # A Faster Decentralized Algorithm for Nonconvex Minimax Problems
2
+
3
+ Wenhan Xian, Feihu Huang, Yanfu Zhang, Heng Huang
4
+
5
+ Electrical and Computer Engineering, University of Pittsburgh, Pittsburgh, PA 15213 wex37@pitt.edu, huangfeihu2018@gmail.com, yaz91@pitt.edu, heng.huang@pitt.edu
6
+
7
+ # Abstract
8
+
9
+ 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.
10
+
11
+ # 1 Introduction
12
+
13
+ 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
14
+
15
+ $$
16
+ \min _ {x \in \mathcal {X}} \max _ {y \in \mathcal {Y}} f (x, y), \tag {1}
17
+ $$
18
+
19
+ 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
20
+
21
+ $$
22
+ \Phi (x) = \max _ {y \in \mathcal {Y}} f (x, y). \tag {2}
23
+ $$
24
+
25
+ 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].
26
+
27
+ 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.
28
+
29
+ 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:
30
+
31
+ $$
32
+ \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}
33
+ $$
34
+
35
+ 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:
36
+
37
+ (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.
38
+ (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.
39
+
40
+ 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.
41
+
42
+ Table 1: Comparison of Related Algorithms for Minimax Optimization
43
+
44
+ <table><tr><td>Name</td><td>SFO</td><td>Decentralized</td><td>Stochastic</td><td>Implementation</td><td>Reference</td></tr><tr><td>SGDA</td><td>O(κ3ε-4)</td><td>×</td><td>✓</td><td>single-loop</td><td>[19]</td></tr><tr><td>SGDmax</td><td>O(κ3ε-4 log(1/ε))</td><td>×</td><td>✓</td><td>double-loop</td><td>[19]</td></tr><tr><td>SREDA</td><td>O(κ3ε-3)</td><td>×</td><td>✓</td><td>double-loop</td><td>[25]</td></tr><tr><td>Acc-MDA</td><td>O(κ3ε-3)</td><td>×</td><td>✓</td><td>single-loop</td><td>[11]</td></tr><tr><td>DPOSG</td><td>O(ε-12)</td><td>✓ (iid)</td><td>✓</td><td>single-loop</td><td>[21]</td></tr><tr><td>GT/DA</td><td>O(Nε-2 log(1/ε))</td><td>✓ (non-iid)</td><td>×</td><td>double-loop</td><td>[41]</td></tr><tr><td>DM-HSGD</td><td>O(κ3ε-3)</td><td>✓ (non-iid)</td><td>✓</td><td>single-loop</td><td>Ours</td></tr></table>
45
+
46
+ # 2 Related Works
47
+
48
+ # 2.1 Centralized Minimax Optimization
49
+
50
+ 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})$ .
51
+
52
+ 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.
53
+
54
+ 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$ .
55
+
56
+ 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.
57
+
58
+ # 2.2 Decentralized Minimax Optimization
59
+
60
+ 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
61
+
62
+ 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.
63
+
64
+ 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})$ .
65
+
66
+ [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.
67
+
68
+ # 3 Proposed New Algorithm
69
+
70
+ # 3.1 Preliminaries
71
+
72
+ 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:
73
+
74
+ $$
75
+ 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}
76
+ $$
77
+
78
+ Note that when $f$ is strongly-concave in $y$ , $\hat{y}_t$ is unique. We also define:
79
+
80
+ $$
81
+ \delta_ {t} = \left\| \hat {y} _ {t} - \bar {y} _ {t} \right\| ^ {2} \tag {5}
82
+ $$
83
+
84
+ 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$ .
85
+
86
+ Mixing matrix $W$ represents the weights of averaging among the communication network topology. It is doubly stochastic which satisfies:
87
+
88
+ $$
89
+ W \mathbf {1} = W ^ {T} \mathbf {1} = \mathbf {1} \tag {6}
90
+ $$
91
+
92
+ We should notice that here matrix $W$ is not assumed to be symmetric so that the communication network is not restricted to undirected graph.
93
+
94
+ # Algorithm 1 DM-HSGD
95
+
96
+ 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$
97
+
98
+ Parameter: stepsize $\eta_{x}$ $\eta_{y}$ weight $\beta_{x},\beta_{y}$ , batch size $b_{0}$ , iteration $T$
99
+
100
+ Output: $\bar{x}_{\zeta}$ , where $\zeta$ is chosen randomly from $\{1,2,\dots,T\}$
101
+
102
+ 1: On i-th node:
103
+ 2: for $t = 0,1,\ldots ,T - 1$ do
104
+ 3: if $t = 0$ then
105
+ 4: $g_{t}^{(i)} = \nabla_{x}F_{i}(x_{t}^{(i)},y_{t}^{(i)};\xi_{x,t}^{(i)})$ $|\xi_{x,t}^{(i)}| = b_0$
106
+ 5: $h_t^{(i)} = \nabla_yF_i(x_t^{(i)},y_t^{(i)};\xi_{y,t}^{(i)})$ $|\xi_{y,t}^{(i)}| = b_0$
107
+ 6: else
108
+ 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)}))$
109
+ 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)}))$
110
+ 9: end if
111
+
112
+ 10: Communicate with neighbors and update gradient estimator as follows
113
+
114
+ 11: $v_{t}^{(i)} = \sum_{j=1}^{n} w_{ij}(v_{t-1}^{(j)} + g_{t}^{(j)} - g_{t-1}^{(j)})$
115
+ 12: $u_{t}^{(i)} = \sum_{j = 1}^{n}w_{ij}(u_{t - 1}^{(j)} + h_{t}^{(j)} - h_{t - 1}^{(j)})$
116
+ 13: Communicate with neighbors and update model parameter as follows
117
+ 14: $x_{t + 1}^{(i)} = \sum_{j = 1}^{n}w_{ij}(x_t^{(j)} - \eta_xv_t^{(j)})$
118
+ 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)})$
119
+ 16: end for
120
+
121
+ # 3.2 Decentralized Minimax Hybrid Stochastic Gradient Descent
122
+
123
+ 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.
124
+
125
+ 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
126
+
127
+ $$
128
+ 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)
129
+ $$
130
+
131
+ 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$ .
132
+
133
+ # 3.3 Discussions on STORM and Gradient Tracking
134
+
135
+ 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,
136
+
137
+ 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.
138
+
139
+ 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:
140
+
141
+ $$
142
+ \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}
143
+ $$
144
+
145
+ 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.
146
+
147
+ 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^{*}$ .
148
+
149
+ 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
150
+
151
+ $$
152
+ W = \left[ \begin{array}{c c} 2 / 3 & 1 / 3 \\ 1 / 3 & 2 / 3 \end{array} \right]
153
+ $$
154
+
155
+ Then we have
156
+
157
+ $$
158
+ 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}
159
+ $$
160
+
161
+ Therefore, $\lim_{t\to \infty}\| p_t - q_t\| = \frac{\eta}{2}\| a - b\|$
162
+
163
+ # 4 Convergence Analysis
164
+
165
+ 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.
166
+
167
+ 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
168
+
169
+ $$
170
+ \| \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})
171
+ $$
172
+
173
+ 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.,
174
+
175
+ $$
176
+ \mathbb {E} \| \nabla F _ {i} (x, y; \xi) - \nabla f _ {i} (x, y) \| ^ {2} \leq \sigma < + \infty
177
+ $$
178
+
179
+ Assumption 3. (Lower Bound). The function $\Phi (\cdot)$ is lower bounded, i.e., $\inf_x\Phi (x) = \Phi^* > - \infty$
180
+
181
+ Assumption 4. (Spectral Gap). The doubly stochastic matrix $W$ satisfies $\| W - \frac{11^T}{n} \|_2 = \lambda \in [0,1)$ .
182
+
183
+ 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
184
+
185
+ $$
186
+ 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}
187
+ $$
188
+
189
+ 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.
190
+
191
+ 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:
192
+
193
+ $$
194
+ \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}
195
+ $$
196
+
197
+ 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.
198
+
199
+ 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
200
+
201
+ $$
202
+ \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}
203
+ $$
204
+
205
+ 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).
206
+
207
+ 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.
208
+
209
+ 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
210
+
211
+ $$
212
+ \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}
213
+ $$
214
+
215
+ 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.
216
+
217
+ # 5 Experiments
218
+
219
+ # 5.1 Robust Logistic Regression
220
+
221
+ We conduct the experiment of decentralized robust logistic regression<sup>1</sup> task as the first experiment, which was proposed in [49] and was also conducted in the related work [25]. Given dataset
222
+
223
+ $\{(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:
224
+
225
+ $$
226
+ \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}
227
+ $$
228
+
229
+ 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
230
+
231
+ $$
232
+ \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}
233
+ $$
234
+
235
+ $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.
236
+
237
+ Table 2: Descriptions of datasets used in our experiment
238
+
239
+ <table><tr><td>Name</td><td>a9a</td><td>covtype</td><td>ijCNN1</td><td>phishing</td><td>rcv1</td><td>w8a</td></tr><tr><td>N</td><td>32561</td><td>581012</td><td>49990</td><td>11055</td><td>20242</td><td>49749</td></tr><tr><td>d</td><td>123</td><td>54</td><td>22</td><td>68</td><td>47236</td><td>300</td></tr></table>
240
+
241
+ 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.
242
+
243
+ ![](images/452a54e76badb3967b2803429d988cbe047550a4b1262947031694c70162c305.jpg)
244
+ (a)
245
+
246
+ ![](images/f9990dca077f84a33febae3bf53fc6794bb6b2d36c2bc670aecea6f757327322.jpg)
247
+ (b)
248
+
249
+ ![](images/0b99aa9f8ad8fd1f3fae592d3a324521a9fb60b758c6d25fb08f4dd0ca2c891c.jpg)
250
+ (c)
251
+
252
+ ![](images/5999996bafeae2c2c51c1aa3202e8f89fa4f31c671fd36bdbe6b54b97c68c46f.jpg)
253
+ (d)
254
+
255
+ ![](images/6245e33330d1dce9f531e69f84744e9dec444c10c4f0aa98c7ba8a6daaf84319.jpg)
256
+ (e)
257
+
258
+ ![](images/f0c6cebbacac514e5142381d01070558705a35af2795bf491b4bdfa03dff56f6.jpg)
259
+ (f)
260
+ 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.
261
+
262
+ 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
263
+
264
+ 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.
265
+
266
+ # 5.2 Policy Evaluation
267
+
268
+ 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:
269
+
270
+ $$
271
+ \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),
272
+ $$
273
+
274
+ $$
275
+ 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}
276
+ $$
277
+
278
+ 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.
279
+
280
+ 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.
281
+
282
+ ![](images/4af362cdb6ec66eecc11a8fab4e903a4e423d66204439d051eba6f2981a8d87e.jpg)
283
+ (a)
284
+
285
+ ![](images/3e7a2a104b66ce0a36bcbd34a665049386e134b9f25870625f705c44b189847a.jpg)
286
+ (b)
287
+ 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$ .
288
+
289
+ ![](images/7747393e92edf6f7a20e5f67f85b38cfdf7e88c8e8e149006cf468baf1da6b80.jpg)
290
+ (c)
291
+
292
+ 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
293
+
294
+ 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.
295
+
296
+ 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.
297
+
298
+ # 6 Conclusion
299
+
300
+ 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].
301
+
302
+ # Acknowledgments and Disclosure of Funding
303
+
304
+ This work was partially supported by NSF IIS 1845666, 1852606, 1838627, 1837956, 1956002, OIA 2040588.
305
+
306
+ # References
307
+
308
+ [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.
309
+ [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.
310
+ [3] Ashok Cutkosky and Francesco Orabona. Momentum-based variance reduction in non-convex sgd. Neural Information Processing Systems (NeurIPS), 2019.
311
+ [4] Christoph Dann, Gerhard Neumann, and Jan Peters. Policy evaluation with temporal differences: A survey and comparison. Journal of Machine Learning Research, 2014.
312
+ [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.
313
+ [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.
314
+ [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.
315
+
316
+ [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.
317
+ [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.
318
+ [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.
319
+ [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.
320
+ [12] Feihu Huang and Heng Huang. Adagda: Faster adaptive gradient descent ascent methods for minimax optimization. arXiv preprint arXiv:2106.16101, 2021.
321
+ [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.
322
+ [14] Chi Jin, Praneeth Netrapalli, and Michael I. Jordan. What is local optimality in nonconvex-nonconcave minimax optimization? arXiv:1902.00618v2, 2019.
323
+ [15] R. Johnson and T. Zhang. Accelerating stochastic gradient descent using predictive variance reduction. Neural Information Processing Systems (NeurIPS), 2013.
324
+ [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.
325
+ [17] Alec Koppel, Felicia Y. Jakubiec, and Alejandro Ribeiro. A saddle point algorithm for networked online convex optimization. IEEE Transactions on Signal Processing, 2015.
326
+ [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.
327
+ [19] Tianyi Lin, Chi Jin, and Michael I. Jordan. On gradient descent ascent for nonconvex-concave minimax problems. arXiv:1906.00331v4, 2019.
328
+ [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.
329
+ [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.
330
+ [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.
331
+ [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.
332
+ [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.
333
+ [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.
334
+
335
+ [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.
336
+ [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.
337
+ [28] David Mateos-Núñez and Jorge Cortés. Distributed subgradient methods for saddle-point problems. IEEE Conference on Decision and Control, 2015.
338
+ [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.
339
+ [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.
340
+ [31] Lam M. Nguyen, Katya Scheinberg, and Martin Takáč. Inexact sarah algorithm for stochastic optimization. arXiv:1811.10105, 2018.
341
+ [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.
342
+ [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.
343
+ [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.
344
+ [35] Richard S. Sutton and Andrew G. Barto. Reinforcement Learning: An Introduction. MIT Press, 1998.
345
+ [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.
346
+ [37] Csaba Szepesvári. Algorithms for Reinforcement Learning. Synthesis Lectures on Artificial Intelligence and Machine Learning, 2010.
347
+ [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.
348
+ [39] Kiran Koshy Thekumprampil, Prateek Jain, Praneeth Netrapalli, and Sewoong Oh. Efficient algorithms for smooth minimax optimization. Neural Information Processing Systems (NeurIPS), 2019.
349
+ [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.
350
+ [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.
351
+ [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.
352
+
353
+ [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.
354
+ [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.
355
+ [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.
356
+ [46] Ran Xin, Usman A. Khan, and Soummya Kar. A hybrid variance-reduced method for decentralized stochastic non-convex optimization. arXiv:2102.06752, 2021.
357
+ [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.
358
+ [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.
359
+ [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.
360
+ [50] Junchi Yang, Siqi Zhang, Negar Kiyavash, and Niao He. A catalyst framework for minimax optimization. In NeurIPS, 2020.
361
+ [51] Kun Yuan, Qing Ling, and Wotao Yin. On the convergence of decentralized gradient descent. SIAM Journal on Optimization, 2016.
afasterdecentralizedalgorithmfornonconvexminimaxproblems/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c7b18e9e19c519561e8b308ea4991919ad60a676c0445b6234db07d5e12b72a9
3
+ size 336042
afasterdecentralizedalgorithmfornonconvexminimaxproblems/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:16e82e24a6ecb316dd5af6cdb9bb248ffb735666b0a10475a88a1a78358acf36
3
+ size 591799
afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/52112131-c964-4798-81d9-c7b36dd828ab_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8dce1ceee21ad7eeeeeb77d635385a101734039543b87ae5ac20eb4e87deca18
3
+ size 86132
afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/52112131-c964-4798-81d9-c7b36dd828ab_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c13fe065c35e7403aada48b8f15502cf44b13a82e0ee5349d385948a7d79f5b6
3
+ size 108484
afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/52112131-c964-4798-81d9-c7b36dd828ab_origin.pdf ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:aa75c183f1241ef91ed0f693bf4fa1b4e9214f62e4208d066b8d1bc766511e80
3
+ size 376422
afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/full.md ADDED
@@ -0,0 +1,316 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # A Faster Maximum Cardinality Matching Algorithm with Applications in Machine Learning
2
+
3
+ Nathaniel Lahn*
4
+
5
+ School of Computing and Information Sciences
6
+
7
+ Radford University
8
+
9
+ Radford, VA 24142
10
+
11
+ nlahn@radford.edu
12
+
13
+ Sharath Raghvendra
14
+
15
+ Department of Computer Science
16
+
17
+ Virginia Tech Blacksburg, VA 24061
18
+
19
+ sharathr@vt.edu
20
+
21
+ Jiacheng Ye
22
+
23
+ Department of Computer Science
24
+
25
+ Virginia Tech Blacksburg, VA 24061
26
+
27
+ yjc0513@vt.edu
28
+
29
+ # Abstract
30
+
31
+ 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.
32
+
33
+ # 1 Introduction
34
+
35
+ 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:
36
+
37
+ 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
38
+
39
+ 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.
40
+
41
+ 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$ .
42
+
43
+ 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:
44
+
45
+ $$
46
+ \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 ;
47
+ $$
48
+
49
+ 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
50
+
51
+ $$
52
+ \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}
53
+ $$
54
+
55
+ 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.
56
+
57
+ 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.
58
+
59
+ 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.
60
+
61
+ In this paper, we make the following contributions:
62
+
63
+ - We remove the need to maintain dual weights in the LR algorithm, resulting in a significantly simpler algorithm.
64
+
65
+ - 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})$ .
66
+ - 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.
67
+ - 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.
68
+
69
+ 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.
70
+
71
+ 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.
72
+
73
+ 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.
74
+
75
+ 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].
76
+
77
+ 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
78
+
79
+ 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].
80
+
81
+ 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].
82
+
83
+ # 2 Matching algorithms
84
+
85
+ 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.
86
+
87
+ # 2.1 Preliminaries
88
+
89
+ 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$ .
90
+
91
+ 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.
92
+
93
+ 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.
94
+
95
+ 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
96
+
97
+ 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)$ .
98
+
99
+ 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)$ .
100
+
101
+ # 2.2 A simplified implementation of the LR algorithm
102
+
103
+ 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.
104
+
105
+ 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.
106
+
107
+ 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.
108
+
109
+ 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.
110
+
111
+ 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.
112
+
113
+ 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.
114
+
115
+ 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
116
+
117
+ 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.
118
+
119
+ Differences with HK algorithm: The main differences between our algorithm and the HK algorithm are:
120
+
121
+ (1) Our algorithm assigns weights of 0 and 1 to the edges. No weights are assigned in the HK algorithm.
122
+ (2) Our algorithm has a preprocessing step that computes a maximum cardinality matching within each piece.
123
+ (3) In Stage 1, our algorithm executes a $0/1$ -BFS instead of the BFS executed by HK algorithm.
124
+ (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.
125
+
126
+ 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.
127
+
128
+ 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})$ .
129
+
130
+ 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.
131
+
132
+ 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.
133
+
134
+ 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.
135
+
136
+ 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.
137
+
138
+ 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:
139
+
140
+ $$
141
+ y (b) - y (a) \leq w (a, b) \quad \text {i f} (a, b) \notin M, \tag {2}
142
+ $$
143
+
144
+ $$
145
+ y (a) - y (b) = w (a, b) \quad \text {i f} (a, b) \in M. \tag {3}
146
+ $$
147
+
148
+ 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$ .
149
+
150
+ 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.
151
+
152
+ 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.
153
+
154
+ Lemma 1. During Stage 2 of the LR algorithm, an augmenting path has zero slack if and only if it has minimum weight.
155
+
156
+ # 3 Applications
157
+
158
+ 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
159
+
160
+ # 3.1 $\delta$ -disc graph matching
161
+
162
+ 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.
163
+
164
+ 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$ .
165
+
166
+ 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$ .
167
+
168
+ 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$ .
169
+
170
+ 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$ .
171
+
172
+ 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
173
+
174
+ 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.
175
+
176
+ 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})$ .
177
+
178
+ 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.
179
+
180
+ # 3.2 Bottleneck distance
181
+
182
+ 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.
183
+
184
+ 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:
185
+
186
+ 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.
187
+
188
+ 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.
189
+
190
+ # 3.3 Lévy-Prokhorov distance
191
+
192
+ 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.
193
+
194
+ 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.
195
+
196
+ 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.
197
+
198
+ 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$ .
199
+
200
+ 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.
201
+
202
+ 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$ .
203
+
204
+ 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$ .
205
+
206
+ 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$ .
207
+
208
+ # 4 Experimental results
209
+
210
+ 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|$ .
211
+
212
+ 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$
213
+
214
+ 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.
215
+
216
+ 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
217
+
218
+ ![](images/dc4250fe0bafe0ee2736e51b42bc250bf93195c8c12e41ef42e0d71831fddc94.jpg)
219
+ 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.
220
+
221
+ ![](images/aafbaf18ac8be529372ea5ff3998ca5f42f89bc9777224e7b634c35783240d66.jpg)
222
+
223
+ ![](images/82973993e3ddd94e361e54995f8365ae29f4f42894336da267577f39109cdcc4.jpg)
224
+ 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.
225
+
226
+ ![](images/b690cabc935b98bb3dc73d059228458e3c272f500047877f30df1e4701e25868.jpg)
227
+
228
+ 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.
229
+
230
+ 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).
231
+
232
+ # 5 Conclusion
233
+
234
+ 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?
235
+
236
+ 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.
237
+
238
+ # References
239
+
240
+ [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.
241
+ [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.
242
+ [3] M. Arjovsky, S. Chintala, and L. Bottou, Wasserstein GAN, arXiv:1701.07875v3 [stat.ML], (2017).
243
+ [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.
244
+ [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.
245
+ [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.
246
+ [7] G. Beugnot, A. Geneva, K. Greenewald, and J. Solomon, Improving approximate optimal transport distances using quantization, arXiv preprint arXiv:2102.12731, (2021).
247
+ [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.
248
+ [9] J. Blanchet, A. Jambulapati, C. Kent, and A. Sidford, Towards optimal running times for optimal transport, arXiv:1810.07717 [cs.DS], (2018).
249
+ [10] M. Cuturi and A. Doucet, Fast computation of wasserstein barycenters, International Conference on Machine Learning, 2014, pp. 685-693.
250
+ [11] R. M. Dudley, Distances of probability measures and random variables, The Annals of Mathematical Statistics, 39 (1968), 1563-1572.
251
+ [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.
252
+ [13] A. Efrat, A. Itai, and M. J. Katz, Geometry helps in bottleneck matching and related problems, Algorithmica, 31 (2001), 1-28.
253
+ [14] R. Flamary, M. Cuturi, N. Courty, and A. Rakotomamonjy, Wasserstein discriminant analysis, Machine Learning, 107 (2018), 1923-1945.
254
+ [15] H. N. Gabow and R. E. Tarjan, Faster scaling algorithms for network problems, SIAM Journal on Computing, 18 (1989), 1013-1036.
255
+ [16] A. L. Gibbs and F. E. Su, On choosing and bounding probability metrics, International statistical review, 70 (2002), 419-435.
256
+ [17] F. Godi, Bottleneck distance, in: GUDHI User and Reference Manual, GUDHI Editorial Board, 3.4.1 edition, 2021.
257
+ [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.
258
+
259
+ [19] P. J. Huber, Robust Statistics, New York: John Wiley and Sons, 1981.
260
+ [20] M. L. Huson and A. Sen, Broadcast scheduling algorithms for radio networks, Proceedings of MILCOM'95, Vol. 2, IEEE, 1995, pp. 647-651.
261
+ [21] M. J. Katz and M. Sharir, An expander-based approach to geometric optimization, SIAM Journal on Computing, 26 (1997), 1384-1408.
262
+ [22] M. Kerber, D. Morozov, and A. Nigmetov, Geometry helps to compare persistence diagrams, Journal of Experimental Algorithms (JEA), 22 (2017), 1-20.
263
+ [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.
264
+ [24] H. W. Kuhn, The hungarian method for the assignment problem, Naval Research Logistics Quarterly, 2 (1955), 83-97.
265
+ [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.
266
+ [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.
267
+ [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.
268
+ [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.
269
+ [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.
270
+ [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).
271
+ [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.
272
+ [32] R. Motwani, Average-case analysis of algorithms for matchings and related problems, J. ACM, 41 (1994), 1329-1356.
273
+ [33] M. Mucha and P. Sankowski, Maximum matchings via gaussian elimination, 45th Annual IEEE Symposium on Foundations of Computer Science, 2004, pp. 248-255.
274
+ [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].
275
+ [35] K. Quanrud, Approximating optimal transport with linear programs, Symposium on Simplicity of Algorithms, Vol. 69, 2019, pp. 6:1-6:9.
276
+ [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.
277
+ [37] P. W. Shor and J. E. Yukich, Minimax Grid Matching and Empirical Measures, The Annals of Probability, 19 (1991), 1338 - 1348.
278
+
279
+ [38] V. Strassen, The existence of probability measures with given marginals, The Annals of Mathematical Statistics, 36 (1965), 423-439.
280
+ [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.
281
+ [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.
282
+
283
+ # Checklist
284
+
285
+ 1. For all authors...
286
+
287
+ (a) Do the main claims made in the abstract and introduction accurately reflect the paper's contributions and scope? [Yes]
288
+ (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.
289
+ (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.
290
+ (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.
291
+
292
+ 2. If you are including theoretical results...
293
+
294
+ (a) Did you state the full set of assumptions of all theoretical results? [Yes]
295
+ (b) Did you include complete proofs of all theoretical results? [Yes] Some proofs are included in the supplemental materials.
296
+
297
+ 3. If you ran experiments...
298
+
299
+ (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]
300
+ (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.
301
+ (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.
302
+ (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]
303
+
304
+ 4. If you are using existing assets (e.g., code, data, models) or curating/releasing new assets...
305
+
306
+ (a) If your work uses existing assets, did you cite the creators? [N/A] We do not use existing assets.
307
+ (b) Did you mention the license of the assets? [N/A] We do not use existing assets.
308
+ (c) Did you include any new assets either in the supplemental material or as a URL? [Yes] We include code in the supplemental materials.
309
+ (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.
310
+ (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.
311
+
312
+ 5. If you used crowdsourcing or conducted research with human subjects...
313
+
314
+ (a) Did you include the full text of instructions given to participants and screenshots, if applicable? [N/A]
315
+ (b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable? [N/A]
316
+ (c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation? [N/A]
afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/images.zip ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fa16fd19fafac73d0386cb5132bd802d020b20cad62b6d2ea46e985d223f3c88
3
+ size 60326
afastermaximumcardinalitymatchingalgorithmwithapplicationsinmachinelearning/layout.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c58121d2adf284a89d8470ac9998f426fddb16613d4a8bc93c1416fc900524fb
3
+ size 837200
afecactiveforgettingofnegativetransferincontinuallearning/7ea88ec5-7a8f-4240-899d-5add09d673b3_content_list.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:67dcb867a1ec6c82e70435f0cefc61e0ea4642abb20facf96c4b277119beda70
3
+ size 82122
afecactiveforgettingofnegativetransferincontinuallearning/7ea88ec5-7a8f-4240-899d-5add09d673b3_model.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dabe1bddc410c7c77088507ce51a33e9eb749dfcead27b58db57771701a65ef5
3
+ size 100218